mirror of https://github.com/OpenRCT2/OpenRCT2.git
Added more of rotation 0 paintstruct setup
This commit is contained in:
parent
f12d21c6bb
commit
d624dcfbd4
|
@ -751,20 +751,55 @@ void sub_688485(){
|
|||
|
||||
}
|
||||
|
||||
int sub_0x686806(rct_sprite* sprite, int eax, int ecx, int edx){
|
||||
int sub_0x686806(rct_sprite* sprite, int eax, int image_id, int ecx, int edx){
|
||||
int ebp = (eax >> 8) & 0xFF;
|
||||
edx <<= 16;
|
||||
ebp += RCT2_GLOBAL(0x9DEA56, uint16);
|
||||
RCT2_GLOBAL(0xF1AD28, uint32) = 0;
|
||||
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
|
||||
edx = (edx >> 16) | (ebp << 16);
|
||||
ebp = RCT2_GLOBAL(0xEE7888, uint32);
|
||||
if ((uint32)ebp >= RCT2_GLOBAL(0xEE7880, uint32)) return 1;
|
||||
//686840 not finished
|
||||
|
||||
//Not a paint struct but something similar
|
||||
paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*);
|
||||
|
||||
if ((uint32)ps >= RCT2_GLOBAL(0xEE7880, uint32)) return 1;
|
||||
|
||||
ps->image_id = image_id;
|
||||
|
||||
rct_g1_element *g1Element = &RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[image_id & 0x7FFFF];
|
||||
|
||||
eax = (eax & 0xFF) + RCT2_GLOBAL(0x9DE568, uint16);
|
||||
ecx = (ecx & 0xFF) + RCT2_GLOBAL(0x9DE56C, uint16);
|
||||
|
||||
int x = ecx - eax;
|
||||
int y = (ecx + eax) / 2 - (edx & 0xFFFF);
|
||||
|
||||
ps->x = x;
|
||||
ps->y = y;
|
||||
|
||||
int left = x + g1Element->x_offset;
|
||||
int bottom = y + g1Element->y_offset;
|
||||
|
||||
int right = left + g1Element->width;
|
||||
int top = bottom + g1Element->height;
|
||||
|
||||
RCT2_GLOBAL(0xF1AD1C, uint16) = left;
|
||||
RCT2_GLOBAL(0xF1AD1E, uint16) = bottom;
|
||||
|
||||
rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
|
||||
|
||||
if (right <= dpi->x)return 1;
|
||||
if (top <= dpi->y)return 1;
|
||||
if (left > dpi->x + dpi->width) return 1;
|
||||
if (bottom > dpi->y + dpi->height) return 1;
|
||||
|
||||
RCT2_GLOBAL(0x9DE568, uint16);
|
||||
//686918 not finished
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Litter Paint Setup??
|
||||
* rct2: 0x006736FC
|
||||
|
|
Loading…
Reference in New Issue