This commit is contained in:
zsilencer 2015-07-12 20:23:58 -06:00
parent 01d2d599ca
commit af68e9d9ea
7 changed files with 21 additions and 13 deletions

View File

@ -500,6 +500,22 @@ void gfx_invalidate_pickedup_peep()
}
}
void gfx_draw_pickedup_peep()
{
if (RCT2_GLOBAL(0x009ABDF2, uint8) == 0)
return;
// Draw picked-up peep
if (RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_SPRITE, uint32) != 0xFFFFFFFF) {
gfx_draw_sprite(
(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), 0
);
}
}
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);

View File

@ -94,6 +94,7 @@ void gfx_draw_rain(int left, int top, int width, int height, sint32 x_start, sin
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();
void gfx_draw_pickedup_peep();
// line
void gfx_draw_line(rct_drawpixelinfo *dpi, int x1, int y1, int x2, int y2, int colour);

View File

@ -155,16 +155,6 @@ void update_rain_animation()
if (RCT2_GLOBAL(0x009ABDF2, uint8) == 0)
return;
// Draw picked-up peep
if (RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_SPRITE, uint32) != 0xFFFFFFFF) {
gfx_draw_sprite(
(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), 0
);
}
// Get rain draw function and draw rain
uint32 draw_rain_func = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RAIN_LEVEL, uint8);
if (draw_rain_func > 0 && !(RCT2_GLOBAL(0x009DEA6F, uint8) & 1))

View File

@ -325,7 +325,6 @@ 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();

View File

@ -178,6 +178,7 @@ void window_update_all()
gfx_draw_all_dirty_blocks();
window_update_all_viewports();
gfx_draw_all_dirty_blocks();
// 1000 tick update
RCT2_GLOBAL(0x009DEB7C, sint16) += RCT2_GLOBAL(0x009DE588, sint16);

View File

@ -187,7 +187,7 @@ bool openrct2_initialise()
title_sequences_load_presets();
// Hooks to allow RCT2 to call OpenRCT2 functions instead
addhook(0x006E732D, (int)gfx_set_dirty_blocks, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0); // remove after all drawing is decompiled
addhook(0x006E732D, (int)gfx_set_dirty_blocks, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0); // remove when all callers are decompiled
addhook(0x006E7499, (int)gfx_redraw_screen_rect, 0, (int[]){ EAX, EBX, EDX, EBP, END }, 0); // remove when 0x6E7FF3 is decompiled
addhook(0x006B752C, (int)ride_crash, 0, (int[]){ EDX, EBX, END }, 0); // remove when all callers are decompiled
addhook(0x0069A42F, (int)peep_window_state_update, 0, (int[]){ ESI }, 0); // remove when all callers are decompiled

View File

@ -218,9 +218,10 @@ void rct2_draw()
{
redraw_rain();
window_update_all();
gfx_invalidate_pickedup_peep();
gfx_draw_pickedup_peep();
update_rain_animation();
update_palette_effects();
gfx_draw_all_dirty_blocks();
console_draw(RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo));