diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index 672f51a375..e482c71242 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -78,7 +78,7 @@ private: SDL_Window* _window = nullptr; int32_t _width = 0; int32_t _height = 0; - ScaleQuality _scaleQuality = ScaleQuality::NearestNeighbour; + ScaleQuality _scaleQuality = ScaleQuality::nearestNeighbour; std::vector _fsResolutions; @@ -602,16 +602,16 @@ public: void TriggerResize() override { char scaleQualityBuffer[4]; - _scaleQuality = ScaleQuality::SmoothNearestNeighbour; + _scaleQuality = ScaleQuality::smoothNearestNeighbour; if (Config::Get().general.windowScale == std::floor(Config::Get().general.windowScale)) { - _scaleQuality = ScaleQuality::NearestNeighbour; + _scaleQuality = ScaleQuality::nearestNeighbour; } ScaleQuality scaleQuality = _scaleQuality; - if (_scaleQuality == ScaleQuality::SmoothNearestNeighbour) + if (_scaleQuality == ScaleQuality::smoothNearestNeighbour) { - scaleQuality = ScaleQuality::Linear; + scaleQuality = ScaleQuality::linear; } snprintf(scaleQualityBuffer, sizeof(scaleQualityBuffer), "%d", static_cast(scaleQuality)); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer); diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 801c8c5cf1..8fb71f40a8 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -1050,7 +1050,7 @@ public: if (gLegacyScene == LegacyScene::scenarioEditor) { - if (getGameState().editorStep != EditorStep::LandscapeEditor) + if (getGameState().editorStep != EditorStep::landscapeEditor) return; } diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index 80f085aa15..c032c4a931 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -125,9 +125,9 @@ public: } ScaleQuality scaleQuality = GetContext()->GetUiContext().GetScaleQuality(); - if (scaleQuality == ScaleQuality::SmoothNearestNeighbour) + if (scaleQuality == ScaleQuality::smoothNearestNeighbour) { - scaleQuality = ScaleQuality::Linear; + scaleQuality = ScaleQuality::linear; smoothNN = true; } else diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 218aa7eec0..b3d18c1082 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -605,11 +605,11 @@ private: _screenFramebuffer = std::make_unique(_window); _smoothScaleFramebuffer.reset(); _scaleFramebuffer.reset(); - if (GetContext()->GetUiContext().GetScaleQuality() != ScaleQuality::NearestNeighbour) + if (GetContext()->GetUiContext().GetScaleQuality() != ScaleQuality::nearestNeighbour) { _scaleFramebuffer = std::make_unique(_width, _height, false, false); } - if (GetContext()->GetUiContext().GetScaleQuality() == ScaleQuality::SmoothNearestNeighbour) + if (GetContext()->GetUiContext().GetScaleQuality() == ScaleQuality::smoothNearestNeighbour) { uint32_t scale = std::ceil(Config::Get().general.windowScale); _smoothScaleFramebuffer = std::make_unique(_width * scale, _height * scale, false, false); diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index f3a22f8353..6e15df855c 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -265,7 +265,7 @@ void InputManager::handleViewScrolling() // Mouse edge scrolling if (Config::Get().general.edgeScrolling) { - if (InputGetState() != InputState::Normal) + if (InputGetState() != InputState::normal) return; if (isModifierKeyPressed(ModifierKey::shift) || isModifierKeyPressed(ModifierKey::ctrl)) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 5ababb50d2..8a2e653696 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -175,7 +175,7 @@ namespace OpenRCT2 */ static void InputScrollDragBegin(const ScreenCoordsXY& screenCoords, WindowBase* w, WidgetIndex widgetIndex) { - _inputState = InputState::ScrollRight; + _inputState = InputState::scrollRight; gInputDragLast = screenCoords; _dragWidget.windowClassification = w->classification; _dragWidget.windowNumber = w->number; @@ -244,7 +244,7 @@ namespace OpenRCT2 if (w == nullptr) { ContextShowCursor(); - _inputState = InputState::Reset; + _inputState = InputState::reset; return; } @@ -258,7 +258,7 @@ namespace OpenRCT2 } break; case MouseState::rightRelease: - _inputState = InputState::Reset; + _inputState = InputState::reset; ContextShowCursor(); break; case MouseState::leftPress: @@ -288,10 +288,10 @@ namespace OpenRCT2 switch (_inputState) { - case InputState::Reset: + case InputState::reset: WindowTooltipReset(screenCoords); [[fallthrough]]; - case InputState::Normal: + case InputState::normal: switch (state) { case MouseState::released: @@ -333,14 +333,14 @@ namespace OpenRCT2 break; } break; - case InputState::WidgetPressed: + case InputState::widgetPressed: InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget); break; - case InputState::PositioningWindow: + case InputState::positioningWindow: w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { - _inputState = InputState::Reset; + _inputState = InputState::reset; } else { @@ -351,7 +351,7 @@ namespace OpenRCT2 } } break; - case InputState::ViewportRight: + case InputState::viewportRight: if (state == MouseState::released) { InputViewportDragContinue(); @@ -366,14 +366,14 @@ namespace OpenRCT2 } } break; - case InputState::DropdownActive: + case InputState::dropdownActive: InputStateWidgetPressed(screenCoords, state, widgetIndex, w, widget); break; - case InputState::ViewportLeft: + case InputState::viewportLeft: w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { - _inputState = InputState::Reset; + _inputState = InputState::reset; break; } @@ -382,7 +382,7 @@ namespace OpenRCT2 case MouseState::released: if (w->viewport == nullptr) { - _inputState = InputState::Reset; + _inputState = InputState::reset; break; } @@ -404,7 +404,7 @@ namespace OpenRCT2 w->onToolDrag(gCurrentToolWidget.widgetIndex, screenCoords); break; case MouseState::leftRelease: - _inputState = InputState::Reset; + _inputState = InputState::reset; if (_dragWidget.windowNumber == w->number) { if (gInputFlags.has(InputFlag::toolActive)) @@ -429,7 +429,7 @@ namespace OpenRCT2 break; } break; - case InputState::ScrollLeft: + case InputState::scrollLeft: switch (state) { case MouseState::released: @@ -445,11 +445,11 @@ namespace OpenRCT2 break; } break; - case InputState::Resizing: + case InputState::resizing: w = windowMgr->FindByNumber(_dragWidget.windowClassification, _dragWidget.windowNumber); if (w == nullptr) { - _inputState = InputState::Reset; + _inputState = InputState::reset; } else { @@ -463,7 +463,7 @@ namespace OpenRCT2 } } break; - case InputState::ScrollRight: + case InputState::scrollRight: InputScrollRight(screenCoords, state); break; } @@ -473,7 +473,7 @@ namespace OpenRCT2 void InputWindowPositionBegin(WindowBase& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { - _inputState = InputState::PositioningWindow; + _inputState = InputState::positioningWindow; gInputDragLast = screenCoords - w.windowPos; _dragWidget.windowClassification = w.classification; _dragWidget.windowNumber = w.number; @@ -489,7 +489,7 @@ namespace OpenRCT2 static void InputWindowPositionEnd(WindowBase& w, const ScreenCoordsXY& screenCoords) { - _inputState = InputState::Normal; + _inputState = InputState::normal; gTooltipCloseTimeout = 0; gTooltipWidget = _dragWidget; w.onMoved(screenCoords); @@ -497,7 +497,7 @@ namespace OpenRCT2 static void InputWindowResizeBegin(WindowBase& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { - _inputState = InputState::Resizing; + _inputState = InputState::resizing; gInputDragLast = screenCoords; _dragWidget.windowClassification = w.classification; _dragWidget.windowNumber = w.number; @@ -520,7 +520,7 @@ namespace OpenRCT2 static void InputWindowResizeEnd() { - _inputState = InputState::Normal; + _inputState = InputState::normal; gTooltipCloseTimeout = 0; gTooltipWidget = _dragWidget; } @@ -532,7 +532,7 @@ namespace OpenRCT2 static void InputViewportDragBegin(WindowBase& w) { w.flags.unset(WindowFlag::scrollingToLocation); - _inputState = InputState::ViewportRight; + _inputState = InputState::viewportRight; _dragWidget.windowClassification = w.classification; _dragWidget.windowNumber = w.number; _ticksSinceDragStart = gCurrentRealTimeTicks; @@ -578,7 +578,7 @@ namespace OpenRCT2 if (viewport == nullptr) { ContextShowCursor(); - _inputState = InputState::Reset; + _inputState = InputState::reset; } else if (differentialCoords.x != 0 || differentialCoords.y != 0) { @@ -627,7 +627,7 @@ namespace OpenRCT2 static void InputViewportDragEnd() { - _inputState = InputState::Reset; + _inputState = InputState::reset; ContextShowCursor(); } @@ -639,7 +639,7 @@ namespace OpenRCT2 { const auto& widget = w.widgets[widgetIndex]; - _inputState = InputState::ScrollLeft; + _inputState = InputState::scrollLeft; gPressedWidget.windowClassification = w.classification; gPressedWidget.windowNumber = w.number; gPressedWidget.widgetIndex = widgetIndex; @@ -766,7 +766,7 @@ namespace OpenRCT2 static void InputScrollEnd() { - _inputState = InputState::Reset; + _inputState = InputState::reset; InvalidateScroll(); } @@ -1072,7 +1072,7 @@ namespace OpenRCT2 InputWindowResizeBegin(*w, widgetIndex, screenCoords); break; case WidgetType::viewport: - _inputState = InputState::ViewportLeft; + _inputState = InputState::viewportLeft; gInputDragLast = screenCoords; _dragWidget.windowClassification = windowClass; _dragWidget.windowNumber = windowNumber; @@ -1124,7 +1124,7 @@ namespace OpenRCT2 gPressedWidget.windowNumber = windowNumber; gPressedWidget.widgetIndex = widgetIndex; gInputFlags.set(InputFlag::widgetPressed); - _inputState = InputState::WidgetPressed; + _inputState = InputState::widgetPressed; _clickRepeatTicks = gCurrentRealTimeTicks; windowMgr->InvalidateWidgetByNumber(windowClass, windowNumber, widgetIndex); @@ -1225,7 +1225,7 @@ namespace OpenRCT2 if (w == nullptr) ToolCancel(); - else if (InputGetState() != InputState::ViewportRight) + else if (InputGetState() != InputState::viewportRight) w->onToolUpdate(gCurrentToolWidget.widgetIndex, screenCoords); } } @@ -1247,7 +1247,7 @@ namespace OpenRCT2 WindowBase* cursor_w = windowMgr->FindByNumber(cursor_w_class, cursor_w_number); if (cursor_w == nullptr) { - _inputState = InputState::Reset; + _inputState = InputState::reset; return; } @@ -1309,7 +1309,7 @@ namespace OpenRCT2 if (gInputFlags.has(InputFlag::widgetPressed)) { - if (_inputState == InputState::DropdownActive) + if (_inputState == InputState::dropdownActive) { gDropdown.highlightedIndex = gDropdown.defaultIndex; windowMgr->InvalidateByClass(WindowClass::dropdown); @@ -1322,7 +1322,7 @@ namespace OpenRCT2 return; case MouseState::leftRelease: case MouseState::rightPress: - if (_inputState == InputState::DropdownActive) + if (_inputState == InputState::dropdownActive) { if (w != nullptr) { @@ -1376,7 +1376,7 @@ namespace OpenRCT2 windowMgr->InvalidateWidgetByNumber(cursor_w_class, cursor_w_number, cursor_widgetIndex); } - _inputState = InputState::Normal; + _inputState = InputState::normal; gTooltipCloseTimeout = 0; gTooltipWidget.widgetIndex = cursor_widgetIndex; gTooltipWidget.windowClassification = cursor_w_class; @@ -1394,7 +1394,7 @@ namespace OpenRCT2 } } - _inputState = InputState::Normal; + _inputState = InputState::normal; if (state == MouseState::rightPress) { @@ -1429,7 +1429,7 @@ namespace OpenRCT2 } _clickRepeatTicks = std::nullopt; - if (_inputState != InputState::DropdownActive) + if (_inputState != InputState::dropdownActive) { // Hold down widget and drag outside of area?? if (gInputFlags.has(InputFlag::widgetPressed)) @@ -1543,7 +1543,7 @@ namespace OpenRCT2 void SetCursor(CursorID cursor_id) { assert(cursor_id != CursorID::Undefined); - if (_inputState == InputState::Resizing) + if (_inputState == InputState::resizing) { cursor_id = CursorID::DiagonalArrows; } diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 73e96cbea1..b09eb638d5 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -199,7 +199,7 @@ static void ShortcutAdjustLand() if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor) return; if (isInTrackDesignerOrManager()) @@ -213,7 +213,7 @@ static void ShortcutAdjustWater() if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor) return; if (isInTrackDesignerOrManager()) @@ -227,7 +227,7 @@ static void ShortcutBuildScenery() if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor) return; if (isInTrackDesignerOrManager()) @@ -241,7 +241,7 @@ static void ShortcutBuildPaths() if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor) return; if (isInTrackDesignerOrManager()) @@ -343,7 +343,7 @@ static void ShortcutShowMap() if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene != LegacyScene::scenarioEditor || getGameState().editorStep == EditorStep::LandscapeEditor) + if (gLegacyScene != LegacyScene::scenarioEditor || getGameState().editorStep == EditorStep::landscapeEditor) if (!(isInTrackDesignerOrManager())) ContextOpenWindow(WindowClass::map); } @@ -400,7 +400,7 @@ static void ShortcutClearScenery() if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor) return; if (isInTrackDesignerOrManager()) @@ -440,7 +440,7 @@ static void ShortcutOpenSceneryPicker() { if ((gLegacyScene == LegacyScene::titleSequence || gLegacyScene == LegacyScene::trackDesigner || gLegacyScene == LegacyScene::trackDesignsManager) - || (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor)) + || (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor)) return; auto* windowMgr = GetWindowManager(); @@ -762,7 +762,7 @@ void ShortcutManager::registerDefaultShortcuts() { windowMgr->CloseAll(); } - else if (getGameState().editorStep == EditorStep::LandscapeEditor) + else if (getGameState().editorStep == EditorStep::landscapeEditor) { windowMgr->CloseTop(); } diff --git a/src/openrct2-ui/interface/FileBrowser.cpp b/src/openrct2-ui/interface/FileBrowser.cpp index 0fc8c9b2c7..3602768dc5 100644 --- a/src/openrct2-ui/interface/FileBrowser.cpp +++ b/src/openrct2-ui/interface/FileBrowser.cpp @@ -90,17 +90,17 @@ namespace OpenRCT2::Ui::FileBrowser switch (Config::Get().general.loadSaveSort) { - case FileBrowserSort::NameAscending: + case FileBrowserSort::nameAscending: return String::logicalCmp(a.name.c_str(), b.name.c_str()) < 0; - case FileBrowserSort::NameDescending: + case FileBrowserSort::nameDescending: return -String::logicalCmp(a.name.c_str(), b.name.c_str()) < 0; - case FileBrowserSort::DateDescending: + case FileBrowserSort::dateDescending: return -difftime(a.dateModified, b.dateModified) < 0; - case FileBrowserSort::DateAscending: + case FileBrowserSort::dateAscending: return difftime(a.dateModified, b.dateModified) < 0; - case FileBrowserSort::SizeDescending: + case FileBrowserSort::sizeDescending: return a.fileSizeBytes > b.fileSizeBytes; - case FileBrowserSort::SizeAscending: + case FileBrowserSort::sizeAscending: return a.fileSizeBytes < b.fileSizeBytes; } return String::logicalCmp(a.name.c_str(), b.name.c_str()) < 0; @@ -320,7 +320,7 @@ namespace OpenRCT2::Ui::FileBrowser SetAndSaveConfigPath(Config::Get().general.lastSaveScenarioDirectory, pathBuffer); int32_t parkFlagsBackup = gameState.park.flags; gameState.park.flags &= ~PARK_FLAGS_SPRITES_INITIALISED; - gameState.editorStep = EditorStep::Invalid; + gameState.editorStep = EditorStep::invalid; gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer))); int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2); gameState.park.flags = parkFlagsBackup; @@ -336,7 +336,7 @@ namespace OpenRCT2::Ui::FileBrowser else { ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); - gameState.editorStep = EditorStep::ObjectiveSelection; + gameState.editorStep = EditorStep::objectiveSelection; InvokeCallback(ModalResult::fail, pathBuffer); } break; @@ -409,7 +409,7 @@ namespace OpenRCT2::Ui::FileBrowser SetAndSaveConfigPath(Config::Get().general.lastSaveScenarioDirectory, pathBuffer); int32_t parkFlagsBackup = gameState.park.flags; gameState.park.flags &= ~PARK_FLAGS_SPRITES_INITIALISED; - gameState.editorStep = EditorStep::Invalid; + gameState.editorStep = EditorStep::invalid; gameState.scenarioFileName = std::string(String::toStringView(pathBuffer, std::size(pathBuffer))); int32_t success = ScenarioSave(gameState, pathBuffer, Config::Get().general.savePluginData ? 3 : 2); gameState.park.flags = parkFlagsBackup; @@ -425,7 +425,7 @@ namespace OpenRCT2::Ui::FileBrowser else { ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); - gameState.editorStep = EditorStep::ObjectiveSelection; + gameState.editorStep = EditorStep::objectiveSelection; InvokeCallback(ModalResult::fail, pathBuffer); } break; diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 0eadbca023..f389f7ab36 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::Ui return info; // - if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner) + if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::rollerCoasterDesigner) return info; info = GetMapCoordinatesFromPos( @@ -275,7 +275,7 @@ namespace OpenRCT2::Ui return info; // - if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner) + if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::rollerCoasterDesigner) return info; constexpr auto flags = static_cast( diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 7178019ccc..37964ad799 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -922,7 +922,7 @@ namespace OpenRCT2::Ui if (w.widgets[widgetIndex].flags.has(WidgetFlag::isPressed)) return true; - if (InputGetState() == InputState::WidgetPressed || InputGetState() == InputState::DropdownActive) + if (InputGetState() == InputState::widgetPressed || InputGetState() == InputState::dropdownActive) { if (!gInputFlags.has(InputFlag::widgetPressed)) return false; diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 07afd7b225..4aab3ddcfa 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -1084,7 +1084,7 @@ namespace OpenRCT2::Ui::Windows if (gLegacyScene == LegacyScene::titleSequence) return; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep != EditorStep::landscapeEditor) return; if (gLegacyScene == LegacyScene::trackDesignsManager) diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp index 61b9ca45a1..97588da618 100644 --- a/src/openrct2-ui/ride/VehicleSounds.cpp +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -109,7 +109,7 @@ namespace OpenRCT2::Audio if (gLegacyScene == LegacyScene::scenarioEditor) return false; - if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner) + if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::rollerCoasterDesigner) return false; if (vehicle.sound1_id == SoundId::null && vehicle.sound2_id == SoundId::null) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 3adf58ba40..b99b20eec0 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -1119,17 +1119,17 @@ static StringId window_cheats_page_titles[] = { switch (dropdownIndex) { case 0: - gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::None; + gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::none; speed = kCheatsStaffNormalSpeed; break; case 1: - gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::Frozen; + gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::frozen; speed = kCheatsStaffFreezeSpeed; break; case 2: - gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::Fast; + gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::fast; speed = kCheatsStaffFastSpeed; } CheatsSet(CheatType::setStaffSpeed, speed); diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 5d9712da81..c95aa1dc4d 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -77,7 +77,7 @@ namespace OpenRCT2::Ui::Windows gDropdown.highlightedIndex = -1; gDropdown.hasTooltips = false; gDropdown.defaultIndex = -1; - InputSetState(InputState::DropdownActive); + InputSetState(InputState::dropdownActive); } static int32_t GetDefaultRowHeight() diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index c90da19e8e..466e7f8e98 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -62,15 +62,15 @@ namespace OpenRCT2::Ui::Windows using FuncPtr = void (EditorBottomToolbarWindow::*)() const; static constexpr StringId kEditorStepNames[] = { - STR_EDITOR_STEP_OBJECT_SELECTION, // EditorStep::ObjectSelection - STR_EDITOR_STEP_LANDSCAPE_EDITOR, // EditorStep::LandscapeEditor - STR_EDITOR_STEP_INVENTIONS_LIST_SET_UP, // EditorStep::InventionsListSetUp - STR_EDITOR_STEP_OPTIONS_SELECTION, // EditorStep::OptionsSelection - STR_EDITOR_STEP_OBJECTIVE_SELECTION, // EditorStep::ObjectiveSelection - STR_EDITOR_STEP_SCENARIO_DETAILS, // EditorStep::ScenarioDetails - STR_EDITOR_STEP_SAVE_SCENARIO, // EditorStep::SaveScenario - STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER, // EditorStep::RollercoasterDesigner - STR_EDITOR_STEP_TRACK_DESIGNS_MANAGER, // EditorStep::DesignsManager + STR_EDITOR_STEP_OBJECT_SELECTION, // EditorStep::objectSelection + STR_EDITOR_STEP_LANDSCAPE_EDITOR, // EditorStep::landscapeEditor + STR_EDITOR_STEP_INVENTIONS_LIST_SET_UP, // EditorStep::inventionsListSetUp + STR_EDITOR_STEP_OPTIONS_SELECTION, // EditorStep::optionsSelection + STR_EDITOR_STEP_OBJECTIVE_SELECTION, // EditorStep::objectiveSelection + STR_EDITOR_STEP_SCENARIO_DETAILS, // EditorStep::scenarioDetails + STR_EDITOR_STEP_SAVE_SCENARIO, // EditorStep::saveScenario + STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER, // EditorStep::rollerCoasterDesigner + STR_EDITOR_STEP_TRACK_DESIGNS_MANAGER, // EditorStep::designsManager }; public: @@ -108,19 +108,19 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_NEXT_IMAGE].type = WidgetType::imgBtn; auto& gameState = getGameState(); - if (gLegacyScene == LegacyScene::trackDesignsManager || gameState.editorStep == EditorStep::SaveScenario) + if (gLegacyScene == LegacyScene::trackDesignsManager || gameState.editorStep == EditorStep::saveScenario) { HidePreviousStepButton(); HideNextStepButton(); } else { - if (gameState.editorStep == EditorStep::ObjectSelection - || (GameHasEntities() && gameState.editorStep == EditorStep::OptionsSelection)) + if (gameState.editorStep == EditorStep::objectSelection + || (GameHasEntities() && gameState.editorStep == EditorStep::optionsSelection)) { HidePreviousStepButton(); } - else if (gameState.editorStep == EditorStep::RollercoasterDesigner) + else if (gameState.editorStep == EditorStep::rollerCoasterDesigner) { HideNextStepButton(); } @@ -168,7 +168,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); windowMgr->CloseAll(); - getGameState().editorStep = EditorStep::ObjectSelection; + getGameState().editorStep = EditorStep::objectSelection; GfxInvalidateScreen(); } @@ -179,7 +179,7 @@ namespace OpenRCT2::Ui::Windows SetAllSceneryItemsInvented(); WindowScenerySetDefaultPlacementConfiguration(); - getGameState().editorStep = EditorStep::LandscapeEditor; + getGameState().editorStep = EditorStep::landscapeEditor; ContextOpenWindow(WindowClass::map); GfxInvalidateScreen(); } @@ -190,7 +190,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorInventionList); - getGameState().editorStep = EditorStep::InventionsListSetUp; + getGameState().editorStep = EditorStep::inventionsListSetUp; GfxInvalidateScreen(); } @@ -200,7 +200,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorScenarioOptions); - getGameState().editorStep = EditorStep::ObjectiveSelection; + getGameState().editorStep = EditorStep::objectiveSelection; GfxInvalidateScreen(); } @@ -210,7 +210,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorScenarioOptions); - getGameState().editorStep = EditorStep::OptionsSelection; + getGameState().editorStep = EditorStep::optionsSelection; GfxInvalidateScreen(); } @@ -242,7 +242,7 @@ namespace OpenRCT2::Ui::Windows auto* windowMgr = GetWindowManager(); windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorInventionList); - getGameState().editorStep = EditorStep::InventionsListSetUp; + getGameState().editorStep = EditorStep::inventionsListSetUp; } else { @@ -258,7 +258,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorScenarioOptions); - getGameState().editorStep = EditorStep::ObjectiveSelection; + getGameState().editorStep = EditorStep::objectiveSelection; GfxInvalidateScreen(); } @@ -268,7 +268,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorScenarioOptions); - getGameState().editorStep = EditorStep::OptionsSelection; + getGameState().editorStep = EditorStep::optionsSelection; GfxInvalidateScreen(); } @@ -278,7 +278,7 @@ namespace OpenRCT2::Ui::Windows windowMgr->CloseAll(); ContextOpenWindow(WindowClass::editorScenarioOptions); - getGameState().editorStep = EditorStep::ScenarioDetails; + getGameState().editorStep = EditorStep::scenarioDetails; GfxInvalidateScreen(); } @@ -290,14 +290,14 @@ namespace OpenRCT2::Ui::Windows } else { - getGameState().editorStep = EditorStep::ScenarioDetails; + getGameState().editorStep = EditorStep::scenarioDetails; } } void JumpForwardToSaveScenario() const { auto& gameState = getGameState(); - gameState.editorStep = EditorStep::SaveScenario; + gameState.editorStep = EditorStep::saveScenario; GfxInvalidateScreen(); const auto savePrepareResult = ScenarioPrepareForSave(gameState); diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 05c807c544..fab5165ebb 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1610,7 +1610,7 @@ namespace OpenRCT2::Ui::Windows SetEveryRideTypeInvented(); SetEveryRideEntryInvented(); - getGameState().editorStep = EditorStep::DesignsManager; + getGameState().editorStep = EditorStep::designsManager; int32_t entry_index = 0; for (; ObjectEntryGetChunk(ObjectType::ride, entry_index) == nullptr; entry_index++) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index b236800c15..0bb21716e4 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -522,8 +522,8 @@ namespace OpenRCT2::Ui::Windows return; auto step = getGameState().editorStep; - bool isObjectiveSelection = step == EditorStep::ObjectiveSelection; - bool isScenarioDetails = step == EditorStep::ScenarioDetails; + bool isObjectiveSelection = step == EditorStep::objectiveSelection; + bool isScenarioDetails = step == EditorStep::scenarioDetails; bool isOtherTab = !isObjectiveSelection && !isScenarioDetails; // Disable tabs based on current editor step diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 633c560848..c4e9210f88 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -215,7 +215,7 @@ namespace OpenRCT2::Ui::Windows int32_t temperature = getGameState().weatherCurrent.temperature; StringId format = STR_CELSIUS_VALUE; - if (Config::Get().general.temperatureFormat == TemperatureUnit::Fahrenheit) + if (Config::Get().general.temperatureFormat == TemperatureUnit::fahrenheit) { temperature = Weather::celsiusToFahrenheit(temperature); format = STR_FAHRENHEIT_VALUE; diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 5948ea86bd..c78ded546f 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -777,16 +777,16 @@ namespace OpenRCT2::Ui::Windows auto& config = Config::Get().general; drawButtonCaption( - widgets[WIDX_SORT_NAME], STR_NAME_COLUMN, FileBrowserSort::NameAscending, FileBrowserSort::NameDescending); + widgets[WIDX_SORT_NAME], STR_NAME_COLUMN, FileBrowserSort::nameAscending, FileBrowserSort::nameDescending); if (config.fileBrowserShowSizeColumn) drawButtonCaption( - widgets[WIDX_SORT_SIZE], STR_FILEBROWSER_SIZE_COLUMN, FileBrowserSort::SizeAscending, - FileBrowserSort::SizeDescending); + widgets[WIDX_SORT_SIZE], STR_FILEBROWSER_SIZE_COLUMN, FileBrowserSort::sizeAscending, + FileBrowserSort::sizeDescending); if (config.fileBrowserShowDateColumn) drawButtonCaption( - widgets[WIDX_SORT_DATE], STR_DATE_COLUMN, FileBrowserSort::DateAscending, FileBrowserSort::DateDescending); + widgets[WIDX_SORT_DATE], STR_DATE_COLUMN, FileBrowserSort::dateAscending, FileBrowserSort::dateDescending); // 'Filename:' label if (action == LoadSaveAction::save) @@ -836,13 +836,13 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_SORT_NAME: - if (Config::Get().general.loadSaveSort == FileBrowserSort::NameAscending) + if (Config::Get().general.loadSaveSort == FileBrowserSort::nameAscending) { - Config::Get().general.loadSaveSort = FileBrowserSort::NameDescending; + Config::Get().general.loadSaveSort = FileBrowserSort::nameDescending; } else { - Config::Get().general.loadSaveSort = FileBrowserSort::NameAscending; + Config::Get().general.loadSaveSort = FileBrowserSort::nameAscending; } Config::Save(); SortList(); @@ -850,13 +850,13 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_SORT_SIZE: - if (Config::Get().general.loadSaveSort == FileBrowserSort::SizeDescending) + if (Config::Get().general.loadSaveSort == FileBrowserSort::sizeDescending) { - Config::Get().general.loadSaveSort = FileBrowserSort::SizeAscending; + Config::Get().general.loadSaveSort = FileBrowserSort::sizeAscending; } else { - Config::Get().general.loadSaveSort = FileBrowserSort::SizeDescending; + Config::Get().general.loadSaveSort = FileBrowserSort::sizeDescending; } Config::Save(); SortList(); @@ -864,13 +864,13 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_SORT_DATE: - if (Config::Get().general.loadSaveSort == FileBrowserSort::DateDescending) + if (Config::Get().general.loadSaveSort == FileBrowserSort::dateDescending) { - Config::Get().general.loadSaveSort = FileBrowserSort::DateAscending; + Config::Get().general.loadSaveSort = FileBrowserSort::dateAscending; } else { - Config::Get().general.loadSaveSort = FileBrowserSort::DateDescending; + Config::Get().general.loadSaveSort = FileBrowserSort::dateDescending; } Config::Save(); SortList(); diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 50a2d984ab..3f18bb0eeb 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -1409,7 +1409,7 @@ namespace OpenRCT2::Ui::Windows { switch (Config::Get().general.measurementFormat) { - case MeasurementFormat::Imperial: + case MeasurementFormat::imperial: value = FeetToMetres(value); [[fallthrough]]; diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index dd7b86c856..017a739fb4 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::Ui::Windows // Check for cursor movement _cursorHoldDuration++; if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || gInputFlags.has(InputFlag::rightMousePressed) - || InputGetState() == InputState::ViewportRight) + || InputGetState() == InputState::viewportRight) _cursorHoldDuration = 0; _lastCursor = cursor; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index fdc020e386..36689a38f0 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1344,10 +1344,10 @@ namespace OpenRCT2::Ui::Windows StringId stringId = kStringIdNone; switch (Config::Get().general.measurementFormat) { - case MeasurementFormat::Imperial: + case MeasurementFormat::imperial: stringId = STR_IMPERIAL; break; - case MeasurementFormat::Metric: + case MeasurementFormat::metric: stringId = STR_METRIC; break; case MeasurementFormat::SI: @@ -1361,7 +1361,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_DATE_FORMAT].text = DateFormatStringIDs[Config::Get().general.dateFormat]; // Temperature: celsius/fahrenheit - widgets[WIDX_TEMPERATURE].text = Config::Get().general.temperatureFormat == TemperatureUnit::Fahrenheit + widgets[WIDX_TEMPERATURE].text = Config::Get().general.temperatureFormat == TemperatureUnit::fahrenheit ? STR_FAHRENHEIT : STR_CELSIUS; @@ -1497,7 +1497,7 @@ namespace OpenRCT2::Ui::Windows invalidate(); StopTitleMusic(); - if (Config::Get().sound.titleMusic != TitleMusicKind::None) + if (Config::Get().sound.titleMusic != TitleMusicKind::none) { PlayTitleMusic(); } @@ -2355,11 +2355,11 @@ namespace OpenRCT2::Ui::Windows TitleMusicKind Kind; StringId Name; } TitleThemeOptions[] = { - { TitleMusicKind::None, STR_OPTIONS_MUSIC_VALUE_NONE }, + { TitleMusicKind::none, STR_OPTIONS_MUSIC_VALUE_NONE }, { TitleMusicKind::OpenRCT2, STR_OPENRCT2_DROPDOWN }, { TitleMusicKind::RCT1, STR_ROLLERCOASTER_TYCOON_1_DROPDOWN }, { TitleMusicKind::RCT2, STR_ROLLERCOASTER_TYCOON_2_DROPDOWN }, - { TitleMusicKind::Random, STR_OPTIONS_MUSIC_VALUE_RANDOM }, + { TitleMusicKind::random, STR_OPTIONS_MUSIC_VALUE_RANDOM }, }; static constexpr StringId FullscreenModeNames[] = { diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 2261780f0e..85fbfd5b82 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -946,7 +946,7 @@ namespace OpenRCT2::Ui::Windows // Draw park size auto parkSize = _parkData.size * 10; auto stringIndex = STR_PARK_SIZE_METRIC_LABEL; - if (Config::Get().general.measurementFormat == MeasurementFormat::Imperial) + if (Config::Get().general.measurementFormat == MeasurementFormat::imperial) { stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL; parkSize = SquaredMetresToSquaredFeet(parkSize); diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index bfd9d1cc4f..a6db757f15 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -510,7 +510,7 @@ namespace OpenRCT2::Ui::Windows _hoverCounter++; if (_hoverCounter < 8) { - if (InputGetState() != InputState::ScrollLeft) + if (InputGetState() != InputState::scrollLeft) { minHeight = _actualMinHeight; maxHeight = _actualMinHeight; @@ -543,7 +543,7 @@ namespace OpenRCT2::Ui::Windows else { _hoverCounter = 0; - if (InputGetState() != InputState::ScrollLeft) + if (InputGetState() != InputState::scrollLeft) { minHeight = _actualMinHeight; maxHeight = _actualMinHeight; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index cca4fe16ca..664d848d85 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -161,7 +161,7 @@ namespace OpenRCT2::Ui::Windows gTooltipCursor = screenCoords; gTooltipCloseTimeout = 0; gTooltipWidget.windowClassification = WindowClass::null; - InputSetState(InputState::Normal); + InputSetState(InputState::normal); gInputFlags.unset(InputFlag::leftMousePressed); } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 8eec9e7560..2897f32b26 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -426,7 +426,7 @@ namespace OpenRCT2::Ui::Windows auto i = 0; gDropdown.items[i++] = Dropdown::PlainMenuLabel(STR_SHORTCUT_SHOW_MAP); gDropdown.items[i++] = Dropdown::PlainMenuLabel(STR_EXTRA_VIEWPORT); - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep == EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep == EditorStep::landscapeEditor) { gDropdown.items[i++] = Dropdown::PlainMenuLabel(STR_MAPGEN_MENU_ITEM); } @@ -456,7 +456,7 @@ namespace OpenRCT2::Ui::Windows void mapMenuDropdown(int16_t dropdownIndex) { int32_t customStartIndex = 3; - if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep == EditorStep::LandscapeEditor) + if (gLegacyScene == LegacyScene::scenarioEditor && getGameState().editorStep == EditorStep::landscapeEditor) { customStartIndex++; } @@ -1168,21 +1168,21 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_NETWORK].type = WidgetType::empty; auto& gameState = getGameState(); - if (gameState.editorStep != EditorStep::LandscapeEditor) + if (gameState.editorStep != EditorStep::landscapeEditor) { widgets[WIDX_LAND].type = WidgetType::empty; widgets[WIDX_WATER].type = WidgetType::empty; } - if (gameState.editorStep != EditorStep::RollercoasterDesigner) + if (gameState.editorStep != EditorStep::rollerCoasterDesigner) { widgets[WIDX_RIDES].type = WidgetType::empty; widgets[WIDX_CONSTRUCT_RIDE].type = WidgetType::empty; widgets[WIDX_FASTFORWARD].type = WidgetType::empty; } - if (gameState.editorStep != EditorStep::LandscapeEditor - && gameState.editorStep != EditorStep::RollercoasterDesigner) + if (gameState.editorStep != EditorStep::landscapeEditor + && gameState.editorStep != EditorStep::rollerCoasterDesigner) { widgets[WIDX_MAP].type = WidgetType::empty; widgets[WIDX_SCENERY].type = WidgetType::empty; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index cdf4c193d9..7d01519792 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -323,7 +323,7 @@ namespace OpenRCT2::Ui::Windows // Print the value in the configured measurement units. switch (Config::Get().general.measurementFormat) { - case MeasurementFormat::Metric: + case MeasurementFormat::metric: case MeasurementFormat::SI: { auto ft = Formatter(); @@ -332,7 +332,7 @@ namespace OpenRCT2::Ui::Windows drawText(rt, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] }); break; } - case MeasurementFormat::Imperial: + case MeasurementFormat::imperial: { auto ft = Formatter(); ft.Add( diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index e3f5d2d6e2..0abea5ec7f 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -55,7 +55,7 @@ void CheatsReset() gameState.cheats.allowRegularPathAsQueue = false; gameState.cheats.allowSpecialColourSchemes = false; gameState.cheats.makeAllDestructible = false; - gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::None; + gameState.cheats.selectedStaffSpeed = StaffSpeedCheat::none; gameState.cheats.forcedParkRating = kForcedParkRatingDisabled; } diff --git a/src/openrct2/Cheats.h b/src/openrct2/Cheats.h index 69af0468c5..9e22d619eb 100644 --- a/src/openrct2/Cheats.h +++ b/src/openrct2/Cheats.h @@ -13,9 +13,9 @@ enum class StaffSpeedCheat { - None, - Frozen, - Fast, + none, + frozen, + fast, }; struct CheatsState diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index e64f31b078..8a899e8552 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -574,7 +574,7 @@ namespace OpenRCT2 WindowInitAll(); gInputFlags.clearAll(); - InputSetState(InputState::Reset); + InputSetState(InputState::reset); gPressedWidget.windowClassification = WindowClass::null; gPickupPeepImage = ImageId(); ResetTooltipNotShown(); @@ -1063,35 +1063,35 @@ namespace OpenRCT2 if (gOpenRCT2Headless) { // NONE or OPEN are the only allowed actions for headless mode - if (gOpenRCT2StartupAction != StartupAction::Open) + if (gOpenRCT2StartupAction != StartupAction::open) { - gOpenRCT2StartupAction = StartupAction::None; + gOpenRCT2StartupAction = StartupAction::none; } } else { - if ((gOpenRCT2StartupAction == StartupAction::Title) && Config::Get().general.playIntro) + if ((gOpenRCT2StartupAction == StartupAction::title) && Config::Get().general.playIntro) { - gOpenRCT2StartupAction = StartupAction::Intro; + gOpenRCT2StartupAction = StartupAction::intro; } } IScene* nextScene{}; switch (gOpenRCT2StartupAction) { - case StartupAction::Intro: + case StartupAction::intro: { nextScene = GetIntroScene(); break; } - case StartupAction::Title: + case StartupAction::title: { nextScene = GetTitleScene(); break; } - case StartupAction::Open: + case StartupAction::open: { // A path that includes "://" is illegal with all common filesystems, so it is almost certainly a URL // This way all cURL supported protocols, like http, ftp, scp and smb are automatically handled @@ -1139,7 +1139,7 @@ namespace OpenRCT2 break; } - case StartupAction::Edit: + case StartupAction::edit: { if (String::sizeOf(gOpenRCT2StartupActionPath) == 0) { diff --git a/src/openrct2/Diagnostic.cpp b/src/openrct2/Diagnostic.cpp index 35f23a2c17..ff894f2722 100644 --- a/src/openrct2/Diagnostic.cpp +++ b/src/openrct2/Diagnostic.cpp @@ -23,7 +23,7 @@ using namespace OpenRCT2; [[maybe_unused]] static bool _log_location_enabled = true; -bool _log_levels[EnumValue(DiagnosticLevel::Count)] = { +bool _log_levels[EnumValue(DiagnosticLevel::count)] = { true, true, true, false, true, }; @@ -31,8 +31,8 @@ static FILE* diagnostic_get_stream(DiagnosticLevel level) { switch (level) { - case DiagnosticLevel::Verbose: - case DiagnosticLevel::Information: + case DiagnosticLevel::verbose: + case DiagnosticLevel::information: return stdout; default: return stderr; @@ -41,7 +41,7 @@ static FILE* diagnostic_get_stream(DiagnosticLevel level) #ifdef __ANDROID__ -int _android_log_priority[EnumValue(DiagnosticLevel::Count)] = { +int _android_log_priority[EnumValue(DiagnosticLevel::count)] = { ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO, }; diff --git a/src/openrct2/Diagnostic.h b/src/openrct2/Diagnostic.h index 7744b8f5fb..2acf275ba0 100644 --- a/src/openrct2/Diagnostic.h +++ b/src/openrct2/Diagnostic.h @@ -13,12 +13,12 @@ enum class DiagnosticLevel { - Fatal, - Error, - Warning, - Verbose, - Information, - Count + fatal, + error, + warning, + verbose, + information, + count }; /** @@ -68,7 +68,7 @@ enum class DiagnosticLevel #define DEBUG_LEVEL_1 0 #endif // defined(DEBUG) -extern bool _log_levels[static_cast(DiagnosticLevel::Count)]; +extern bool _log_levels[static_cast(DiagnosticLevel::count)]; void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...); void DiagnosticLogWithLocation( @@ -82,8 +82,8 @@ void DiagnosticLogWithLocation( DiagnosticLogWithLocation(level, __FILE__, __func__, __LINE__, format, ##__VA_ARGS__) #endif // _MSC_VER -#define LOG_FATAL(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Fatal, format, ##__VA_ARGS__) -#define LOG_ERROR(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Error, format, ##__VA_ARGS__) -#define LOG_WARNING(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Warning, format, ##__VA_ARGS__) -#define LOG_VERBOSE(format, ...) DiagnosticLog(DiagnosticLevel::Verbose, format, ##__VA_ARGS__) -#define LOG_INFO(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Information, format, ##__VA_ARGS__) +#define LOG_FATAL(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::fatal, format, ##__VA_ARGS__) +#define LOG_ERROR(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::error, format, ##__VA_ARGS__) +#define LOG_WARNING(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::warning, format, ##__VA_ARGS__) +#define LOG_VERBOSE(format, ...) DiagnosticLog(DiagnosticLevel::verbose, format, ##__VA_ARGS__) +#define LOG_INFO(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::information, format, ##__VA_ARGS__) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 676dea2783..0974cf0789 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -115,7 +115,7 @@ namespace OpenRCT2::Editor Audio::StopAll(); gameStateInitAll(gameState, kDefaultMapSize); gLegacyScene = LegacyScene::scenarioEditor; - gameState.editorStep = EditorStep::ObjectSelection; + gameState.editorStep = EditorStep::objectSelection; gameState.park.flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; gameState.scenarioOptions.category = Scenario::Category::other; ObjectListLoad(); @@ -160,7 +160,7 @@ namespace OpenRCT2::Editor ScenarioReset(gameState); gLegacyScene = LegacyScene::scenarioEditor; - gameState.editorStep = EditorStep::OptionsSelection; + gameState.editorStep = EditorStep::optionsSelection; gameState.scenarioOptions.category = Scenario::Category::other; ContextResetSubsystems(); OpenEditorWindows(); @@ -193,7 +193,7 @@ namespace OpenRCT2::Editor auto& gameState = getGameState(); gameStateInitAll(gameState, kDefaultMapSize); - gameState.editorStep = EditorStep::ObjectSelection; + gameState.editorStep = EditorStep::objectSelection; SetAllLandOwned(); ObjectListLoad(); ContextResetSubsystems(); @@ -222,7 +222,7 @@ namespace OpenRCT2::Editor auto& gameState = getGameState(); gameStateInitAll(gameState, kDefaultMapSize); SetAllLandOwned(); - gameState.editorStep = EditorStep::ObjectSelection; + gameState.editorStep = EditorStep::objectSelection; ObjectListLoad(); ContextResetSubsystems(); WindowBase* mainWindow = OpenEditorWindows(); @@ -261,7 +261,7 @@ namespace OpenRCT2::Editor auto* context = GetContext(); context->SetActiveScene(context->GetGameScene()); - getGameState().editorStep = EditorStep::LandscapeEditor; + getGameState().editorStep = EditorStep::landscapeEditor; gScreenAge = 0; gLegacyScene = LegacyScene::scenarioEditor; ContextResetSubsystems(); @@ -361,7 +361,7 @@ namespace OpenRCT2::Editor switch (getGameState().editorStep) { - case EditorStep::ObjectSelection: + case EditorStep::objectSelection: if (windowMgr->FindByClass(WindowClass::editorObjectSelection) != nullptr) { return; @@ -379,7 +379,7 @@ namespace OpenRCT2::Editor ContextOpenWindow(WindowClass::editorObjectSelection); break; - case EditorStep::InventionsListSetUp: + case EditorStep::inventionsListSetUp: if (windowMgr->FindByClass(WindowClass::editorInventionList) != nullptr) { return; @@ -387,9 +387,9 @@ namespace OpenRCT2::Editor ContextOpenWindow(WindowClass::editorInventionList); break; - case EditorStep::OptionsSelection: - case EditorStep::ObjectiveSelection: - case EditorStep::ScenarioDetails: + case EditorStep::optionsSelection: + case EditorStep::objectiveSelection: + case EditorStep::scenarioDetails: if (windowMgr->FindByClass(WindowClass::editorScenarioOptions) != nullptr) { return; @@ -397,11 +397,11 @@ namespace OpenRCT2::Editor ContextOpenWindow(WindowClass::editorScenarioOptions); break; - case EditorStep::LandscapeEditor: - case EditorStep::SaveScenario: - case EditorStep::RollercoasterDesigner: - case EditorStep::DesignsManager: - case EditorStep::Invalid: + case EditorStep::landscapeEditor: + case EditorStep::saveScenario: + case EditorStep::rollerCoasterDesigner: + case EditorStep::designsManager: + case EditorStep::invalid: break; } } diff --git a/src/openrct2/Editor.h b/src/openrct2/Editor.h index c696dd9aaa..e9fb183039 100644 --- a/src/openrct2/Editor.h +++ b/src/openrct2/Editor.h @@ -35,16 +35,16 @@ namespace OpenRCT2::Editor enum class EditorStep : uint8_t { - ObjectSelection, // 0 - LandscapeEditor, // 1 - InventionsListSetUp, // 2 - OptionsSelection, // 3 - ObjectiveSelection, // 4 - ScenarioDetails, // 5 - SaveScenario, // 6 - RollercoasterDesigner, // 7 - DesignsManager, // 8 - Invalid = 255, // 255 + objectSelection, // 0 + landscapeEditor, // 1 + inventionsListSetUp, // 2 + optionsSelection, // 3 + objectiveSelection, // 4 + scenarioDetails, // 5 + saveScenario, // 6 + rollerCoasterDesigner, // 7 + designsManager, // 8 + invalid = 255, // 255 }; void EditorOpenWindowsForCurrentStep(); diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 3670a449fb..ae9b158a7e 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -533,7 +533,7 @@ void FinishObjectSelection() gameState.lastEntranceStyle = 0; } - gameState.editorStep = EditorStep::RollercoasterDesigner; + gameState.editorStep = EditorStep::rollerCoasterDesigner; GfxInvalidateScreen(); } else @@ -543,7 +543,7 @@ void FinishObjectSelection() auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); ContextBroadcastIntent(&intent); - gameState.editorStep = EditorStep::LandscapeEditor; + gameState.editorStep = EditorStep::landscapeEditor; GfxInvalidateScreen(); } } diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 971e6ce0d0..dc5076ae9a 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -195,7 +195,7 @@ namespace OpenRCT2 gameStateUpdateLogic(); if (gGameSpeed == 1) { - if (InputGetState() == InputState::Reset || InputGetState() == InputState::Normal) + if (InputGetState() == InputState::reset || InputGetState() == InputState::normal) { if (gInputFlags.has(InputFlag::viewportScrolling)) { diff --git a/src/openrct2/Input.h b/src/openrct2/Input.h index d5898444db..7620ee31fe 100644 --- a/src/openrct2/Input.h +++ b/src/openrct2/Input.h @@ -33,16 +33,16 @@ namespace OpenRCT2 enum class InputState { - Reset, - Normal, - WidgetPressed, - PositioningWindow, - ViewportRight, - DropdownActive, - ViewportLeft, - ScrollLeft, - Resizing, - ScrollRight + reset, + normal, + widgetPressed, + positioningWindow, + viewportRight, + dropdownActive, + viewportLeft, + scrollLeft, + resizing, + scrollRight }; struct CursorState diff --git a/src/openrct2/OpenRCT2.cpp b/src/openrct2/OpenRCT2.cpp index d2ac266f3e..e7e6efc99c 100644 --- a/src/openrct2/OpenRCT2.cpp +++ b/src/openrct2/OpenRCT2.cpp @@ -11,7 +11,7 @@ #include "core/EnumUtils.hpp" -StartupAction gOpenRCT2StartupAction = StartupAction::Title; +StartupAction gOpenRCT2StartupAction = StartupAction::title; utf8 gOpenRCT2StartupActionPath[512] = { 0 }; u8string gCustomUserDataPath = {}; u8string gCustomOpenRCT2DataPath = {}; diff --git a/src/openrct2/OpenRCT2.h b/src/openrct2/OpenRCT2.h index e9211024a8..ecd82d5a04 100644 --- a/src/openrct2/OpenRCT2.h +++ b/src/openrct2/OpenRCT2.h @@ -15,11 +15,11 @@ enum class PromptMode : uint8_t; enum class StartupAction { - None, - Intro, - Title, - Open, - Edit + none, + intro, + title, + open, + edit }; enum class LegacyScene : uint8_t diff --git a/src/openrct2/actions/peep/StaffHireNewAction.cpp b/src/openrct2/actions/peep/StaffHireNewAction.cpp index 4518eebbed..2a3b4572be 100644 --- a/src/openrct2/actions/peep/StaffHireNewAction.cpp +++ b/src/openrct2/actions/peep/StaffHireNewAction.cpp @@ -196,17 +196,17 @@ namespace OpenRCT2::GameActions // Staff energy determines their walking speed switch (gameState.cheats.selectedStaffSpeed) { - case StaffSpeedCheat::None: + case StaffSpeedCheat::none: newPeep->Energy = kCheatsStaffNormalSpeed; newPeep->EnergyTarget = kCheatsStaffNormalSpeed; break; - case StaffSpeedCheat::Frozen: + case StaffSpeedCheat::frozen: newPeep->Energy = kCheatsStaffFreezeSpeed; newPeep->EnergyTarget = kCheatsStaffFreezeSpeed; break; - case StaffSpeedCheat::Fast: + case StaffSpeedCheat::fast: newPeep->Energy = kCheatsStaffFastSpeed; newPeep->EnergyTarget = kCheatsStaffFastSpeed; break; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 5f7c7ab331..942d704b55 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -277,7 +277,7 @@ namespace OpenRCT2::Audio { auto musicMap = GetAvailableMusicMap(); auto it = musicMap.find(musicKind); - if (musicKind == TitleMusicKind::Random) + if (musicKind == TitleMusicKind::random) { it = std::next(musicMap.begin(), UtilRand() % musicMap.size()); } @@ -287,7 +287,7 @@ namespace OpenRCT2::Audio return ObjectEntryDescriptor(ObjectType::audio, it->second); } - // No music descriptor for the current setting, intentional for TitleMusicKind::None + // No music descriptor for the current setting, intentional for TitleMusicKind::none return {}; } diff --git a/src/openrct2/command_line/RootCommands.cpp b/src/openrct2/command_line/RootCommands.cpp index 3d5d0d47d7..27b845ad83 100644 --- a/src/openrct2/command_line/RootCommands.cpp +++ b/src/openrct2/command_line/RootCommands.cpp @@ -177,7 +177,7 @@ namespace OpenRCT2 { if (_verbose) { - _log_levels[EnumValue(DiagnosticLevel::Verbose)] = true; + _log_levels[EnumValue(DiagnosticLevel::verbose)] = true; PrintLaunchInformation(); } @@ -246,7 +246,7 @@ namespace OpenRCT2 if (enumerator->TryPopString(&parkUri) && parkUri[0] != '-') { String::set(gOpenRCT2StartupActionPath, sizeof(gOpenRCT2StartupActionPath), parkUri); - gOpenRCT2StartupAction = StartupAction::Open; + gOpenRCT2StartupAction = StartupAction::open; } return EXITCODE_CONTINUE; @@ -268,7 +268,7 @@ namespace OpenRCT2 } String::set(gOpenRCT2StartupActionPath, sizeof(gOpenRCT2StartupActionPath), parkUri); - gOpenRCT2StartupAction = StartupAction::Edit; + gOpenRCT2StartupAction = StartupAction::edit; return EXITCODE_CONTINUE; } @@ -280,7 +280,7 @@ namespace OpenRCT2 return result; } - gOpenRCT2StartupAction = StartupAction::Intro; + gOpenRCT2StartupAction = StartupAction::intro; return EXITCODE_CONTINUE; } @@ -301,7 +301,7 @@ namespace OpenRCT2 return EXITCODE_FAIL; } - gOpenRCT2StartupAction = StartupAction::Open; + gOpenRCT2StartupAction = StartupAction::open; String::set(gOpenRCT2StartupActionPath, sizeof(gOpenRCT2StartupActionPath), parkUri); gNetworkStart = Network::Mode::server; diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index dacd09c059..7164a08fe7 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -69,8 +69,8 @@ namespace OpenRCT2::Config #pragma region Enums static const auto Enum_MeasurementFormat = ConfigEnum({ - ConfigEnumEntry("IMPERIAL", MeasurementFormat::Imperial), - ConfigEnumEntry("METRIC", MeasurementFormat::Metric), + ConfigEnumEntry("IMPERIAL", MeasurementFormat::imperial), + ConfigEnumEntry("METRIC", MeasurementFormat::metric), ConfigEnumEntry("SI", MeasurementFormat::SI), }); @@ -113,17 +113,17 @@ namespace OpenRCT2::Config }); static const auto Enum_Temperature = ConfigEnum({ - ConfigEnumEntry("CELSIUS", TemperatureUnit::Celsius), - ConfigEnumEntry("FAHRENHEIT", TemperatureUnit::Fahrenheit), + ConfigEnumEntry("CELSIUS", TemperatureUnit::celsius), + ConfigEnumEntry("FAHRENHEIT", TemperatureUnit::fahrenheit), }); static const auto Enum_FileBrowserSort = ConfigEnum({ - ConfigEnumEntry("NAME_ASCENDING", FileBrowserSort::NameAscending), - ConfigEnumEntry("NAME_DESCENDING", FileBrowserSort::NameDescending), - ConfigEnumEntry("SIZE_ASCENDING", FileBrowserSort::SizeAscending), - ConfigEnumEntry("SIZE_DESCENDING", FileBrowserSort::SizeDescending), - ConfigEnumEntry("DATE_ASCENDING", FileBrowserSort::DateAscending), - ConfigEnumEntry("DATE_DESCENDING", FileBrowserSort::DateDescending), + ConfigEnumEntry("NAME_ASCENDING", FileBrowserSort::nameAscending), + ConfigEnumEntry("NAME_DESCENDING", FileBrowserSort::nameDescending), + ConfigEnumEntry("SIZE_ASCENDING", FileBrowserSort::sizeAscending), + ConfigEnumEntry("SIZE_DESCENDING", FileBrowserSort::sizeDescending), + ConfigEnumEntry("DATE_ASCENDING", FileBrowserSort::dateAscending), + ConfigEnumEntry("DATE_DESCENDING", FileBrowserSort::dateDescending), }); static const auto Enum_ParkPreviewPref = ConfigEnum({ @@ -226,7 +226,7 @@ namespace OpenRCT2::Config model->lastRunVersion = reader->GetString("last_run_version", ""); model->invertViewportDrag = reader->GetBoolean("invert_viewport_drag", false); model->loadSaveSort = reader->GetEnum( - "load_save_sort", FileBrowserSort::NameAscending, Enum_FileBrowserSort); + "load_save_sort", FileBrowserSort::nameAscending, Enum_FileBrowserSort); model->minimizeFullscreenFocusLoss = reader->GetBoolean("minimize_fullscreen_focus_loss", true); model->disableScreensaver = reader->GetBoolean("disable_screensaver", true); diff --git a/src/openrct2/config/ConfigTypes.h b/src/openrct2/config/ConfigTypes.h index 423ed6fc87..d83620c814 100644 --- a/src/openrct2/config/ConfigTypes.h +++ b/src/openrct2/config/ConfigTypes.h @@ -22,12 +22,12 @@ namespace OpenRCT2 enum class FileBrowserSort : int32_t { - NameAscending, - NameDescending, - SizeAscending, - SizeDescending, - DateAscending, - DateDescending, + nameAscending, + nameDescending, + sizeAscending, + sizeDescending, + dateAscending, + dateDescending, }; enum class ParkPreviewPref : int32_t @@ -39,28 +39,28 @@ namespace OpenRCT2 enum class TemperatureUnit : int32_t { - Celsius, - Fahrenheit + celsius, + fahrenheit }; enum class ScaleQuality : int32_t { - NearestNeighbour, - Linear, - SmoothNearestNeighbour + nearestNeighbour, + linear, + smoothNearestNeighbour }; enum class MeasurementFormat : int32_t { - Imperial, - Metric, + imperial, + metric, SI }; enum class TitleMusicKind : int32_t { - None, - Random, + none, + random, OpenRCT2, RCT1, RCT2, diff --git a/src/openrct2/core/Identifier.hpp b/src/openrct2/core/Identifier.hpp index fca9fa1671..8c2466aa14 100644 --- a/src/openrct2/core/Identifier.hpp +++ b/src/openrct2/core/Identifier.hpp @@ -18,7 +18,7 @@ class TIdentifier { enum class ValueType : T { - Null = TNullValue, + null = TNullValue, } _handle; private: @@ -39,7 +39,7 @@ public: static constexpr TIdentifier GetNull() noexcept { - return TIdentifier{ ValueType::Null }; + return TIdentifier{ ValueType::null }; } static constexpr TIdentifier FromUnderlying(const T val) noexcept @@ -60,7 +60,7 @@ public: constexpr bool IsNull() const noexcept { - return _handle == ValueType::Null; + return _handle == ValueType::null; } auto operator<=>(const TIdentifier&) const = default; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 2898ece410..afb24f04f7 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -1964,7 +1964,7 @@ namespace OpenRCT2 return 0; // Height labels in feet - if (Config::Get().general.measurementFormat == MeasurementFormat::Imperial) + if (Config::Get().general.measurementFormat == MeasurementFormat::imperial) return 1 * 256; // Height labels in metres diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 6e0d0b6fd9..978f05a79a 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -556,10 +556,10 @@ namespace OpenRCT2 switch (Config::Get().general.measurementFormat) { default: - case MeasurementFormat::Imperial: + case MeasurementFormat::imperial: FormatStringID(ss, STR_UNIT_SUFFIX_MILES_PER_HOUR, arg); break; - case MeasurementFormat::Metric: + case MeasurementFormat::metric: FormatStringID(ss, STR_UNIT_SUFFIX_KILOMETRES_PER_HOUR, MphToKmph(arg)); break; case MeasurementFormat::SI: @@ -586,10 +586,10 @@ namespace OpenRCT2 switch (Config::Get().general.measurementFormat) { default: - case MeasurementFormat::Imperial: + case MeasurementFormat::imperial: FormatStringID(ss, STR_UNIT_SUFFIX_FEET, MetresToFeet(arg)); break; - case MeasurementFormat::Metric: + case MeasurementFormat::metric: case MeasurementFormat::SI: FormatStringID(ss, STR_UNIT_SUFFIX_METRES, arg); break; @@ -603,10 +603,10 @@ namespace OpenRCT2 switch (Config::Get().general.measurementFormat) { default: - case MeasurementFormat::Imperial: + case MeasurementFormat::imperial: FormatStringID(ss, STR_UNIT_SUFFIX_FEET, MetresToFeet(metres)); break; - case MeasurementFormat::Metric: + case MeasurementFormat::metric: case MeasurementFormat::SI: FormatStringID(ss, STR_UNIT_SUFFIX_METRES, metres); break; diff --git a/src/openrct2/platform/Platform.Android.cpp b/src/openrct2/platform/Platform.Android.cpp index daf7cbc548..f0fe6e12ac 100644 --- a/src/openrct2/platform/Platform.Android.cpp +++ b/src/openrct2/platform/Platform.Android.cpp @@ -163,7 +163,7 @@ namespace OpenRCT2::Platform env->DeleteLocalRef(activity); env->DeleteLocalRef(activityClass); - return isImperial == JNI_TRUE ? MeasurementFormat::Imperial : MeasurementFormat::Metric; + return isImperial == JNI_TRUE ? MeasurementFormat::imperial : MeasurementFormat::metric; } SteamPaths GetSteamPaths() diff --git a/src/openrct2/platform/Platform.Emscripten.cpp b/src/openrct2/platform/Platform.Emscripten.cpp index 4bf486b268..1e391dd69c 100644 --- a/src/openrct2/platform/Platform.Emscripten.cpp +++ b/src/openrct2/platform/Platform.Emscripten.cpp @@ -94,7 +94,7 @@ namespace OpenRCT2::Platform return ([ "LR", "MM", "US" ]).includes(country) ? 1 : 0; }); - return isImperial == 1 ? MeasurementFormat::Imperial : MeasurementFormat::Metric; + return isImperial == 1 ? MeasurementFormat::imperial : MeasurementFormat::metric; } SteamPaths GetSteamPaths() diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp index 1c53ba864e..126ac8b420 100644 --- a/src/openrct2/platform/Platform.Linux.cpp +++ b/src/openrct2/platform/Platform.Linux.cpp @@ -336,10 +336,10 @@ namespace OpenRCT2::Platform // using https://en.wikipedia.org/wiki/Metrication#Chronology_and_status_of_conversion_by_country as reference if (!fnmatch("*_US*", langstring, 0) || !fnmatch("*_MM*", langstring, 0) || !fnmatch("*_LR*", langstring, 0)) { - return MeasurementFormat::Imperial; + return MeasurementFormat::imperial; } } - return MeasurementFormat::Metric; + return MeasurementFormat::metric; } SteamPaths GetSteamPaths() diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index e956e44fed..775fb061f4 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -353,10 +353,10 @@ namespace OpenRCT2::Platform if (!fnmatch("*_US*", langstring, 0) || !fnmatch("*_BS*", langstring, 0) || !fnmatch("*_BZ*", langstring, 0) || !fnmatch("*_PW*", langstring, 0)) { - return TemperatureUnit::Fahrenheit; + return TemperatureUnit::fahrenheit; } } - return TemperatureUnit::Celsius; + return TemperatureUnit::celsius; } bool ProcessIsElevated() diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 715a665d3a..9787115e72 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -645,10 +645,10 @@ namespace OpenRCT2::Platform sizeof(measurement_system) / sizeof(wchar_t)) == 0) { - return MeasurementFormat::Metric; + return MeasurementFormat::metric; } - return measurement_system == 1 ? MeasurementFormat::Imperial : MeasurementFormat::Metric; + return measurement_system == 1 ? MeasurementFormat::imperial : MeasurementFormat::metric; } uint8_t GetLocaleDateFormat() @@ -712,10 +712,10 @@ namespace OpenRCT2::Platform == 0) { // Assume celsius by default if function call fails - return TemperatureUnit::Celsius; + return TemperatureUnit::celsius; } - return fahrenheit == 1 ? TemperatureUnit::Fahrenheit : TemperatureUnit::Celsius; + return fahrenheit == 1 ? TemperatureUnit::fahrenheit : TemperatureUnit::celsius; } bool ProcessIsElevated() diff --git a/src/openrct2/platform/Platform.macOS.mm b/src/openrct2/platform/Platform.macOS.mm index b694f1a408..617af45e6a 100644 --- a/src/openrct2/platform/Platform.macOS.mm +++ b/src/openrct2/platform/Platform.macOS.mm @@ -221,10 +221,10 @@ namespace OpenRCT2::Platform if (metricSystem.boolValue) { - return MeasurementFormat::Metric; + return MeasurementFormat::metric; } - return MeasurementFormat::Imperial; + return MeasurementFormat::imperial; } } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index bbbebda3bb..e3c828f51e 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -345,7 +345,7 @@ namespace OpenRCT2::RCT1 // Do map initialisation, same kind of stuff done when loading scenario editor gameStateInitAll(gameState, { mapSize, mapSize }); - gameState.editorStep = EditorStep::ObjectSelection; + gameState.editorStep = EditorStep::objectSelection; gameState.park.flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES; gameState.scenarioOptions.category = Scenario::Category::other; } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index dde5417fe2..982ddbc9db 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -699,21 +699,21 @@ void Ride::updateAll() { switch (getGameState().editorStep) { - case EditorStep::ObjectSelection: - case EditorStep::LandscapeEditor: - case EditorStep::InventionsListSetUp: + case EditorStep::objectSelection: + case EditorStep::landscapeEditor: + case EditorStep::inventionsListSetUp: { for (auto& ride : RideManager(gameState)) ride.remove(); break; } - case EditorStep::OptionsSelection: - case EditorStep::ObjectiveSelection: - case EditorStep::ScenarioDetails: - case EditorStep::SaveScenario: - case EditorStep::RollercoasterDesigner: - case EditorStep::DesignsManager: - case EditorStep::Invalid: + case EditorStep::optionsSelection: + case EditorStep::objectiveSelection: + case EditorStep::scenarioDetails: + case EditorStep::saveScenario: + case EditorStep::rollerCoasterDesigner: + case EditorStep::designsManager: + case EditorStep::invalid: break; } return; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index cc06b29b3f..5b726559b9 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -251,7 +251,7 @@ void VehicleUpdateAll() if (gLegacyScene == LegacyScene::scenarioEditor) return; - if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::RollercoasterDesigner) + if (gLegacyScene == LegacyScene::trackDesigner && getGameState().editorStep != EditorStep::rollerCoasterDesigner) return; for (auto vehicle : TrainManager::View()) diff --git a/src/openrct2/ui/DummyUiContext.cpp b/src/openrct2/ui/DummyUiContext.cpp index d2a175c637..80a55a419c 100644 --- a/src/openrct2/ui/DummyUiContext.cpp +++ b/src/openrct2/ui/DummyUiContext.cpp @@ -57,7 +57,7 @@ namespace OpenRCT2::Ui } ScaleQuality GetScaleQuality() override { - return ScaleQuality::NearestNeighbour; + return ScaleQuality::nearestNeighbour; } void SetFullscreenMode(FullscreenMode /*mode*/) override { diff --git a/test/tests/FormattingTests.cpp b/test/tests/FormattingTests.cpp index 60a876e1ce..10a73d0f4f 100644 --- a/test/tests/FormattingTests.cpp +++ b/test/tests/FormattingTests.cpp @@ -210,14 +210,14 @@ TEST_F(FormattingTests, escaped_braces) TEST_F(FormattingTests, velocity_mph) { - Config::Get().general.measurementFormat = MeasurementFormat::Imperial; + Config::Get().general.measurementFormat = MeasurementFormat::imperial; auto actual = FormatString("Train is going at {VELOCITY}.", 1024); ASSERT_EQ("Train is going at 1,024 mph.", actual); } TEST_F(FormattingTests, velocity_kph) { - Config::Get().general.measurementFormat = MeasurementFormat::Metric; + Config::Get().general.measurementFormat = MeasurementFormat::metric; auto actual = FormatString("Train is going at {VELOCITY}.", 1024); ASSERT_EQ("Train is going at 1,648 km/h.", actual); } @@ -231,14 +231,14 @@ TEST_F(FormattingTests, velocity_mps) TEST_F(FormattingTests, length_imperial) { - Config::Get().general.measurementFormat = MeasurementFormat::Imperial; + Config::Get().general.measurementFormat = MeasurementFormat::imperial; auto actual = FormatString("Height: {LENGTH}", 1024); ASSERT_EQ("Height: 3,360 ft", actual); } TEST_F(FormattingTests, length_metric) { - Config::Get().general.measurementFormat = MeasurementFormat::Metric; + Config::Get().general.measurementFormat = MeasurementFormat::metric; auto actual = FormatString("Height: {LENGTH}", 1024); ASSERT_EQ("Height: 1,024 m", actual); }