mirror of https://github.com/OpenRCT2/OpenRCT2.git
Clean up window vars
This commit is contained in:
parent
8056d050c9
commit
8883f428ba
|
@ -309,7 +309,6 @@ rct_window* window_editor_inventions_list_open()
|
|||
w->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_RESIZE) | (1 << WIDX_TAB_1) | (1 << WIDX_RANDOM_SHUFFLE)
|
||||
| (1 << WIDX_MOVE_ITEMS_TO_BOTTOM) | (1 << WIDX_MOVE_ITEMS_TO_TOP);
|
||||
window_init_scroll_widgets(w);
|
||||
w->var_4AE = 0;
|
||||
w->selected_tab = 0;
|
||||
w->research_item = nullptr;
|
||||
_editorInventionsListDraggedItem.rawValue = RESEARCH_ITEM_NULL;
|
||||
|
|
|
@ -402,7 +402,6 @@ rct_window* window_editor_object_selection_open()
|
|||
}
|
||||
window_init_scroll_widgets(window);
|
||||
|
||||
window->var_4AE = 0;
|
||||
window->selected_tab = 0;
|
||||
window->selected_list_item = -1;
|
||||
window->object_entry = nullptr;
|
||||
|
|
|
@ -263,7 +263,6 @@ rct_window* window_editor_objective_options_open()
|
|||
w->pressed_widgets = 0;
|
||||
w->hold_down_widgets = window_editor_objective_options_page_hold_down_widgets[WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN];
|
||||
window_init_scroll_widgets(w);
|
||||
w->var_4AE = 0;
|
||||
w->selected_tab = WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN;
|
||||
w->no_list_items = 0;
|
||||
w->selected_list_item = -1;
|
||||
|
|
|
@ -399,7 +399,6 @@ rct_window* window_editor_scenario_options_open()
|
|||
w->enabled_widgets = window_editor_scenario_options_page_enabled_widgets[0];
|
||||
w->hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets[0];
|
||||
window_init_scroll_widgets(w);
|
||||
w->var_4AE = 0;
|
||||
w->page = 0;
|
||||
|
||||
return w;
|
||||
|
|
|
@ -875,42 +875,42 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER)
|
||||
y++;
|
||||
|
||||
int32_t ebx = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image + 1;
|
||||
int32_t animationFrame = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image + 1;
|
||||
|
||||
int32_t eax = 0;
|
||||
int32_t animationFrameOffset = 0;
|
||||
|
||||
if (w->page == WINDOW_GUEST_OVERVIEW)
|
||||
{
|
||||
eax = w->var_496;
|
||||
eax &= 0xFFFC;
|
||||
animationFrameOffset = w->var_496;
|
||||
animationFrameOffset &= 0xFFFC;
|
||||
}
|
||||
ebx += eax;
|
||||
animationFrame += animationFrameOffset;
|
||||
|
||||
int32_t sprite_id = ebx | SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour);
|
||||
int32_t sprite_id = animationFrame | SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour);
|
||||
gfx_draw_sprite(&clip_dpi, sprite_id, x, y, 0);
|
||||
|
||||
// If holding a balloon
|
||||
if (ebx >= 0x2A1D && ebx < 0x2A3D)
|
||||
if (animationFrame >= 0x2A1D && animationFrame < 0x2A3D)
|
||||
{
|
||||
ebx += 32;
|
||||
ebx |= SPRITE_ID_PALETTE_COLOUR_1(peep->balloon_colour);
|
||||
gfx_draw_sprite(&clip_dpi, ebx, x, y, 0);
|
||||
animationFrame += 32;
|
||||
animationFrame |= SPRITE_ID_PALETTE_COLOUR_1(peep->balloon_colour);
|
||||
gfx_draw_sprite(&clip_dpi, animationFrame, x, y, 0);
|
||||
}
|
||||
|
||||
// If holding umbrella
|
||||
if (ebx >= 0x2BBD && ebx < 0x2BDD)
|
||||
if (animationFrame >= 0x2BBD && animationFrame < 0x2BDD)
|
||||
{
|
||||
ebx += 32;
|
||||
ebx |= SPRITE_ID_PALETTE_COLOUR_1(peep->umbrella_colour);
|
||||
gfx_draw_sprite(&clip_dpi, ebx, x, y, 0);
|
||||
animationFrame += 32;
|
||||
animationFrame |= SPRITE_ID_PALETTE_COLOUR_1(peep->umbrella_colour);
|
||||
gfx_draw_sprite(&clip_dpi, animationFrame, x, y, 0);
|
||||
}
|
||||
|
||||
// If wearing hat
|
||||
if (ebx >= 0x29DD && ebx < 0x29FD)
|
||||
if (animationFrame >= 0x29DD && animationFrame < 0x29FD)
|
||||
{
|
||||
ebx += 32;
|
||||
ebx |= SPRITE_ID_PALETTE_COLOUR_1(peep->hat_colour);
|
||||
gfx_draw_sprite(&clip_dpi, ebx, x, y, 0);
|
||||
animationFrame += 32;
|
||||
animationFrame |= SPRITE_ID_PALETTE_COLOUR_1(peep->hat_colour);
|
||||
gfx_draw_sprite(&clip_dpi, animationFrame, x, y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1166,10 +1166,10 @@ void window_guest_overview_invalidate(rct_window* w)
|
|||
*/
|
||||
void window_guest_overview_update(rct_window* w)
|
||||
{
|
||||
int32_t var_496 = w->var_496;
|
||||
var_496++;
|
||||
var_496 %= 24;
|
||||
w->var_496 = var_496;
|
||||
int32_t newAnimationFrame = w->var_496;
|
||||
newAnimationFrame++;
|
||||
newAnimationFrame %= 24;
|
||||
w->var_496 = newAnimationFrame;
|
||||
|
||||
widget_invalidate(w, WIDX_TAB_1);
|
||||
widget_invalidate(w, WIDX_TAB_2);
|
||||
|
|
|
@ -1389,7 +1389,7 @@ static void window_ride_draw_tab_customer(rct_drawpixelinfo* dpi, rct_window* w)
|
|||
rct_widget* widget = &w->widgets[widgetIndex];
|
||||
int32_t spriteIndex = 0;
|
||||
if (w->page == WINDOW_RIDE_PAGE_CUSTOMER)
|
||||
spriteIndex = w->var_492 & ~3;
|
||||
spriteIndex = w->picked_peep_frame & ~3;
|
||||
|
||||
spriteIndex += g_peep_animation_entries[PEEP_SPRITE_TYPE_NORMAL].sprite_animation->base_image;
|
||||
spriteIndex += 1;
|
||||
|
@ -1560,7 +1560,7 @@ static rct_window* window_ride_open(Ride* ride)
|
|||
w->vehicleIndex = 0;
|
||||
w->frame_no = 0;
|
||||
w->list_information_type = 0;
|
||||
w->var_492 = 0;
|
||||
w->picked_peep_frame = 0;
|
||||
w->ride_colour = 0;
|
||||
window_ride_disable_tabs(w);
|
||||
w->min_width = 316;
|
||||
|
@ -1801,7 +1801,7 @@ static void window_ride_set_page(rct_window* w, int32_t page)
|
|||
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
w->var_492 = 0;
|
||||
w->picked_peep_frame = 0;
|
||||
|
||||
// There doesn't seem to be any need for this call, and it can sometimes modify the reported number of cars per train, so
|
||||
// I've removed it if (page == WINDOW_RIDE_PAGE_VEHICLE) { ride_update_max_vehicles(ride);
|
||||
|
@ -6908,9 +6908,9 @@ static void window_ride_customer_resize(rct_window* w)
|
|||
*/
|
||||
static void window_ride_customer_update(rct_window* w)
|
||||
{
|
||||
w->var_492++;
|
||||
if (w->var_492 >= 24)
|
||||
w->var_492 = 0;
|
||||
w->picked_peep_frame++;
|
||||
if (w->picked_peep_frame >= 24)
|
||||
w->picked_peep_frame = 0;
|
||||
|
||||
window_event_invalidate_call(w);
|
||||
widget_invalidate(w, WIDX_TAB_10);
|
||||
|
|
|
@ -183,7 +183,7 @@ rct_window* window_sign_open(rct_windownumber number)
|
|||
|
||||
w->list_information_type = tile_element->AsLargeScenery()->GetPrimaryColour();
|
||||
w->var_492 = tile_element->AsLargeScenery()->GetSecondaryColour();
|
||||
w->var_48C = tile_element->AsLargeScenery()->GetEntryIndex();
|
||||
w->SceneryEntry = tile_element->AsLargeScenery()->GetEntryIndex();
|
||||
|
||||
// Create viewport
|
||||
viewportWidget = &window_sign_widgets[WIDX_VIEWPORT];
|
||||
|
@ -316,7 +316,7 @@ static void window_sign_invalidate(rct_window* w)
|
|||
rct_widget* main_colour_btn = &window_sign_widgets[WIDX_MAIN_COLOUR];
|
||||
rct_widget* text_colour_btn = &window_sign_widgets[WIDX_TEXT_COLOUR];
|
||||
|
||||
rct_scenery_entry* scenery_entry = get_large_scenery_entry(w->var_48C);
|
||||
rct_scenery_entry* scenery_entry = get_large_scenery_entry(w->SceneryEntry);
|
||||
|
||||
main_colour_btn->type = WWT_EMPTY;
|
||||
text_colour_btn->type = WWT_EMPTY;
|
||||
|
@ -426,7 +426,7 @@ rct_window* window_sign_small_open(rct_windownumber number)
|
|||
|
||||
w->list_information_type = tile_element->AsWall()->GetPrimaryColour();
|
||||
w->var_492 = tile_element->AsWall()->GetSecondaryColour();
|
||||
w->var_48C = tile_element->AsWall()->GetEntryIndex();
|
||||
w->SceneryEntry = tile_element->AsWall()->GetEntryIndex();
|
||||
|
||||
// Create viewport
|
||||
viewportWidget = &window_sign_widgets[WIDX_VIEWPORT];
|
||||
|
@ -527,7 +527,7 @@ static void window_sign_small_invalidate(rct_window* w)
|
|||
rct_widget* main_colour_btn = &window_sign_widgets[WIDX_MAIN_COLOUR];
|
||||
rct_widget* text_colour_btn = &window_sign_widgets[WIDX_TEXT_COLOUR];
|
||||
|
||||
rct_scenery_entry* scenery_entry = get_wall_entry(w->var_48C);
|
||||
rct_scenery_entry* scenery_entry = get_wall_entry(w->SceneryEntry);
|
||||
|
||||
main_colour_btn->type = WWT_EMPTY;
|
||||
text_colour_btn->type = WWT_EMPTY;
|
||||
|
|
|
@ -623,13 +623,13 @@ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex,
|
|||
*/
|
||||
void window_staff_overview_update(rct_window* w)
|
||||
{
|
||||
int32_t var_496 = w->var_496;
|
||||
var_496++;
|
||||
if (var_496 >= 24)
|
||||
int32_t newAnimationFrame = w->var_496;
|
||||
newAnimationFrame++;
|
||||
if (newAnimationFrame >= 24)
|
||||
{
|
||||
var_496 = 0;
|
||||
newAnimationFrame = 0;
|
||||
}
|
||||
w->var_496 = var_496;
|
||||
w->var_496 = newAnimationFrame;
|
||||
widget_invalidate(w, WIDX_TAB_1);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ struct rct_window
|
|||
int16_t picked_peep_old_x; // staff/guest window: peep x gets set to 0x8000 on pickup, this is the old value
|
||||
int16_t vehicleIndex; // Ride window: selected car when setting vehicle colours
|
||||
int16_t numberOfStaff; // Used in park window.
|
||||
int16_t SceneryEntry; // Used in sign window.
|
||||
int16_t var_48C;
|
||||
};
|
||||
uint16_t frame_no; // updated every tic for motion in windows sprites
|
||||
|
@ -88,7 +89,7 @@ struct rct_window
|
|||
uint16_t viewport_target_sprite;
|
||||
ScreenCoordsXY savedViewPos;
|
||||
rct_windowclass classification;
|
||||
uint8_t colours[6];
|
||||
colour_t colours[6];
|
||||
uint8_t visibility;
|
||||
uint16_t viewport_smart_follow_sprite; // Handles setting viewport target sprite etc
|
||||
|
||||
|
|
Loading…
Reference in New Issue