diff --git a/src/addresses.h b/src/addresses.h index 194e111b50..921c3d423f 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -56,7 +56,7 @@ #define RCT2_ADDRESS_RIDE_PROPERTIES 0x00997C9D #define RCT2_ADDRESS_LAND_TOOL_SIZE 0x009A9800 #define RCT2_ADDRESS_SAVE_PROMPT_MODE 0x009A9802 - +#define RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS 0x009A9804 #define RCT2_ADDRESS_MAP_TOOLTIP_ARGS 0x009A9808 // #define RCT2_ADDRESS_SCENARIO_LIST 0x009A9FF4 diff --git a/src/management/finance.c b/src/management/finance.c index 8eccfd85b5..eaa7602382 100644 --- a/src/management/finance.c +++ b/src/management/finance.c @@ -60,9 +60,8 @@ void finance_payment(money32 amount, rct_expenditure_type type) RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32) -= amount; // Cumulative amount of money spent this day - RCT2_GLOBAL(0x009A9804, uint32) |= 1; // money dirty flag + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint32) |= 1; // money dirty flag window_invalidate_by_class(WC_FINANCES); - window_invalidate_by_class(WC_BOTTOM_TOOLBAR); } /** diff --git a/src/peep/peep.c b/src/peep/peep.c index 1a7dde9345..e637f5a942 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -313,7 +313,7 @@ void peep_remove(rct_peep* peep){ if (peep->type == PEEP_TYPE_GUEST){ if (peep->var_2A == 0){ RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16)--; - RCT2_GLOBAL(0x9A9804, uint16) |= (1 << 2); + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) |= (1 << 2); } if (peep->state == PEEP_STATE_ENTERING_PARK){ RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_HEADING_FOR_PARK, uint16)--; @@ -916,7 +916,7 @@ static void peep_update_leaving_park(rct_peep* peep){ peep->var_2A = 1; peep->destination_tolerence = 5; RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16)--; - RCT2_GLOBAL(0x9A9804, uint16) |= (1 << 0); + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) |= (1 << 0); peep->var_37 = 1; window_invalidate_by_class(WC_GUEST_LIST); @@ -1037,7 +1037,7 @@ static void peep_update_entering_park(rct_peep* peep){ peep->time_in_park = RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TICKS, sint32); RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16)++; RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_HEADING_FOR_PARK, uint16)--; - RCT2_GLOBAL(0x9A9804, uint16) |= (1 << 2); + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) |= (1 << 2); window_invalidate_by_class(WC_GUEST_LIST); } diff --git a/src/scenario.c b/src/scenario.c index 9eef0e7590..ecbf59daef 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -650,7 +650,7 @@ void scenario_update() if (next_month_tick >= 0x10000) { // month ends actions RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16)++; - RCT2_GLOBAL(0x009A9804, uint32) |= 2; + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint32) |= 2; RCT2_CALLPROC_EBPSAFE(0x0069DEAD); scenario_objectives_check(); scenario_entrance_fee_too_high_check(); diff --git a/src/windows/game_bottom_toolbar.c b/src/windows/game_bottom_toolbar.c index 4374968647..2cbe70e80c 100644 --- a/src/windows/game_bottom_toolbar.c +++ b/src/windows/game_bottom_toolbar.c @@ -76,15 +76,17 @@ static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, rct_window *w); static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rct_window *w); static void window_game_bottom_toolbar_draw_tutorial_text(rct_drawpixelinfo *dpi, rct_window *w); +static void window_game_bottom_toobar_update(rct_window* w); +/* rct2: 0x0097BFDC */ static void* window_game_bottom_toolbar_events[] = { window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_mouseup, window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_emptysub, - window_game_bottom_toolbar_emptysub, - window_game_bottom_toolbar_emptysub, + window_game_bottom_toolbar_emptysub,//0x66c6f2 + window_game_bottom_toobar_update,//0x66c6d8 window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_emptysub, @@ -101,7 +103,7 @@ static void* window_game_bottom_toolbar_events[] = { window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_tooltip, - window_game_bottom_toolbar_emptysub, + window_game_bottom_toolbar_emptysub,//0x66c644 window_game_bottom_toolbar_emptysub, window_game_bottom_toolbar_invalidate, window_game_bottom_toolbar_paint, @@ -674,3 +676,35 @@ static void window_game_bottom_toolbar_draw_tutorial_text(rct_drawpixelinfo *dpi gfx_draw_string_centred(dpi, STR_TUTORIAL, x, y, 32, 0); gfx_draw_string_centred(dpi, STR_PRESS_KEY_OR_MOUSE_BUTTON_FOR_CONTROL, x, y + 10, 32, 0); } + +/* rct2: 0x0066C6D8 */ +static void window_game_bottom_toobar_update(rct_window* w){ + + w->frame_no++; + if (w->frame_no >= 24)w->frame_no = 0; + + if (RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) & 1){ + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) &= ~1; + widget_invalidate(w, WIDX_LEFT_INSET); + } + + if (RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) & 2){ + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) &= ~2; + widget_invalidate(w, WIDX_RIGHT_INSET); + } + + if (RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) & 4){ + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) &= ~4; + widget_invalidate(w, WIDX_LEFT_INSET); + } + + if (RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) & 8){ + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) &= ~8; + widget_invalidate(w, WIDX_RIGHT_INSET); + } + + if (RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) & 16){ + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) &= ~16; + widget_invalidate(w, WIDX_LEFT_INSET); + } +} \ No newline at end of file diff --git a/src/world/climate.c b/src/world/climate.c index b6a66723ee..f21702eb1a 100644 --- a/src/world/climate.c +++ b/src/world/climate.c @@ -158,7 +158,7 @@ void climate_update() if (RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE_UPDATE_TIMER, sint16)) { if (RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE_UPDATE_TIMER, sint16) == 960) - RCT2_GLOBAL(0x009A9804, uint32) |= 8; // climate dirty flag? + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint32) |= 8; // climate dirty flag? RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE_UPDATE_TIMER, sint16)--; @@ -173,7 +173,7 @@ void climate_update() if (cur_rain == next_rain) { RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8) = gClimateNextWeather; climate_determine_future_weather(); - RCT2_GLOBAL(0x009A9804, uint32) |= 8; // climate dirty flag? + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint32) |= 8; // climate dirty flag? } else if (next_rain <= 2) { // Safe-guard RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RAIN_LEVEL, sint8) = step_weather_level(cur_rain, next_rain); } @@ -184,7 +184,7 @@ void climate_update() } else { RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TEMPERATURE, sint8) = step_weather_level(temperature, target_temperature); - RCT2_GLOBAL(0x009A9804, uint32) |= 8; // climate dirty flag? + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint32) |= 8; // climate dirty flag? } } } diff --git a/src/world/park.c b/src/world/park.c index 7115b5b88d..72e90bfed9 100644 --- a/src/world/park.c +++ b/src/world/park.c @@ -540,7 +540,7 @@ void park_update() RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_COMPANY_VALUE, money32) = calculate_company_value(); window_invalidate_by_class(WC_FINANCES); _guestGenerationProbability = park_calculate_guest_generation_probability(); - RCT2_GLOBAL(0x009A9804, uint16) |= 0x10; + RCT2_GLOBAL(RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS, uint16) |= 0x10; window_invalidate_by_class(WC_PARK_INFORMATION); }