diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 26abc9dd0b..1105d6ef89 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -632,7 +632,7 @@ public: { auto viewport = WindowGetViewport(mainWindow); - mainWindow->viewport_target_sprite = EntityId::GetNull(); + mainWindow->viewportTargetSprite = EntityId::GetNull(); mainWindow->savedViewPos = viewPos; viewport->zoom = zoom; viewport->rotation = rotation; @@ -912,10 +912,10 @@ public: wp->windowPos = pos; wp->width = windowSize.width; wp->height = windowSize.height; - wp->min_width = windowSize.width; - wp->max_width = windowSize.width; - wp->min_height = windowSize.height; - wp->max_height = windowSize.height; + wp->minWidth = windowSize.width; + wp->maxWidth = windowSize.width; + wp->minHeight = windowSize.height; + wp->maxHeight = windowSize.height; wp->focus = std::nullopt; diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 2995f204f6..0a204d6748 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -866,14 +866,14 @@ namespace OpenRCT2::Ui { if (w.classification == WindowClass::Custom) return w.widgets[widgetIndex].flags.has(WidgetFlag::isDisabled); - return (w.disabled_widgets & (1LL << widgetIndex)) != 0; + return (w.disabledWidgets & (1LL << widgetIndex)) != 0; } bool widgetIsHoldable(const WindowBase& w, WidgetIndex widgetIndex) { if (w.classification == WindowClass::Custom) return w.widgets[widgetIndex].flags.has(WidgetFlag::isHoldable); - return (w.hold_down_widgets & (1LL << widgetIndex)) != 0; + return (w.holdDownWidgets & (1LL << widgetIndex)) != 0; } bool widgetIsVisible(const WindowBase& w, WidgetIndex widgetIndex) @@ -892,7 +892,7 @@ namespace OpenRCT2::Ui } else { - if (w.pressed_widgets & (1LL << widgetIndex)) + if (w.pressedWidgets & (1LL << widgetIndex)) { return true; } @@ -1075,11 +1075,11 @@ namespace OpenRCT2::Ui SafeSetWidgetFlag(w, widgetIndex, WidgetFlag::isDisabled, value); if (value) { - w.disabled_widgets |= (1uLL << widgetIndex); + w.disabledWidgets |= (1uLL << widgetIndex); } else { - w.disabled_widgets &= ~(1uLL << widgetIndex); + w.disabledWidgets &= ~(1uLL << widgetIndex); } } @@ -1088,11 +1088,11 @@ namespace OpenRCT2::Ui SafeSetWidgetFlag(w, widgetIndex, WidgetFlag::isHoldable, value); if (value) { - w.hold_down_widgets |= (1uLL << widgetIndex); + w.holdDownWidgets |= (1uLL << widgetIndex); } else { - w.hold_down_widgets &= ~(1uLL << widgetIndex); + w.holdDownWidgets &= ~(1uLL << widgetIndex); } } @@ -1105,9 +1105,9 @@ namespace OpenRCT2::Ui { SafeSetWidgetFlag(w, widgetIndex, WidgetFlag::isPressed, value); if (value) - w.pressed_widgets |= (1uLL << widgetIndex); + w.pressedWidgets |= (1uLL << widgetIndex); else - w.pressed_widgets &= ~(1uLL << widgetIndex); + w.pressedWidgets &= ~(1uLL << widgetIndex); } void widgetSetCheckboxValue(WindowBase& w, WidgetIndex widgetIndex, bool value) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 7f9e54926f..30b1beb9ac 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -637,8 +637,8 @@ namespace OpenRCT2::Ui::Windows w.Invalidate(); // Clamp new size to minimum and maximum - w.width = std::clamp(w.width + dw, w.min_width, w.max_width); - w.height = std::clamp(w.height + dh, w.min_height, w.max_height); + w.width = std::clamp(w.width + dw, w.minWidth, w.maxWidth); + w.height = std::clamp(w.height + dh, w.minHeight, w.maxHeight); w.OnResize(); w.ResizeFrame(); @@ -955,10 +955,10 @@ namespace OpenRCT2::Ui::Windows bool WindowSetResize(WindowBase& w, ScreenSize minSize, ScreenSize maxSize) { - w.min_width = std::min(minSize.width, maxSize.width); - w.min_height = std::min(minSize.height, maxSize.height); - w.max_width = std::max(minSize.width, maxSize.width); - w.max_height = std::max(minSize.height, maxSize.height); + w.minWidth = std::min(minSize.width, maxSize.width); + w.minHeight = std::min(minSize.height, maxSize.height); + w.maxWidth = std::max(minSize.width, maxSize.width); + w.maxHeight = std::max(minSize.height, maxSize.height); if (Config::Get().interface.EnlargedUi) { @@ -966,19 +966,19 @@ namespace OpenRCT2::Ui::Windows // but they currently show a deviation if we don't. if (w.classification == WindowClass::Custom) { - w.min_height += w.getTitleBarDiffTarget(); - w.max_height += w.getTitleBarDiffTarget(); + w.minHeight += w.getTitleBarDiffTarget(); + w.maxHeight += w.getTitleBarDiffTarget(); } else { - w.min_height += w.getTitleBarDiffNormal(); - w.max_height += w.getTitleBarDiffNormal(); + w.minHeight += w.getTitleBarDiffNormal(); + w.maxHeight += w.getTitleBarDiffNormal(); } } // Clamp width and height to minimum and maximum - int16_t width = std::clamp(w.width, w.min_width, w.max_width); - int16_t height = std::clamp(w.height, w.min_height, w.max_height); + int16_t width = std::clamp(w.width, w.minWidth, w.maxWidth); + int16_t height = std::clamp(w.height, w.minHeight, w.maxHeight); // Resize window if size has changed if (w.width != width || w.height != height) @@ -996,7 +996,7 @@ namespace OpenRCT2::Ui::Windows bool WindowCanResize(const WindowBase& w) { - return (w.flags & WF_RESIZABLE) && (w.min_width != w.max_width || w.min_height != w.max_height); + return (w.flags & WF_RESIZABLE) && (w.minWidth != w.maxWidth || w.minHeight != w.maxHeight); } /** diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index b0af13130a..4922d909a5 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -423,10 +423,10 @@ namespace OpenRCT2::Ui::Windows if (_info.Desc.IsResizable()) { - min_width = _info.Desc.MinWidth.value_or(0); - min_height = _info.Desc.MinHeight.value_or(0); - max_width = _info.Desc.MaxWidth.value_or(kMaxWindowSize.width); - max_height = _info.Desc.MaxHeight.value_or(kMaxWindowSize.height); + minWidth = _info.Desc.MinWidth.value_or(0); + minHeight = _info.Desc.MinHeight.value_or(0); + maxWidth = _info.Desc.MaxWidth.value_or(kMaxWindowSize.width); + maxHeight = _info.Desc.MaxHeight.value_or(kMaxWindowSize.height); } RefreshWidgets(); } @@ -438,15 +438,15 @@ namespace OpenRCT2::Ui::Windows void OnResize() override { - if (width < min_width) + if (width < minWidth) { Invalidate(); - width = min_width; + width = minWidth; } - if (height < min_height) + if (height < minHeight) { Invalidate(); - height = min_height; + height = minHeight; } UpdateViewport(); } @@ -458,10 +458,10 @@ namespace OpenRCT2::Ui::Windows const auto& tab = _info.Desc.Tabs[page]; if (tab.imageFrameCount != 0) { - frame_no++; - if (frame_no >= tab.imageFrameCount * tab.imageFrameDuration) + currentFrame++; + if (currentFrame >= tab.imageFrameCount * tab.imageFrameDuration) { - frame_no = 0; + currentFrame = 0; } InvalidateWidget(WIDX_TAB_0 + this->page); @@ -761,7 +761,7 @@ namespace OpenRCT2::Ui::Windows return; page = static_cast(tabIndex); - frame_no = 0; + currentFrame = 0; RefreshWidgets(); Invalidate(); @@ -867,7 +867,7 @@ namespace OpenRCT2::Ui::Windows auto image = tab.imageFrameBase; if (static_cast(page) == tabIndex && tab.imageFrameDuration != 0 && tab.imageFrameCount != 0) { - auto frame = frame_no / tab.imageFrameDuration; + auto frame = currentFrame / tab.imageFrameDuration; auto imageOffset = frame % tab.imageFrameCount; image = image.WithIndex(image.GetIndex() + imageOffset); } diff --git a/src/openrct2-ui/scripting/ScWindow.hpp b/src/openrct2-ui/scripting/ScWindow.hpp index 0f577d1951..602901289f 100644 --- a/src/openrct2-ui/scripting/ScWindow.hpp +++ b/src/openrct2-ui/scripting/ScWindow.hpp @@ -103,7 +103,7 @@ namespace OpenRCT2::Scripting } else { - WindowSetResize(*w, { value, w->min_height }, { value, w->max_height }); + WindowSetResize(*w, { value, w->minHeight }, { value, w->maxHeight }); } } } @@ -128,7 +128,7 @@ namespace OpenRCT2::Scripting } else { - WindowSetResize(*w, { w->min_width, value }, { w->max_width, value }); + WindowSetResize(*w, { w->minWidth, value }, { w->maxWidth, value }); } } } @@ -137,7 +137,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - return w->min_width; + return w->minWidth; } return 0; } @@ -146,7 +146,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - WindowSetResize(*w, { value, w->min_height }, { w->max_width, w->max_height }); + WindowSetResize(*w, { value, w->minHeight }, { w->maxWidth, w->maxHeight }); } } int32_t maxWidth_get() const @@ -154,7 +154,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - return w->max_width; + return w->maxWidth; } return 0; } @@ -163,7 +163,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - WindowSetResize(*w, { w->min_width, w->min_height }, { value, w->max_height }); + WindowSetResize(*w, { w->minWidth, w->minHeight }, { value, w->maxHeight }); } } int32_t minHeight_get() const @@ -171,7 +171,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - return w->min_height - w->getTitleBarDiffNormal(); + return w->minHeight - w->getTitleBarDiffNormal(); } return 0; } @@ -181,7 +181,7 @@ namespace OpenRCT2::Scripting if (w != nullptr) { value += w->getTitleBarDiffNormal(); - WindowSetResize(*w, { w->min_width, value }, { w->max_width, w->max_height }); + WindowSetResize(*w, { w->minWidth, value }, { w->maxWidth, w->maxHeight }); } } int32_t maxHeight_get() const @@ -189,7 +189,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - return w->max_height - w->getTitleBarDiffNormal(); + return w->maxHeight - w->getTitleBarDiffNormal(); } return 0; } @@ -199,7 +199,7 @@ namespace OpenRCT2::Scripting if (w != nullptr) { value += w->getTitleBarDiffNormal(); - WindowSetResize(*w, { w->min_width, w->min_height }, { w->max_width, value }); + WindowSetResize(*w, { w->minWidth, w->minHeight }, { w->maxWidth, value }); } } bool isSticky_get() const diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 823d8d652d..8adc254952 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -451,7 +451,7 @@ namespace OpenRCT2::Title void StoreCurrentViewLocation() { WindowBase* w = WindowGetMain(); - if (w != nullptr && w->viewport_smart_follow_sprite.IsNull()) + if (w != nullptr && w->viewportSmartFollowSprite.IsNull()) { _previousWindowWidth = w->width; _previousWindowHeight = w->height; @@ -465,7 +465,7 @@ namespace OpenRCT2::Title void RestoreViewLocationIfResized() { WindowBase* w = WindowGetMain(); - if (w != nullptr && w->viewport_smart_follow_sprite.IsNull()) + if (w != nullptr && w->viewportSmartFollowSprite.IsNull()) { if (w->width != _previousWindowWidth || w->height != _previousWindowHeight) { diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index c7bf22f00f..4a974575fb 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -202,8 +202,8 @@ namespace OpenRCT2::Ui::Windows return; page = p; - frame_no = 0; - pressed_widgets = 0; + currentFrame = 0; + pressedWidgets = 0; WindowSetResize(*this, kWindowSize, kWindowSize); SetWidgets(_windowAboutPageWidgets[p]); @@ -211,10 +211,10 @@ namespace OpenRCT2::Ui::Windows switch (p) { case WINDOW_ABOUT_PAGE_OPENRCT2: - pressed_widgets |= (1uLL << WIDX_TAB_ABOUT_OPENRCT2); + pressedWidgets |= (1uLL << WIDX_TAB_ABOUT_OPENRCT2); break; case WINDOW_ABOUT_PAGE_RCT2: - pressed_widgets |= (1uLL << WIDX_TAB_ABOUT_RCT2); + pressedWidgets |= (1uLL << WIDX_TAB_ABOUT_RCT2); break; } } diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 80b6d570bd..8000e54250 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -295,13 +295,13 @@ namespace OpenRCT2::Ui::Windows { colourBtn.type = WidgetType::colourBtn; } - pressed_widgets &= ~(1uLL << WIDX_BANNER_NO_ENTRY); - disabled_widgets &= ~( + pressedWidgets &= ~(1uLL << WIDX_BANNER_NO_ENTRY); + disabledWidgets &= ~( (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON)); if (banner->flags.has(BannerFlag::noEntry)) { - pressed_widgets |= (1uLL << WIDX_BANNER_NO_ENTRY); - disabled_widgets |= (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) + pressedWidgets |= (1uLL << WIDX_BANNER_NO_ENTRY); + disabledWidgets |= (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON); } colourBtn.image = getColourButtonImage(banner->colour); diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 19753844c6..1aec714985 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -360,7 +360,7 @@ static constexpr std::span window_cheats_page_widgets[] = window_cheats_weather_widgets, }; -static uint64_t window_cheats_page_hold_down_widgets[] = { +static uint64_t window_cheats_page_holdDownWidgets[] = { (1uLL << WIDX_MONEY_SPINNER_INCREMENT) | (1uLL << WIDX_MONEY_SPINNER_DECREMENT) | (1uLL << WIDX_ADD_MONEY), @@ -414,7 +414,7 @@ static StringId window_cheats_page_titles[] = { void OnUpdate() override { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1 + page); } @@ -496,8 +496,8 @@ static StringId window_cheats_page_titles[] = { void OnPrepareDraw() override { - pressed_widgets = 0; - disabled_widgets = 0; + pressedWidgets = 0; + disabledWidgets = 0; // Set correct active tab for (auto i = 0; i < WINDOW_CHEATS_PAGE_COUNT; i++) @@ -735,10 +735,10 @@ static StringId window_cheats_page_titles[] = { return; page = p; - frame_no = 0; + currentFrame = 0; - hold_down_widgets = window_cheats_page_hold_down_widgets[p]; - pressed_widgets = 0; + holdDownWidgets = window_cheats_page_holdDownWidgets[p]; + pressedWidgets = 0; SetWidgets(window_cheats_page_widgets[p]); auto maxY = 0; @@ -782,7 +782,7 @@ static StringId window_cheats_page_titles[] = { { uint32_t sprite_idx = SPR_TAB_FINANCES_SUMMARY_0; if (page == WINDOW_CHEATS_PAGE_MONEY) - sprite_idx += (frame_no / 2) % 8; + sprite_idx += (currentFrame / 2) % 8; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); } @@ -792,7 +792,7 @@ static StringId window_cheats_page_titles[] = { { uint32_t sprite_idx = SPR_TAB_TIMER_0; if (page == WINDOW_CHEATS_PAGE_DATE) - sprite_idx += (frame_no / 8) % 8; + sprite_idx += (currentFrame / 8) % 8; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); } @@ -802,7 +802,7 @@ static StringId window_cheats_page_titles[] = { { uint32_t sprite_idx = SPR_TAB_GUESTS_0; if (page == WINDOW_CHEATS_PAGE_GUESTS) - sprite_idx += (frame_no / 3) % 8; + sprite_idx += (currentFrame / 3) % 8; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); } @@ -828,7 +828,7 @@ static StringId window_cheats_page_titles[] = { { uint32_t sprite_idx = SPR_TAB_RIDE_0; if (page == WINDOW_CHEATS_PAGE_RIDES) - sprite_idx += (frame_no / 4) % 16; + sprite_idx += (currentFrame / 4) % 16; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top }); } diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index c91bacc3b5..682800ae9f 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -68,7 +68,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(window_clear_scenery_widgets); - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + holdDownWidgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); @@ -155,7 +155,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; + currentFrame++; // Close window if another tool is open if (!isToolActive(WindowClass::ClearScenery, WIDX_BACKGROUND)) Close(); @@ -164,7 +164,7 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { // Set the preview image button to be pressed down - pressed_widgets = (1uLL << WIDX_PREVIEW) | (_clearSmallScenery ? (1uLL << WIDX_SMALL_SCENERY) : 0) + pressedWidgets = (1uLL << WIDX_PREVIEW) | (_clearSmallScenery ? (1uLL << WIDX_SMALL_SCENERY) : 0) | (_clearLargeScenery ? (1uLL << WIDX_LARGE_SCENERY) : 0) | (_clearFootpath ? (1uLL << WIDX_FOOTPATH) : 0); // Update the preview image (for tool sizes up to 7) diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 63bdfcb437..4d9615d9e1 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -54,7 +54,7 @@ namespace OpenRCT2::Ui::Windows void OnOpen() override { SetWidgets(window_custom_currency_widgets); - hold_down_widgets = (1uLL << WIDX_RATE_UP) | (1uLL << WIDX_RATE_DOWN); + holdDownWidgets = (1uLL << WIDX_RATE_UP) | (1uLL << WIDX_RATE_DOWN); WindowInitScrollWidgets(*this); colours[0] = COLOUR_LIGHT_BROWN; colours[1] = COLOUR_LIGHT_BROWN; diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 64a4e6ac90..fd3f0e19e1 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -125,8 +125,8 @@ namespace OpenRCT2::Ui::Windows newWidth += 8 * 2 + 15; width = newWidth; - max_width = newWidth; - min_width = newWidth; + maxWidth = newWidth; + minWidth = newWidth; widgets[WIDX_BACKGROUND].right = newWidth - 1; widgets[WIDX_TOGGLE_SHOW_WIDE_PATHS].right = newWidth - 8; widgets[WIDX_TOGGLE_SHOW_BLOCKED_TILES].right = newWidth - 8; diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 25600780a2..9e37c5c3f7 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -152,7 +152,7 @@ namespace OpenRCT2::Ui::Windows SetWidgets(_inventionListWidgets); InitScrollWidgets(); - selected_tab = 0; + selectedTab = 0; _selectedResearchItem = nullptr; WindowSetResize(*this, kWindowSize, { kWindowSize.width * 2, kWindowSize.height * 2 }); @@ -197,21 +197,21 @@ namespace OpenRCT2::Ui::Windows void OnResize() override { - if (width < min_width) + if (width < minWidth) { Invalidate(); - width = min_width; + width = minWidth; } - if (height < min_height) + if (height < minHeight) { Invalidate(); - height = min_height; + height = minHeight; } } void OnUpdate() override { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_1); @@ -357,7 +357,7 @@ namespace OpenRCT2::Ui::Windows // Tab image auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }; - GfxDrawSprite(rt, ImageId(SPR_TAB_FINANCES_RESEARCH_0 + (frame_no / 2) % 8), screenPos); + GfxDrawSprite(rt, ImageId(SPR_TAB_FINANCES_RESEARCH_0 + (currentFrame / 2) % 8), screenPos); // Pre-researched items label screenPos = windowPos @@ -442,8 +442,8 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - pressed_widgets |= 1uLL << WIDX_PREVIEW; - pressed_widgets |= 1uLL << WIDX_TAB_1; + pressedWidgets |= 1uLL << WIDX_PREVIEW; + pressedWidgets |= 1uLL << WIDX_TAB_1; widgets[WIDX_CLOSE].type = gLegacyScene == LegacyScene::scenarioEditor ? WidgetType::empty : WidgetType::closeBox; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index f1753006d6..4bb7c3c702 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -282,15 +282,15 @@ namespace OpenRCT2::Ui::Windows WindowInitScrollWidgets(*this); - selected_tab = 0; - selected_list_item = -1; + selectedTab = 0; + selectedListItem = -1; WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize); _listSortType = RIDE_SORT_TYPE; _listSortDescending = false; - disabled_widgets |= 1u << WIDX_FILTER_RIDE_TAB_FRAME; + disabledWidgets |= 1u << WIDX_FILTER_RIDE_TAB_FRAME; VisibleListRefresh(); } @@ -349,7 +349,7 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(WIDX_FILTER_TEXT_BOX); } - auto& currentPage = ObjectSelectionPages[selected_tab]; + auto& currentPage = ObjectSelectionPages[selectedTab]; if (currentPage.subTabs.empty()) return; @@ -358,9 +358,9 @@ namespace OpenRCT2::Ui::Windows auto& subTabDef = currentPage.subTabs[_selectedSubTab]; - frame_no++; - if (frame_no >= subTabDef.animationLength) - frame_no = 0; + currentFrame++; + if (currentFrame >= subTabDef.animationLength) + currentFrame = 0; InvalidateWidget(WIDX_SUB_TAB_0 + _selectedSubTab); } @@ -406,7 +406,7 @@ namespace OpenRCT2::Ui::Windows { _selectedSubTab = widgetIndex - WIDX_SUB_TAB_0; - auto& currentPage = ObjectSelectionPages[selected_tab]; + auto& currentPage = ObjectSelectionPages[selectedTab]; auto& subTabDef = currentPage.subTabs[_selectedSubTab]; _filterFlags &= ~FILTER_RIDES_ALL; _filterFlags |= subTabDef.flagFilter; @@ -416,18 +416,18 @@ namespace OpenRCT2::Ui::Windows VisibleListRefresh(); - selected_list_item = -1; + selectedListItem = -1; scrolls[0].contentOffsetY = 0; - frame_no = 0; + currentFrame = 0; Invalidate(); break; } case WIDX_INSTALL_TRACK: { - if (selected_list_item != -1) + if (selectedListItem != -1) { - selected_list_item = -1; + selectedListItem = -1; } Invalidate(); @@ -697,9 +697,9 @@ namespace OpenRCT2::Ui::Windows selectedObject = -1; } } - if (selectedObject != selected_list_item) + if (selectedObject != selectedListItem) { - selected_list_item = selectedObject; + selectedListItem = selectedObject; if (_loadedObject != nullptr) { @@ -743,7 +743,7 @@ namespace OpenRCT2::Ui::Windows rt, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0); // Highlight background - auto highlighted = i == static_cast(selected_list_item) + auto highlighted = i == static_cast(selectedListItem) && !(*listItem.flags & ObjectSelectionFlags::Flag6); if (highlighted) { @@ -857,7 +857,7 @@ namespace OpenRCT2::Ui::Windows installTrackWidget.moveToX(dropdownWidget.left - installTrackWidget.width() - 10); // Set pressed widgets - pressed_widgets |= 1uLL << WIDX_PREVIEW; + pressedWidgets |= 1uLL << WIDX_PREVIEW; SetPressedTab(); // Set window title and buttons @@ -879,7 +879,7 @@ namespace OpenRCT2::Ui::Windows } // Set title parameters for current page - const auto& currentPage = ObjectSelectionPages[selected_tab]; + const auto& currentPage = ObjectSelectionPages[selectedTab]; auto ft = Formatter::Common(); if (!currentPage.subTabs.empty()) ft.Add(currentPage.subTabs[_selectedSubTab].tooltip); @@ -957,13 +957,13 @@ namespace OpenRCT2::Ui::Windows { widgets[WIDX_SUB_TAB_0 + i].tooltip = i < numSubTabs ? currentPage.subTabs[i].tooltip : kStringIdNone; widgets[WIDX_SUB_TAB_0 + i].type = i < numSubTabs ? WidgetType::tab : WidgetType::empty; - pressed_widgets &= ~(1uLL << (WIDX_SUB_TAB_0 + i)); + pressedWidgets &= ~(1uLL << (WIDX_SUB_TAB_0 + i)); } // Mark current sub-tab as active, and toggle tab frame if (hasSubTabs) { - pressed_widgets |= (1uLL << (WIDX_SUB_TAB_0 + _selectedSubTab)); + pressedWidgets |= (1uLL << (WIDX_SUB_TAB_0 + _selectedSubTab)); widgets[WIDX_FILTER_RIDE_TAB_FRAME].type = WidgetType::imgBtn; } else @@ -1024,7 +1024,7 @@ namespace OpenRCT2::Ui::Windows }; // Draw sub-tab images, if applicable - auto& currentPage = ObjectSelectionPages[selected_tab]; + auto& currentPage = ObjectSelectionPages[selectedTab]; if (!currentPage.subTabs.empty()) { for (auto i = 0u; i < currentPage.subTabs.size(); i++) @@ -1037,7 +1037,7 @@ namespace OpenRCT2::Ui::Windows int32_t frame = 0; if (subTabDef.animationLength > 1 && _selectedSubTab == i) { - frame = frame_no / subTabDef.animationDivisor; + frame = currentFrame / subTabDef.animationDivisor; } // TODO: generalise this? @@ -1099,7 +1099,7 @@ namespace OpenRCT2::Ui::Windows DrawTextEllipsised(rt, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] }); } - if (selected_list_item == -1 || _loadedObject == nullptr) + if (selectedListItem == -1 || _loadedObject == nullptr) return; // Draw preview @@ -1152,15 +1152,15 @@ namespace OpenRCT2::Ui::Windows void SetPage(int32_t _page) { // Skip setting page if we're already on this page, unless we're initialising the window - if (selected_tab == _page && !widgets.empty()) + if (selectedTab == _page && !widgets.empty()) return; - selected_tab = _page; + selectedTab = _page; _selectedSubTab = 0; _filterFlags |= FILTER_RIDES_ALL; - selected_list_item = -1; + selectedListItem = -1; scrolls[0].contentOffsetY = 0; - frame_no = 0; + currentFrame = 0; if (_page == EnumValue(ObjectType::ride)) { @@ -1182,7 +1182,7 @@ namespace OpenRCT2::Ui::Windows int32_t numObjects = static_cast(ObjectRepositoryGetItemsCount()); VisibleListClear(); - selected_list_item = -1; + selectedListItem = -1; const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); for (int32_t i = 0; i < numObjects; i++) @@ -1250,7 +1250,7 @@ namespace OpenRCT2::Ui::Windows // Draw name of object { - ObjectListItem* listItem = &_listItems[selected_list_item]; + ObjectListItem* listItem = &_listItems[selectedListItem]; auto ft = Formatter(); ft.Add(STR_STRING); @@ -1353,7 +1353,7 @@ namespace OpenRCT2::Ui::Windows void DrawDebugData(RenderTarget& rt) { - ObjectListItem* listItem = &_listItems[selected_list_item]; + ObjectListItem* listItem = &_listItems[selectedListItem]; auto screenPos = windowPos + ScreenCoordsXY{ width - 5, height - (kListRowHeight * 6) }; // Draw fallback image warning @@ -1563,7 +1563,7 @@ namespace OpenRCT2::Ui::Windows ObjectType GetSelectedObjectType() { - auto& currentPage = ObjectSelectionPages[selected_tab]; + auto& currentPage = ObjectSelectionPages[selectedTab]; auto& subTabs = currentPage.subTabs; if (!subTabs.empty()) return subTabs[_selectedSubTab].subObjectType; @@ -1592,9 +1592,9 @@ namespace OpenRCT2::Ui::Windows { for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) { - pressed_widgets &= ~(1ull << (WIDX_TAB_1 + i)); + pressedWidgets &= ~(1ull << (WIDX_TAB_1 + i)); } - pressed_widgets |= 1LL << (WIDX_TAB_1 + selected_tab); + pressedWidgets |= 1LL << (WIDX_TAB_1 + selectedTab); } /** diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 51fe28f706..3241bca288 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -253,12 +253,12 @@ namespace OpenRCT2::Ui::Windows InitScrollWidgets(); InitParkEntranceItems(); - list_information_type = 0; + listInformationType = 0; - auto maxHeight = static_cast(kWindowSize.height + kImageSize * (GetNumRows() - 1)); - WindowSetResize(*this, kWindowSize, { kWindowSize.width, maxHeight }); + auto newMaxHeight = static_cast(kWindowSize.height + kImageSize * (GetNumRows() - 1)); + WindowSetResize(*this, kWindowSize, { kWindowSize.width, newMaxHeight }); - pressed_widgets |= 1LL << WIDX_TAB; + pressedWidgets |= 1LL << WIDX_TAB; ToolSet(*this, WIDX_LIST, Tool::entranceDown); gInputFlags.set(InputFlag::unk6); diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 55527a74ab..1c81347d56 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -302,7 +302,7 @@ namespace OpenRCT2::Ui::Windows #pragma region Enabled widgets - static uint64_t window_editor_scenario_options_page_hold_down_widgets[] = { + static uint64_t window_editor_scenario_options_page_holdDownWidgets[] = { (1uLL << WIDX_OBJECTIVE_ARG_1_INCREASE) | (1uLL << WIDX_OBJECTIVE_ARG_1_DECREASE) | (1uLL << WIDX_OBJECTIVE_ARG_2_INCREASE) | @@ -598,7 +598,7 @@ namespace OpenRCT2::Ui::Windows widget = &widgets[WIDX_TAB_1]; spriteIndex = SPR_TAB_OBJECTIVE_0; if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_OBJECTIVE) - spriteIndex += (frame_no / 4) % 16; + spriteIndex += (currentFrame / 4) % 16; GfxDrawSprite(rt, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); } @@ -609,7 +609,7 @@ namespace OpenRCT2::Ui::Windows widget = &widgets[WIDX_TAB_2]; spriteIndex = SPR_TAB_KIOSKS_AND_FACILITIES_0; if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_SCENARIO_DETAILS) - spriteIndex += (frame_no / 4) % 8; + spriteIndex += (currentFrame / 4) % 8; GfxDrawSprite(rt, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); } @@ -620,7 +620,7 @@ namespace OpenRCT2::Ui::Windows widget = &widgets[WIDX_TAB_3]; spriteIndex = SPR_TAB_FINANCES_SUMMARY_0; if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL) - spriteIndex += (frame_no / 2) % 8; + spriteIndex += (currentFrame / 2) % 8; GfxDrawSprite(rt, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); } @@ -631,7 +631,7 @@ namespace OpenRCT2::Ui::Windows widget = &widgets[WIDX_TAB_4]; spriteIndex = SPR_TAB_GUESTS_0; if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS) - spriteIndex += (frame_no / 4) % 8; + spriteIndex += (currentFrame / 4) % 8; GfxDrawSprite(rt, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); } @@ -650,7 +650,7 @@ namespace OpenRCT2::Ui::Windows widget = &widgets[WIDX_TAB_6]; spriteIndex = SPR_TAB_RIDE_0; if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_RIDES) - spriteIndex += (frame_no / 4) % 16; + spriteIndex += (currentFrame / 4) % 16; GfxDrawSprite(rt, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); } @@ -663,10 +663,10 @@ namespace OpenRCT2::Ui::Windows return; page = newPage; - frame_no = 0; - disabled_widgets = 0; - hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets[page]; - pressed_widgets = 0; + currentFrame = 0; + disabledWidgets = 0; + holdDownWidgets = window_editor_scenario_options_page_holdDownWidgets[page]; + pressedWidgets = 0; SetWidgets(window_editor_scenario_options_widgets[page]); Invalidate(); @@ -1027,7 +1027,7 @@ namespace OpenRCT2::Ui::Windows */ void ObjectiveOnUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_1); @@ -1360,7 +1360,7 @@ namespace OpenRCT2::Ui::Windows void ScenarioDetailsOnUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1); } @@ -1602,7 +1602,7 @@ namespace OpenRCT2::Ui::Windows void FinancialUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1); } @@ -1946,7 +1946,7 @@ namespace OpenRCT2::Ui::Windows void GuestsUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); } @@ -2143,7 +2143,7 @@ namespace OpenRCT2::Ui::Windows void LandUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_3); } @@ -2232,7 +2232,7 @@ namespace OpenRCT2::Ui::Windows */ void RidesOnUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); OnResize(); InvalidateWidget(WIDX_TAB_2); @@ -2302,9 +2302,9 @@ namespace OpenRCT2::Ui::Windows if (i < 0 || i >= static_cast(_rideableRides.size())) return; - if (selected_list_item != i) + if (selectedListItem != i) { - selected_list_item = i; + selectedListItem = i; Invalidate(); } } @@ -2351,7 +2351,7 @@ namespace OpenRCT2::Ui::Windows // Highlighted auto stringId = STR_BLACK_STRING; - if (i == selected_list_item) + if (i == selectedListItem) { stringId = STR_WINDOW_COLOUR_2_STRINGID; GfxFilterRect(rt, { 0, y, width, y + 11 }, FilterPaletteID::PaletteDarken1); diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index c7da283112..6662850632 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -225,7 +225,7 @@ namespace OpenRCT2::Ui::Windows void SetDisabledTabs() { - disabled_widgets = (getGameState().park.flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0; + disabledWidgets = (getGameState().park.flags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0; } public: @@ -239,7 +239,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1 + page); if (page == WINDOW_FINANCES_PAGE_VALUE_GRAPH || page == WINDOW_FINANCES_PAGE_PROFIT_GRAPH @@ -480,7 +480,7 @@ namespace OpenRCT2::Ui::Windows return; page = p; - frame_no = 0; + currentFrame = 0; Invalidate(); if (p == WINDOW_FINANCES_PAGE_RESEARCH) @@ -517,8 +517,8 @@ namespace OpenRCT2::Ui::Windows SetWidgets(_windowFinancesPageWidgets[p]); SetDisabledTabs(); - hold_down_widgets = _windowFinancesPageHoldDownWidgets[p]; - pressed_widgets = 0; + holdDownWidgets = _windowFinancesPageHoldDownWidgets[p]; + pressedWidgets = 0; ResizeFrame(); OnPrepareDraw(); @@ -826,8 +826,8 @@ namespace OpenRCT2::Ui::Windows // dynamic padding for long axis labels: char buffer[64]{}; FormatStringToBuffer(buffer, sizeof(buffer), "{BLACK}{CURRENCY2DP}", centredGraph ? -max : max); - int32_t maxWidth = GfxGetStringWidth(buffer, FontStyle::Small) + Graph::kYTickMarkPadding + 1; - const ScreenCoordsXY dynamicPadding{ std::max(maxWidth, kGraphTopLeftPadding.x), kGraphTopLeftPadding.y }; + int32_t maxGraphWidth = GfxGetStringWidth(buffer, FontStyle::Small) + Graph::kYTickMarkPadding + 1; + const ScreenCoordsXY dynamicPadding{ std::max(maxGraphWidth, kGraphTopLeftPadding.x), kGraphTopLeftPadding.y }; _graphBounds = { windowPos + ScreenCoordsXY{ graphPageWidget->left + 4, graphPageWidget->top + 15 }, windowPos + ScreenCoordsXY{ graphPageWidget->right - 4, graphPageWidget->bottom - 4 } }; @@ -855,7 +855,7 @@ namespace OpenRCT2::Ui::Windows { if (this->page == tabPage) { - int32_t frame = frame_no / 2; + int32_t frame = currentFrame / 2; spriteIndex += (frame % _windowFinancesTabAnimationFrames[this->page]); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index f61186f5a0..ce14c42758 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -218,7 +218,7 @@ namespace OpenRCT2::Ui::Windows _footpathPlaceCtrlState = false; _footpathPlaceShiftState = false; - hold_down_widgets = (1u << WIDX_CONSTRUCT) | (1u << WIDX_REMOVE); + holdDownWidgets = (1u << WIDX_CONSTRUCT) | (1u << WIDX_REMOVE); } void OnClose() override @@ -434,10 +434,9 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { // Press / unpress footpath and queue type buttons - pressed_widgets &= ~(1uLL << WIDX_FOOTPATH_TYPE); - pressed_widgets &= ~(1uLL << WIDX_QUEUELINE_TYPE); - pressed_widgets |= gFootpathSelection.IsQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) - : (1uLL << WIDX_FOOTPATH_TYPE); + pressedWidgets &= ~(1uLL << WIDX_FOOTPATH_TYPE); + pressedWidgets &= ~(1uLL << WIDX_QUEUELINE_TYPE); + pressedWidgets |= gFootpathSelection.IsQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) : (1uLL << WIDX_FOOTPATH_TYPE); // Enable / disable construct button widgets[WIDX_CONSTRUCT].type = _footpathConstructionMode == PathConstructionMode::bridgeOrTunnel @@ -843,7 +842,7 @@ namespace OpenRCT2::Ui::Windows } else if (im.IsModifierKeyPressed(ModifierKey::shift)) { - uint16_t maxHeight = ZoomLevel::max().ApplyTo( + uint16_t maxPathHeight = ZoomLevel::max().ApplyTo( std::numeric_limits::max() - 32); _footpathPlaceShiftZ = _footpathPlaceShiftStart.y - screenCoords.y + 4; @@ -859,7 +858,7 @@ namespace OpenRCT2::Ui::Windows _footpathPlaceShiftZ = floor2(_footpathPlaceShiftZ, heightStep); // Clamp to maximum possible value of BaseHeight can offer. - _footpathPlaceShiftZ = std::min(_footpathPlaceShiftZ, maxHeight); + _footpathPlaceShiftZ = std::min(_footpathPlaceShiftZ, maxPathHeight); screenCoords = _footpathPlaceShiftStart; } @@ -1358,7 +1357,7 @@ namespace OpenRCT2::Ui::Windows MapInvalidateMapSelectionTiles(); } - uint64_t newPressedWidgets = pressed_widgets + uint64_t newPressedWidgets = pressedWidgets & ~((1LL << WIDX_DIRECTION_NW) | (1LL << WIDX_DIRECTION_NE) | (1LL << WIDX_DIRECTION_SW) | (1LL << WIDX_DIRECTION_SE) | (1LL << WIDX_SLOPEDOWN) | (1LL << WIDX_LEVEL) | (1LL << WIDX_SLOPEUP)); uint64_t newDisabledWidgets = 0; @@ -1404,8 +1403,8 @@ namespace OpenRCT2::Ui::Windows | (1uLL << WIDX_REMOVE); } - pressed_widgets = newPressedWidgets; - disabled_widgets = newDisabledWidgets; + pressedWidgets = newPressedWidgets; + disabledWidgets = newDisabledWidgets; Invalidate(); } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 3944734358..2a0003ddab 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -282,7 +282,7 @@ namespace OpenRCT2::Ui::Windows auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); uint32_t image_id_base = animObj->GetPeepAnimation(peep->AnimationGroup).base_image; - image_id_base += frame_no & 0xFFFFFFFC; + image_id_base += currentFrame & 0xFFFFFFFC; image_id_base++; auto image_id = ImageId(image_id_base, peep->TshirtColour, peep->TrousersColour); @@ -294,7 +294,7 @@ namespace OpenRCT2::Ui::Windows // There are only 6 walking frames available for each item, // as well as 1 sprite for sitting and 1 for standing still. - auto itemFrame = (frame_no / 4) % 6; + auto itemFrame = (currentFrame / 4) % 6; if (guest->AnimationGroup == PeepAnimationGroup::Hat) { @@ -416,7 +416,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(window_game_bottom_toolbar_widgets); - frame_no = 0; + currentFrame = 0; InitScrollWidgets(); // Reset the middle widget to not show by default. @@ -588,25 +588,25 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_NEWS_LOCATE].type = WidgetType::flatBtn; widgets[WIDX_MIDDLE_OUTSET].colour = 2; widgets[WIDX_MIDDLE_INSET].colour = 2; - disabled_widgets &= ~(1uLL << WIDX_NEWS_SUBJECT); - disabled_widgets &= ~(1uLL << WIDX_NEWS_LOCATE); + disabledWidgets &= ~(1uLL << WIDX_NEWS_SUBJECT); + disabledWidgets &= ~(1uLL << WIDX_NEWS_LOCATE); // Find out if the news item is no longer valid auto subjectLoc = News::GetSubjectLocation(newsItem->type, newsItem->assoc); if (!subjectLoc.has_value()) - disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); + disabledWidgets |= (1uLL << WIDX_NEWS_LOCATE); if (!(newsItem->typeHasSubject())) { - disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); + disabledWidgets |= (1uLL << WIDX_NEWS_SUBJECT); widgets[WIDX_NEWS_SUBJECT].type = WidgetType::empty; } if (newsItem->hasButton()) { - disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); - disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); + disabledWidgets |= (1uLL << WIDX_NEWS_SUBJECT); + disabledWidgets |= (1uLL << WIDX_NEWS_LOCATE); } } } @@ -651,9 +651,9 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; - if (frame_no >= 24) - frame_no = 0; + currentFrame++; + if (currentFrame >= 24) + currentFrame = 0; InvalidateDirtyWidgets(); } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index cb8d9d99a9..a79995c126 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -213,13 +213,13 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(_guestWindowWidgetsOverview); page = WINDOW_GUEST_OVERVIEW; - frame_no = 0; + currentFrame = 0; _marqueePosition = 0; - picked_peep_frame = 0; + pickedPeepFrame = 0; WindowSetResize(*this, kWindowSize, { 500, 450 }); - selected_list_item = -1; + selectedListItem = -1; } void Init(EntityId id) @@ -457,7 +457,7 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDrawCommon() { - pressed_widgets |= 1uLL << (page + WIDX_TAB_1); + pressedWidgets |= 1uLL << (page + WIDX_TAB_1); const auto peep = GetGuest(); if (peep == nullptr) @@ -498,7 +498,7 @@ namespace OpenRCT2::Ui::Windows { newDisabledWidgets |= (1uLL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on } - disabled_widgets = newDisabledWidgets; + disabledWidgets = newDisabledWidgets; } void SetPage(int32_t newPage) @@ -518,14 +518,14 @@ namespace OpenRCT2::Ui::Windows return; page = newPage; - frame_no = 0; + currentFrame = 0; _riddenRides.clear(); - selected_list_item = -1; + selectedListItem = -1; RemoveViewport(); - hold_down_widgets = 0; - pressed_widgets = 0; + holdDownWidgets = 0; + pressedWidgets = 0; SetWidgets(_guestWindowPageWidgets[page]); DisableWidgets(); Invalidate(); @@ -861,10 +861,10 @@ namespace OpenRCT2::Ui::Windows { return; } - pressed_widgets &= ~(1uLL << WIDX_TRACK); + pressedWidgets &= ~(1uLL << WIDX_TRACK); if (peep->PeepFlags & PEEP_FLAGS_TRACKING) { - pressed_widgets |= (1uLL << WIDX_TRACK); + pressedWidgets |= (1uLL << WIDX_TRACK); } widgets[WIDX_VIEWPORT].right = width - 26; @@ -907,8 +907,8 @@ namespace OpenRCT2::Ui::Windows const auto pickAnimLength = pickAnim.frame_offsets.size(); // Update pickup animation, can only happen in this tab. - picked_peep_frame++; - picked_peep_frame %= pickAnimLength * 4; + pickedPeepFrame++; + pickedPeepFrame %= pickAnimLength * 4; InvalidateWidget(WIDX_TAB_1); InvalidateWidget(WIDX_TAB_2); @@ -1007,7 +1007,7 @@ namespace OpenRCT2::Ui::Windows auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); auto baseImageId = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::Hanging).base_image; - baseImageId += picked_peep_frame >> 2; + baseImageId += pickedPeepFrame >> 2; gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour); } @@ -1071,13 +1071,13 @@ namespace OpenRCT2::Ui::Windows switch (imageId) { case SPR_PEEP_LARGE_FACE_VERY_VERY_SICK_0: - imageId += (frame_no / 4) & 0xF; + imageId += (currentFrame / 4) & 0xF; break; case SPR_PEEP_LARGE_FACE_VERY_SICK_0: - imageId += (frame_no / 8) & 0x3; + imageId += (currentFrame / 8) & 0x3; break; case SPR_PEEP_LARGE_FACE_ANGRY_0: - imageId += (frame_no / 8) & 0x3; + imageId += (currentFrame / 8) & 0x3; break; } } @@ -1086,7 +1086,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateStats() { - frame_no++; + currentFrame++; auto peep = GetGuest(); if (peep == nullptr) { @@ -1218,7 +1218,7 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_GUEST_RIDES) { - imageId += (frame_no / 4) & 0xF; + imageId += (currentFrame / 4) & 0xF; } GfxDrawSprite(rt, ImageId(imageId), screenCoords); @@ -1226,7 +1226,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateRides() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); InvalidateWidget(WIDX_TAB_3); @@ -1266,9 +1266,9 @@ namespace OpenRCT2::Ui::Windows ScreenSize newSize; newSize.height = static_cast(_riddenRides.size()) * 10; - if (selected_list_item != -1) + if (selectedListItem != -1) { - selected_list_item = -1; + selectedListItem = -1; Invalidate(); } @@ -1302,9 +1302,9 @@ namespace OpenRCT2::Ui::Windows if (index >= static_cast(_riddenRides.size())) return; - if (index == selected_list_item) + if (index == selectedListItem) return; - selected_list_item = index; + selectedListItem = index; Invalidate(); } @@ -1361,7 +1361,7 @@ namespace OpenRCT2::Ui::Windows { int32_t y = listIndex * 10; StringId stringId = STR_BLACK_STRING; - if (listIndex == selected_list_item) + if (listIndex == selectedListItem) { GfxFilterRect(rt, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1); stringId = STR_WINDOW_COLOUR_2_STRINGID; @@ -1391,7 +1391,7 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_GUEST_FINANCE) { - imageId += (frame_no / 2) & 0x7; + imageId += (currentFrame / 2) & 0x7; } GfxDrawSprite(rt, ImageId(imageId), screenCoords); @@ -1399,7 +1399,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateFinance() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); InvalidateWidget(WIDX_TAB_4); @@ -1529,7 +1529,7 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_GUEST_THOUGHTS) { - imageId += (frame_no / 2) & 0x7; + imageId += (currentFrame / 2) & 0x7; } GfxDrawSprite(rt, ImageId(imageId), screenCoords); @@ -1537,7 +1537,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateThoughts() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); InvalidateWidget(WIDX_TAB_5); @@ -1608,7 +1608,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateInventory() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); InvalidateWidget(WIDX_TAB_6); @@ -1796,7 +1796,7 @@ namespace OpenRCT2::Ui::Windows int32_t imageId = SPR_TAB_GEARS_0; if (page == WINDOW_GUEST_DEBUG) { - imageId += (frame_no / 2) & 0x3; + imageId += (currentFrame / 2) & 0x3; } GfxDrawSprite(rt, ImageId(imageId), screenCoords); @@ -1804,7 +1804,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateDebug() { - frame_no++; + currentFrame++; Invalidate(); } diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index a591200842..67a8422e21 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -135,14 +135,14 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; + pressedWidgets |= 1uLL << WIDX_TRACK_PREVIEW; if (!gTrackDesignSceneryToggle) { - pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); + pressedWidgets |= (1uLL << WIDX_TOGGLE_SCENERY); } else { - pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); + pressedWidgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); } } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 4800f78275..82ffd98e04 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -91,7 +91,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(window_land_widgets); - hold_down_widgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT); + holdDownWidgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); @@ -236,7 +236,7 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - pressed_widgets = 0; + pressedWidgets = 0; SetWidgetPressed(WIDX_PREVIEW, true); if (gLandToolTerrainSurface != kObjectEntryIndexNull) SetWidgetPressed(WIDX_FLOOR, true); diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index b6b4f7665c..dd846599f7 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -105,7 +105,7 @@ namespace OpenRCT2::Ui::Windows void SwitchToMode(LandRightsMode mode) { auto widgetIndex = WIDX_BUY_LAND_RIGHTS + EnumValue(mode); - pressed_widgets = (1uLL << widgetIndex); + pressedWidgets = (1uLL << widgetIndex); _landRightsMode = mode; ToolSet(*this, widgetIndex, Tool::upArrow); @@ -129,7 +129,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(window_land_rights_widgets); - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + holdDownWidgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); @@ -250,7 +250,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; + currentFrame++; // Close window if another tool is open if (!isToolActive(WindowClass::LandRights)) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 6eae4c8544..c575605185 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -172,7 +172,7 @@ namespace OpenRCT2::Ui::Windows if (directory.empty() && drives) { // List Windows drives - disabled_widgets |= (1uLL << WIDX_NEW_FOLDER) | (1uLL << WIDX_PARENT_FOLDER); + disabledWidgets |= (1uLL << WIDX_NEW_FOLDER) | (1uLL << WIDX_PARENT_FOLDER); static constexpr auto NumDriveLetters = 26; for (int32_t x = 0; x < NumDriveLetters; x++) { @@ -217,12 +217,12 @@ namespace OpenRCT2::Ui::Windows // Disable the Up button if the current directory is the root directory if (String::isNullOrEmpty(_parentDirectory) && !drives) - disabled_widgets |= (1uLL << WIDX_PARENT_FOLDER); + disabledWidgets |= (1uLL << WIDX_PARENT_FOLDER); else - disabled_widgets &= ~(1uLL << WIDX_PARENT_FOLDER); + disabledWidgets &= ~(1uLL << WIDX_PARENT_FOLDER); // Re-enable the "new" button if it was disabled - disabled_widgets &= ~(1uLL << WIDX_NEW_FOLDER); + disabledWidgets &= ~(1uLL << WIDX_NEW_FOLDER); // List all directories auto subDirectories = Path::GetDirectories(absoluteDirectory); @@ -338,7 +338,7 @@ namespace OpenRCT2::Ui::Windows { _preview = {}; - if (selected_list_item == -1) + if (selectedListItem == -1) return; if (!ShowPreviews()) @@ -347,10 +347,10 @@ namespace OpenRCT2::Ui::Windows if (type == LoadSaveType::track || type == LoadSaveType::heightmap) return; - if (_listItems[selected_list_item].type == FileType::directory) + if (_listItems[selectedListItem].type == FileType::directory) return; - auto path = _listItems[selected_list_item].path; + auto path = _listItems[selectedListItem].path; auto& bgWorker = GetContext()->GetBackgroundWorker(); @@ -539,7 +539,7 @@ namespace OpenRCT2::Ui::Windows const auto& uiContext = OpenRCT2::GetContext()->GetUiContext(); if (!uiContext.HasFilePicker()) { - disabled_widgets |= (1uLL << WIDX_SYSTEM_BROWSER); + disabledWidgets |= (1uLL << WIDX_SYSTEM_BROWSER); widgets[WIDX_SYSTEM_BROWSER].type = WidgetType::empty; } @@ -574,8 +574,8 @@ namespace OpenRCT2::Ui::Windows const char* pattern = GetFilterPatternByType(type, isSave); const auto path = GetDir(type); PopulateList(path, pattern); - no_list_items = static_cast(_listItems.size()); - selected_list_item = -1; + numListItems = static_cast(_listItems.size()); + selectedListItem = -1; // Reset window dimensions InitScrollWidgets(); @@ -806,7 +806,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_PARENT_FOLDER: PopulateList(_parentDirectory, _extensionPattern); InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); + numListItems = static_cast(_listItems.size()); break; case WIDX_NEW_FOLDER: @@ -827,7 +827,7 @@ namespace OpenRCT2::Ui::Windows // If user cancels file dialog, refresh list PopulateList(_directory, _extensionPattern); InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); + numListItems = static_cast(_listItems.size()); } } break; @@ -877,7 +877,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_DEFAULT_FOLDER: PopulateList(GetInitialDirectoryByType(type).c_str(), _extensionPattern); InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); + numListItems = static_cast(_listItems.size()); break; case WIDX_FILENAME_TEXTBOX: @@ -991,13 +991,13 @@ namespace OpenRCT2::Ui::Windows return; } - no_list_items = 0; - selected_list_item = -1; + numListItems = 0; + selectedListItem = -1; PopulateList(path, _extensionPattern); InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); + numListItems = static_cast(_listItems.size()); Invalidate(); break; } @@ -1016,18 +1016,18 @@ namespace OpenRCT2::Ui::Windows ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - return { 0, no_list_items * kScrollableRowHeight }; + return { 0, numListItems * kScrollableRowHeight }; } void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { int32_t selectedItem = screenCoords.y / kScrollableRowHeight; - if (selectedItem >= no_list_items) + if (selectedItem >= numListItems) return; - if (selected_list_item != selectedItem) + if (selectedListItem != selectedItem) { - selected_list_item = selectedItem; + selectedListItem = selectedItem; LoadPreview(); Invalidate(); } @@ -1038,14 +1038,14 @@ namespace OpenRCT2::Ui::Windows int32_t selectedItem; selectedItem = screenCoords.y / kScrollableRowHeight; - if (selectedItem >= no_list_items) + if (selectedItem >= numListItems) return; if (_listItems[selectedItem].type == FileType::directory) { // The selected item is a folder - no_list_items = 0; - selected_list_item = -1; + numListItems = 0; + selectedListItem = -1; char directory[MAX_PATH]; String::safeUtf8Copy(directory, _listItems[selectedItem].path.c_str(), sizeof(directory)); @@ -1053,7 +1053,7 @@ namespace OpenRCT2::Ui::Windows PopulateList(directory, _extensionPattern); InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); + numListItems = static_cast(_listItems.size()); } else // FileType::file { @@ -1085,7 +1085,7 @@ namespace OpenRCT2::Ui::Windows auto& config = Config::Get().general; - for (int32_t i = 0; i < no_list_items; i++) + for (int32_t i = 0; i < numListItems; i++) { int32_t y = i * kScrollableRowHeight; if (y > rt.y + rt.height) @@ -1097,7 +1097,7 @@ namespace OpenRCT2::Ui::Windows StringId stringId = STR_BLACK_STRING; // If hovering over item, change the color and fill the backdrop. - if (i == selected_list_item) + if (i == selectedListItem) { stringId = STR_WINDOW_COLOUR_2_STRINGID; GfxFilterRect(rt, { 0, y, listWidth, y + kScrollableRowHeight }, FilterPaletteID::PaletteDarken1); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 6522874910..e760b004eb 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -236,7 +236,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(window_map_widgets); - hold_down_widgets = (1uLL << WIDX_MAP_SIZE_SPINNER_Y_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_Y_DOWN) + holdDownWidgets = (1uLL << WIDX_MAP_SIZE_SPINNER_Y_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_Y_DOWN) | (1uLL << WIDX_MAP_SIZE_SPINNER_X_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_X_DOWN); flags |= WF_RESIZABLE; @@ -318,11 +318,11 @@ namespace OpenRCT2::Ui::Windows if (widgetIndex >= WIDX_PEOPLE_TAB && widgetIndex <= WIDX_RIDES_TAB) { widgetIndex -= WIDX_PEOPLE_TAB; - if (widgetIndex == selected_tab) + if (widgetIndex == selectedTab) break; - selected_tab = widgetIndex; - list_information_type = 0; + selectedTab = widgetIndex; + listInformationType = 0; _recalculateScrollbars = true; ResetMaxWindowDimensions(); } @@ -391,19 +391,19 @@ namespace OpenRCT2::Ui::Windows } // Update tab animations - list_information_type++; - switch (selected_tab) + listInformationType++; + switch (selectedTab) { case PAGE_PEEPS: - if (list_information_type >= 32) + if (listInformationType >= 32) { - list_information_type = 0; + listInformationType = 0; } break; case PAGE_RIDES: - if (list_information_type >= 64) + if (listInformationType >= 64) { - list_information_type = 0; + listInformationType = 0; } break; } @@ -583,7 +583,7 @@ namespace OpenRCT2::Ui::Windows DrawingEngineInvalidateImage(SPR_TEMP); GfxDrawSprite(rt, ImageId(SPR_TEMP), screenOffset); - if (selected_tab == PAGE_PEEPS) + if (selectedTab == PAGE_PEEPS) { PaintPeepOverlay(rt, screenOffset); } @@ -599,18 +599,18 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); // Set the pressed widgets - pressed_widgets = 0; + pressedWidgets = 0; SetWidgetPressed(WIDX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); - pressed_widgets |= (1uLL << (WIDX_PEOPLE_TAB + selected_tab)); + pressedWidgets |= (1uLL << (WIDX_PEOPLE_TAB + selectedTab)); if (windowMgr->FindByClass(WindowClass::EditorParkEntrance)) - pressed_widgets |= (1uLL << WIDX_BUILD_PARK_ENTRANCE); + pressedWidgets |= (1uLL << WIDX_BUILD_PARK_ENTRANCE); if (windowMgr->FindByClass(WindowClass::LandRights)) - pressed_widgets |= (1uLL << WIDX_SET_LAND_RIGHTS); + pressedWidgets |= (1uLL << WIDX_SET_LAND_RIGHTS); if (windowMgr->FindByClass(WindowClass::Mapgen)) - pressed_widgets |= (1uLL << WIDX_MAP_GENERATOR); + pressedWidgets |= (1uLL << WIDX_MAP_GENERATOR); // Set disabled widgets auto& gameState = getGameState(); @@ -668,7 +668,7 @@ namespace OpenRCT2::Ui::Windows if (!isEditorOrSandbox()) { // Render the map legend - if (selected_tab == PAGE_RIDES) + if (selectedTab == PAGE_RIDES) { auto screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP].bottom + 2 }; @@ -819,7 +819,7 @@ namespace OpenRCT2::Ui::Windows if (!MapIsEdge({ x, y })) { uint16_t colour = 0; - switch (selected_tab) + switch (selectedTab) { case PAGE_PEEPS: colour = GetPixelColourPeep({ x, y }); @@ -1070,8 +1070,8 @@ namespace OpenRCT2::Ui::Windows { // Guest tab image (animated) uint32_t guestTabImage = SPR_TAB_GUESTS_0; - if (selected_tab == PAGE_PEEPS) - guestTabImage += list_information_type / 4; + if (selectedTab == PAGE_PEEPS) + guestTabImage += listInformationType / 4; GfxDrawSprite( rt, ImageId(guestTabImage), @@ -1079,8 +1079,8 @@ namespace OpenRCT2::Ui::Windows // Ride/stall tab image (animated) uint32_t rideTabImage = SPR_TAB_RIDE_0; - if (selected_tab == PAGE_RIDES) - rideTabImage += list_information_type / 4; + if (selectedTab == PAGE_RIDES) + rideTabImage += listInformationType / 4; GfxDrawSprite( rt, ImageId(rideTabImage), @@ -1177,7 +1177,7 @@ namespace OpenRCT2::Ui::Windows { if (isEditorOrSandbox()) return kEditorReservedVSpace; - else if (selected_tab == PAGE_RIDES) + else if (selectedTab == PAGE_RIDES) return kRidesTabReservedVSpace; else return kDefaultReservedVSpace; @@ -1234,14 +1234,14 @@ namespace OpenRCT2::Ui::Windows } textOffset += _firstColumnWidth + 4; - min_width = kWindowSize.width; + minWidth = kWindowSize.width; for (uint32_t i = 4; i < std::size(MapLabels); i++) { const auto* labelStr = LanguageGetString(MapLabels[i]); - min_width = std::max( - static_cast(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium)), min_width); + minWidth = std::max( + static_cast(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium)), minWidth); } - width = std::max(min_width, width); + width = std::max(minWidth, width); _recalculateScrollbars = true; } }; @@ -1252,8 +1252,8 @@ namespace OpenRCT2::Ui::Windows { auto* windowMgr = GetWindowManager(); auto* w = windowMgr->FocusOrCreate(WindowClass::Map, kWindowSize, WF_10); - w->selected_tab = 0; - w->list_information_type = 0; + w->selectedTab = 0; + w->listInformationType = 0; return w; } catch (const std::bad_alloc&) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 8cf384c61b..6260208c11 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -280,13 +280,13 @@ namespace OpenRCT2::Ui::Windows return; page = newPage; - frame_no = 0; + currentFrame = 0; RemoveViewport(); SetWidgets(PageWidgets[newPage]); - hold_down_widgets = HoldDownWidgets[newPage]; - disabled_widgets = PageDisabledWidgets[newPage]; - pressed_widgets = PressedWidgets[newPage]; + holdDownWidgets = HoldDownWidgets[newPage]; + disabledWidgets = PageDisabledWidgets[newPage]; + pressedWidgets = PressedWidgets[newPage]; InitScrollWidgets(); Invalidate(); @@ -295,8 +295,8 @@ namespace OpenRCT2::Ui::Windows void SetPressedTab() { for (auto i = 0; i < WINDOW_MAPGEN_PAGE_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + pressedWidgets &= ~(1 << (WIDX_TAB_1 + i)); + pressedWidgets |= 1LL << (WIDX_TAB_1 + page); } void DrawTabImage(RenderTarget& rt, int32_t newPage, int32_t spriteIndex) @@ -307,7 +307,7 @@ namespace OpenRCT2::Ui::Windows { if (page == newPage) { - int32_t frame = frame_no / TabAnimationDivisor[page]; + int32_t frame = currentFrame / TabAnimationDivisor[page]; spriteIndex += (frame % TabAnimationFrames[page]); } @@ -473,8 +473,8 @@ namespace OpenRCT2::Ui::Windows void BaseUpdate() { // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; + if (++currentFrame >= TabAnimationLoops[page]) + currentFrame = 0; InvalidateWidget(WIDX_TAB_1); } @@ -711,8 +711,8 @@ namespace OpenRCT2::Ui::Windows void ForestsUpdate() { // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; + if (++currentFrame >= TabAnimationLoops[page]) + currentFrame = 0; InvalidateWidget(WIDX_TAB_2); } @@ -740,9 +740,9 @@ namespace OpenRCT2::Ui::Windows void ForestsPrepareDraw() { - pressed_widgets = 0; + pressedWidgets = 0; if (_settings.trees) - pressed_widgets |= 1uLL << WIDX_FORESTS_PLACE_TREES; + pressedWidgets |= 1uLL << WIDX_FORESTS_PLACE_TREES; SetPressedTab(); @@ -1093,8 +1093,8 @@ namespace OpenRCT2::Ui::Windows void TerrainUpdate() { // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; + if (++currentFrame >= TabAnimationLoops[page]) + currentFrame = 0; InvalidateWidget(WIDX_TAB_3); } @@ -1310,8 +1310,8 @@ namespace OpenRCT2::Ui::Windows void WaterUpdate() { // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; + if (++currentFrame >= TabAnimationLoops[page]) + currentFrame = 0; InvalidateWidget(WIDX_TAB_4); } @@ -1361,9 +1361,9 @@ namespace OpenRCT2::Ui::Windows SetPage(WINDOW_MAPGEN_PAGE_BASE); Invalidate(); - hold_down_widgets = HoldDownWidgets[WINDOW_MAPGEN_PAGE_BASE]; - pressed_widgets = PressedWidgets[WINDOW_MAPGEN_PAGE_BASE]; - disabled_widgets = PageDisabledWidgets[WINDOW_MAPGEN_PAGE_BASE]; + holdDownWidgets = HoldDownWidgets[WINDOW_MAPGEN_PAGE_BASE]; + pressedWidgets = PressedWidgets[WINDOW_MAPGEN_PAGE_BASE]; + disabledWidgets = PageDisabledWidgets[WINDOW_MAPGEN_PAGE_BASE]; InitScrollWidgets(); _heightmapLoaded = false; diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 2786065262..3e5bd2086e 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -183,7 +183,7 @@ namespace OpenRCT2::Ui::Windows } // Set and invalidate the changed widgets - uint64_t currentDisabledWidgets = disabled_widgets; + uint64_t currentDisabledWidgets = disabledWidgets; if (currentDisabledWidgets == newDisabledWidgets) return; @@ -194,7 +194,7 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(i); } } - disabled_widgets = newDisabledWidgets; + disabledWidgets = newDisabledWidgets; } void OnMouseDown(WidgetIndex widgetIndex) override @@ -456,7 +456,7 @@ namespace OpenRCT2::Ui::Windows if (w == nullptr) return; - uint64_t newPressedWidgets = w->pressed_widgets; + uint64_t newPressedWidgets = w->pressedWidgets; // Unpress all the mode buttons newPressedWidgets &= ~EnumToFlag(WIDX_MAZE_BUILD_MODE); @@ -490,7 +490,7 @@ namespace OpenRCT2::Ui::Windows break; } - w->pressed_widgets = newPressedWidgets; + w->pressedWidgets = newPressedWidgets; w->Invalidate(); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index e6b7c83bb3..a8bc6e9826 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -211,12 +211,12 @@ namespace OpenRCT2::Ui::Windows _windowInformationSize.reset(); page = page_number; - frame_no = 0; - no_list_items = 0; - selected_list_item = -1; + currentFrame = 0; + numListItems = 0; + selectedListItem = -1; - hold_down_widgets = 0; - pressed_widgets = 0; + holdDownWidgets = 0; + pressedWidgets = 0; SetWidgets(window_multiplayer_page_widgets[page]); widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page]; @@ -357,11 +357,11 @@ namespace OpenRCT2::Ui::Windows { WindowSetResize(*this, { 420, 124 }, { 500, 450 }); - no_list_items = (IsServerPlayerInvisible() ? Network::GetNumVisiblePlayers() : Network::GetNumPlayers()); + numListItems = (IsServerPlayerInvisible() ? Network::GetNumVisiblePlayers() : Network::GetNumPlayers()); widgets[WIDX_HEADER_PING].right = width - 5; - selected_list_item = -1; + selectedListItem = -1; Invalidate(); break; } @@ -369,9 +369,9 @@ namespace OpenRCT2::Ui::Windows { WindowSetResize(*this, { 320, 200 }, { 320, 500 }); - no_list_items = Network::GetNumActions(); + numListItems = Network::GetNumActions(); - selected_list_item = -1; + selectedListItem = -1; Invalidate(); break; } @@ -385,7 +385,7 @@ namespace OpenRCT2::Ui::Windows void MultiplayerWindow::OnUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB1 + page); } @@ -570,9 +570,9 @@ namespace OpenRCT2::Ui::Windows { case WINDOW_MULTIPLAYER_PAGE_PLAYERS: { - if (selected_list_item != -1) + if (selectedListItem != -1) { - selected_list_item = -1; + selectedListItem = -1; Invalidate(); } @@ -590,9 +590,9 @@ namespace OpenRCT2::Ui::Windows case WINDOW_MULTIPLAYER_PAGE_GROUPS: { - if (selected_list_item != -1) + if (selectedListItem != -1) { - selected_list_item = -1; + selectedListItem = -1; Invalidate(); } @@ -618,10 +618,10 @@ namespace OpenRCT2::Ui::Windows case WINDOW_MULTIPLAYER_PAGE_PLAYERS: { int32_t index = screenCoords.y / kScrollableRowHeight; - if (index >= no_list_items) + if (index >= numListItems) return; - selected_list_item = index; + selectedListItem = index; Invalidate(); int32_t player = (IsServerPlayerInvisible() ? index + 1 : index); @@ -632,10 +632,10 @@ namespace OpenRCT2::Ui::Windows case WINDOW_MULTIPLAYER_PAGE_GROUPS: { int32_t index = screenCoords.y / kScrollableRowHeight; - if (index >= no_list_items) + if (index >= numListItems) return; - selected_list_item = index; + selectedListItem = index; Invalidate(); auto networkModifyGroup = GameActions::NetworkModifyGroupAction( @@ -655,10 +655,10 @@ namespace OpenRCT2::Ui::Windows case WINDOW_MULTIPLAYER_PAGE_GROUPS: { int32_t index = screenCoords.y / kScrollableRowHeight; - if (index >= no_list_items) + if (index >= numListItems) return; - selected_list_item = index; + selectedListItem = index; Invalidate(); break; } @@ -735,10 +735,10 @@ namespace OpenRCT2::Ui::Windows void MultiplayerWindow::PlayersPaint(RenderTarget& rt) { // Number of players - StringId stringId = no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL; + StringId stringId = numListItems == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL; auto screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }; auto ft = Formatter(); - ft.Add(no_list_items); + ft.Add(numListItems); DrawTextBasic(rt, screenCoords, stringId, ft, { colours[2] }); } @@ -765,7 +765,7 @@ namespace OpenRCT2::Ui::Windows // Draw player name auto colour = ColourWithFlags{ COLOUR_BLACK }; - if (listPosition == selected_list_item) + if (listPosition == selectedListItem) { GfxFilterRect( rt, { 0, screenCoords.y, 800, screenCoords.y + kScrollableRowHeight - 1 }, @@ -896,7 +896,7 @@ namespace OpenRCT2::Ui::Windows for (int32_t i = 0; i < Network::GetNumActions(); i++) { - if (i == selected_list_item) + if (i == selectedListItem) { GfxFilterRect( rt, { 0, screenCoords.y, 800, screenCoords.y + kScrollableRowHeight - 1 }, FilterPaletteID::PaletteDarken1); @@ -938,7 +938,7 @@ namespace OpenRCT2::Ui::Windows int32_t numFrames = window_multiplayer_animation_frames[page]; if (numFrames > 1) { - int32_t frame = frame_no / window_multiplayer_animation_divisor[page]; + int32_t frame = currentFrame / window_multiplayer_animation_divisor[page]; spriteIndex += (frame % numFrames); } } diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index fdbbf39184..b4b337102d 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -39,9 +39,9 @@ namespace OpenRCT2::Ui::Windows WindowSetResize(*this, kWindowSize, kWindowSize); SetWidgets(window_network_status_widgets); - frame_no = 0; + currentFrame = 0; page = 0; - list_information_type = 0; + listInformationType = 0; } void OnClose() override diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index fd629acd26..3705c4d617 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -175,7 +175,7 @@ namespace OpenRCT2::Ui::Windows void OnOpen() override { SetWidgets(window_new_campaign_widgets); - hold_down_widgets = (1uLL << WIDX_WEEKS_INCREASE_BUTTON) | (1uLL << WIDX_WEEKS_DECREASE_BUTTON); + holdDownWidgets = (1uLL << WIDX_WEEKS_INCREASE_BUTTON) | (1uLL << WIDX_WEEKS_DECREASE_BUTTON); WindowInitScrollWidgets(*this); } diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 68db068898..afdabf8f0c 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -303,7 +303,7 @@ namespace OpenRCT2::Ui::Windows InitScrollWidgets(); _filter.clear(); - frame_no = 0; + currentFrame = 0; _newRideVars.SelectedRide = { kRideTypeNull, kObjectEntryIndexNull }; _lastTrackDesignCountRideType.Type = kRideTypeNull; _lastTrackDesignCountRideType.EntryIndex = kObjectEntryIndexNull; @@ -320,9 +320,9 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; - if (frame_no >= TabAnimationLoops[_currentTab]) - frame_no = 0; + currentFrame++; + if (currentFrame >= TabAnimationLoops[_currentTab]) + currentFrame = 0; InvalidateWidget(WIDX_TAB_1 + static_cast(_currentTab)); @@ -395,9 +395,9 @@ namespace OpenRCT2::Ui::Windows SetPressedTab(); if (!Config::Get().interface.ListRideVehiclesSeparately) - pressed_widgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); + pressedWidgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); else - pressed_widgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); + pressedWidgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); widgets[WIDX_TITLE].text = RideTitles[_currentTab]; widgets[WIDX_TAB_7].type = WidgetType::tab; @@ -545,7 +545,7 @@ namespace OpenRCT2::Ui::Windows return; _currentTab = tab; - frame_no = 0; + currentFrame = 0; _newRideVars.HighlightedRide = { kRideTypeNull, kObjectEntryIndexNull }; _newRideVars.SelectedRideCountdown = std::numeric_limits::max(); PopulateRideList(); @@ -799,9 +799,9 @@ namespace OpenRCT2::Ui::Windows int32_t i{}; for (i = 0; i < TAB_COUNT; i++) { - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + pressedWidgets &= ~(1 << (WIDX_TAB_1 + i)); } - pressed_widgets |= 1LL << (WIDX_TAB_1 + static_cast(_currentTab)); + pressedWidgets |= 1LL << (WIDX_TAB_1 + static_cast(_currentTab)); } void RefreshWidgetSizing() @@ -810,11 +810,11 @@ namespace OpenRCT2::Ui::Windows if (_currentTab < SHOP_TAB) { - disabled_widgets &= ~(1 << WIDX_GROUP_BY_TRACK_TYPE); + disabledWidgets &= ~(1 << WIDX_GROUP_BY_TRACK_TYPE); } else { - disabled_widgets |= 1LL << WIDX_GROUP_BY_TRACK_TYPE; + disabledWidgets |= 1LL << WIDX_GROUP_BY_TRACK_TYPE; } // Show or hide unrelated widgets @@ -1007,7 +1007,7 @@ namespace OpenRCT2::Ui::Windows { int32_t frame = 0; if (_currentTab == tab) - frame = frame_no / TabAnimationDivisor[_currentTab]; + frame = currentFrame / TabAnimationDivisor[_currentTab]; spriteIndex += tab == THRILL_TAB ? ThrillRidesTabAnimationSequence[frame] : frame; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index b6d155a1c2..a7af97a263 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -269,7 +269,7 @@ namespace OpenRCT2::Ui::Windows { auto imageId = ImageId(SPR_TAB_GEARS_0); if (page == optionsTab) - imageId = imageId.WithIndexOffset((frame_no / 2) % 4); + imageId = imageId.WithIndexOffset((currentFrame / 2) % 4); auto& widget = widgets[WIDX_TAB_OPTIONS]; GfxDrawSprite(rt, imageId, windowPos + ScreenCoordsXY{ widget.left, widget.top }); @@ -345,7 +345,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; + currentFrame++; if (page != newsTab) return; diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 0ee12e8723..8d2563ad03 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -358,7 +358,7 @@ namespace OpenRCT2::Ui::Windows [de](const ObjectEntryDescriptor& e) { return de.GetName() == e.GetName(); }), _invalidEntries.end()); } - no_list_items = static_cast(_invalidEntries.size()); + numListItems = static_cast(_invalidEntries.size()); } #endif @@ -369,7 +369,7 @@ namespace OpenRCT2::Ui::Windows void CopyObjectNamesToClipboard() { std::stringstream stream; - for (uint16_t i = 0; i < no_list_items; i++) + for (uint16_t i = 0; i < numListItems; i++) { const auto& entry = _invalidEntries[i]; stream << entry.GetName(); @@ -382,13 +382,13 @@ namespace OpenRCT2::Ui::Windows void SelectObjectFromList(const int32_t index) { - if (index < 0 || index > no_list_items) + if (index < 0 || index > numListItems) { - selected_list_item = -1; + selectedListItem = -1; } else { - selected_list_item = index; + selectedListItem = index; } InvalidateWidget(WIDX_SCROLL); } @@ -418,9 +418,9 @@ namespace OpenRCT2::Ui::Windows Close(); return; case WIDX_COPY_CURRENT: - if (selected_list_item > -1 && selected_list_item < no_list_items) + if (selectedListItem > -1 && selectedListItem < numListItems) { - const auto name = std::string(_invalidEntries[selected_list_item].GetName()); + const auto name = std::string(_invalidEntries[selectedListItem].GetName()); OpenRCT2::GetContext()->GetUiContext().SetClipboardText(name.c_str()); } break; @@ -437,7 +437,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; + currentFrame++; // Check if the mouse is hovering over the list if (!widgetIsHighlighted(*this, WIDX_SCROLL)) @@ -453,7 +453,7 @@ namespace OpenRCT2::Ui::Windows if (_objDownloader.IsDownloading()) { // Don't do this too often as it isn't particularly efficient - if (frame_no % 64 == 0) + if (currentFrame % 64 == 0) { UpdateObjectList(); } @@ -468,7 +468,7 @@ namespace OpenRCT2::Ui::Windows ScreenSize OnScrollGetSize(const int32_t scrollIndex) override { - return ScreenSize(0, no_list_items * kScrollableRowHeight); + return ScreenSize(0, numListItems * kScrollableRowHeight); } void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override @@ -481,7 +481,7 @@ namespace OpenRCT2::Ui::Windows { // Highlight item that the cursor is over, or remove highlighting if none const auto selectedItem = screenCoords.y / kScrollableRowHeight; - if (selectedItem < 0 || selectedItem >= no_list_items) + if (selectedItem < 0 || selectedItem >= numListItems) _highlightedIndex = -1; else _highlightedIndex = selectedItem; @@ -515,7 +515,7 @@ namespace OpenRCT2::Ui::Windows ColourMapA[colours[1].colour].mid_light); const int32_t listWidth = widgets[WIDX_SCROLL].width(); - for (int32_t i = 0; i < no_list_items; i++) + for (int32_t i = 0; i < numListItems; i++) { ScreenCoordsXY screenCoords; screenCoords.y = i * kScrollableRowHeight; @@ -528,7 +528,7 @@ namespace OpenRCT2::Ui::Windows const auto screenRect = ScreenRect{ { 0, screenCoords.y }, { listWidth, screenCoords.y + kScrollableRowHeight - 1 } }; // If hovering over item, change the color and fill the backdrop. - if (i == selected_list_item) + if (i == selectedListItem) GfxFillRect(rt, screenRect, ColourMapA[colours[1].colour].darker); else if (i == _highlightedIndex) GfxFillRect(rt, screenRect, ColourMapA[colours[1].colour].mid_dark); @@ -563,7 +563,7 @@ namespace OpenRCT2::Ui::Windows _invalidEntries = std::vector(missingObjects, missingObjects + numMissingObjects); // Refresh list items and path - no_list_items = static_cast(numMissingObjects); + numListItems = static_cast(numMissingObjects); _filePath = path; Invalidate(); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index ba60e0ce6d..223a2822cd 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -741,12 +741,12 @@ namespace OpenRCT2::Ui::Windows { SetPressedTab(); - disabled_widgets = 0; + disabledWidgets = 0; auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext().HasFilePicker(); const bool advancedTabSelected = (WIDX_FIRST_TAB + page) == WIDX_TAB_ADVANCED; if (!hasFilePicker && advancedTabSelected) { - disabled_widgets |= (1uLL << WIDX_ALWAYS_NATIVE_LOADSAVE); + disabledWidgets |= (1uLL << WIDX_ALWAYS_NATIVE_LOADSAVE); widgets[WIDX_ALWAYS_NATIVE_LOADSAVE].type = WidgetType::empty; } } @@ -774,7 +774,7 @@ namespace OpenRCT2::Ui::Windows void CommonUpdate() { // Tab animation - frame_no++; + currentFrame++; InvalidateWidget(WIDX_FIRST_TAB + page); } #pragma endregion @@ -983,15 +983,15 @@ namespace OpenRCT2::Ui::Windows // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" if (Config::Get().general.FullscreenMode != static_cast(OpenRCT2::Ui::FullscreenMode::fullscreen)) { - disabled_widgets |= (1uLL << WIDX_RESOLUTION_DROPDOWN); - disabled_widgets |= (1uLL << WIDX_RESOLUTION); - disabled_widgets |= (1uLL << WIDX_RESOLUTION_LABEL); + disabledWidgets |= (1uLL << WIDX_RESOLUTION_DROPDOWN); + disabledWidgets |= (1uLL << WIDX_RESOLUTION); + disabledWidgets |= (1uLL << WIDX_RESOLUTION_LABEL); } else { - disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_DROPDOWN); - disabled_widgets &= ~(1uLL << WIDX_RESOLUTION); - disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_LABEL); + disabledWidgets &= ~(1uLL << WIDX_RESOLUTION_DROPDOWN); + disabledWidgets &= ~(1uLL << WIDX_RESOLUTION); + disabledWidgets &= ~(1uLL << WIDX_RESOLUTION_LABEL); } SetCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, Config::Get().general.ShowFPS); @@ -1148,11 +1148,11 @@ namespace OpenRCT2::Ui::Windows if (Config::Get().general.DayNightCycle && Config::Get().general.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) { - disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + disabledWidgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); } else { - disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + disabledWidgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); Config::Get().general.EnableLightFx = false; } @@ -1161,11 +1161,11 @@ namespace OpenRCT2::Ui::Windows && Config::Get().general.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay && Config::Get().general.EnableLightFx) { - disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + disabledWidgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); } else { - disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + disabledWidgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); Config::Get().general.EnableLightFxForVehicles = false; } @@ -1176,11 +1176,11 @@ namespace OpenRCT2::Ui::Windows if (!Config::Get().general.RenderWeatherEffects && !Config::Get().general.RenderWeatherGloom) { SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); - disabled_widgets |= (1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + disabledWidgets |= (1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); } else { - disabled_widgets &= ~(1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + disabledWidgets &= ~(1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); } } @@ -1644,7 +1644,7 @@ namespace OpenRCT2::Ui::Windows widgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, Config::Get().sound.MasterSoundEnabled); // Initialize only on first frame, otherwise the scrollbars won't be able to be modified - if (frame_no == 0) + if (currentFrame == 0) { InitializeScrollPosition(WIDX_MASTER_VOLUME, 0, Config::Get().sound.MasterVolume); InitializeScrollPosition(WIDX_SOUND_VOLUME, 1, Config::Get().sound.SoundVolume); @@ -1723,7 +1723,7 @@ namespace OpenRCT2::Ui::Windows widgetSetEnabled(*this, WIDX_TOUCH_ENHANCEMENTS, Config::Get().interface.EnlargedUi); // Initialize scroll positions for sliders only on first frame - if (frame_no == 0) + if (currentFrame == 0) { // Convert deadzone (0-32767) to percentage (0-100), then to scroll position (0-500) uint8_t deadzonePercent = static_cast((Config::Get().general.gamepadDeadzone / 32767.0f) * 100); @@ -2012,7 +2012,7 @@ namespace OpenRCT2::Ui::Windows // and the server cannot change the setting during gameplay to prevent desyncs if (Network::GetMode() != Network::Mode::none) { - disabled_widgets |= (1uLL << WIDX_REAL_NAMES_GUESTS_CHECKBOX) | (1uLL << WIDX_REAL_NAMES_STAFF_CHECKBOX); + disabledWidgets |= (1uLL << WIDX_REAL_NAMES_GUESTS_CHECKBOX) | (1uLL << WIDX_REAL_NAMES_STAFF_CHECKBOX); widgets[WIDX_REAL_NAMES_GUESTS_CHECKBOX].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; widgets[WIDX_REAL_NAMES_STAFF_CHECKBOX].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; @@ -2021,7 +2021,7 @@ namespace OpenRCT2::Ui::Windows // the way scenarios are completed during this network-session if (Network::GetMode() == Network::Mode::client) { - disabled_widgets |= (1uLL << WIDX_ALLOW_EARLY_COMPLETION); + disabledWidgets |= (1uLL << WIDX_ALLOW_EARLY_COMPLETION); widgets[WIDX_ALLOW_EARLY_COMPLETION].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; } } @@ -2274,8 +2274,8 @@ namespace OpenRCT2::Ui::Windows return; page = p; - frame_no = 0; - pressed_widgets = 0; + currentFrame = 0; + pressedWidgets = 0; SetWidgets(window_options_page_widgets[page]); Invalidate(); @@ -2288,8 +2288,8 @@ namespace OpenRCT2::Ui::Windows void SetPressedTab() { for (int32_t i = 0; i < WINDOW_OPTIONS_PAGE_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_FIRST_TAB + i)); - pressed_widgets |= 1LL << (WIDX_FIRST_TAB + page); + pressedWidgets &= ~(1 << (WIDX_FIRST_TAB + i)); + pressedWidgets |= 1LL << (WIDX_FIRST_TAB + page); } void ShowDropdown(Widget* widget, int32_t num_items) @@ -2323,7 +2323,7 @@ namespace OpenRCT2::Ui::Windows { if (page == p) { - int32_t frame = frame_no / TabAnimationDivisor[page]; + int32_t frame = currentFrame / TabAnimationDivisor[page]; spriteIndex += (frame % TabAnimationFrames[page]); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index b2721b4102..5af970b4ab 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -183,7 +183,7 @@ namespace OpenRCT2::Ui::Windows void OnOpen() override { number = 0; - frame_no = 0; + currentFrame = 0; _numberOfRides = -1; _numberOfStaff = -1; _peepAnimationFrame = 0; @@ -394,7 +394,7 @@ namespace OpenRCT2::Ui::Windows void SetDisabledTabs() { // Disable price tab if money is disabled - disabled_widgets = (getGameState().park.flags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0; + disabledWidgets = (getGameState().park.flags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0; } void PrepareWindowTitleText() @@ -483,7 +483,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateEntrance() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1); } @@ -521,9 +521,9 @@ namespace OpenRCT2::Ui::Windows // Only allow closing of park for guest / rating objective if (gameState.scenarioOptions.objective.Type == Scenario::ObjectiveType::guestsAndRating) - disabled_widgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT); + disabledWidgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT); else - disabled_widgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT)); + disabledWidgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT)); // Only allow purchase of land when there is money if (gameState.park.flags & PARK_FLAGS_NO_MONEY) @@ -665,7 +665,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateRating() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); if (_ratingProps.UpdateHoverIndex()) { @@ -689,8 +689,8 @@ namespace OpenRCT2::Ui::Windows char buffer[64]{}; FormatStringToBuffer(buffer, sizeof(buffer), "{BLACK}{COMMA32}", _ratingProps.max); - int32_t maxWidth = GfxGetStringWidth(buffer, FontStyle::Small) + Graph::kYTickMarkPadding + 1; - const ScreenCoordsXY dynamicPadding{ std::max(maxWidth, kGraphTopLeftPadding.x), kGraphTopLeftPadding.y }; + int32_t maxGraphWidth = GfxGetStringWidth(buffer, FontStyle::Small) + Graph::kYTickMarkPadding + 1; + const ScreenCoordsXY dynamicPadding{ std::max(maxGraphWidth, kGraphTopLeftPadding.x), kGraphTopLeftPadding.y }; _ratingProps.RecalculateLayout( { _ratingGraphBounds.Point1 + dynamicPadding, _ratingGraphBounds.Point2 - kGraphBottomRightPadding }, @@ -732,7 +732,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateGuests() { - frame_no++; + currentFrame++; _peepAnimationFrame = (_peepAnimationFrame + 1) % 24; InvalidateWidget(WIDX_TAB_3); if (_guestProps.UpdateHoverIndex()) @@ -768,8 +768,8 @@ namespace OpenRCT2::Ui::Windows char buffer[64]{}; FormatStringToBuffer(buffer, sizeof(buffer), "{BLACK}{COMMA32}", _guestProps.max); - int32_t maxWidth = GfxGetStringWidth(buffer, FontStyle::Small) + Graph::kYTickMarkPadding + 1; - const ScreenCoordsXY dynamicPadding{ std::max(maxWidth, kGraphTopLeftPadding.x), kGraphTopLeftPadding.y }; + int32_t maxGraphWidth = GfxGetStringWidth(buffer, FontStyle::Small) + Graph::kYTickMarkPadding + 1; + const ScreenCoordsXY dynamicPadding{ std::max(maxGraphWidth, kGraphTopLeftPadding.x), kGraphTopLeftPadding.y }; _guestProps.RecalculateLayout( { _guestGraphBounds.Point1 + dynamicPadding, _guestGraphBounds.Point2 - kGraphBottomRightPadding }, @@ -839,7 +839,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdatePrice() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_4); } @@ -907,7 +907,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateStats() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_5); // Invalidate ride count if changed @@ -1012,7 +1012,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateObjective() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_6); } @@ -1115,7 +1115,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateAwards() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_7); } @@ -1169,11 +1169,11 @@ namespace OpenRCT2::Ui::Windows return; page = newPage; - frame_no = 0; + currentFrame = 0; _peepAnimationFrame = 0; RemoveViewport(); - hold_down_widgets = _pagedHoldDownWidgets[newPage]; + holdDownWidgets = _pagedHoldDownWidgets[newPage]; SetWidgets(_pagedWidgets[newPage]); SetDisabledTabs(); Invalidate(); @@ -1197,8 +1197,8 @@ namespace OpenRCT2::Ui::Windows void SetPressedTab() { for (int32_t i = WIDX_TAB_1; i <= WIDX_TAB_7; i++) - pressed_widgets &= ~(1 << i); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + pressedWidgets &= ~(1 << i); + pressedWidgets |= 1LL << (WIDX_TAB_1 + page); } void DrawTabImages(RenderTarget& rt) @@ -1216,7 +1216,7 @@ namespace OpenRCT2::Ui::Windows { ImageId spriteIdx(SPR_TAB_GRAPH_0); if (page == WINDOW_PARK_PAGE_RATING) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8); + spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 8) % 8); GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); GfxDrawSprite( rt, ImageId(SPR_RATING_HIGH), @@ -1231,7 +1231,7 @@ namespace OpenRCT2::Ui::Windows { ImageId spriteIdx(SPR_TAB_GRAPH_0); if (page == WINDOW_PARK_PAGE_GUESTS) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8); + spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 8) % 8); GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest); @@ -1249,7 +1249,7 @@ namespace OpenRCT2::Ui::Windows { ImageId spriteIdx(SPR_TAB_ADMISSION_0); if (page == WINDOW_PARK_PAGE_PRICE) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 2) % 8); + spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 2) % 8); GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); } @@ -1258,7 +1258,7 @@ namespace OpenRCT2::Ui::Windows { ImageId spriteIdx(SPR_TAB_STATS_0); if (page == WINDOW_PARK_PAGE_STATS) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 7); + spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 4) % 7); GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); } @@ -1267,7 +1267,7 @@ namespace OpenRCT2::Ui::Windows { ImageId spriteIdx(SPR_TAB_OBJECTIVE_0); if (page == WINDOW_PARK_PAGE_OBJECTIVE) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 16); + spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 4) % 16); GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top }); } diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 2851d98700..c4c038dbef 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -60,7 +60,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(PatrolAreaWidgets); - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + holdDownWidgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); gLandToolSize = 4; diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 600dc6b364..25655435d7 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -99,13 +99,13 @@ namespace OpenRCT2::Ui::Windows void OnOpen() override { page = 0; - frame_no = 0; - list_information_type = 0; + currentFrame = 0; + listInformationType = 0; WindowSetResize(*this, { 210, 134 }, { 500, 450 }); - hold_down_widgets = 0; - pressed_widgets = 0; + holdDownWidgets = 0; + pressedWidgets = 0; SetPage(WINDOW_PLAYER_PAGE_OVERVIEW); } @@ -218,10 +218,10 @@ namespace OpenRCT2::Ui::Windows int32_t originalPage = page; page = newPage; - frame_no = 0; + currentFrame = 0; - hold_down_widgets = 0; - pressed_widgets = 0; + holdDownWidgets = 0; + pressedWidgets = 0; SetWidgets(window_player_page_widgets[newPage]); Invalidate(); OnResize(); @@ -272,7 +272,7 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_PLAYER_PAGE_STATISTICS) { - imageId += (frame_no / 2) & 7; + imageId += (currentFrame / 2) & 7; } GfxDrawSprite(rt, ImageId(imageId), screenCoords); @@ -348,7 +348,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateOverview() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1 + page); if (Network::GetPlayerIndex(static_cast(number)) == -1) @@ -377,9 +377,9 @@ namespace OpenRCT2::Ui::Windows return; } - pressed_widgets &= ~(WIDX_TAB_1); - pressed_widgets &= ~(WIDX_TAB_2); - pressed_widgets |= 1uLL << (page + WIDX_TAB_1); + pressedWidgets &= ~(WIDX_TAB_1); + pressedWidgets &= ~(WIDX_TAB_2); + pressedWidgets |= 1uLL << (page + WIDX_TAB_1); UpdateTitle(); @@ -579,7 +579,7 @@ namespace OpenRCT2::Ui::Windows void OnUpdateStatistics() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_1 + page); if (Network::GetPlayerIndex(static_cast(number)) == -1) @@ -590,9 +590,9 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDrawStatistics() { - pressed_widgets &= ~(WIDX_TAB_1); - pressed_widgets &= ~(WIDX_TAB_2); - pressed_widgets |= 1uLL << (page + WIDX_TAB_1); + pressedWidgets &= ~(WIDX_TAB_1); + pressedWidgets &= ~(WIDX_TAB_2); + pressedWidgets |= 1uLL << (page + WIDX_TAB_1); UpdateTitle(); diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index 05f1c51568..6cffe2739a 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -91,7 +91,7 @@ namespace OpenRCT2::Ui::Windows SetWidgets(kProgressWindowWidgets); WindowSetResize(*this, kWindowSize, kWindowSize); - frame_no = 0; + currentFrame = 0; ApplyStyle(); ResizeFrame(); diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 7ad6b0a5b8..16892c32f5 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -129,7 +129,7 @@ namespace OpenRCT2::Ui::Windows return; page = newPageIndex; - frame_no = 0; + currentFrame = 0; Invalidate(); if (newPageIndex == WINDOW_RESEARCH_PAGE_DEVELOPMENT) @@ -145,17 +145,17 @@ namespace OpenRCT2::Ui::Windows Invalidate(); SetWidgets(window_research_page_widgets[newPageIndex]); - hold_down_widgets = 0; - disabled_widgets = 0; - pressed_widgets = 0; + holdDownWidgets = 0; + disabledWidgets = 0; + pressedWidgets = 0; } private: void OnUpdate() override { // Tab animation - if (++frame_no >= window_research_tab_animation_loops[page]) - frame_no = 0; + if (++currentFrame >= window_research_tab_animation_loops[page]) + currentFrame = 0; switch (page) { @@ -274,7 +274,7 @@ namespace OpenRCT2::Ui::Windows { if (page == tabPage) { - int32_t frame = frame_no / 2; + int32_t frame = currentFrame / 2; if (tabPage == WINDOW_RESEARCH_PAGE_DEVELOPMENT) frame %= 8; spriteIndex += frame; @@ -556,18 +556,18 @@ namespace OpenRCT2::Ui::Windows // Set checkbox disabled if research type is complete if (uncompletedResearchTypes & mask) { - w->disabled_widgets &= ~widgetMask; + w->disabledWidgets &= ~widgetMask; // Set checkbox ticked if research type is active if (activeResearchTypes & mask) - w->pressed_widgets |= widgetMask; + w->pressedWidgets |= widgetMask; else - w->pressed_widgets &= ~widgetMask; + w->pressedWidgets &= ~widgetMask; } else { - w->disabled_widgets |= widgetMask; - w->pressed_widgets &= ~widgetMask; + w->disabledWidgets |= widgetMask; + w->pressedWidgets &= ~widgetMask; } } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index acaf0aac1a..0711f068b6 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -748,11 +748,11 @@ namespace OpenRCT2::Ui::Windows void OnOpen() override { SetWidgets(PageWidgets[WINDOW_RIDE_PAGE_MAIN]); - hold_down_widgets = PageHoldDownWidgets[WINDOW_RIDE_PAGE_MAIN]; + holdDownWidgets = PageHoldDownWidgets[WINDOW_RIDE_PAGE_MAIN]; SetPage(WINDOW_RIDE_PAGE_MAIN); - list_information_type = 0; - picked_peep_frame = 0; + listInformationType = 0; + pickedPeepFrame = 0; DisableTabs(); WindowSetResize(*this, { kMinimumWindowWidth, 180 }, { 500, 450 }); @@ -1161,8 +1161,8 @@ namespace OpenRCT2::Ui::Windows return; page = newPage; - frame_no = 0; - picked_peep_frame = 0; + currentFrame = 0; + pickedPeepFrame = 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 (newPage == WINDOW_RIDE_PAGE_VEHICLE) { ride_update_max_vehicles(ride); @@ -1170,8 +1170,8 @@ namespace OpenRCT2::Ui::Windows RemoveViewport(); - hold_down_widgets = PageHoldDownWidgets[page]; - pressed_widgets = 0; + holdDownWidgets = PageHoldDownWidgets[page]; + pressedWidgets = 0; SetWidgets(PageWidgets[page]); DisableTabs(); Invalidate(); @@ -1209,7 +1209,7 @@ namespace OpenRCT2::Ui::Windows { if (page == tab) { - int32_t frame = frame_no / PageTabAnimationDivisor[page]; + int32_t frame = currentFrame / PageTabAnimationDivisor[page]; spriteIndex += (frame % PageTabAnimationNumFrames[page]); } @@ -1232,17 +1232,17 @@ namespace OpenRCT2::Ui::Windows case RideClassification::ride: spriteIndex = SPR_TAB_RIDE_0; if (page == WINDOW_RIDE_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 16; + spriteIndex += (currentFrame / 4) % 16; break; case RideClassification::shopOrStall: spriteIndex = SPR_TAB_SHOPS_AND_STALLS_0; if (page == WINDOW_RIDE_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 16; + spriteIndex += (currentFrame / 4) % 16; break; case RideClassification::kioskOrFacility: spriteIndex = SPR_TAB_KIOSKS_AND_FACILITIES_0; if (page == WINDOW_RIDE_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 8; + spriteIndex += (currentFrame / 4) % 8; break; } @@ -1305,7 +1305,7 @@ namespace OpenRCT2::Ui::Windows // imageIndex represents a precision of 64 auto imageIndex = OpenRCT2::Entity::Yaw::YawFrom4(2) * 2; if (page == WINDOW_RIDE_PAGE_VEHICLE) - imageIndex += frame_no; + imageIndex += currentFrame; imageIndex = carEntry.SpriteByYaw(imageIndex / 2, SpriteGroupType::SlopeFlat); imageIndex &= carEntry.TabRotationMask; imageIndex *= carEntry.base_num_frames; @@ -1324,7 +1324,7 @@ namespace OpenRCT2::Ui::Windows const auto& widget = widgets[widgetIndex]; int32_t spriteIndex = 0; if (page == WINDOW_RIDE_PAGE_CUSTOMER) - spriteIndex = picked_peep_frame & ~3; + spriteIndex = pickedPeepFrame & ~3; auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest); spriteIndex += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1; @@ -1401,7 +1401,7 @@ namespace OpenRCT2::Ui::Windows disabledTabs |= (1uLL << WIDX_TAB_5); } - disabled_widgets = disabledTabs; + disabledWidgets = disabledTabs; } void UpdateOverallView(const Ride& ride) const @@ -1469,8 +1469,8 @@ namespace OpenRCT2::Ui::Windows { int32_t i; for (i = 0; i < WINDOW_RIDE_PAGE_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + pressedWidgets &= ~(1 << (WIDX_TAB_1 + i)); + pressedWidgets |= 1LL << (WIDX_TAB_1 + page); } #pragma region Main @@ -1682,10 +1682,10 @@ namespace OpenRCT2::Ui::Windows void MainResize() { - int32_t minHeight = 180; + int32_t newMinHeight = 180; if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) { - minHeight += 20 + kRCT1LightOffset; + newMinHeight += 20 + kRCT1LightOffset; auto ride = GetRide(rideId); if (ride != nullptr) @@ -1693,22 +1693,22 @@ namespace OpenRCT2::Ui::Windows #ifdef __SIMULATE_IN_RIDE_WINDOW__ if (ride->supportsStatus(RideStatus::simulating)) { - minHeight += 14; + newMinHeight += 14; } #endif if (ride->supportsStatus(RideStatus::testing)) { - minHeight += 14; + newMinHeight += 14; } } } if (getGameState().cheats.allowArbitraryRideTypeChanges) { - minHeight += 15; + newMinHeight += 15; } flags |= WF_RESIZABLE; - WindowSetResize(*this, { kMinimumWindowWidth, minHeight }, { 500, 450 }); + WindowSetResize(*this, { kMinimumWindowWidth, newMinHeight }, { 500, 450 }); // Unlike with other windows, the focus needs to be recentred so it’s best to just reset it. focus = std::nullopt; InitViewport(); @@ -2254,7 +2254,7 @@ namespace OpenRCT2::Ui::Windows void MainUpdate() { // Update tab animation - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_1); @@ -2316,10 +2316,10 @@ namespace OpenRCT2::Ui::Windows return; const auto& gameState = getGameState(); - disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); + disabledWidgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); if (ride->lifecycleFlags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && !gameState.cheats.makeAllDestructible) - disabled_widgets |= (1uLL << WIDX_DEMOLISH); + disabledWidgets |= (1uLL << WIDX_DEMOLISH); auto ft = Formatter::Common(); ride->formatNameTo(ft); @@ -2706,7 +2706,7 @@ namespace OpenRCT2::Ui::Windows void VehicleUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_2); } @@ -2816,11 +2816,11 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WidgetType::checkbox; if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) { - pressed_widgets |= (1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); } else { - pressed_widgets &= ~(1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); + pressedWidgets &= ~(1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); } } else @@ -3391,7 +3391,7 @@ namespace OpenRCT2::Ui::Windows void OperatingUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_3); @@ -3466,7 +3466,7 @@ namespace OpenRCT2::Ui::Windows ride->formatNameTo(ft); // Widget setup - pressed_widgets &= ~( + pressedWidgets &= ~( (1uLL << WIDX_LOAD_CHECKBOX) | (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX) | (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX) | (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX) | (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX)); @@ -3569,7 +3569,7 @@ namespace OpenRCT2::Ui::Windows ft.Add(ride->maxWaitingTime); if (ride->departFlags & RIDE_DEPART_WAIT_FOR_LOAD) - pressed_widgets |= (1uLL << WIDX_LOAD_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_LOAD_CHECKBOX); } else { @@ -3589,13 +3589,13 @@ namespace OpenRCT2::Ui::Windows } if (ride->departFlags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) - pressed_widgets |= (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); if (ride->departFlags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) - pressed_widgets |= (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); if (ride->departFlags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) - pressed_widgets |= (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX); if (ride->departFlags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) - pressed_widgets |= (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX); // Mode specific functionality auto multiplier = ride->getRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; @@ -3666,7 +3666,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_MODE_TWEAK].text = format; widgets[WIDX_MODE_TWEAK_INCREASE].type = WidgetType::button; widgets[WIDX_MODE_TWEAK_DECREASE].type = WidgetType::button; - pressed_widgets &= ~(1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); + pressedWidgets &= ~(1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); } else { @@ -3970,7 +3970,7 @@ namespace OpenRCT2::Ui::Windows void MaintenanceUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_4); @@ -4009,12 +4009,12 @@ namespace OpenRCT2::Ui::Windows if (ride->getRideTypeDescriptor().AvailableBreakdowns == 0 || !(ride->lifecycleFlags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) { - disabled_widgets |= (1uLL << WIDX_REFURBISH_RIDE); + disabledWidgets |= (1uLL << WIDX_REFURBISH_RIDE); widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED; } else { - disabled_widgets &= ~(1uLL << WIDX_REFURBISH_RIDE); + disabledWidgets &= ~(1uLL << WIDX_REFURBISH_RIDE); widgets[WIDX_REFURBISH_RIDE].tooltip = STR_REFURBISH_RIDE_TIP; } } @@ -4546,7 +4546,7 @@ namespace OpenRCT2::Ui::Windows void ColourUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_5); InvalidateWidget(WIDX_VEHICLE_PREVIEW); @@ -4644,11 +4644,11 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WidgetType::checkbox; if (ride->hasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) { - pressed_widgets |= (1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); + pressedWidgets |= (1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } else { - pressed_widgets &= ~(1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); + pressedWidgets &= ~(1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } } else @@ -4946,8 +4946,8 @@ namespace OpenRCT2::Ui::Windows screenCoords.y += carEntry.tab_height; // Draw the coloured spinning vehicle - // frame_no represents a SpritePrecision of 64 - ImageIndex imageIndex = carEntry.SpriteByYaw(frame_no / 2, SpriteGroupType::SlopeFlat); + // currentFrame represents a SpritePrecision of 64 + ImageIndex imageIndex = carEntry.SpriteByYaw(currentFrame / 2, SpriteGroupType::SlopeFlat); imageIndex &= carEntry.TabRotationMask; imageIndex *= carEntry.base_num_frames; imageIndex += carEntry.base_image_id; @@ -5007,9 +5007,9 @@ namespace OpenRCT2::Ui::Windows // Expand the window when music is playing auto isMusicActivated = (ride->lifecycleFlags & RIDE_LIFECYCLE_MUSIC) != 0; auto standardHeight = widgets[WIDX_MUSIC_DROPDOWN].bottom + 6; - auto minHeight = isMusicActivated ? standardHeight + 133 : standardHeight; - auto maxHeight = isMusicActivated ? standardHeight + 369 : standardHeight; - WindowSetResize(*this, { kMinimumWindowWidth, minHeight }, { 500, maxHeight }); + auto newMinHeight = isMusicActivated ? standardHeight + 133 : standardHeight; + auto newMaxHeight = isMusicActivated ? standardHeight + 369 : standardHeight; + WindowSetResize(*this, { kMinimumWindowWidth, newMinHeight }, { 500, newMaxHeight }); } static std::string GetMusicString(ObjectEntryIndex musicObjectIndex) @@ -5111,7 +5111,7 @@ namespace OpenRCT2::Ui::Windows void MusicUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_6); @@ -5211,14 +5211,14 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_MUSIC_DATA].right = width - 8; } - pressed_widgets |= (1uLL << WIDX_PLAY_MUSIC) | (1uLL << WIDX_MUSIC_IMAGE); - disabled_widgets &= ~((1uLL << WIDX_MUSIC) | (1uLL << WIDX_MUSIC_DROPDOWN) | (1uLL << WIDX_MUSIC_DATA)); + pressedWidgets |= (1uLL << WIDX_PLAY_MUSIC) | (1uLL << WIDX_MUSIC_IMAGE); + disabledWidgets &= ~((1uLL << WIDX_MUSIC) | (1uLL << WIDX_MUSIC_DROPDOWN) | (1uLL << WIDX_MUSIC_DATA)); } else { - pressed_widgets &= ~(1uLL << WIDX_PLAY_MUSIC); - pressed_widgets |= (1uLL << WIDX_MUSIC_IMAGE); - disabled_widgets |= (1uLL << WIDX_MUSIC) | (1uLL << WIDX_MUSIC_DROPDOWN) | (1uLL << WIDX_MUSIC_DATA); + pressedWidgets &= ~(1uLL << WIDX_PLAY_MUSIC); + pressedWidgets |= (1uLL << WIDX_MUSIC_IMAGE); + disabledWidgets |= (1uLL << WIDX_MUSIC) | (1uLL << WIDX_MUSIC_DROPDOWN) | (1uLL << WIDX_MUSIC_DATA); } WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); @@ -5496,7 +5496,7 @@ namespace OpenRCT2::Ui::Windows void MeasurementsUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_7); @@ -5589,12 +5589,12 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_CANCEL_DESIGN].type = WidgetType::empty; widgets[WIDX_SAVE_TRACK_DESIGN].type = WidgetType::flatBtn; - disabled_widgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); + disabledWidgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); if (ride->lifecycleFlags & RIDE_LIFECYCLE_TESTED) { if (!ride->ratings.isNull()) { - disabled_widgets &= ~(1uLL << WIDX_SAVE_TRACK_DESIGN); + disabledWidgets &= ~(1uLL << WIDX_SAVE_TRACK_DESIGN); widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN; } } @@ -5858,13 +5858,13 @@ namespace OpenRCT2::Ui::Windows void SetGraph(int32_t type) { - if (list_information_type == type) + if (listInformationType == type) { _autoScrollGraph = !_autoScrollGraph; } else { - list_information_type = type; + listInformationType = type; } Invalidate(); } @@ -5920,7 +5920,7 @@ namespace OpenRCT2::Ui::Windows Widget* widget; int32_t x; - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_8); OnPrepareDraw(); @@ -6009,11 +6009,11 @@ namespace OpenRCT2::Ui::Windows ride->formatNameTo(ft); // Set pressed graph button type - pressed_widgets &= ~(1uLL << WIDX_GRAPH_VELOCITY); - pressed_widgets &= ~(1uLL << WIDX_GRAPH_ALTITUDE); - pressed_widgets &= ~(1uLL << WIDX_GRAPH_VERTICAL); - pressed_widgets &= ~(1uLL << WIDX_GRAPH_LATERAL); - pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + list_information_type)); + pressedWidgets &= ~(1uLL << WIDX_GRAPH_VELOCITY); + pressedWidgets &= ~(1uLL << WIDX_GRAPH_ALTITUDE); + pressedWidgets &= ~(1uLL << WIDX_GRAPH_VERTICAL); + pressedWidgets &= ~(1uLL << WIDX_GRAPH_LATERAL); + pressedWidgets |= (1LL << (WIDX_GRAPH_VELOCITY + listInformationType)); // Hide graph buttons that are not applicable if (ride->getRideTypeDescriptor().HasFlag(RtdFlag::hasGForces)) @@ -6096,7 +6096,7 @@ namespace OpenRCT2::Ui::Windows } // Horizontal grid lines - int32_t listType = list_information_type; + int32_t listType = listInformationType; int16_t yUnit = GraphsYAxisDetails[listType].unit; StringId stringID = GraphsYAxisDetails[listType].label; int16_t yUnitInterval = GraphsYAxisDetails[listType].unit_interval; @@ -6470,7 +6470,7 @@ namespace OpenRCT2::Ui::Windows void IncomeUpdate() { - frame_no++; + currentFrame++; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_9); @@ -6525,8 +6525,8 @@ namespace OpenRCT2::Ui::Windows return; // Primary item - pressed_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); - disabled_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE); + pressedWidgets &= ~(1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); + disabledWidgets &= ~(1uLL << WIDX_PRIMARY_PRICE); widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = kStringIdNone; widgets[WIDX_PRIMARY_PRICE].tooltip = kStringIdNone; @@ -6536,7 +6536,7 @@ namespace OpenRCT2::Ui::Windows if (!Park::RidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None && rtd.specialType != RtdSpecialType::toilet) { - disabled_widgets |= (1uLL << WIDX_PRIMARY_PRICE); + disabledWidgets |= (1uLL << WIDX_PRIMARY_PRICE); widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; widgets[WIDX_PRIMARY_PRICE].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; } @@ -6558,7 +6558,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WidgetType::checkbox; if (ShopItemHasCommonPrice(primaryItem)) - pressed_widgets |= (1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); + pressedWidgets |= (1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); widgets[WIDX_PRIMARY_PRICE_LABEL].text = GetShopItemDescriptor(primaryItem).Naming.PriceLabel; } @@ -6585,9 +6585,9 @@ namespace OpenRCT2::Ui::Windows else { // Set same price throughout park checkbox - pressed_widgets &= ~(1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); + pressedWidgets &= ~(1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); if (ShopItemHasCommonPrice(secondaryItem)) - pressed_widgets |= (1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); + pressedWidgets |= (1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); // Show widgets widgets[WIDX_SECONDARY_PRICE_LABEL].type = WidgetType::label; @@ -6766,9 +6766,9 @@ namespace OpenRCT2::Ui::Windows void CustomerUpdate() { - picked_peep_frame++; - if (picked_peep_frame >= 24) - picked_peep_frame = 0; + pickedPeepFrame++; + if (pickedPeepFrame >= 24) + pickedPeepFrame = 0; OnPrepareDraw(); InvalidateWidget(WIDX_TAB_10); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 40d73242a0..2575c7489c 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1000,7 +1000,7 @@ namespace OpenRCT2::Ui::Windows } // Set and invalidate the changed widgets - uint64_t currentDisabledWidgets = disabled_widgets; + uint64_t currentDisabledWidgets = disabledWidgets; if (currentDisabledWidgets == newDisabledWidgets) return; @@ -1011,7 +1011,7 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(i); } } - disabled_widgets = newDisabledWidgets; + disabledWidgets = newDisabledWidgets; } void OnUpdate() override @@ -1642,11 +1642,11 @@ namespace OpenRCT2::Ui::Windows simulateWidget.type = WidgetType::flatBtn; if (currentRide->status == RideStatus::simulating) { - pressed_widgets |= (1uLL << WIDX_SIMULATE); + pressedWidgets |= (1uLL << WIDX_SIMULATE); } else { - pressed_widgets &= ~(1uLL << WIDX_SIMULATE); + pressedWidgets &= ~(1uLL << WIDX_SIMULATE); } } @@ -1738,7 +1738,7 @@ namespace OpenRCT2::Ui::Windows const auto& rtd = GetRideTypeDescriptor(currentRide->type); auto trackDrawerDescriptor = getCurrentTrackDrawerDescriptor(rtd); - hold_down_widgets = (1u << WIDX_CONSTRUCT) | (1u << WIDX_DEMOLISH) | (1u << WIDX_NEXT_SECTION) + holdDownWidgets = (1u << WIDX_CONSTRUCT) | (1u << WIDX_DEMOLISH) | (1u << WIDX_NEXT_SECTION) | (1u << WIDX_PREVIOUS_SECTION); if (rtd.HasFlag(RtdFlag::isShopOrFacility) || !currentRide->hasStation()) { @@ -2034,7 +2034,7 @@ namespace OpenRCT2::Ui::Windows auto spinnerStart = 124 + widgets[WIDX_TITLE].bottom; ResizeSpinner(WIDX_SPEED_SETTING_SPINNER, { 12, spinnerStart }, { 85, kSpinnerHeight }); - hold_down_widgets |= (1uLL << WIDX_SPEED_SETTING_SPINNER_UP) | (1uLL << WIDX_SPEED_SETTING_SPINNER_DOWN); + holdDownWidgets |= (1uLL << WIDX_SPEED_SETTING_SPINNER_UP) | (1uLL << WIDX_SPEED_SETTING_SPINNER_DOWN); } static constexpr int16_t bankingGroupboxRightNoSeatRotation = kGroupWidth; @@ -2077,7 +2077,7 @@ namespace OpenRCT2::Ui::Windows } } - uint64_t newPressedWidgets = pressed_widgets + uint64_t newPressedWidgets = pressedWidgets & ((1uLL << WIDX_BACKGROUND) | (1uLL << WIDX_TITLE) | (1uLL << WIDX_CLOSE) | (1uLL << WIDX_DIRECTION_GROUPBOX) | (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_CONSTRUCT) | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) | (1uLL << WIDX_NEXT_SECTION) @@ -2120,7 +2120,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_PREVIOUS_SECTION].type = WidgetType::empty; break; default: - pressed_widgets = newPressedWidgets; + pressedWidgets = newPressedWidgets; Invalidate(); return; } @@ -2219,7 +2219,7 @@ namespace OpenRCT2::Ui::Windows if (_currentTrackHasLiftHill) newPressedWidgets |= (1uLL << WIDX_CHAIN_LIFT); - pressed_widgets = newPressedWidgets; + pressedWidgets = newPressedWidgets; Invalidate(); } diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 449dd616dd..c682c8ee6a 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -187,9 +187,9 @@ namespace OpenRCT2::Ui::Windows WindowSetResize(*this, kWindowSize, kWindowSize * 2); page = PAGE_RIDES; - frame_no = 0; + currentFrame = 0; - list_information_type = INFORMATION_TYPE_STATUS; + listInformationType = INFORMATION_TYPE_STATUS; RefreshList(); _windowRideListInformationType = INFORMATION_TYPE_STATUS; @@ -203,15 +203,15 @@ namespace OpenRCT2::Ui::Windows */ void OnResize() override { - if (width < min_width) + if (width < minWidth) { Invalidate(); - width = min_width; + width = minWidth; } - if (height < min_height) + if (height < minHeight) { Invalidate(); - height = min_height; + height = minHeight; } } @@ -227,9 +227,9 @@ namespace OpenRCT2::Ui::Windows Close(); break; case WIDX_HEADER_NAME: - if (list_information_type != INFORMATION_TYPE_STATUS) + if (listInformationType != INFORMATION_TYPE_STATUS) { - list_information_type = INFORMATION_TYPE_STATUS; + listInformationType = INFORMATION_TYPE_STATUS; _windowListSortDescending = false; } else @@ -239,9 +239,9 @@ namespace OpenRCT2::Ui::Windows SortList(); break; case WIDX_HEADER_OTHER: - if (list_information_type != _windowRideListInformationType) + if (listInformationType != _windowRideListInformationType) { - list_information_type = _windowRideListInformationType; + listInformationType = _windowRideListInformationType; _windowListSortDescending = true; } else @@ -256,7 +256,7 @@ namespace OpenRCT2::Ui::Windows if (page != widgetIndex - WIDX_TAB_1) { page = widgetIndex - WIDX_TAB_1; - frame_no = 0; + currentFrame = 0; if (page != PAGE_RIDES && _windowRideListInformationType > INFORMATION_TYPE_RUNNING_COST) { _windowRideListInformationType = INFORMATION_TYPE_STATUS; @@ -377,9 +377,9 @@ namespace OpenRCT2::Ui::Windows Invalidate(); // Automatically change sort if we're sorting by the custom/info column - if (list_information_type != INFORMATION_TYPE_STATUS) + if (listInformationType != INFORMATION_TYPE_STATUS) { - list_information_type = _windowRideListInformationType; + listInformationType = _windowRideListInformationType; SortList(); } } @@ -391,7 +391,7 @@ namespace OpenRCT2::Ui::Windows */ void OnUpdate() override { - frame_no = (frame_no + 1) % 64; + currentFrame = (currentFrame + 1) % 64; InvalidateWidget(WIDX_TAB_1 + page); if (_windowRideListInformationType != INFORMATION_TYPE_STATUS) Invalidate(); @@ -483,7 +483,7 @@ namespace OpenRCT2::Ui::Windows if (index < 0) return; - selected_list_item = index; + selectedListItem = index; Invalidate(); } @@ -498,15 +498,15 @@ namespace OpenRCT2::Ui::Windows // Set correct active tab for (int32_t i = 0; i < 3; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + pressedWidgets &= ~(1 << (WIDX_TAB_1 + i)); + pressedWidgets |= 1LL << (WIDX_TAB_1 + page); widgets[WIDX_TITLE].text = page_names[page]; if (_quickDemolishMode) - pressed_widgets |= (1uLL << WIDX_QUICK_DEMOLISH); + pressedWidgets |= (1uLL << WIDX_QUICK_DEMOLISH); else - pressed_widgets &= ~(1uLL << WIDX_QUICK_DEMOLISH); + pressedWidgets &= ~(1uLL << WIDX_QUICK_DEMOLISH); widgets[WIDX_LIST].right = width - 26; widgets[WIDX_LIST].bottom = height - 15; @@ -587,7 +587,7 @@ namespace OpenRCT2::Ui::Windows const auto drawButtonCaption = [rt, this](Widget& widget, StringId strId, InformationType sortType) { StringId indicatorId = kStringIdNone; - if (list_information_type == sortType && !(strId == STR_STATUS && sortType == INFORMATION_TYPE_STATUS)) + if (listInformationType == sortType && !(strId == STR_STATUS && sortType == INFORMATION_TYPE_STATUS)) indicatorId = _windowListSortDescending ? STR_DOWN : STR_UP; auto ft = Formatter(); @@ -633,7 +633,7 @@ namespace OpenRCT2::Ui::Windows if (_quickDemolishMode) format = STR_RED_STRINGID; - if (i == static_cast(selected_list_item)) + if (i == static_cast(selectedListItem)) { // Background highlight GfxFilterRect(rt, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::PaletteDarken1); @@ -874,21 +874,21 @@ namespace OpenRCT2::Ui::Windows // Rides tab sprite_idx = SPR_TAB_RIDE_0; if (page == PAGE_RIDES) - sprite_idx += frame_no / 4; + sprite_idx += currentFrame / 4; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); // Shops and stalls tab sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0; if (page == PAGE_SHOPS_AND_STALLS) - sprite_idx += frame_no / 4; + sprite_idx += currentFrame / 4; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); // Information kiosks and facilities tab sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0; if (page == PAGE_KIOSKS_AND_FACILITIES) - sprite_idx += (frame_no / 4) % 8; + sprite_idx += (currentFrame / 4) % 8; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); } @@ -977,13 +977,13 @@ namespace OpenRCT2::Ui::Windows _rideList.push_back(std::move(entry)); } - selected_list_item = -1; + selectedListItem = -1; SortList(); } void SortList() { - switch (list_information_type) + switch (listInformationType) { case INFORMATION_TYPE_STATUS: SortListByName(); @@ -1088,7 +1088,7 @@ namespace OpenRCT2::Ui::Windows break; } - selected_list_item = -1; + selectedListItem = -1; Invalidate(); } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index bb73da0f3b..26768f5ec7 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -165,8 +165,8 @@ namespace OpenRCT2::Ui::Windows { if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB10) { - selected_tab = widgetIndex - 4; - Config::Get().interface.scenarioSelectLastTab = selected_tab; + selectedTab = widgetIndex - 4; + Config::Get().interface.scenarioSelectLastTab = selectedTab; Config::Save(); _highlightedScenario = nullptr; @@ -422,12 +422,12 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - pressed_widgets &= ~( + pressedWidgets &= ~( (1uLL << WIDX_CLOSE) | (1uLL << WIDX_TAB1) | (1uLL << WIDX_TAB2) | (1uLL << WIDX_TAB3) | (1uLL << WIDX_TAB4) | (1uLL << WIDX_TAB5) | (1uLL << WIDX_TAB6) | (1uLL << WIDX_TAB7) | (1uLL << WIDX_TAB8) | (1uLL << WIDX_TAB9) | (1uLL << WIDX_TAB10)); - pressed_widgets |= 1LL << (selected_tab + WIDX_TAB1); + pressedWidgets |= 1LL << (selectedTab + WIDX_TAB1); const int32_t bottomMargin = Config::Get().general.DebuggingTools ? 17 : 5; widgets[WIDX_SCENARIOLIST].right = width - GetPreviewPaneWidth() - 2 * kPadding; @@ -695,7 +695,7 @@ namespace OpenRCT2::Ui::Windows // Category heading StringId headingStringId = kStringIdNone; - if (selected_tab != EnumValue(ScenarioSource::Real) && currentHeading.category != scenario->Category) + if (selectedTab != EnumValue(ScenarioSource::Real) && currentHeading.category != scenario->Category) { currentHeading.category = scenario->Category; headingStringId = Scenario::kScenarioCategoryStringIds[currentHeading.raw]; @@ -774,7 +774,7 @@ namespace OpenRCT2::Ui::Windows bool IsScenarioVisible(const ScenarioIndexEntry& scenario) const { - if (static_cast(scenario.SourceGame) != selected_tab) + if (static_cast(scenario.SourceGame) != selectedTab) { return false; } @@ -786,7 +786,7 @@ namespace OpenRCT2::Ui::Windows { if (!Config::Get().general.ScenarioUnlockingEnabled) return false; - if (selected_tab >= 6) + if (selectedTab >= 6) return false; return true; @@ -804,14 +804,14 @@ namespace OpenRCT2::Ui::Windows if (showPages & (1 << Config::Get().interface.scenarioSelectLastTab)) { - selected_tab = Config::Get().interface.scenarioSelectLastTab; + selectedTab = Config::Get().interface.scenarioSelectLastTab; } else { int32_t firstPage = Numerics::bitScanForward(showPages); if (firstPage != -1) { - selected_tab = firstPage; + selectedTab = firstPage; } } diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index a9d1ba5166..c760217300 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -237,11 +237,11 @@ namespace OpenRCT2::Ui::Windows _actualMinHeight = GetMinimumHeight(); width = GetRequiredWidth(); - min_width = width; - max_width = width; + minWidth = width; + maxWidth = width; height = _actualMinHeight; - min_height = height; - max_height = height; + minHeight = height; + maxHeight = height; if (_activeTabIndex > _tabSelections.size()) { _activeTabIndex = 0; @@ -342,34 +342,34 @@ namespace OpenRCT2::Ui::Windows void OnResize() override { - if (width < min_width) + if (width < minWidth) { Invalidate(); - width = min_width; + width = minWidth; Invalidate(); } - if (width > max_width) + if (width > maxWidth) { Invalidate(); - width = max_width; + width = maxWidth; Invalidate(); } - if (height < min_height) + if (height < minHeight) { Invalidate(); - height = min_height; + height = minHeight; Invalidate(); // HACK: For some reason invalidate has not been called OnPrepareDraw(); ContentUpdateScroll(); } - if (height > max_height) + if (height > maxHeight) { Invalidate(); - height = max_height; + height = maxHeight; Invalidate(); // HACK: For some reason invalidate has not been called OnPrepareDraw(); @@ -478,8 +478,8 @@ namespace OpenRCT2::Ui::Windows { if (InputGetState() != InputState::ScrollLeft) { - min_height = _actualMinHeight; - max_height = _actualMinHeight; + minHeight = _actualMinHeight; + maxHeight = _actualMinHeight; } } else @@ -492,12 +492,12 @@ namespace OpenRCT2::Ui::Windows const auto expandedWindowHeight = maxContentHeight + nonListHeight; const auto windowHeight = std::clamp(expandedWindowHeight, _actualMinHeight, kMaxWindowHeight); - min_height = windowHeight; - max_height = windowHeight; + minHeight = windowHeight; + maxHeight = windowHeight; - if (height < min_height) + if (height < minHeight) { - height = min_height; + height = minHeight; OnPrepareDraw(); ContentUpdateScroll(); Invalidate(); @@ -511,15 +511,15 @@ namespace OpenRCT2::Ui::Windows _hoverCounter = 0; if (InputGetState() != InputState::ScrollLeft) { - min_height = _actualMinHeight; - max_height = _actualMinHeight; + minHeight = _actualMinHeight; + maxHeight = _actualMinHeight; } } - if (height > max_height) + if (height > maxHeight) { Invalidate(); - height = max_height; + height = maxHeight; OnPrepareDraw(); ContentUpdateScroll(); } @@ -682,14 +682,14 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_SCENERY_TITLE].text = titleStringId; widgets[WIDX_FILTER_TEXT_BOX].string = _filteredSceneryTab.Filter.data(); - pressed_widgets = 0; - pressed_widgets |= 1uLL << (tabIndex + WIDX_SCENERY_TAB_1); + pressedWidgets = 0; + pressedWidgets |= 1uLL << (tabIndex + WIDX_SCENERY_TAB_1); if (_sceneryPaintEnabled) - pressed_widgets |= (1uLL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON); + pressedWidgets |= (1uLL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON); if (gWindowSceneryEyedropperEnabled) - pressed_widgets |= (1uLL << WIDX_SCENERY_EYEDROPPER_BUTTON); + pressedWidgets |= (1uLL << WIDX_SCENERY_EYEDROPPER_BUTTON); if (gWindowSceneryScatterEnabled) - pressed_widgets |= (1uLL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); + pressedWidgets |= (1uLL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WidgetType::empty; widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WidgetType::empty; @@ -717,9 +717,9 @@ namespace OpenRCT2::Ui::Windows { widgets[WIDX_RESTRICT_SCENERY].type = WidgetType::button; if (IsSceneryItemRestricted(tabSelectedScenery)) - pressed_widgets |= (1uLL << WIDX_RESTRICT_SCENERY); + pressedWidgets |= (1uLL << WIDX_RESTRICT_SCENERY); else - pressed_widgets &= ~(1uLL << WIDX_RESTRICT_SCENERY); + pressedWidgets &= ~(1uLL << WIDX_RESTRICT_SCENERY); } } @@ -1106,10 +1106,10 @@ namespace OpenRCT2::Ui::Windows int32_t GetMinimumHeight() const { // Minimum window height: title, one scenery button, status bar, padding - int32_t minHeight = getTitleBarTargetHeight() + kSceneryButtonHeight + kDescriptionHeight + 2 * kTabMargin; - minHeight += static_cast(1 + (_tabEntries.size() / GetMaxTabCountInARow())) * kTabHeight; - minHeight += widgets[WIDX_FILTER_TEXT_BOX].height() + 2 * kInputMargin; - return minHeight; + int32_t newMinHeight = getTitleBarTargetHeight() + kSceneryButtonHeight + kDescriptionHeight + 2 * kTabMargin; + newMinHeight += static_cast(1 + (_tabEntries.size() / GetMaxTabCountInARow())) * kTabHeight; + newMinHeight += widgets[WIDX_FILTER_TEXT_BOX].height() + 2 * kInputMargin; + return newMinHeight; } int32_t GetNumColumns() const @@ -2954,9 +2954,9 @@ namespace OpenRCT2::Ui::Windows return; } - auto selectedTab = WindowSceneryGetTabSelection(); - uint8_t sceneryType = selectedTab.SceneryType; - uint16_t selectedScenery = selectedTab.EntryIndex; + auto tabSelection = WindowSceneryGetTabSelection(); + uint8_t sceneryType = tabSelection.SceneryType; + uint16_t selectedScenery = tabSelection.EntryIndex; CoordsXY gridPos; auto& gameState = getGameState(); diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 30446b89fd..a163b1f308 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -61,7 +61,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(_sceneryScatterWidgets); - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + holdDownWidgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); @@ -159,21 +159,21 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { // Set the preview image button to be pressed down - pressed_widgets = (1uLL << WIDX_PREVIEW); + pressedWidgets = (1uLL << WIDX_PREVIEW); // Set density buttons' pressed state. switch (gWindowSceneryScatterDensity) { case ScatterToolDensity::LowDensity: - pressed_widgets |= (1uLL << WIDX_DENSITY_LOW); + pressedWidgets |= (1uLL << WIDX_DENSITY_LOW); break; case ScatterToolDensity::MediumDensity: - pressed_widgets |= (1uLL << WIDX_DENSITY_MEDIUM); + pressedWidgets |= (1uLL << WIDX_DENSITY_MEDIUM); break; case ScatterToolDensity::HighDensity: - pressed_widgets |= (1uLL << WIDX_DENSITY_HIGH); + pressedWidgets |= (1uLL << WIDX_DENSITY_HIGH); break; } diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 35ea9c4a60..aef37ff1d4 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -96,15 +96,15 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); InitScrollWidgets(); - no_list_items = 0; - selected_list_item = -1; - frame_no = 0; + numListItems = 0; + selectedListItem = -1; + currentFrame = 0; page = 0; - list_information_type = 0; + listInformationType = 0; WindowSetResize(*this, kMinimumWindowSize, kMaximumWindowSize); - no_list_items = static_cast(_serverList.GetCount()); + numListItems = static_cast(_serverList.GetCount()); ServerListFetchServersBegin(); } @@ -128,7 +128,7 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_LIST: { - int32_t serverIndex = selected_list_item; + int32_t serverIndex = selectedListItem; if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) { const auto& server = _serverList.GetServer(serverIndex); @@ -168,7 +168,7 @@ namespace OpenRCT2::Ui::Windows { return; } - auto serverIndex = selected_list_item; + auto serverIndex = selectedListItem; if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) { auto& server = _serverList.GetServer(serverIndex); @@ -208,12 +208,12 @@ namespace OpenRCT2::Ui::Windows ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - return { 0, no_list_items * kItemHeight }; + return { 0, numListItems * kItemHeight }; } void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - int32_t serverIndex = selected_list_item; + int32_t serverIndex = selectedListItem; if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) { const auto& server = _serverList.GetServer(serverIndex); @@ -239,7 +239,7 @@ namespace OpenRCT2::Ui::Windows int32_t itemIndex = screenCoords.y / kItemHeight; bool showNetworkVersionTooltip = false; - if (itemIndex < 0 || itemIndex >= no_list_items) + if (itemIndex < 0 || itemIndex >= numListItems) { itemIndex = -1; } @@ -249,9 +249,9 @@ namespace OpenRCT2::Ui::Windows showNetworkVersionTooltip = screenCoords.x > iconX; } - if (selected_list_item != itemIndex || _showNetworkVersionTooltip != showNetworkVersionTooltip) + if (selectedListItem != itemIndex || _showNetworkVersionTooltip != showNetworkVersionTooltip) { - selected_list_item = itemIndex; + selectedListItem = itemIndex; _showNetworkVersionTooltip = showNetworkVersionTooltip; listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : kStringIdNone; @@ -333,13 +333,13 @@ namespace OpenRCT2::Ui::Windows ScreenCoordsXY screenCoords; screenCoords.y = 0; - for (int32_t i = 0; i < no_list_items; i++) + for (int32_t i = 0; i < numListItems; i++) { if (screenCoords.y >= rt.y + rt.height) continue; const auto& serverDetails = _serverList.GetServer(i); - bool highlighted = i == selected_list_item; + bool highlighted = i == selectedListItem; // Draw hover highlight if (highlighted) @@ -527,7 +527,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_START_SERVER].top = buttonTop; widgets[WIDX_START_SERVER].bottom = buttonBottom; - no_list_items = static_cast(_serverList.GetCount()); + numListItems = static_cast(_serverList.GetCount()); } }; diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index c1870f99b4..32a5ef25de 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -74,9 +74,9 @@ namespace OpenRCT2::Ui::Windows InitScrollWidgets(); WindowSetResize(*this, { width, height }, { width, height }); - frame_no = 0; + currentFrame = 0; page = 0; - list_information_type = 0; + listInformationType = 0; snprintf(_port, 7, "%u", Config::Get().network.DefaultPort); String::safeUtf8Copy(_name, Config::Get().network.ServerName.c_str(), sizeof(_name)); diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 03c3f37711..18a90f178c 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -110,7 +110,7 @@ namespace OpenRCT2::Ui::Windows return false; int32_t viewZ = tileElement->GetBaseZ(); - frame_no = viewZ; + currentFrame = viewZ; if (_isSmall) { @@ -316,7 +316,7 @@ namespace OpenRCT2::Ui::Windows return; } - auto signViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), frame_no }; + auto signViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), currentFrame }; // Create viewport Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 1f0cd9617a..f184629c87 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -644,8 +644,8 @@ namespace OpenRCT2::Ui::Windows const auto pickAnimLength = pickAnim.frame_offsets.size(); // Update pickup animation frame - picked_peep_frame++; - picked_peep_frame %= pickAnimLength * 4; + pickedPeepFrame++; + pickedPeepFrame %= pickAnimLength * 4; InvalidateWidget(WIDX_TAB_1); @@ -695,7 +695,7 @@ namespace OpenRCT2::Ui::Windows auto* animObj = objManager.GetLoadedObject(staff->AnimationObjectIndex); auto& pickupAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Hanging); - auto baseImageId = pickupAnim.base_image + pickupAnim.frame_offsets[picked_peep_frame >> 2]; + auto baseImageId = pickupAnim.base_image + pickupAnim.frame_offsets[pickedPeepFrame >> 2]; gPickupPeepImage = ImageId(baseImageId, staff->TshirtColour, staff->TrousersColour); } @@ -919,7 +919,7 @@ namespace OpenRCT2::Ui::Windows void OptionsUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_2); } #pragma endregion @@ -998,7 +998,7 @@ namespace OpenRCT2::Ui::Windows void StatsUpdate() { - frame_no++; + currentFrame++; InvalidateWidget(WIDX_TAB_3); auto staff = GetStaff(); @@ -1069,9 +1069,9 @@ namespace OpenRCT2::Ui::Windows return; page = newPage; - frame_no = 0; - pressed_widgets = 0; - hold_down_widgets = 0; + currentFrame = 0; + pressedWidgets = 0; + holdDownWidgets = 0; SetWidgets(window_staff_page_widgets[page]); RemoveViewport(); @@ -1200,7 +1200,7 @@ namespace OpenRCT2::Ui::Windows { if (page == p) { - int32_t frame = frame_no / TabAnimationDivisor[page - 1]; + int32_t frame = currentFrame / TabAnimationDivisor[page - 1]; baseImageId += (frame % TabAnimationFrames); } diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 97408caa62..80911ba714 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -246,7 +246,7 @@ namespace OpenRCT2::Ui::Windows class ThemesWindow final : public Window { private: - uint8_t _selected_tab = 0; + uint8_t _selectedTab = 0; int16_t _classIndex = -1; int8_t _buttonIndex = -1; const uint8_t _max_row_height = 56; @@ -267,19 +267,19 @@ namespace OpenRCT2::Ui::Windows WindowInitScrollWidgets(*this); WindowSetResize(*this, kWindowSize, kWindowSize); - list_information_type = 0; + listInformationType = 0; _classIndex = -1; _buttonIndex = -1; } void OnResize() override { - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + if (_selectedTab == WINDOW_THEMES_TAB_SETTINGS) { if (WindowSetResize(*this, kWindowSize, kWindowSize)) GfxInvalidateScreen(); } - else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) + else if (_selectedTab == WINDOW_THEMES_TAB_FEATURES) { if (WindowSetResize(*this, { 320, 122 }, { 320, 122 })) GfxInvalidateScreen(); @@ -292,22 +292,22 @@ namespace OpenRCT2::Ui::Windows void OnUpdate() override { - frame_no++; - if (frame_no >= window_themes_tab_animation_loops[_selected_tab]) - frame_no = 0; + currentFrame++; + if (currentFrame >= window_themes_tab_animation_loops[_selectedTab]) + currentFrame = 0; - InvalidateWidget(WIDX_THEMES_SETTINGS_TAB + _selected_tab); + InvalidateWidget(WIDX_THEMES_SETTINGS_TAB + _selectedTab); } void OnPrepareDraw() override { - int32_t newPressedWidgets = pressed_widgets + int32_t newPressedWidgets = pressedWidgets & ~((1LL << WIDX_THEMES_SETTINGS_TAB) | (1LL << WIDX_THEMES_MAIN_UI_TAB) | (1LL << WIDX_THEMES_PARK_TAB) | (1LL << WIDX_THEMES_TOOLS_TAB) | (1LL << WIDX_THEMES_RIDE_PEEPS_TAB) | (1LL << WIDX_THEMES_EDITORS_TAB) | (1LL << WIDX_THEMES_MISC_TAB) | (1LL << WIDX_THEMES_PROMPTS_TAB) | (1LL << WIDX_THEMES_FEATURES_TAB)); - WidgetIndex widgetIndex = _selected_tab + WIDX_THEMES_SETTINGS_TAB; + WidgetIndex widgetIndex = _selectedTab + WIDX_THEMES_SETTINGS_TAB; - pressed_widgets = newPressedWidgets | (1 << widgetIndex); + pressedWidgets = newPressedWidgets | (1 << widgetIndex); auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Dropdown) == nullptr) @@ -319,7 +319,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_THEMES_LIST].right = width - 4; widgets[WIDX_THEMES_LIST].bottom = height - 0x0F; - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + if (_selectedTab == WINDOW_THEMES_TAB_SETTINGS) { widgets[WIDX_THEMES_HEADER_WINDOW].type = WidgetType::empty; widgets[WIDX_THEMES_HEADER_PALETTE].type = WidgetType::empty; @@ -336,7 +336,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WidgetType::button; widgets[WIDX_THEMES_COLOURBTN_MASK].type = WidgetType::empty; } - else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) + else if (_selectedTab == WINDOW_THEMES_TAB_FEATURES) { widgets[WIDX_THEMES_HEADER_WINDOW].type = WidgetType::empty; widgets[WIDX_THEMES_HEADER_PALETTE].type = WidgetType::empty; @@ -385,7 +385,7 @@ namespace OpenRCT2::Ui::Windows WindowDrawWidgets(*this, rt); WindowThemesDrawTabImages(rt); - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + if (_selectedTab == WINDOW_THEMES_TAB_SETTINGS) { DrawTextBasic( rt, windowPos + ScreenCoordsXY{ 10, widgets[WIDX_THEMES_PRESETS].top + 1 }, STR_THEMES_LABEL_CURRENT_THEME, @@ -423,11 +423,11 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_FEATURES_TAB: { auto newSelectedTab = widgetIndex - WIDX_THEMES_SETTINGS_TAB; - if (_selected_tab == newSelectedTab) + if (_selectedTab == newSelectedTab) break; - _selected_tab = static_cast(newSelectedTab); + _selectedTab = static_cast(newSelectedTab); scrolls[0].contentOffsetY = 0; - frame_no = 0; + currentFrame = 0; OnResize(); Invalidate(); break; @@ -613,7 +613,7 @@ namespace OpenRCT2::Ui::Windows ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) + if (_selectedTab == WINDOW_THEMES_TAB_SETTINGS || _selectedTab == WINDOW_THEMES_TAB_FEATURES) return {}; int32_t scrollHeight = GetTotalColoursUpTo(GetColourSchemeTabCount()) * (_button_size + 2); @@ -697,7 +697,7 @@ namespace OpenRCT2::Ui::Windows { ScreenCoordsXY screenCoords; - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) + if (_selectedTab == WINDOW_THEMES_TAB_SETTINGS || _selectedTab == WINDOW_THEMES_TAB_FEATURES) return; if (!colours[1].hasFlag(ColourFlag::translucent)) @@ -792,12 +792,12 @@ namespace OpenRCT2::Ui::Windows void WindowThemesInitVars() { - _selected_tab = WINDOW_THEMES_TAB_SETTINGS; + _selectedTab = WINDOW_THEMES_TAB_SETTINGS; } WindowClass GetWindowClassTabIndex(int32_t index) { - WindowClass* classes = window_themes_tab_classes[_selected_tab]; + WindowClass* classes = window_themes_tab_classes[_selectedTab]; return classes[index]; } @@ -862,7 +862,7 @@ namespace OpenRCT2::Ui::Windows int32_t GetColourSchemeTabCount() { - switch (_selected_tab) + switch (_selectedTab) { case 1: return sizeof(window_themes_tab_1_classes); @@ -887,8 +887,8 @@ namespace OpenRCT2::Ui::Windows for (int32_t i = 0; i < WINDOW_THEMES_TAB_COUNT; i++) { int32_t sprite_idx = window_themes_tab_sprites[i]; - if (_selected_tab == i) - sprite_idx += frame_no / window_themes_tab_animation_divisor[_selected_tab]; + if (_selectedTab == i) + sprite_idx += currentFrame / window_themes_tab_animation_divisor[_selectedTab]; GfxDrawSprite( rt, ImageId(sprite_idx), windowPos diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index b542162c46..b221cee126 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -754,15 +754,15 @@ static uint64_t PageDisabledWidgets[] = { void OnResize() override { - if (width < min_width) + if (width < minWidth) { Invalidate(); - width = min_width; + width = minWidth; } - if (height < min_height) + if (height < minHeight) { Invalidate(); - height = min_height; + height = minHeight; } } @@ -1768,20 +1768,20 @@ static uint64_t PageDisabledWidgets[] = { { auto index = EnumValue(tileInspectorPage) - 1; height -= PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3; - min_height -= PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3; + minHeight -= PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3; } if (p != TileInspectorPage::Default) { auto index = EnumValue(p) - 1; height += PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3; - min_height += PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3; + minHeight += PageGroupBoxSettings[index].details_top_offset - kGroupboxPadding - 3; } tileInspectorPage = p; auto pageIndex = EnumValue(p); SetWidgets(PageWidgets[pageIndex]); - hold_down_widgets = PageHoldDownWidgets[pageIndex]; - disabled_widgets = PageDisabledWidgets[pageIndex]; - pressed_widgets = 0; + holdDownWidgets = PageHoldDownWidgets[pageIndex]; + disabledWidgets = PageDisabledWidgets[pageIndex]; + pressedWidgets = 0; Invalidate(); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 1ae750d612..96dfce766f 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -735,15 +735,15 @@ namespace OpenRCT2::Ui::Windows if (mainWindow->viewport->zoom == ZoomLevel::min()) { - disabled_widgets |= (1uLL << WIDX_ZOOM_IN); + disabledWidgets |= (1uLL << WIDX_ZOOM_IN); } else if (mainWindow->viewport->zoom >= ZoomLevel::max()) { - disabled_widgets |= (1uLL << WIDX_ZOOM_OUT); + disabledWidgets |= (1uLL << WIDX_ZOOM_OUT); } else { - disabled_widgets &= ~((1uLL << WIDX_ZOOM_IN) | (1uLL << WIDX_ZOOM_OUT)); + disabledWidgets &= ~((1uLL << WIDX_ZOOM_IN) | (1uLL << WIDX_ZOOM_OUT)); } } @@ -752,12 +752,12 @@ namespace OpenRCT2::Ui::Windows bool paused = (gGamePaused & GAME_PAUSED_NORMAL); if (paused || _waitingForPause) { - pressed_widgets |= (1uLL << WIDX_PAUSE); + pressedWidgets |= (1uLL << WIDX_PAUSE); if (paused) _waitingForPause = false; } else - pressed_widgets &= ~(1uLL << WIDX_PAUSE); + pressedWidgets &= ~(1uLL << WIDX_PAUSE); } void ApplyMapRotation() @@ -790,9 +790,9 @@ namespace OpenRCT2::Ui::Windows // Footpath button pressed down auto* windowMgr = GetWindowManager(); if (windowMgr->FindByClass(WindowClass::Footpath) == nullptr) - pressed_widgets &= ~(1uLL << WIDX_PATH); + pressedWidgets &= ~(1uLL << WIDX_PATH); else - pressed_widgets |= (1uLL << WIDX_PATH); + pressedWidgets |= (1uLL << WIDX_PATH); } // TODO: look into using std::span diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 772fc390d4..8bedbc00a4 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -490,7 +490,7 @@ namespace OpenRCT2::Ui::Windows } else if (im.IsModifierKeyPressed(ModifierKey::shift)) { - uint16_t maxHeight = ZoomLevel::max().ApplyTo( + uint16_t newMaxHeight = ZoomLevel::max().ApplyTo( std::numeric_limits::max() - 32); _trackPlaceShiftZ = _trackPlaceShiftStart.y - screenCoords.y + 4; @@ -504,7 +504,7 @@ namespace OpenRCT2::Ui::Windows _trackPlaceShiftZ = floor2(_trackPlaceShiftZ, kCoordsZStep); // Clamp to maximum possible value of BaseHeight can offer. - _trackPlaceShiftZ = std::min(_trackPlaceShiftZ, maxHeight); + _trackPlaceShiftZ = std::min(_trackPlaceShiftZ, newMaxHeight); } else if (_trackPlaceShiftState) { diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 47132212f2..8640856008 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -109,9 +109,9 @@ namespace OpenRCT2::Ui::Windows } // Ensure that the selected item is still in the list. - if (static_cast(selected_list_item) >= _filteredTrackIds.size()) + if (static_cast(selectedListItem) >= _filteredTrackIds.size()) { - selected_list_item = 0; + selectedListItem = 0; } } @@ -225,10 +225,10 @@ namespace OpenRCT2::Ui::Windows _selectedItemIsBeingUpdated = false; _reloadTrackDesigns = false; // Start with first track highlighted - selected_list_item = 0; + selectedListItem = 0; if (_trackDesigns.size() != 0 && !(gLegacyScene == LegacyScene::trackDesignsManager)) { - selected_list_item = 1; + selectedListItem = 1; } gTrackDesignSceneryToggle = false; WindowPushOthersRight(*this); @@ -303,15 +303,15 @@ namespace OpenRCT2::Ui::Windows // Keep the highlighted item selected if (gLegacyScene == LegacyScene::trackDesignsManager) { - if (selected_list_item != -1 && _filteredTrackIds.size() > static_cast(selected_list_item)) - selected_list_item = _filteredTrackIds[selected_list_item]; + if (selectedListItem != -1 && _filteredTrackIds.size() > static_cast(selectedListItem)) + selectedListItem = _filteredTrackIds[selectedListItem]; else - selected_list_item = -1; + selectedListItem = -1; } else { - if (selected_list_item != 0) - selected_list_item = _filteredTrackIds[selected_list_item - 1] + 1; + if (selectedListItem != 0) + selectedListItem = _filteredTrackIds[selectedListItem - 1] + 1; } String::set(_filterString, sizeof(_filterString), ""); @@ -351,9 +351,9 @@ namespace OpenRCT2::Ui::Windows if (!_selectedItemIsBeingUpdated) { int32_t i = GetListItemFromPosition(screenCoords); - if (i != -1 && selected_list_item != i) + if (i != -1 && selectedListItem != i) { - selected_list_item = i; + selectedListItem = i; Invalidate(); } } @@ -399,25 +399,25 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP; } - if ((gLegacyScene == LegacyScene::trackDesignsManager) || selected_list_item != 0) + if ((gLegacyScene == LegacyScene::trackDesignsManager) || selectedListItem != 0) { - pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; - disabled_widgets &= ~(1uLL << WIDX_TRACK_PREVIEW); + pressedWidgets |= 1uLL << WIDX_TRACK_PREVIEW; + disabledWidgets &= ~(1uLL << WIDX_TRACK_PREVIEW); widgets[WIDX_ROTATE].type = WidgetType::flatBtn; widgets[WIDX_TOGGLE_SCENERY].type = WidgetType::flatBtn; if (gTrackDesignSceneryToggle) { - pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); + pressedWidgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); } else { - pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); + pressedWidgets |= (1uLL << WIDX_TOGGLE_SCENERY); } } else { - pressed_widgets &= ~(1uLL << WIDX_TRACK_PREVIEW); - disabled_widgets |= (1uLL << WIDX_TRACK_PREVIEW); + pressedWidgets &= ~(1uLL << WIDX_TRACK_PREVIEW); + disabledWidgets |= (1uLL << WIDX_TRACK_PREVIEW); widgets[WIDX_ROTATE].type = WidgetType::empty; widgets[WIDX_TOGGLE_SCENERY].type = WidgetType::empty; } @@ -443,7 +443,7 @@ namespace OpenRCT2::Ui::Windows if (_reloadTrackDesigns) { LoadDesignsList(_window_track_list_item); - selected_list_item = 0; + selectedListItem = 0; Invalidate(); _reloadTrackDesigns = false; } @@ -453,7 +453,7 @@ namespace OpenRCT2::Ui::Windows { DrawWidgets(rt); - int32_t listItemIndex = selected_list_item; + int32_t listItemIndex = selectedListItem; if ((gLegacyScene == LegacyScene::trackDesignsManager) == 0) { // Because the first item in the list is "Build a custom design", lower the index by one @@ -690,7 +690,7 @@ namespace OpenRCT2::Ui::Windows { // Build custom track item StringId stringId; - if (listIndex == static_cast(selected_list_item)) + if (listIndex == static_cast(selectedListItem)) { // Highlight GfxFilterRect( @@ -715,7 +715,7 @@ namespace OpenRCT2::Ui::Windows if (screenCoords.y + kScrollableRowHeight >= rt.y && screenCoords.y < rt.y + rt.height) { StringId stringId; - if (listIndex == static_cast(selected_list_item)) + if (listIndex == static_cast(selectedListItem)) { // Highlight GfxFilterRect( diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index f9753f0c97..aebabb98e8 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -114,8 +114,8 @@ namespace OpenRCT2::Ui::Windows uint32_t wflags = 0; WindowBase* w = WindowGetMain(); - pressed_widgets = 0; - disabled_widgets = 0; + pressedWidgets = 0; + disabledWidgets = 0; if (w != nullptr) wflags = w->viewport->flags; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 186b126385..17aeddcbfc 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -283,11 +283,11 @@ namespace OpenRCT2::Ui::Windows if (IsActive()) { - this->pressed_widgets |= 1uLL << WIDX_CLIP_SELECTOR; + this->pressedWidgets |= 1uLL << WIDX_CLIP_SELECTOR; } else { - this->pressed_widgets &= ~(1uLL << WIDX_CLIP_SELECTOR); + this->pressedWidgets &= ~(1uLL << WIDX_CLIP_SELECTOR); } } @@ -364,7 +364,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(_viewClippingWidgets); - this->hold_down_widgets = (1uLL << WIDX_CLIP_HEIGHT_INCREASE) | (1uL << WIDX_CLIP_HEIGHT_DECREASE); + this->holdDownWidgets = (1uLL << WIDX_CLIP_HEIGHT_INCREASE) | (1uL << WIDX_CLIP_HEIGHT_DECREASE); WindowInitScrollWidgets(*this); _clipHeightDisplayType = DisplayType::DisplayUnits; diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 9f099b1bfa..c5b7866d83 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -163,13 +163,13 @@ namespace OpenRCT2::Ui::Windows int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); - max_width = (screenWidth * 4) / 5; - max_height = (screenHeight * 4) / 5; + maxWidth = (screenWidth * 4) / 5; + maxHeight = (screenHeight * 4) / 5; - min_width = kWindowSize.width; - min_height = kWindowSize.height; + minWidth = kWindowSize.width; + minHeight = kWindowSize.height; - WindowSetResize(*this, { min_width, min_height }, { max_width, max_height }); + WindowSetResize(*this, { minWidth, minHeight }, { maxWidth, maxHeight }); } void OnPrepareDraw() override @@ -189,11 +189,11 @@ namespace OpenRCT2::Ui::Windows Formatter::Common().Add(number); // Set disabled widgets - disabled_widgets = 0; + disabledWidgets = 0; if (viewport != nullptr && viewport->zoom == ZoomLevel::min()) - disabled_widgets |= 1uLL << WIDX_ZOOM_IN; + disabledWidgets |= 1uLL << WIDX_ZOOM_IN; if (viewport != nullptr && viewport->zoom >= ZoomLevel::max()) - disabled_widgets |= 1uLL << WIDX_ZOOM_OUT; + disabledWidgets |= 1uLL << WIDX_ZOOM_OUT; if (viewport != nullptr) { diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 3d274ad7c9..977b83a24e 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -59,7 +59,7 @@ namespace OpenRCT2::Ui::Windows { SetWidgets(_waterWidgets); - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + holdDownWidgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); WindowPushOthersBelow(*this); diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index f50620034f..2321b64a0a 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -282,7 +282,7 @@ namespace OpenRCT2::GameActions if (rideEntry == nullptr) continue; - int32_t maxHeight = rideEntry->max_height; + int32_t maxHeight = rideEntry->maxHeight; if (maxHeight == 0) { maxHeight = ride->getRideTypeDescriptor().Heights.MaxHeight; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 3715322f05..c15274e8bb 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -371,9 +371,9 @@ namespace OpenRCT2::GameActions { uint16_t maxHeight; - if (rtd.HasFlag(RtdFlag::listVehiclesSeparately) && rideEntry->max_height != 0) + if (rtd.HasFlag(RtdFlag::listVehiclesSeparately) && rideEntry->maxHeight != 0) { - maxHeight = rideEntry->max_height; + maxHeight = rideEntry->maxHeight; } else { diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 40af28e14f..961b77a09d 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -207,7 +207,7 @@ namespace OpenRCT2 viewport->isVisible = w.isVisible; CoordsXYZ centrePos = focus.GetPos(); - w.viewport_target_sprite = std::visit( + w.viewportTargetSprite = std::visit( [](auto&& arg) { using T = std::decay_t; if constexpr (std::is_same_v) @@ -532,7 +532,7 @@ namespace OpenRCT2 static void ViewportSetUndergroundFlag(int32_t underground, WindowBase* window, Viewport* viewport) { if ((window->classification != WindowClass::MainWindow && window->classification != WindowClass::Viewport) - || (window->classification == WindowClass::MainWindow && !window->viewport_smart_follow_sprite.IsNull())) + || (window->classification == WindowClass::MainWindow && !window->viewportSmartFollowSprite.IsNull())) { if (!underground) { @@ -566,12 +566,12 @@ namespace OpenRCT2 if (viewport == nullptr) return; - if (!window->viewport_smart_follow_sprite.IsNull()) + if (!window->viewportSmartFollowSprite.IsNull()) { ViewportUpdateSmartFollowEntity(window); } - if (!window->viewport_target_sprite.IsNull()) + if (!window->viewportTargetSprite.IsNull()) { ViewportUpdateFollowSprite(window); return; @@ -661,9 +661,9 @@ namespace OpenRCT2 void ViewportUpdateFollowSprite(WindowBase* window) { - if (!window->viewport_target_sprite.IsNull() && window->viewport != nullptr) + if (!window->viewportTargetSprite.IsNull() && window->viewport != nullptr) { - auto* sprite = getGameState().entities.GetEntity(window->viewport_target_sprite); + auto* sprite = getGameState().entities.GetEntity(window->viewportTargetSprite); if (sprite == nullptr) { return; @@ -687,11 +687,11 @@ namespace OpenRCT2 void ViewportUpdateSmartFollowEntity(WindowBase* window) { - auto entity = getGameState().entities.TryGetEntity(window->viewport_smart_follow_sprite); + auto entity = getGameState().entities.TryGetEntity(window->viewportSmartFollowSprite); if (entity == nullptr || entity->Type == EntityType::Null) { - window->viewport_smart_follow_sprite = EntityId::GetNull(); - window->viewport_target_sprite = EntityId::GetNull(); + window->viewportSmartFollowSprite = EntityId::GetNull(); + window->viewportTargetSprite = EntityId::GetNull(); return; } @@ -722,8 +722,8 @@ namespace OpenRCT2 break; } default: // All other types don't need any "smart" following; steam particle, duck, money effect, etc. - window->focus = Focus(window->viewport_smart_follow_sprite); - window->viewport_target_sprite = window->viewport_smart_follow_sprite; + window->focus = Focus(window->viewportSmartFollowSprite); + window->viewportTargetSprite = window->viewportSmartFollowSprite; break; } } @@ -731,12 +731,12 @@ namespace OpenRCT2 void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest& peep) { Focus focus = Focus(peep.Id); - window->viewport_target_sprite = peep.Id; + window->viewportTargetSprite = peep.Id; if (peep.State == PeepState::Picked) { - window->viewport_smart_follow_sprite = EntityId::GetNull(); - window->viewport_target_sprite = EntityId::GetNull(); + window->viewportSmartFollowSprite = EntityId::GetNull(); + window->viewportTargetSprite = EntityId::GetNull(); window->focus = std::nullopt; // No focus return; } @@ -756,7 +756,7 @@ namespace OpenRCT2 { focus = Focus(car->Id); overallFocus = false; - window->viewport_target_sprite = car->Id; + window->viewportTargetSprite = car->Id; } } } @@ -773,7 +773,7 @@ namespace OpenRCT2 coordFocus.y = xy.y; coordFocus.z = TileElementHeight(xy) + (4 * kCoordsZStep); focus = Focus(coordFocus); - window->viewport_target_sprite = EntityId::GetNull(); + window->viewportTargetSprite = EntityId::GetNull(); } } @@ -784,20 +784,20 @@ namespace OpenRCT2 { if (peep.State == PeepState::Picked) { - window->viewport_smart_follow_sprite = EntityId::GetNull(); - window->viewport_target_sprite = EntityId::GetNull(); + window->viewportSmartFollowSprite = EntityId::GetNull(); + window->viewportTargetSprite = EntityId::GetNull(); window->focus = std::nullopt; return; } - window->focus = Focus(window->viewport_smart_follow_sprite); - window->viewport_target_sprite = window->viewport_smart_follow_sprite; + window->focus = Focus(window->viewportSmartFollowSprite); + window->viewportTargetSprite = window->viewportSmartFollowSprite; } void ViewportUpdateSmartFollowVehicle(WindowBase* window) { - window->focus = Focus(window->viewport_smart_follow_sprite); - window->viewport_target_sprite = window->viewport_smart_follow_sprite; + window->focus = Focus(window->viewportSmartFollowSprite); + window->viewportTargetSprite = window->viewportSmartFollowSprite; } static void ViewportRotateSingleInternal(WindowBase& w, int32_t direction) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 1d2394734f..edaf9abcfc 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -401,7 +401,7 @@ static constexpr float kWindowScrollLocations[][2] = { } // rct2: 0x006E7C76 - if (w.viewport_target_sprite.IsNull()) + if (w.viewportTargetSprite.IsNull()) { if (!(w.flags & WF_NO_SCROLLING)) { @@ -877,14 +877,14 @@ static constexpr float kWindowScrollLocations[][2] = { { if (spriteIndex.ToUnderlying() < kMaxEntities || spriteIndex.IsNull()) { - w.viewport_smart_follow_sprite = spriteIndex; + w.viewportSmartFollowSprite = spriteIndex; } } void WindowUnfollowSprite(WindowBase& w) { - w.viewport_smart_follow_sprite = EntityId::GetNull(); - w.viewport_target_sprite = EntityId::GetNull(); + w.viewportSmartFollowSprite = EntityId::GetNull(); + w.viewportTargetSprite = EntityId::GetNull(); } Viewport* WindowGetViewport(WindowBase* w) diff --git a/src/openrct2/interface/WindowBase.cpp b/src/openrct2/interface/WindowBase.cpp index 5db2a2fff4..ca4553ef3f 100644 --- a/src/openrct2/interface/WindowBase.cpp +++ b/src/openrct2/interface/WindowBase.cpp @@ -123,8 +123,8 @@ namespace OpenRCT2 closeButton.bottom += heightDifference; height += heightDifference; - min_height += heightDifference; - max_height += heightDifference; + minHeight += heightDifference; + maxHeight += heightDifference; Invalidate(); diff --git a/src/openrct2/interface/WindowBase.h b/src/openrct2/interface/WindowBase.h index e874bc0410..3851afe191 100644 --- a/src/openrct2/interface/WindowBase.h +++ b/src/openrct2/interface/WindowBase.h @@ -72,17 +72,17 @@ namespace OpenRCT2 struct WindowBase { Viewport* viewport{}; - uint64_t disabled_widgets{}; - uint64_t pressed_widgets{}; - uint64_t hold_down_widgets{}; + uint64_t disabledWidgets{}; + uint64_t pressedWidgets{}; + uint64_t holdDownWidgets{}; std::vector widgets{}; ScreenCoordsXY windowPos; int16_t width{}; int16_t height{}; - int16_t min_width{}; - int16_t max_width{}; - int16_t min_height{}; - int16_t max_height{}; + int16_t minWidth{}; + int16_t maxWidth{}; + int16_t minHeight{}; + int16_t maxHeight{}; union { WindowNumber number{}; @@ -90,24 +90,24 @@ namespace OpenRCT2 }; WindowFlags flags{}; OpenRCT2::ScrollArea scrolls[3]; - uint16_t no_list_items{}; // 0 for no items - int16_t selected_list_item{}; // -1 for none selected + uint16_t numListItems{}; // 0 for no items + int16_t selectedListItem{}; // -1 for none selected std::optional focus; union { int16_t page{}; TileInspectorPage tileInspectorPage; }; - uint16_t frame_no{}; // updated every tic for motion in windows sprites - uint16_t list_information_type{}; // 0 for none - int16_t picked_peep_frame; // Animation frame of picked peep in staff window and guest window - int16_t selected_tab{}; - EntityId viewport_target_sprite{ EntityId::GetNull() }; + uint16_t currentFrame{}; // updated every tic for motion in windows sprites + uint16_t listInformationType{}; // 0 for none + int16_t pickedPeepFrame; // Animation frame of picked peep in staff window and guest window + int16_t selectedTab{}; + EntityId viewportTargetSprite{ EntityId::GetNull() }; ScreenCoordsXY savedViewPos{}; WindowClass classification{}; ColourWithFlags colours[6]{}; bool isVisible = true; - EntityId viewport_smart_follow_sprite{ EntityId::GetNull() }; // Handles setting viewport target sprite etc + EntityId viewportSmartFollowSprite{ EntityId::GetNull() }; // Handles setting viewport target sprite etc void SetViewportLocation(const CoordsXYZ& coords); void Invalidate(); @@ -128,7 +128,7 @@ namespace OpenRCT2 constexpr bool canBeResized() const { - return (flags & WF_RESIZABLE) && (min_width != max_width || min_height != max_height); + return (flags & WF_RESIZABLE) && (minWidth != maxWidth || minHeight != maxHeight); } // Events diff --git a/src/openrct2/object/LargeSceneryEntry.h b/src/openrct2/object/LargeSceneryEntry.h index c78ea40e28..a20408ae53 100644 --- a/src/openrct2/object/LargeSceneryEntry.h +++ b/src/openrct2/object/LargeSceneryEntry.h @@ -49,7 +49,7 @@ namespace OpenRCT2 { int16_t x, y; } offset[2]; // 0x0 - uint16_t max_width; // 0x8 + uint16_t maxWidth; // 0x8 uint16_t PadA; // 0xA uint8_t flags; // 0xC uint8_t num_images; // 0xD @@ -100,7 +100,7 @@ namespace OpenRCT2 struct LargeSceneryText { CoordsXY offset[2]; - uint16_t max_width; + uint16_t maxWidth; uint8_t flags; uint16_t num_images; LargeSceneryTextGlyph glyphs[256]; diff --git a/src/openrct2/object/LargeSceneryObject.cpp b/src/openrct2/object/LargeSceneryObject.cpp index 5cde609e1e..210df13341 100644 --- a/src/openrct2/object/LargeSceneryObject.cpp +++ b/src/openrct2/object/LargeSceneryObject.cpp @@ -31,7 +31,7 @@ namespace OpenRCT2 _3dFontLegacy.offset[0].y = stream.ReadValue(); _3dFontLegacy.offset[1].x = stream.ReadValue(); _3dFontLegacy.offset[1].y = stream.ReadValue(); - _3dFontLegacy.max_width = stream.ReadValue(); + _3dFontLegacy.maxWidth = stream.ReadValue(); stream.ReadValue(); _3dFontLegacy.flags = stream.ReadValue(); _3dFontLegacy.num_images = stream.ReadValue(); @@ -286,7 +286,7 @@ namespace OpenRCT2 std::copy_n(offsets.data(), numOffsets, font->offset); } - font->max_width = Json::GetNumber(j3dFont["maxWidth"]); + font->maxWidth = Json::GetNumber(j3dFont["maxWidth"]); font->num_images = Json::GetNumber(j3dFont["numImages"]); font->flags = Json::GetFlags( diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index e004e33f20..e79d10f9af 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -164,7 +164,7 @@ namespace OpenRCT2 _legacyType.excitement_multiplier = stream->ReadValue(); _legacyType.intensity_multiplier = stream->ReadValue(); _legacyType.nausea_multiplier = stream->ReadValue(); - _legacyType.max_height = stream->ReadValue(); + _legacyType.maxHeight = stream->ReadValue(); // Skipping a uint64_t for the enabled track pieces and two uint8_ts for the categories. stream->Seek(10, STREAM_SEEK_CURRENT); _legacyType.shop_item[0] = static_cast(stream->ReadValue()); @@ -547,7 +547,7 @@ namespace OpenRCT2 _legacyType.ride_type[i] = rideType; } - _legacyType.max_height = Json::GetNumber(properties["maxHeight"]); + _legacyType.maxHeight = Json::GetNumber(properties["maxHeight"]); _legacyType.Clearance = Json::GetNumber(properties["clearance"], GetDefaultClearance()); // This needs to be set for both shops/facilities _and_ regular rides. diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 40028affbc..22a9da89ba 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -94,7 +94,7 @@ static std::string_view LargeSceneryCalculateDisplayText(const LargeSceneryText& size_t totalSize = 0; CodepointView view(s); auto it = view.begin(); - while (it != view.end() && totalSize <= text.max_width) + while (it != view.end() && totalSize <= text.maxWidth) { auto glyph = text.GetGlyph(*it, ' '); totalSize += height ? glyph.height : glyph.width; @@ -181,7 +181,7 @@ static bool Is3DTextSingleLine(const LargeSceneryText& text, std::string_view s) if (text.flags & LARGE_SCENERY_TEXT_FLAG_TWO_LINE) { auto width = text.MeasureWidth(s); - return width <= text.max_width; + return width <= text.maxWidth; } return true; } @@ -273,7 +273,7 @@ static void PaintLargeScenery3DText( lastWhitespaceIndex = it.GetIndex(); } - if (lineWidth > text->max_width) + if (lineWidth > text->maxWidth) { break; } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 388cecc6eb..dcfef2233e 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -184,26 +184,26 @@ static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoor const TileElement* element = tile_element; // push tile_element - uint16_t max_height = 0; + uint16_t maxHeight = 0; do { - max_height = std::max(max_height, static_cast(element->GetClearanceZ())); + maxHeight = std::max(maxHeight, static_cast(element->GetClearanceZ())); } while (!(element++)->IsLastForTile()); element--; if (element->GetType() == TileElementType::Surface && (element->AsSurface()->GetWaterHeight() > 0)) { - max_height = std::max(max_height, static_cast(element->AsSurface()->GetWaterHeight())); + maxHeight = std::max(maxHeight, static_cast(element->AsSurface()->GetWaterHeight())); } if (partOfVirtualFloor) { // We must pretend this tile is at least as tall as the virtual floor - max_height = std::max(max_height, VirtualFloorGetHeight()); + maxHeight = std::max(maxHeight, VirtualFloorGetHeight()); } - if (screenMinY - (max_height + 32) >= session.DPI.WorldY() + session.DPI.WorldHeight()) + if (screenMinY - (maxHeight + 32) >= session.DPI.WorldY() + session.DPI.WorldHeight()) return; session.SpritePosition.x = coords.x; diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index cf43d5b401..d64ef7f3de 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -68,7 +68,7 @@ struct RideObjectEntry int8_t excitement_multiplier; int8_t intensity_multiplier; int8_t nausea_multiplier; - uint8_t max_height; + uint8_t maxHeight; ShopItem shop_item[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]; StringId capacity; uint8_t Clearance; diff --git a/src/openrct2/scripting/bindings/object/ScObject.hpp b/src/openrct2/scripting/bindings/object/ScObject.hpp index e81c2e7a41..10053f72d7 100644 --- a/src/openrct2/scripting/bindings/object/ScObject.hpp +++ b/src/openrct2/scripting/bindings/object/ScObject.hpp @@ -733,7 +733,7 @@ namespace OpenRCT2::Scripting auto entry = GetEntry(); if (entry != nullptr) { - return entry->max_height; + return entry->maxHeight; } return 0; } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index bf13ff81db..5bee0dd662 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -947,14 +947,14 @@ uint8_t MapGetLowestLandHeight(const MapRange& range) MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), std::min(range.GetRight(), mapSizeMax.x), std::min(range.GetBottom(), mapSizeMax.y) }; - uint8_t min_height = 0xFF; + uint8_t minHeight = 0xFF; for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += kCoordsXYStep) { for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += kCoordsXYStep) { auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); - if (surfaceElement != nullptr && min_height > surfaceElement->BaseHeight) + if (surfaceElement != nullptr && minHeight > surfaceElement->BaseHeight) { if (gLegacyScene != LegacyScene::scenarioEditor && !getGameState().cheats.sandboxMode) { @@ -964,11 +964,11 @@ uint8_t MapGetLowestLandHeight(const MapRange& range) } } - min_height = surfaceElement->BaseHeight; + minHeight = surfaceElement->BaseHeight; } } } - return min_height; + return minHeight; } uint8_t MapGetHighestLandHeight(const MapRange& range) @@ -977,7 +977,7 @@ uint8_t MapGetHighestLandHeight(const MapRange& range) MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), std::min(range.GetRight(), mapSizeMax.x), std::min(range.GetBottom(), mapSizeMax.y) }; - uint8_t max_height = 0; + uint8_t maxHeight = 0; for (int32_t yi = validRange.GetTop(); yi <= validRange.GetBottom(); yi += kCoordsXYStep) { for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += kCoordsXYStep) @@ -998,12 +998,12 @@ uint8_t MapGetHighestLandHeight(const MapRange& range) BaseHeight += 2; if (surfaceElement->GetSlope() & kTileSlopeDiagonalFlag) BaseHeight += 2; - if (max_height < BaseHeight) - max_height = BaseHeight; + if (maxHeight < BaseHeight) + maxHeight = BaseHeight; } } } - return max_height; + return maxHeight; } /** diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 5b523afec9..8e3b78ebfc 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -75,7 +75,7 @@ LargeSceneryText::LargeSceneryText(const RCTLargeSceneryText& original) offset[i].x = original.offset[i].x; offset[i].y = original.offset[i].y; } - max_width = original.max_width; + maxWidth = original.maxWidth; flags = original.flags; num_images = original.num_images; for (size_t i = 0; i < std::size(original.glyphs); i++)