diff --git a/src/input.c b/src/input.c index 7a60d4f8a2..459136660d 100644 --- a/src/input.c +++ b/src/input.c @@ -434,7 +434,7 @@ static void input_viewport_drag_continue() platform_show_cursor(); RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8) = INPUT_STATE_RESET; } else if (dx != 0 || dy != 0) { - if (!(w->flags & (1 << 2))) { + if (!(w->flags & WF_NO_SCROLLING)) { RCT2_GLOBAL(0x009DE540, sint16) = 1000; dx <<= viewport->zoom + 1; dy <<= viewport->zoom + 1; @@ -1543,7 +1543,7 @@ void game_handle_edge_scroll() mainWindow = window_get_main(); if (mainWindow == NULL) return; - if ((mainWindow->flags & WF_2) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9)) + if ((mainWindow->flags & WF_NO_SCROLLING) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9)) return; if (mainWindow->viewport == NULL) return; @@ -1586,7 +1586,7 @@ void game_handle_key_scroll() mainWindow = window_get_main(); if (mainWindow == NULL) return; - if ((mainWindow->flags & WF_2) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9)) + if ((mainWindow->flags & WF_NO_SCROLLING) || (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 9)) return; if (mainWindow->viewport == NULL) return; diff --git a/src/interface/window.c b/src/interface/window.c index 699cd15477..b3ae422db0 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -361,7 +361,7 @@ rct_window *window_create(int x, int y, int width, int height, rct_window_event_ if (RCT2_NEW_WINDOW >= &(g_window_list[MAX_NUMBER_WINDOWS])) { // Close least recently used window for (w = g_window_list; w < RCT2_NEW_WINDOW; w++) - if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_9))) + if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) break; window_close(w); @@ -820,7 +820,7 @@ rct_window *window_find_from_point(int x, int y) if (x < w->x || x >= w->x + w->width || y < w->y || y >= w->y + w->height) continue; - if (w->flags & WF_5) { + if (w->flags & WF_NO_BACKGROUND) { widget_index = window_find_widget_from_point(w, x, y); if (widget_index == -1) continue; @@ -1335,7 +1335,7 @@ void window_scroll_to_location(rct_window *w, int x, int y, int z) } // rct2: 0x006E7C76 if (w->viewport_target_sprite == -1) { - if (!(w->flags & WF_2)) { + if (!(w->flags & WF_NO_SCROLLING)) { w->saved_view_x = map_coordinate.x - (sint16)(w->viewport->view_width * window_scroll_locations[i][0]); w->saved_view_y = map_coordinate.y - (sint16)(w->viewport->view_height * window_scroll_locations[i][1]); w->flags |= WF_SCROLLING_TO_LOCATION; @@ -1613,7 +1613,7 @@ void window_draw_widgets(rct_window *w, rct_drawpixelinfo *dpi) rct_widget *widget; int widgetIndex; - if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_5)) + if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_NO_BACKGROUND)) gfx_fill_rect(dpi, w->x, w->y, w->x + w->width - 1, w->y + w->height - 1, 0x2000000 | 51); //todo: some code missing here? Between 006EB18C and 006EB260 diff --git a/src/interface/window.h b/src/interface/window.h index 5b5af29019..6a5b288aba 100644 --- a/src/interface/window.h +++ b/src/interface/window.h @@ -329,13 +329,13 @@ typedef enum { WF_STICK_TO_BACK = (1 << 0), WF_STICK_TO_FRONT = (1 << 1), - WF_2 = (1 << 2), + WF_NO_SCROLLING = (1 << 2), // User is unable to scroll this viewport WF_SCROLLING_TO_LOCATION = (1 << 3), WF_TRANSPARENT = (1 << 4), - WF_5 = (1 << 5), + WF_NO_BACKGROUND = (1 << 5), // Instead of half transparency, completely remove the window background WF_7 = (1 << 7), WF_RESIZABLE = (1 << 8), - WF_9 = (1 << 9), + WF_NO_AUTO_CLOSE = (1 << 9), // Don't auto close this window if too many windows are open WF_10 = (1 << 10), WF_WHITE_BORDER_ONE = (1 << 12), WF_WHITE_BORDER_MASK = (1 << 12) | (1 << 13), diff --git a/src/windows/banner.c b/src/windows/banner.c index 9926914055..a8bba69e64 100644 --- a/src/windows/banner.c +++ b/src/windows/banner.c @@ -117,7 +117,7 @@ void window_banner_open(rct_windownumber number) if (w != NULL) return; - w = window_create_auto_pos(WW, WH, &window_banner_events, WC_BANNER, WF_2); + w = window_create_auto_pos(WW, WH, &window_banner_events, WC_BANNER, WF_NO_SCROLLING); w->widgets = window_banner_widgets; w->enabled_widgets = (1 << WIDX_CLOSE) | diff --git a/src/windows/editor_bottom_toolbar.c b/src/windows/editor_bottom_toolbar.c index 3874d0b05a..84c6979030 100644 --- a/src/windows/editor_bottom_toolbar.c +++ b/src/windows/editor_bottom_toolbar.c @@ -130,7 +130,7 @@ void window_editor_bottom_toolbar_open() window = window_create(0, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, uint16) - 32, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16), 32, &window_editor_bottom_toolbar_events, - WC_BOTTOM_TOOLBAR, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5); + WC_BOTTOM_TOOLBAR, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); window->widgets = window_editor_bottom_toolbar_widgets; window->enabled_widgets |= diff --git a/src/windows/editor_inventions_list.c b/src/windows/editor_inventions_list.c index 5c04f98508..66feb1b2fd 100644 --- a/src/windows/editor_inventions_list.c +++ b/src/windows/editor_inventions_list.c @@ -532,7 +532,7 @@ void window_editor_inventions_list_open() 400, &window_editor_inventions_list_events, WC_EDITOR_INVENTION_LIST, - WF_2 + WF_NO_SCROLLING ); w->widgets = window_editor_inventions_list_widgets; w->enabled_widgets = diff --git a/src/windows/editor_scenario_options.c b/src/windows/editor_scenario_options.c index fc81d86aae..bb6c71fa4f 100644 --- a/src/windows/editor_scenario_options.c +++ b/src/windows/editor_scenario_options.c @@ -343,7 +343,7 @@ void window_editor_scenario_options_open() 148, window_editor_scenario_options_page_events[0], WC_EDITOR_SCENARIO_OPTIONS, - WF_2 + WF_NO_SCROLLING ); w->widgets = window_editor_scenario_options_widgets[0]; w->enabled_widgets = window_editor_scenario_options_page_enabled_widgets[0]; diff --git a/src/windows/game_bottom_toolbar.c b/src/windows/game_bottom_toolbar.c index e65afee41a..c9e001f09e 100644 --- a/src/windows/game_bottom_toolbar.c +++ b/src/windows/game_bottom_toolbar.c @@ -134,7 +134,7 @@ void window_game_bottom_toolbar_open() RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16), 32, &window_game_bottom_toolbar_events, WC_BOTTOM_TOOLBAR, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5 + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND ); window->widgets = window_game_bottom_toolbar_widgets; window->enabled_widgets |= diff --git a/src/windows/guest.c b/src/windows/guest.c index 0e538fc903..d2cda8b34f 100644 --- a/src/windows/guest.c +++ b/src/windows/guest.c @@ -774,7 +774,7 @@ void window_guest_viewport_init(rct_window* w){ int height = view_widget->bottom - view_widget->top - 1; viewport_create(w, x, y, width, height, 0, focus.coordinate.x, focus.coordinate.y, focus.coordinate.z, focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id); - w->flags |= WF_2; + w->flags |= WF_NO_SCROLLING; window_invalidate(w); } } diff --git a/src/windows/map_tooltip.c b/src/windows/map_tooltip.c index a7fc768074..0356c31197 100644 --- a/src/windows/map_tooltip.c +++ b/src/windows/map_tooltip.c @@ -121,7 +121,7 @@ static void window_map_tooltip_open() w = window_find_by_class(WC_MAP_TOOLTIP); if (w == NULL) { w = window_create( - x, y, width, height, &window_map_tooltip_events, WC_MAP_TOOLTIP, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5 + x, y, width, height, &window_map_tooltip_events, WC_MAP_TOOLTIP, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND ); w->widgets = window_map_tooltip_widgets; } else { diff --git a/src/windows/maze_construction.c b/src/windows/maze_construction.c index b3f29fa920..00f0d90576 100644 --- a/src/windows/maze_construction.c +++ b/src/windows/maze_construction.c @@ -143,7 +143,7 @@ static void window_maze_construction_construct(int direction); */ rct_window *window_maze_construction_open() { - rct_window *w = window_create(0, 29, 166, 200, &window_maze_construction_events, WC_RIDE_CONSTRUCTION, WF_9); + rct_window *w = window_create(0, 29, 166, 200, &window_maze_construction_events, WC_RIDE_CONSTRUCTION, WF_NO_AUTO_CLOSE); w->widgets = window_maze_construction_widgets; w->enabled_widgets = 0x6F0001C4; diff --git a/src/windows/ride.c b/src/windows/ride.c index bcdb9de417..7a8d0403cb 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -1581,7 +1581,7 @@ static void window_ride_init_viewport(rct_window *w) focus.sprite.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite.sprite_id); - w->flags |= WF_2; + w->flags |= WF_NO_SCROLLING; window_invalidate(w); } if (w->viewport){ diff --git a/src/windows/ride_construction.c b/src/windows/ride_construction.c index 8c0d9394ed..87926da849 100644 --- a/src/windows/ride_construction.c +++ b/src/windows/ride_construction.c @@ -511,7 +511,7 @@ rct_window *window_ride_construction_open() if (ride->type == RIDE_TYPE_MAZE) return window_maze_construction_open(); - w = window_create(0, 29, 166, 394, &window_ride_construction_events, WC_RIDE_CONSTRUCTION, WF_9); + w = window_create(0, 29, 166, 394, &window_ride_construction_events, WC_RIDE_CONSTRUCTION, WF_NO_AUTO_CLOSE); w->widgets = window_ride_construction_widgets; w->enabled_widgets = 0x67EFFFFFC4; diff --git a/src/windows/scenery.c b/src/windows/scenery.c index b7c132a489..1e7760c359 100644 --- a/src/windows/scenery.c +++ b/src/windows/scenery.c @@ -428,7 +428,7 @@ void window_scenery_open() WINDOW_SCENERY_HEIGHT, &window_scenery_events, WC_SCENERY, - WF_2 + WF_NO_SCROLLING ); window->widgets = window_scenery_widgets; diff --git a/src/windows/sign.c b/src/windows/sign.c index aae51c5078..9c2a56dfe5 100644 --- a/src/windows/sign.c +++ b/src/windows/sign.c @@ -153,7 +153,7 @@ void window_sign_open(rct_windownumber number) if (w != NULL) return; - w = window_create_auto_pos(WW, WH, &window_sign_events, WC_BANNER, WF_2); + w = window_create_auto_pos(WW, WH, &window_sign_events, WC_BANNER, WF_NO_SCROLLING); w->widgets = window_sign_widgets; w->enabled_widgets = (1 << WIDX_CLOSE) | @@ -492,7 +492,7 @@ void window_sign_small_open(rct_windownumber number){ ); w->viewport->flags = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES) ? VIEWPORT_FLAG_GRIDLINES : 0; - w->flags |= WF_2; + w->flags |= WF_NO_SCROLLING; window_invalidate(w); } diff --git a/src/windows/staff.c b/src/windows/staff.c index 29aa3b50e2..143f9bb3fd 100644 --- a/src/windows/staff.c +++ b/src/windows/staff.c @@ -1228,7 +1228,7 @@ void window_staff_viewport_init(rct_window* w){ int height = view_widget->bottom - view_widget->top - 1; viewport_create(w, x, y, width, height, 0, 0, 0, 0, focus.type & VIEWPORT_FOCUS_TYPE_MASK, focus.sprite_id); - w->flags |= WF_2; + w->flags |= WF_NO_SCROLLING; window_invalidate(w); } } diff --git a/src/windows/title_menu.c b/src/windows/title_menu.c index 2bb2c004f1..970d021ca8 100644 --- a/src/windows/title_menu.c +++ b/src/windows/title_menu.c @@ -98,7 +98,7 @@ void window_title_menu_open() 328, 100, &window_title_menu_events, WC_TITLE_MENU, - WF_STICK_TO_BACK | WF_TRANSPARENT | WF_5 + WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND ); window->widgets = window_title_menu_widgets; window->enabled_widgets = ( diff --git a/src/windows/top_toolbar.c b/src/windows/top_toolbar.c index 3e6e307336..620c518ea1 100644 --- a/src/windows/top_toolbar.c +++ b/src/windows/top_toolbar.c @@ -269,7 +269,7 @@ void window_top_toolbar_open() RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16), 28, &window_top_toolbar_events, WC_TOP_TOOLBAR, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_5 + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND ); window->widgets = window_top_toolbar_widgets;