mirror of https://github.com/OpenRCT2/OpenRCT2.git
commit
abe3ff791d
|
@ -211,7 +211,7 @@ uint8* gfx_get_dirty_blocks()
|
|||
* right (dx)
|
||||
* bottom (bp)
|
||||
*/
|
||||
void gfx_set_dirty_blocks(uint16 left, uint16 top, uint16 right, uint16 bottom)
|
||||
void gfx_set_dirty_blocks(sint16 left, sint16 top, sint16 right, sint16 bottom)
|
||||
{
|
||||
int x, y;
|
||||
uint8 *screenDirtyBlocks = gfx_get_dirty_blocks();
|
||||
|
@ -454,22 +454,9 @@ void gfx_draw_rain(int left, int top, int width, int height, sint32 x_start, sin
|
|||
*
|
||||
* rct2: 0x006843DC
|
||||
*/
|
||||
void redraw_peep_and_rain()
|
||||
void redraw_rain()
|
||||
{
|
||||
if (RCT2_GLOBAL(0x009ABDF2, uint32) != 0) {
|
||||
int sprite = RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_SPRITE, sint32);
|
||||
if (sprite != -1) {
|
||||
sprite = sprite & 0x7FFFF;
|
||||
|
||||
rct_g1_element *g1_elements = &g1Elements[sprite];
|
||||
int left = RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_X, sint16) + g1_elements->x_offset;
|
||||
int top = RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_Y, sint16) + g1_elements->y_offset;
|
||||
int right = left + g1_elements->width;
|
||||
int bottom = top + g1_elements->height;
|
||||
|
||||
gfx_set_dirty_blocks(left, top, right, bottom);
|
||||
}
|
||||
|
||||
int rain_no_pixels = RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32);
|
||||
if (rain_no_pixels == 0) {
|
||||
return;
|
||||
|
@ -495,6 +482,24 @@ void redraw_peep_and_rain()
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32) = 0;
|
||||
}
|
||||
|
||||
void gfx_invalidate_pickedup_peep()
|
||||
{
|
||||
if (RCT2_GLOBAL(0x009ABDF2, uint32) != 0) {
|
||||
int sprite = RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_SPRITE, sint32);
|
||||
if (sprite != -1) {
|
||||
sprite = sprite & 0x7FFFF;
|
||||
|
||||
rct_g1_element *g1_elements = &g1Elements[sprite];
|
||||
int left = RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_X, sint16) + g1_elements->x_offset;
|
||||
int top = RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_Y, sint16) + g1_elements->y_offset;
|
||||
int right = left + g1_elements->width;
|
||||
int bottom = top + g1_elements->height;
|
||||
|
||||
gfx_set_dirty_blocks(left, top, right, bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_681DE2(rct_drawpixelinfo *dpi, int x, int y, int image1, int image2)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x00681DE2, 0, image1, x, y, 0, (int)dpi, image2);
|
||||
|
|
|
@ -80,7 +80,7 @@ extern rct_gx g2;
|
|||
|
||||
//
|
||||
rct_drawpixelinfo* clip_drawpixelinfo(rct_drawpixelinfo* dpi, int left, int width, int top, int height);
|
||||
void gfx_set_dirty_blocks(uint16 left, uint16 top, uint16 right, uint16 bottom);
|
||||
void gfx_set_dirty_blocks(sint16 left, sint16 top, sint16 right, sint16 bottom);
|
||||
void gfx_draw_all_dirty_blocks();
|
||||
void gfx_redraw_screen_rect(short left, short top, short right, short bottom);
|
||||
void gfx_invalidate_screen();
|
||||
|
@ -93,6 +93,7 @@ void load_palette();
|
|||
void gfx_draw_rain(int left, int top, int width, int height, sint32 x_start, sint32 y_start);
|
||||
void gfx_clear(rct_drawpixelinfo *dpi, int colour);
|
||||
void gfx_draw_pixel(rct_drawpixelinfo *dpi, int x, int y, int colour);
|
||||
void gfx_invalidate_pickedup_peep();
|
||||
|
||||
// line
|
||||
void gfx_draw_line(rct_drawpixelinfo *dpi, int x1, int y1, int x2, int y2, int colour);
|
||||
|
@ -134,7 +135,7 @@ void sub_6C1F57(rct_drawpixelinfo *dpi, int x, int y, int width, int colour, rct
|
|||
|
||||
// rain
|
||||
void update_rain_animation();
|
||||
void redraw_peep_and_rain();
|
||||
void redraw_rain();
|
||||
|
||||
// unknown
|
||||
void sub_681DE2(rct_drawpixelinfo *dpi, int x, int y, int image1, int image2);
|
||||
|
|
|
@ -325,6 +325,7 @@ void game_logic_update()
|
|||
peep_update_crowd_noise();
|
||||
climate_update_sound();
|
||||
editor_open_windows_for_current_step();
|
||||
gfx_invalidate_pickedup_peep();
|
||||
|
||||
// Update windows
|
||||
//window_dispatch_update_all();
|
||||
|
|
|
@ -66,7 +66,7 @@ void screenshot_check()
|
|||
}
|
||||
|
||||
RCT2_GLOBAL(0x009A8C29, uint8) &= ~1;
|
||||
redraw_peep_and_rain();
|
||||
redraw_rain();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -330,11 +330,6 @@ static void openrct2_loop()
|
|||
invalidate_sprite(&g_sprite_list[i]);
|
||||
}
|
||||
|
||||
// Viewports need to be updated to reduce chopiness of those which follow sprites
|
||||
for (rct_window *w = g_window_list; w < RCT2_GLOBAL(RCT2_ADDRESS_NEW_WINDOW_PTR, rct_window*); w++) {
|
||||
viewport_update_sprite_follow(w);
|
||||
}
|
||||
|
||||
platform_process_messages();
|
||||
rct2_draw();
|
||||
platform_draw();
|
||||
|
|
11
src/rct2.c
11
src/rct2.c
|
@ -216,9 +216,10 @@ void rct2_update()
|
|||
|
||||
void rct2_draw()
|
||||
{
|
||||
// Handles picked-up peep and rain redraw
|
||||
redraw_peep_and_rain();
|
||||
|
||||
redraw_rain();
|
||||
window_update_all();
|
||||
update_rain_animation();
|
||||
update_palette_effects();
|
||||
gfx_draw_all_dirty_blocks();
|
||||
|
||||
console_draw(RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo));
|
||||
|
@ -231,10 +232,6 @@ void rct2_draw()
|
|||
} else {
|
||||
//game
|
||||
}
|
||||
|
||||
window_update_all();
|
||||
update_rain_animation();
|
||||
update_palette_effects();
|
||||
}
|
||||
|
||||
int rct2_open_file(const char *path)
|
||||
|
|
Loading…
Reference in New Issue