Fix #2405. Foundations under shops now correctly drawn.

Issue was caused by a mistake in implementation
This commit is contained in:
duncanspumpkin 2015-11-30 18:00:33 +00:00
parent 89f5f53324
commit d91a9c965c
3 changed files with 10 additions and 10 deletions

View File

@ -1201,7 +1201,7 @@ void sprite_paint_setup(uint16 eax, uint16 ecx){
* dx : height
* edi : unknown
*/
int sub_6629BC(int height, uint16 ax, uint32 image_id, int edi){
bool sub_6629BC(int height, uint16 ax, uint32 image_id, int edi){
int eax = ax, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = edi, ebp = image_id;
RCT2_CALLFUNC_X(0x006629BC, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);

View File

@ -133,7 +133,7 @@ void sub_688217();
int sub_98197C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_y, sint16 length_x, uint32 rotation);
int sub_98199C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_y, sint16 length_x, uint32 rotation);
int sub_6629BC(int height, uint16 ax, uint32 image_id, int edi);
bool sub_6629BC(int height, uint16 ax, uint32 image_id, int edi);
void viewport_invalidate(rct_viewport *viewport, int left, int top, int right, int bottom);

View File

@ -1211,7 +1211,7 @@ TRACK_PAINT_FUNCTION* shop_track_paint_functions[] = {
*/
void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement)
{
int al = sub_6629BC(height, 0, RCT2_GLOBAL(0x00F441A4, uint32), direction & 1);
bool hasSupports = sub_6629BC(height, 0, RCT2_GLOBAL(0x00F441A4, uint32), direction & 1);
RCT2_GLOBAL(0x0141E9D0, sint16) = -1;
RCT2_GLOBAL(0x0141E9C4, sint16) = -1;
@ -1236,12 +1236,7 @@ void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int
sint16 height16 = (sint16)height;
int rotation = get_current_rotation();
if (al) {
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(0, 45, imageId, 0, height, 28, 28, rotation);
} else {
if (hasSupports) {
uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32);
foundationImageId |= 3395;
@ -1253,7 +1248,12 @@ void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98199C(0, 45, imageId, 0, height, 28, 28, rotation);
sub_98199C(0, 45, imageId, 0, height, 28, 28, rotation);
} else {
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(0, 45, imageId, 0, height, 28, 28, rotation);
}
height16 += 48;