diff --git a/src/game.c b/src/game.c index aabbaf4d0e..51923944ee 100644 --- a/src/game.c +++ b/src/game.c @@ -428,7 +428,7 @@ void update_rain_animation() (rct_drawpixelinfo*)RCT2_ADDRESS_SCREEN_DPI, RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_SPRITE, uint32), RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_X, sint16), - RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_Y, sint16) + RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_Y, sint16), 0 ); } diff --git a/src/gfx.c b/src/gfx.c index 1e055ada86..0d5a92c3c2 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -189,7 +189,7 @@ void gfx_load_character_widths(){ for (int i = 0; i < 0xE0; ++i){ memset(drawing_surface, 0, sizeof(drawing_surface)); - gfx_draw_sprite(&dpi, i + 0x10D5, -1, 0); + gfx_draw_sprite(&dpi, i + 0x10D5, -1, 0, 0); for (int x = 0; x < 8; ++x){ uint8 val = 0; @@ -921,11 +921,14 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in * image_id (ebx) * x (cx) * y (dx) + * dpi (esi) + * (ebp) */ -void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y) +void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y, int ebp) { - - int eax = 0, ebx = image_id, ecx = x, edx = y, esi = 0, edi = (int)dpi, ebp = 0; + //RCT2_CALLPROC_X(0x0067A28E, 0, image_id, x, y, 0, (int)dpi, ebp); + //return; + int eax = 0, ebx = image_id, ecx = x, edx = y, esi = 0, edi = (int)dpi; int image_type = (image_id & 0xE0000000) >> 28; int image_sub_type = (image_id & 0x1C000000) >> 26; uint8* palette_pointer = NULL; @@ -1048,39 +1051,40 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in int image_type = (image_id & 0xE0000000) >> 28; rct_g1_element* g1_source = &(RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[image_element]); - - if ( dpi->zoom_level && (g1_source->flags & (1<<4)) ){ - rct_drawpixelinfo zoomed_dpi = { - .bits = dpi->bits, - .x = dpi->x >> 1, - .y = dpi->y >> 1, - .height = dpi->height>>1, - .width = dpi->width>>1, - .pitch = (dpi->width+dpi->pitch)-(dpi->width>>1),//In the actual code this is dpi->pitch but that doesn't seem correct. - .zoom_level = dpi->zoom_level - 1 - }; - gfx_draw_sprite_palette_set(&zoomed_dpi, (image_type << 28) | (image_element - g1_source->zoomed_offset), x >> 1, y >> 1, palette_pointer, unknown_pointer); - return; - } - if ( dpi->zoom_level && (g1_source->flags & (1<<5)) ){ + // //Zooming code has been integrated into main code. + if (dpi->zoom_level >= 1){ //These have not been tested + //something to do with zooming + if (dpi->zoom_level == 1){ + RCT2_CALLPROC_X(0x0067A28E, 0, image_id, x, y, 0, (int)dpi, 0); + return; + } + if (dpi->zoom_level == 2){ + RCT2_CALLPROC_X(0x0067DADA, 0, (int)g1_source, x, y, 0, (int)dpi, 0); + return; + } + RCT2_CALLPROC_X(0x0067FAAE, 0, (int)g1_source, x, y, 0, (int)dpi, 0); return; } - //Zooming code has been integrated into main code. - //if (dpi->zoom_level >= 1){ //These have not been tested - // //something to do with zooming - // if (dpi->zoom_level == 1){ - // RCT2_CALLPROC_X(0x0067A28E, 0, image_id, x, y, 0, (int)dpi, 0); - // return; - // } - // if (dpi->zoom_level == 2){ - // RCT2_CALLPROC_X(0x0067DADA, 0, (int)g1_source, x, y, 0, (int)dpi, 0); - // return; - // } - // RCT2_CALLPROC_X(0x0067FAAE, 0, (int)g1_source, x, y, 0, (int)dpi, 0); + //if ( dpi->zoom_level && (g1_source->flags & (1<<4)) ){ + // rct_drawpixelinfo zoomed_dpi = { + // .bits = dpi->bits, + // .x = dpi->x >> 1, + // .y = dpi->y >> 1, + // .height = dpi->height>>1, + // .width = dpi->width>>1, + // .pitch = (dpi->width+dpi->pitch)-(dpi->width>>1),//In the actual code this is dpi->pitch but that doesn't seem correct. + // .zoom_level = dpi->zoom_level - 1 + // }; + // gfx_draw_sprite_palette_set(&zoomed_dpi, (image_type << 28) | (image_element - g1_source->zoomed_offset), x >> 1, y >> 1, palette_pointer, unknown_pointer); // return; //} + //if ( dpi->zoom_level && (g1_source->flags & (1<<5)) ){ + // return; + //} + + //Its used super often so we will define it to a seperate variable. int zoom_level = dpi->zoom_level; //This will be the height of the drawn image @@ -2219,7 +2223,7 @@ void gfx_draw_string(rct_drawpixelinfo *dpi, char *buffer, int colour, int x, in eax = ebx & 0x7FFFF; g1_element = &(RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[eax]); - gfx_draw_sprite(dpi, ebx, max_x, max_y); + gfx_draw_sprite(dpi, ebx, max_x, max_y, 0); max_x = max_x + g1_element->width; break; diff --git a/src/gfx.h b/src/gfx.h index 85046d3fdd..c66c433c5e 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -70,7 +70,7 @@ void gfx_draw_pixel(rct_drawpixelinfo *dpi, int x, int y, int colour); void gfx_draw_line(rct_drawpixelinfo *dpi, int x1, int y1, int x2, int y2, int colour); void gfx_fill_rect(rct_drawpixelinfo *dpi, int left, int top, int right, int bottom, int colour); void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, short left, short top, short right, short bottom, int colour, short _si); -void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y); +void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y, int ebp); void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, int y, uint8* palette_pointer, uint8* unknown_pointer); void gfx_draw_string(rct_drawpixelinfo *dpi, char *buffer, int colour, int x, int y); void gfx_transpose_palette(int pal, unsigned char product); diff --git a/src/intro.c b/src/intro.c index 2d19d04312..75f3c853cb 100644 --- a/src/intro.c +++ b/src/intro.c @@ -104,10 +104,10 @@ void intro_update() 129); // Draw the logo - gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_00, (screenWidth / 2) - 320 + 69, _tick_counter + 69); - gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_10, (screenWidth / 2) - 320 + 319, _tick_counter + 69); - gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_01, (screenWidth / 2) - 320 + 69, _tick_counter + 319); - gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_11, (screenWidth / 2) - 320 + 319, _tick_counter + 319); + gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_00, (screenWidth / 2) - 320 + 69, _tick_counter + 69, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_10, (screenWidth / 2) - 320 + 319, _tick_counter + 69, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_01, (screenWidth / 2) - 320 + 69, _tick_counter + 319, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_INFOGRAMES_11, (screenWidth / 2) - 320 + 319, _tick_counter + 319, 0); // Check if logo is off the screen .ish if (_tick_counter > 520) { @@ -145,8 +145,8 @@ void intro_update() gfx_clear(screenDPI, 10); // Draw Chris Sawyer logo - gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_00, (screenWidth / 2) - 320 + 70, _tick_counter); - gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_10, (screenWidth / 2) - 320 + 320, _tick_counter); + gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_00, (screenWidth / 2) - 320 + 70, _tick_counter, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_CHRIS_SAWYER_10, (screenWidth / 2) - 320 + 320, _tick_counter, 0); // Check if logo is at 259 pixels if (_tick_counter == 259) { @@ -171,12 +171,12 @@ void intro_update() gfx_clear(screenDPI, 245); // Draw RollerCoaster Tycoon 2 logo - gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_00, (screenWidth / 2) - 320 + 0, 0); - gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_10, (screenWidth / 2) - 320 + 220, 0); - gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_20, (screenWidth / 2) - 320 + 440, 0); - gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_01, (screenWidth / 2) - 320 + 0, 240); - gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_11, (screenWidth / 2) - 320 + 220, 240); - gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_21, (screenWidth / 2) - 320 + 440, 240); + gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_00, (screenWidth / 2) - 320 + 0, 0, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_10, (screenWidth / 2) - 320 + 220, 0, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_20, (screenWidth / 2) - 320 + 440, 0, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_01, (screenWidth / 2) - 320 + 0, 240, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_11, (screenWidth / 2) - 320 + 220, 240, 0); + gfx_draw_sprite(screenDPI, SPR_INTRO_LOGO_21, (screenWidth / 2) - 320 + 440, 240, 0); // Set palette thing gfx_transpose_palette(23224, 0); diff --git a/src/viewport.c b/src/viewport.c index 2e3cf903c6..9ecdf5757f 100644 --- a/src/viewport.c +++ b/src/viewport.c @@ -47,7 +47,7 @@ struct paint_struct{ uint32 var_1C; paint_struct* var_20; paint_struct* var_24; - uint8 var_28; + uint8 sprite_type; }; /** @@ -285,8 +285,8 @@ void sub_0x68615B(int ebp){ } void sub_688485(){ - RCT2_CALLPROC_EBPSAFE(0x688485); - return; + //RCT2_CALLPROC_EBPSAFE(0x688485); + //return; rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); paint_struct* ps = RCT2_GLOBAL(0xEE7884, paint_struct*); paint_struct* previous_ps = ps; @@ -303,7 +303,7 @@ void sub_688485(){ //push ebp int ecx = ps->var_14; int edx = ps->var_16; - if (ps->var_28 == 2){ + if (ps->sprite_type == 2){ if (dpi->zoom_level >= 1){ ecx &= 0xFFFE; edx &= 0xFFFE; @@ -314,24 +314,24 @@ void sub_688485(){ } } int ebx = ps->image_id; - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & 0x2){ - if (ps->var_28 == 3){ + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_RIDES){ + if (ps->sprite_type == 3){ if (!(ebx & 0x40000000)){ ebx &= 0x7FFFF; ebx |= 0x41880000; } } } - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & 0x1){ - if (ps->var_28 == 9){ + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_UNDERGROUND_INSIDE){ + if (ps->sprite_type == 9){ if (!(ebx & 0x40000000)){ ebx &= 0x7FFFF; ebx |= 0x41880000; } } } - if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & 0x4){ - if (ps->var_28 == 10 || ps->var_28 == 12 || ps->var_28 == 9 || ps->var_28 == 5){ + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_SCENERY){ + if (ps->sprite_type == 10 || ps->sprite_type == 12 || ps->sprite_type == 9 || ps->sprite_type == 5){ if (!(ebx & 0x40000000)){ ebx &= 0x7FFFF; ebx |= 0x41880000; @@ -342,7 +342,7 @@ void sub_688485(){ if (!(ps->var_1A & 1)){ //push ebp?? uint32 _ebp = ps->var_04; - gfx_draw_sprite(dpi, ebx, ecx, edx); + gfx_draw_sprite(dpi, ebx, ecx, edx, _ebp); //pop ebp?? if (ps->var_20 != 0){ ps = ps->var_20; @@ -386,8 +386,8 @@ void sub_688485(){ ecx += ps->var_14; edx += ps->var_16; ebx = *(uint32*)esi; - if (RCT2_GLOBAL(0x141E9E4, uint16) & 0x2){ - if (ps->var_28 == 3){ + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_RIDES){ + if (ps->sprite_type == 3){ if (ebx & 0x40000000){ ebx &= 0x7FFFF; ebx |= 0x41880000; @@ -395,8 +395,8 @@ void sub_688485(){ } } - if (RCT2_GLOBAL(0x141E9E4, uint16) & 0x4){ - if (ps->var_28 == 5){ + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_SEETHROUGH_SCENERY){ + if (ps->sprite_type == 5){ if (ebx & 0x40000000){ ebx &= 0x7FFFF; ebx |= 0x41880000; @@ -406,7 +406,7 @@ void sub_688485(){ if (!(*((uint8*)(esi + 0xC)) & 1)){ int _ebp = ps->var_04; - gfx_draw_sprite(dpi, ebx, ecx, edx); + gfx_draw_sprite(dpi, ebx, ecx, edx, _ebp); //call 67A28E draw_sprite //pop ebp //pop esi @@ -419,8 +419,7 @@ void sub_688485(){ //pop ebp //jmp 688491 i.e. start of previous loop } - int a, b, c = ps->var_04; - RCT2_CALLFUNC_X(0x00681DE2, &a, &ebx, &ecx, &edx, &b,(int*) &dpi, &c); + RCT2_CALLPROC_X(0x00681DE2, 0, ebx, ecx, edx, 0, (int)dpi, *(uint32*)(esi + 0x4)); //call 681DE2 //pop ebp //pop esi diff --git a/src/widget.c b/src/widget.c index 9278815ba0..3b39727f08 100644 --- a/src/widget.c +++ b/src/widget.c @@ -204,7 +204,7 @@ static void widget_frame_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetI // Draw the resize sprite at the bottom right corner l = w->x + widget->right - 18; t = w->y + widget->bottom - 18; - gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t); + gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t, 0); } /** @@ -241,7 +241,7 @@ static void widget_resize_draw(rct_drawpixelinfo *dpi, rct_window *w, int widget // Draw the resize sprite at the bottom right corner l = w->x + widget->right - 18; t = w->y + widget->bottom - 18; - gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t); + gfx_draw_sprite(dpi, SPR_RESIZE | 0x20000000 | (colour << 19), l, t, 0); } /** @@ -324,7 +324,7 @@ static void widget_tab_draw(rct_drawpixelinfo *dpi, rct_window *w, int widgetInd image = widget->image + 2; // Draw coloured image - gfx_draw_sprite(dpi, image | colour, l, t); + gfx_draw_sprite(dpi, image | colour, l, t, 0); } /** @@ -631,13 +631,13 @@ static void widget_caption_draw(rct_drawpixelinfo *dpi, rct_window *w, int widge // if (w->var_4B8 != -1) { - gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1, t + 1); + gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1, t + 1, 0); if (w->width > 638) - gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1 + 638, t + 1); + gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B8)) << 19, l + 1 + 638, t + 1, 0); if (w->var_4B9 != -1) { - gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1, t + 1); + gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1, t + 1, 0); if (w->width > 638) - gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1 + 638, t + 1); + gfx_draw_sprite(dpi, *((char*)(0x013CA742 + w->var_4B9)) << 19, l + 1 + 638, t + 1, 0); } // @@ -942,7 +942,7 @@ static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, int widgetI else image |= colour << 19; - gfx_draw_sprite(dpi, image, l, t); + gfx_draw_sprite(dpi, image, l, t, 0); } } diff --git a/src/window_about.c b/src/window_about.c index 36159bdce0..f707439b26 100644 --- a/src/window_about.c +++ b/src/window_about.c @@ -200,8 +200,8 @@ static void window_about_paint() gfx_draw_string_centred(dpi, STR_CREDIT_SPARE_7, x, y, 0, (void*)0x009E2D28); // Images - gfx_draw_sprite(dpi, SPR_CREDITS_CHRIS_SAWYER_SMALL, w->x + 92, w->y + 40); - gfx_draw_sprite(dpi, SPR_CREDITS_INFOGRAMES, w->x + 50, w->y + 247); + gfx_draw_sprite(dpi, SPR_CREDITS_CHRIS_SAWYER_SMALL, w->x + 92, w->y + 40, 0); + gfx_draw_sprite(dpi, SPR_CREDITS_INFOGRAMES, w->x + 50, w->y + 247, 0); // Licence gfx_draw_string_left(dpi, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, 0, 0, w->x + 157, w->y + 257); diff --git a/src/window_cheats.c b/src/window_cheats.c index 7c6453be6e..2289be7b79 100644 --- a/src/window_cheats.c +++ b/src/window_cheats.c @@ -508,7 +508,7 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = 5261; if (w->page == WINDOW_CHEATS_PAGE_MONEY) sprite_idx += (w->frame_no / 2) % 8; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top, 0); } // Guests tab @@ -516,13 +516,13 @@ static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = 5568; if (w->page == WINDOW_CHEATS_PAGE_GUESTS) sprite_idx += (w->frame_no / 3) % 8; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top, 0); } // Misc tab if (!(w->disabled_widgets & (1 << WIDX_TAB_3))) { sprite_idx = SPR_TAB_QUESTION; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0); } } diff --git a/src/window_dropdown.c b/src/window_dropdown.c index 905fc33951..f091d36812 100644 --- a/src/window_dropdown.c +++ b/src/window_dropdown.c @@ -330,7 +330,7 @@ static void window_dropdown_paint() dpi, image, w->x + 2 + (cell_x * _dropdown_item_width), - w->y + 2 + (cell_y * _dropdown_item_height) + w->y + 2 + (cell_y * _dropdown_item_height), 0 ); } else { // Text item diff --git a/src/window_footpath.c b/src/window_footpath.c index f3cb04fbea..8e4abe0951 100644 --- a/src/window_footpath.c +++ b/src/window_footpath.c @@ -687,7 +687,7 @@ static void window_footpath_paint() // Draw construction image x = w->x + (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2; y = w->y + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60; - gfx_draw_sprite(dpi, image, x, y); + gfx_draw_sprite(dpi, image, x, y, 0); // Draw build this... label x = w->x + (window_footpath_widgets[WIDX_CONSTRUCT].left + window_footpath_widgets[WIDX_CONSTRUCT].right) / 2; diff --git a/src/window_game_bottom_toolbar.c b/src/window_game_bottom_toolbar.c index 57479079c9..dac63397f1 100644 --- a/src/window_game_bottom_toolbar.c +++ b/src/window_game_bottom_toolbar.c @@ -474,8 +474,8 @@ static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, } // Draw thumbs on the sides - gfx_draw_sprite(dpi, SPR_RATING_LOW, x - 14, y); - gfx_draw_sprite(dpi, SPR_RATING_HIGH, x + 92, y); + gfx_draw_sprite(dpi, SPR_RATING_LOW, x - 14, y, 0); + gfx_draw_sprite(dpi, SPR_RATING_HIGH, x + 92, y, 0); } static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, rct_window *w) @@ -532,13 +532,13 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, x += 30; // Current weather - gfx_draw_sprite(dpi, climate_weather_data[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8)].sprite_id, x, y); + gfx_draw_sprite(dpi, climate_weather_data[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8)].sprite_id, x, y, 0); // Next weather if (climate_weather_data[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8)].sprite_id != climate_weather_data[gClimateNextWeather].sprite_id) { if (RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE_UPDATE_TIMER, sint16) < 960) { - gfx_draw_sprite(dpi, SPR_NEXT_WEATHER, x + 27, y + 5); - gfx_draw_sprite(dpi, climate_weather_data[gClimateNextWeather].sprite_id, x + 40, y); + gfx_draw_sprite(dpi, SPR_NEXT_WEATHER, x + 27, y + 5, 0); + gfx_draw_sprite(dpi, climate_weather_data[gClimateNextWeather].sprite_id, x + 40, y, 0); } } } @@ -582,7 +582,7 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc y = w->y + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].top; switch (newsItem->type) { case NEWS_ITEM_RIDE: - gfx_draw_sprite(dpi, SPR_RIDE, x, y); + gfx_draw_sprite(dpi, SPR_RIDE, x, y, 0); break; case NEWS_ITEM_PEEP_ON_RIDE: case NEWS_ITEM_PEEP: @@ -680,16 +680,16 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc break; case NEWS_ITEM_MONEY: - gfx_draw_sprite(dpi, SPR_FINANCE, x, y); + gfx_draw_sprite(dpi, SPR_FINANCE, x, y, 0); case NEWS_ITEM_RESEARCH: - gfx_draw_sprite(dpi, (newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY), x, y); + gfx_draw_sprite(dpi, (newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY), x, y, 0); break; case NEWS_ITEM_PEEPS: - gfx_draw_sprite(dpi, SPR_GUESTS, x, y); + gfx_draw_sprite(dpi, SPR_GUESTS, x, y, 0); case NEWS_ITEM_AWARD: - gfx_draw_sprite(dpi, SPR_AWARD, x, y); + gfx_draw_sprite(dpi, SPR_AWARD, x, y, 0); case NEWS_ITEM_GRAPH: - gfx_draw_sprite(dpi, SPR_GRAPH, x, y); + gfx_draw_sprite(dpi, SPR_GRAPH, x, y, 0); break; } } diff --git a/src/window_game_top_toolbar.c b/src/window_game_top_toolbar.c index 224a6101ba..ae7981d55a 100644 --- a/src/window_game_top_toolbar.c +++ b/src/window_game_top_toolbar.c @@ -558,5 +558,5 @@ static void window_game_top_toolbar_paint() if (widget_is_pressed(w, WIDX_STAFF)) imgId++; imgId |= (RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) << 19) | 0xA0000000 | (RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) << 24); - gfx_draw_sprite(dpi, imgId, x, y); + gfx_draw_sprite(dpi, imgId, x, y, 0); } diff --git a/src/window_guest_list.c b/src/window_guest_list.c index d42b56e9ba..405cd10c3e 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -608,7 +608,7 @@ static void window_guest_list_paint() dpi, i, (window_guest_list_widgets[WIDX_TAB_1].left + window_guest_list_widgets[WIDX_TAB_1].right) / 2 + w->x, - window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y + window_guest_list_widgets[WIDX_TAB_1].bottom - 6 + w->y, 0 ); // Tab 2 image @@ -617,7 +617,7 @@ static void window_guest_list_paint() dpi, 5568 + i, window_guest_list_widgets[WIDX_TAB_2].left + w->x, - window_guest_list_widgets[WIDX_TAB_2].top + w->y + window_guest_list_widgets[WIDX_TAB_2].top + w->y, 0 ); // Filter description @@ -713,11 +713,11 @@ static void window_guest_list_scrollpaint() switch (_window_guest_list_selected_view) { case VIEW_ACTIONS: // Guest face - gfx_draw_sprite(dpi, get_guest_face_sprite_small(peep), 118, y); + gfx_draw_sprite(dpi, get_guest_face_sprite_small(peep), 118, y, 0); // Tracking icon if (peep->flags & PEEP_FLAGS_TRACKING) - gfx_draw_sprite(dpi, 5129, 112, y); + gfx_draw_sprite(dpi, 5129, 112, y, 0); // Action @@ -775,7 +775,7 @@ static void window_guest_list_scrollpaint() // Draw guest faces numGuests = _window_guest_list_groups_num_guests[i]; for (j = 0; j < 56 && j < numGuests; j++) - gfx_draw_sprite(dpi, _window_guest_list_groups_guest_faces[i * 56 + j] + 5486, j * 8, y + 9); + gfx_draw_sprite(dpi, _window_guest_list_groups_guest_faces[i * 56 + j] + 5486, j * 8, y + 9, 0); // Draw action RCT2_GLOBAL(0x013CE952, uint32) = _window_guest_list_groups_argument_1[i]; diff --git a/src/window_map.c b/src/window_map.c index b5c3a9685c..6f8d7bc872 100644 --- a/src/window_map.c +++ b/src/window_map.c @@ -427,7 +427,7 @@ static void window_map_paint() gfx_draw_sprite(dpi, image_id, w->x + w->widgets[WIDX_PEOPLE_TAB].left, - w->y + w->widgets[WIDX_PEOPLE_TAB].top); + w->y + w->widgets[WIDX_PEOPLE_TAB].top, 0); // ride/stall tab image (animated) image_id = SPR_TAB_RIDE_0; @@ -436,13 +436,13 @@ static void window_map_paint() gfx_draw_sprite(dpi, image_id, w->x + w->widgets[WIDX_RIDES_TAB].left, - w->y + w->widgets[WIDX_RIDES_TAB].top); + w->y + w->widgets[WIDX_RIDES_TAB].top, 0); // people starting position (scenario editor only) if (w->widgets[WIDX_PEOPLE_STARTING_POSITION].type != 0) { gfx_draw_sprite(dpi, 0x0B6E0190A, w->x + w->widgets[WIDX_PEOPLE_STARTING_POSITION].left + 12, - w->y + w->widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18); + w->y + w->widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18, 0); } if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) { @@ -507,7 +507,7 @@ static void window_map_scrollpaint() g1_element->y_offset = 0xFFF8; g1_element->flags = 0; - gfx_draw_sprite(dpi, 0, 0, 0); + gfx_draw_sprite(dpi, 0, 0, 0, 0); *g1_element = pushed_g1_element; diff --git a/src/window_news.c b/src/window_news.c index 3d2c1347ec..08bff3ae36 100644 --- a/src/window_news.c +++ b/src/window_news.c @@ -385,7 +385,7 @@ static void window_news_scrollpaint() switch (newsItem->type) { case NEWS_ITEM_RIDE: - gfx_draw_sprite(dpi, SPR_RIDE, x, yy); + gfx_draw_sprite(dpi, SPR_RIDE, x, yy, 0); break; case NEWS_ITEM_PEEP_ON_RIDE: // TODO @@ -394,19 +394,19 @@ static void window_news_scrollpaint() // TODO break; case NEWS_ITEM_MONEY: - gfx_draw_sprite(dpi, SPR_FINANCE, x, yy); + gfx_draw_sprite(dpi, SPR_FINANCE, x, yy, 0); break; case NEWS_ITEM_RESEARCH: - gfx_draw_sprite(dpi, newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY, x, yy); + gfx_draw_sprite(dpi, newsItem->assoc < 0x10000 ? SPR_NEW_RIDE : SPR_SCENERY, x, yy, 0); break; case NEWS_ITEM_PEEPS: - gfx_draw_sprite(dpi, SPR_GUESTS, x, yy); + gfx_draw_sprite(dpi, SPR_GUESTS, x, yy, 0); break; case NEWS_ITEM_AWARD: - gfx_draw_sprite(dpi, SPR_AWARD, x, yy); + gfx_draw_sprite(dpi, SPR_AWARD, x, yy, 0); break; case NEWS_ITEM_GRAPH: - gfx_draw_sprite(dpi, SPR_GRAPH, x, yy); + gfx_draw_sprite(dpi, SPR_GRAPH, x, yy, 0); break; } } @@ -423,7 +423,7 @@ static void window_news_scrollpaint() press = 0x20; } gfx_fill_rect_inset(dpi, x, yy, x + 23, yy + 23, w->colours[2], press); - gfx_draw_sprite(dpi, SPR_LOCATE, x, yy); + gfx_draw_sprite(dpi, SPR_LOCATE, x, yy, 0); } y += 42; diff --git a/src/window_park.c b/src/window_park.c index 3193422309..1afa79a951 100644 --- a/src/window_park.c +++ b/src/window_park.c @@ -1090,7 +1090,7 @@ static void window_park_entrance_paint() if (w->viewport != NULL) { window_draw_viewport(dpi, w); if (w->viewport->flags & VIEWPORT_FLAG_SOUND_ON) - gfx_draw_sprite(dpi, SPR_HEARING_VIEWPORT, w->x + 2, w->y + 2); + gfx_draw_sprite(dpi, SPR_HEARING_VIEWPORT, w->x + 2, w->y + 2, 0); } // Draw park closed / open label @@ -2229,7 +2229,7 @@ static void window_park_awards_paint() if (award->time == 0) continue; - gfx_draw_sprite(dpi, SPR_AWARD_MOST_UNTIDY + award->type, x, y); + gfx_draw_sprite(dpi, SPR_AWARD_MOST_UNTIDY + award->type, x, y, 0); gfx_draw_string_left_wrapped(dpi, NULL, x + 34, y + 6, 180, STR_AWARD_MOST_UNTIDY + award->type, 0); y += 32; @@ -2322,16 +2322,16 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) // Entrance tab if (!(w->disabled_widgets & (1 << WIDX_TAB_1))) - gfx_draw_sprite(dpi, 5200, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top); + gfx_draw_sprite(dpi, 5200, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top, 0); // Rating tab if (!(w->disabled_widgets & (1 << WIDX_TAB_2))) { sprite_idx = SPR_TAB_GRAPH_0; if (w->page == WINDOW_PARK_PAGE_RATING) sprite_idx += (w->frame_no / 8) % 8; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top); - gfx_draw_sprite(dpi, SPR_RATING_HIGH, w->x + w->widgets[WIDX_TAB_2].left + 7, w->y + w->widgets[WIDX_TAB_2].top + 1); - gfx_draw_sprite(dpi, SPR_RATING_LOW, w->x + w->widgets[WIDX_TAB_2].left + 16, w->y + w->widgets[WIDX_TAB_2].top + 12); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top, 0); + gfx_draw_sprite(dpi, SPR_RATING_HIGH, w->x + w->widgets[WIDX_TAB_2].left + 7, w->y + w->widgets[WIDX_TAB_2].top + 1, 0); + gfx_draw_sprite(dpi, SPR_RATING_LOW, w->x + w->widgets[WIDX_TAB_2].left + 16, w->y + w->widgets[WIDX_TAB_2].top + 12, 0); } // Guests tab @@ -2339,7 +2339,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = SPR_TAB_GRAPH_0; if (w->page == WINDOW_PARK_PAGE_GUESTS) sprite_idx += (w->frame_no / 8) % 8; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0); sprite_idx = *RCT2_GLOBAL(0x00982708, sint32*) + 1; if (w->page == WINDOW_PARK_PAGE_GUESTS) @@ -2350,7 +2350,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) dpi, sprite_idx, w->x + (w->widgets[WIDX_TAB_3].left + w->widgets[WIDX_TAB_3].right) / 2, - w->y + w->widgets[WIDX_TAB_3].bottom - 9 + w->y + w->widgets[WIDX_TAB_3].bottom - 9, 0 ); } @@ -2359,7 +2359,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = SPR_TAB_ADMISSION_0; if (w->page == WINDOW_PARK_PAGE_PRICE) sprite_idx += (w->frame_no / 2) % 8; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_4].left, w->y + w->widgets[WIDX_TAB_4].top, 0); } // Statistics tab @@ -2367,7 +2367,7 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = SPR_TAB_STATS_0; if (w->page == WINDOW_PARK_PAGE_STATS) sprite_idx += (w->frame_no / 4) % 7; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_5].left, w->y + w->widgets[WIDX_TAB_5].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_5].left, w->y + w->widgets[WIDX_TAB_5].top, 0); } // Objective tab @@ -2375,12 +2375,12 @@ static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w) sprite_idx = SPR_TAB_OBJECTIVE_0; if (w->page == WINDOW_PARK_PAGE_OBJECTIVE) sprite_idx += (w->frame_no / 4) % 16; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_6].left, w->y + w->widgets[WIDX_TAB_6].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_6].left, w->y + w->widgets[WIDX_TAB_6].top, 0); } // Awards tab if (!(w->disabled_widgets & (1 << WIDX_TAB_7))) - gfx_draw_sprite(dpi, SPR_TAB_AWARDS, w->x + w->widgets[WIDX_TAB_7].left, w->y + w->widgets[WIDX_TAB_7].top); + gfx_draw_sprite(dpi, SPR_TAB_AWARDS, w->x + w->widgets[WIDX_TAB_7].left, w->y + w->widgets[WIDX_TAB_7].top, 0); } static void window_park_graph_draw_months(rct_drawpixelinfo *dpi, uint8 *history, int baseX, int baseY) diff --git a/src/window_ride_list.c b/src/window_ride_list.c index 323d9d40de..fec59c0f1d 100644 --- a/src/window_ride_list.c +++ b/src/window_ride_list.c @@ -647,19 +647,19 @@ static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window sprite_idx = SPR_TAB_RIDE_0; if (w->page == PAGE_RIDES) sprite_idx += w->frame_no / 4; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_1].left, w->y + w->widgets[WIDX_TAB_1].top, 0); // Shops and stalls tab sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0; if (w->page == PAGE_SHOPS_AND_STALLS) sprite_idx += w->frame_no / 4; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_2].left, w->y + w->widgets[WIDX_TAB_2].top, 0); // Information kiosks and facilities tab sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0; if (w->page == PAGE_KIOSKS_AND_FACILITIES) sprite_idx += (w->frame_no / 4) % 8; - gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top); + gfx_draw_sprite(dpi, sprite_idx, w->x + w->widgets[WIDX_TAB_3].left, w->y + w->widgets[WIDX_TAB_3].top, 0); } diff --git a/src/window_staff.c b/src/window_staff.c index 273e2462de..d23545d8f9 100644 --- a/src/window_staff.c +++ b/src/window_staff.c @@ -613,7 +613,7 @@ void window_staff_paint() { dpi, i, (window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].left + window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].right) / 2 + w->x, - window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].bottom - 6 + w->y + window_staff_widgets[WIDX_STAFF_HANDYMEN_TAB].bottom - 6 + w->y, 0 ); // Handymen tab image @@ -625,7 +625,7 @@ void window_staff_paint() { dpi, i, (window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].left + window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].right) / 2 + w->x, - window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].bottom - 6 + w->y + window_staff_widgets[WIDX_STAFF_MECHANICS_TAB].bottom - 6 + w->y, 0 ); // Security tab image @@ -637,7 +637,7 @@ void window_staff_paint() { dpi, i, (window_staff_widgets[WIDX_STAFF_SECURITY_TAB].left + window_staff_widgets[WIDX_STAFF_SECURITY_TAB].right) / 2 + w->x, - window_staff_widgets[WIDX_STAFF_SECURITY_TAB].bottom - 6 + w->y + window_staff_widgets[WIDX_STAFF_SECURITY_TAB].bottom - 6 + w->y, 0 ); rct_drawpixelinfo* sprite_dpi = clip_drawpixelinfo( @@ -658,7 +658,7 @@ void window_staff_paint() { sprite_dpi, i, 0x0F, - 0x17 + 0x17, 0 ); rct2_free(sprite_dpi); } @@ -739,7 +739,7 @@ void window_staff_scrollpaint() // True if a patrol path is set for the worker if (RCT2_ADDRESS(0x013CA672, uint8)[peep->var_C5] & 2) { - gfx_draw_sprite(dpi, 0x13FD, 110, y - 1); + gfx_draw_sprite(dpi, 0x13FD, 110, y - 1, 0); } staffOrderIcon_x = 0x7D; @@ -749,14 +749,14 @@ void window_staff_scrollpaint() while (staffOrders != 0) { if (staffOrders & 1) { - gfx_draw_sprite(dpi, staffOrderSprite, staffOrderIcon_x, y - 1); + gfx_draw_sprite(dpi, staffOrderSprite, staffOrderIcon_x, y - 1, 0); } staffOrders = staffOrders >> 1; staffOrderIcon_x += 9; staffOrderSprite++; } } else { - gfx_draw_sprite(dpi, peep->sprite_type - 4 + 0x13FE, staffOrderIcon_x, y - 1); + gfx_draw_sprite(dpi, peep->sprite_type - 4 + 0x13FE, staffOrderIcon_x, y - 1, 0); } } diff --git a/src/window_title_logo.c b/src/window_title_logo.c index 16cfaa776b..7b5bec581d 100644 --- a/src/window_title_logo.c +++ b/src/window_title_logo.c @@ -112,7 +112,7 @@ static void window_title_logo_paint() #endif - gfx_draw_sprite(dpi, SPR_MENU_LOGO, w->x, w->y); + gfx_draw_sprite(dpi, SPR_MENU_LOGO, w->x, w->y, 0); x = 0; y = 105; diff --git a/src/window_title_scenarioselect.c b/src/window_title_scenarioselect.c index 09d185238f..7c8c7b744a 100644 --- a/src/window_title_scenarioselect.c +++ b/src/window_title_scenarioselect.c @@ -386,7 +386,7 @@ static void window_scenarioselect_paint() // Draw SixFlags image if (scenario->flags & SCENARIO_FLAGS_SIXFLAGS) - gfx_draw_sprite(dpi, SPR_SIX_FLAGS, w->x + w->width - 55, w->y + w->height - 75); + gfx_draw_sprite(dpi, SPR_SIX_FLAGS, w->x + w->width - 55, w->y + w->height - 75, 0); // Scenario name x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4; @@ -466,7 +466,7 @@ static void window_scenarioselect_scrollpaint() // Check if scenario is completed if (scenario->flags & SCENARIO_FLAGS_COMPLETED) { // Draw completion tick - gfx_draw_sprite(dpi, 0x5A9F, 395, y + 1); + gfx_draw_sprite(dpi, 0x5A9F, 395, y + 1, 0); // Draw completion score strcpy((char*)0x009BC677, scenario->completed_by);