From be9f27e4f957b360704c3d841334f394230bcd6a Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Sun, 19 Jan 2025 16:59:45 +0100 Subject: [PATCH] Mass rename constants (#23656) --- src/openrct2-ui/CursorData.cpp | 16 +- src/openrct2-ui/TextComposition.cpp | 2 +- src/openrct2-ui/UiContext.cpp | 8 +- src/openrct2-ui/audio/AudioContext.cpp | 4 +- src/openrct2-ui/audio/SDLAudioSource.cpp | 12 +- src/openrct2-ui/audio/WavAudioSource.cpp | 31 +- .../engines/HardwareDisplayDrawingEngine.cpp | 4 +- .../engines/opengl/ApplyPaletteShader.cpp | 4 +- .../opengl/ApplyTransparencyShader.cpp | 4 +- .../drawing/engines/opengl/DrawLineShader.cpp | 4 +- .../drawing/engines/opengl/DrawRectShader.cpp | 4 +- .../engines/opengl/OpenGLDrawingEngine.cpp | 4 +- .../engines/opengl/OpenGLFramebuffer.cpp | 6 +- .../engines/opengl/OpenGLShaderProgram.cpp | 2 +- .../engines/opengl/OpenGLShaderProgram.h | 2 +- .../engines/opengl/SwapFramebuffer.cpp | 14 +- .../drawing/engines/opengl/TextureCache.cpp | 4 +- .../drawing/engines/opengl/TextureCache.h | 8 +- src/openrct2-ui/input/InputManager.cpp | 4 +- src/openrct2-ui/input/MouseInput.cpp | 14 +- src/openrct2-ui/input/ShortcutInput.cpp | 8 +- src/openrct2-ui/input/ShortcutManager.cpp | 28 +- src/openrct2-ui/input/ShortcutManager.h | 2 +- src/openrct2-ui/interface/Dropdown.h | 14 +- src/openrct2-ui/interface/InGameConsole.cpp | 20 +- src/openrct2-ui/interface/InGameConsole.h | 12 +- src/openrct2-ui/interface/LandTool.cpp | 4 +- src/openrct2-ui/interface/Objective.cpp | 2 +- src/openrct2-ui/interface/Theme.cpp | 2 +- .../interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/interface/Widget.cpp | 18 +- src/openrct2-ui/interface/Widget.h | 22 +- src/openrct2-ui/interface/Window.cpp | 4 +- src/openrct2-ui/ride/Construction.h | 2 +- src/openrct2-ui/scripting/CustomImages.cpp | 2 +- src/openrct2-ui/scripting/CustomListView.cpp | 20 +- src/openrct2-ui/scripting/CustomListView.h | 2 +- src/openrct2-ui/scripting/CustomMenu.cpp | 2 +- src/openrct2-ui/scripting/CustomWindow.cpp | 12 +- src/openrct2-ui/scripting/ScUi.hpp | 6 +- src/openrct2-ui/scripting/ScWidget.hpp | 2 +- src/openrct2-ui/windows/About.cpp | 4 +- src/openrct2-ui/windows/Cheats.cpp | 2 +- src/openrct2-ui/windows/ClearScenery.cpp | 5 +- src/openrct2-ui/windows/CustomCurrency.cpp | 2 +- src/openrct2-ui/windows/Dropdown.cpp | 14 +- .../windows/EditorBottomToolbar.cpp | 4 +- .../windows/EditorObjectSelection.cpp | 16 +- .../windows/EditorObjectiveOptions.cpp | 28 +- .../windows/EditorParkEntrance.cpp | 4 +- .../windows/EditorScenarioOptions.cpp | 54 +-- src/openrct2-ui/windows/Finances.cpp | 2 +- src/openrct2-ui/windows/Footpath.cpp | 6 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 10 +- src/openrct2-ui/windows/InstallTrack.cpp | 8 +- src/openrct2-ui/windows/Land.cpp | 5 +- src/openrct2-ui/windows/LandRights.cpp | 3 +- src/openrct2-ui/windows/LoadSave.cpp | 17 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapTooltip.cpp | 4 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 2 +- src/openrct2-ui/windows/NetworkStatus.cpp | 2 +- src/openrct2-ui/windows/NewCampaign.cpp | 16 +- src/openrct2-ui/windows/NewRide.cpp | 4 +- src/openrct2-ui/windows/Options.cpp | 26 +- src/openrct2-ui/windows/Park.cpp | 4 +- src/openrct2-ui/windows/PatrolArea.cpp | 3 +- src/openrct2-ui/windows/ProgressWindow.cpp | 2 +- src/openrct2-ui/windows/Research.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 62 +-- src/openrct2-ui/windows/RideConstruction.cpp | 6 +- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/SavePrompt.cpp | 4 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 4 +- src/openrct2-ui/windows/Scenery.cpp | 4 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 10 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 4 +- src/openrct2-ui/windows/Staff.cpp | 4 +- src/openrct2-ui/windows/StaffList.cpp | 6 +- src/openrct2-ui/windows/TextInput.cpp | 14 +- src/openrct2-ui/windows/Themes.cpp | 16 +- src/openrct2-ui/windows/TileInspector.cpp | 8 +- src/openrct2-ui/windows/TitleMenu.cpp | 2 +- src/openrct2-ui/windows/Tooltip.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 26 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 2 +- src/openrct2-ui/windows/TrackList.cpp | 4 +- src/openrct2-ui/windows/Transparency.cpp | 12 +- src/openrct2-ui/windows/ViewClipping.cpp | 2 +- src/openrct2-ui/windows/Viewport.cpp | 2 +- src/openrct2-ui/windows/Water.cpp | 5 +- src/openrct2-ui/windows/Windows.h | 2 +- src/openrct2/Context.cpp | 20 +- src/openrct2/Context.h | 2 +- src/openrct2/Editor.cpp | 6 +- src/openrct2/FileClassifier.cpp | 2 +- src/openrct2/Game.cpp | 2 +- src/openrct2/GameState.h | 2 +- src/openrct2/GameStateSnapshots.cpp | 14 +- src/openrct2/Limits.h | 4 +- src/openrct2/PlatformEnvironment.cpp | 20 +- src/openrct2/PlatformEnvironment.h | 4 +- src/openrct2/Version.cpp | 4 +- src/openrct2/Version.h | 2 +- src/openrct2/actions/BannerRemoveAction.cpp | 12 +- .../actions/BannerSetColourAction.cpp | 2 +- src/openrct2/actions/BannerSetStyleAction.cpp | 4 +- src/openrct2/actions/ClearAction.cpp | 2 +- .../actions/FootpathAdditionPlaceAction.cpp | 2 +- .../actions/FootpathAdditionRemoveAction.cpp | 2 +- src/openrct2/actions/FootpathPlaceAction.cpp | 4 +- src/openrct2/actions/FootpathRemoveAction.cpp | 2 +- src/openrct2/actions/GameAction.h | 4 +- src/openrct2/actions/GameActionRegistry.cpp | 2 +- src/openrct2/actions/GameActionResult.h | 4 +- src/openrct2/actions/GuestSetFlagsAction.cpp | 4 +- src/openrct2/actions/GuestSetNameAction.cpp | 8 +- src/openrct2/actions/LandBuyRightsAction.cpp | 10 +- src/openrct2/actions/LandBuyRightsAction.h | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 24 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/LandSmoothAction.cpp | 2 +- src/openrct2/actions/LandSmoothAction.h | 2 +- .../actions/LargeSceneryPlaceAction.cpp | 2 +- .../actions/LargeSceneryRemoveAction.cpp | 2 +- .../actions/LargeScenerySetColourAction.cpp | 6 +- src/openrct2/actions/MazeSetTrackAction.cpp | 14 +- .../actions/ParkEntrancePlaceAction.cpp | 4 +- .../actions/ParkEntranceRemoveAction.cpp | 6 +- .../actions/ParkSetEntranceFeeAction.cpp | 4 +- .../actions/ParkSetParameterAction.cpp | 4 +- src/openrct2/actions/ParkSetParameterAction.h | 6 +- src/openrct2/actions/PeepPickupAction.cpp | 18 +- src/openrct2/actions/PeepSpawnPlaceAction.cpp | 2 +- src/openrct2/actions/ResultWithMessage.h | 4 +- src/openrct2/actions/RideCreateAction.cpp | 6 +- src/openrct2/actions/RideDemolishAction.cpp | 6 +- .../actions/RideEntranceExitRemoveAction.cpp | 4 +- src/openrct2/actions/RideSetPriceAction.cpp | 4 +- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/RideSetVehicleAction.cpp | 14 +- src/openrct2/actions/SignSetNameAction.cpp | 4 +- src/openrct2/actions/SignSetStyleAction.cpp | 12 +- .../actions/SmallScenerySetColourAction.cpp | 2 +- src/openrct2/actions/StaffFireAction.cpp | 6 +- .../actions/StaffSetCostumeAction.cpp | 2 +- src/openrct2/actions/StaffSetNameAction.cpp | 4 +- src/openrct2/actions/StaffSetOrdersAction.cpp | 2 +- src/openrct2/actions/TrackDesignAction.cpp | 4 +- src/openrct2/actions/TrackPlaceAction.cpp | 2 +- .../actions/TrackSetBrakeSpeedAction.cpp | 2 +- src/openrct2/actions/WallPlaceAction.cpp | 6 +- src/openrct2/actions/WallSetColourAction.cpp | 8 +- src/openrct2/actions/WaterSetHeightAction.cpp | 12 +- src/openrct2/audio/Audio.cpp | 6 +- src/openrct2/command_line/CommandLine.cpp | 6 +- src/openrct2/command_line/CommandLine.hpp | 4 +- .../command_line/ParkInfoCommands.cpp | 4 +- src/openrct2/command_line/RootCommands.cpp | 54 +-- .../command_line/ScreenshotCommands.cpp | 26 +- src/openrct2/command_line/SpriteCommands.cpp | 18 +- src/openrct2/core/BitSet.hpp | 80 ++-- src/openrct2/core/ChecksumStream.cpp | 4 +- src/openrct2/core/ChecksumStream.h | 4 +- src/openrct2/core/Compression.cpp | 16 +- src/openrct2/core/Crypt.OpenRCT2.cpp | 12 +- src/openrct2/core/DateTime.h | 2 +- src/openrct2/core/EnumMap.hpp | 8 +- src/openrct2/core/FileIndex.hpp | 6 +- src/openrct2/core/Guard.cpp | 6 +- src/openrct2/core/Http.Android.cpp | 4 +- src/openrct2/core/Http.WinHttp.cpp | 24 +- src/openrct2/core/Http.cURL.cpp | 4 +- src/openrct2/core/Imaging.cpp | 6 +- src/openrct2/core/Json.hpp | 4 +- src/openrct2/core/OrcaStream.hpp | 17 +- src/openrct2/core/RTL.FriBidi.cpp | 8 +- src/openrct2/core/Random.hpp | 8 +- src/openrct2/drawing/Drawing.Sprite.BMP.cpp | 10 +- src/openrct2/drawing/Drawing.Sprite.RLE.cpp | 10 +- src/openrct2/drawing/Drawing.Sprite.cpp | 4 +- src/openrct2/drawing/Drawing.String.cpp | 20 +- src/openrct2/drawing/Drawing.cpp | 10 +- src/openrct2/drawing/Drawing.h | 22 +- src/openrct2/drawing/Font.cpp | 18 +- src/openrct2/drawing/Font.h | 2 +- src/openrct2/drawing/Image.cpp | 26 +- src/openrct2/drawing/ImageId.hpp | 61 +-- src/openrct2/drawing/ImageImporter.cpp | 14 +- src/openrct2/drawing/LightFX.cpp | 41 +- src/openrct2/drawing/NewDrawing.cpp | 12 +- src/openrct2/drawing/ScrollingText.cpp | 170 +++---- src/openrct2/drawing/ScrollingText.h | 4 +- src/openrct2/drawing/Weather.cpp | 24 +- src/openrct2/drawing/Weather.h | 4 +- src/openrct2/drawing/X8DrawingEngine.cpp | 28 +- src/openrct2/drawing/X8DrawingEngine.h | 4 +- src/openrct2/entity/Duck.cpp | 19 +- src/openrct2/entity/EntityRegistry.cpp | 26 +- src/openrct2/entity/EntityRegistry.h | 2 +- src/openrct2/entity/Fountain.cpp | 16 +- src/openrct2/entity/Guest.cpp | 78 ++-- src/openrct2/entity/Guest.h | 2 +- src/openrct2/entity/Litter.cpp | 8 +- src/openrct2/entity/MoneyEffect.cpp | 6 +- src/openrct2/entity/Particle.cpp | 4 +- src/openrct2/entity/PatrolArea.h | 4 +- src/openrct2/entity/Peep.cpp | 24 +- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 24 +- src/openrct2/entity/Yaw.hpp | 6 +- src/openrct2/interface/InteractiveConsole.cpp | 10 +- src/openrct2/interface/Screenshot.cpp | 8 +- src/openrct2/interface/Viewport.cpp | 6 +- src/openrct2/interface/Viewport.h | 2 +- src/openrct2/interface/Widget.h | 2 +- src/openrct2/interface/Window.cpp | 14 +- .../localisation/LocalisationService.cpp | 22 +- src/openrct2/localisation/StringIdType.h | 4 +- src/openrct2/management/Research.cpp | 10 +- src/openrct2/network/NetworkBase.cpp | 31 +- src/openrct2/object/EntranceObject.cpp | 2 +- .../object/FootpathRailingsObject.cpp | 2 +- src/openrct2/object/Object.cpp | 6 +- src/openrct2/object/Object.h | 2 +- src/openrct2/object/ObjectRepository.h | 4 +- src/openrct2/object/RideObject.cpp | 18 +- src/openrct2/object/RideObject.h | 4 +- src/openrct2/object/StationObject.cpp | 4 +- src/openrct2/object/StationObject.h | 4 +- .../paint/tile_element/Paint.Entrance.cpp | 2 +- .../paint/tile_element/Paint.PathAddition.cpp | 6 +- .../coaster/ClassicStandUpRollerCoaster.cpp | 6 +- .../coaster/ClassicWoodenRollerCoaster.cpp | 82 ++-- .../coaster/SideFrictionRollerCoaster.cpp | 4 +- .../track/coaster/WoodenRollerCoaster.hpp | 236 +++++----- src/openrct2/paint/vehicle/VehiclePaint.cpp | 4 +- src/openrct2/park/ParkFile.cpp | 12 +- src/openrct2/park/ParkFile.h | 8 +- src/openrct2/peep/GuestPathfinding.cpp | 6 +- src/openrct2/platform/Crash.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/DATLimits.h | 8 +- src/openrct2/rct2/RCT2.h | 10 +- src/openrct2/rct2/S6Importer.cpp | 6 +- src/openrct2/ride/Ride.cpp | 12 +- src/openrct2/ride/Ride.h | 2 +- src/openrct2/ride/RideData.h | 4 +- src/openrct2/ride/RideEntry.h | 6 +- src/openrct2/ride/ShopItem.cpp | 8 +- src/openrct2/ride/TrackData.cpp | 440 +++++++++--------- src/openrct2/ride/TrackDesign.cpp | 2 +- src/openrct2/ride/TrackPaint.cpp | 2 +- src/openrct2/scenario/ScenarioRepository.cpp | 4 +- src/openrct2/scripting/ScriptEngine.cpp | 6 +- src/openrct2/scripting/ScriptEngine.h | 10 +- .../scripting/bindings/entity/ScEntity.hpp | 4 +- .../scripting/bindings/game/ScContext.hpp | 4 +- .../scripting/bindings/network/ScNetwork.cpp | 8 +- .../scripting/bindings/world/ScMap.cpp | 4 +- src/openrct2/sprites.h | 4 +- src/openrct2/world/ConstructionClearance.cpp | 8 +- src/openrct2/world/Footpath.cpp | 4 +- src/openrct2/world/Location.hpp | 4 +- src/openrct2/world/TileInspector.cpp | 2 +- 270 files changed, 1636 insertions(+), 1640 deletions(-) diff --git a/src/openrct2-ui/CursorData.cpp b/src/openrct2-ui/CursorData.cpp index 425061a91a..1e583e7c76 100644 --- a/src/openrct2-ui/CursorData.cpp +++ b/src/openrct2-ui/CursorData.cpp @@ -15,9 +15,9 @@ namespace OpenRCT2::Ui { - constexpr char rawTransparent = ' '; - constexpr char rawWhite = '.'; - constexpr char rawBlack = 'X'; + constexpr char kRawTransparent = ' '; + constexpr char kRawWhite = '.'; + constexpr char kRawBlack = 'X'; constexpr static CursorData cursorFromBitMap(int x, int y, std::string_view bitmap) { @@ -35,15 +35,15 @@ namespace OpenRCT2::Ui uint8_t dataBit{}, maskBit{}; switch (rawPixel) { - case rawBlack: + case kRawBlack: dataBit = 1; maskBit = 1; break; - case rawWhite: + case kRawWhite: dataBit = 0; maskBit = 1; break; - case rawTransparent: + case kRawTransparent: dataBit = 0; maskBit = 0; break; @@ -947,7 +947,7 @@ namespace OpenRCT2::Ui " X.X " " X "); - static constexpr const CursorData* RawCursorData[] = { + static constexpr const CursorData* kRawCursorData[] = { nullptr, // CursorID::Arrow &kBlankCursorData, // CursorID::Blank &kUpArrowCursorData, // CursorID::UpArrow @@ -983,7 +983,7 @@ namespace OpenRCT2::Ui const CursorData* result = nullptr; if (cursorId != CursorID::Undefined && cursorId != CursorID::Count) { - result = RawCursorData[EnumValue(cursorId)]; + result = kRawCursorData[EnumValue(cursorId)]; } return result; } diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index 789fc979c3..19be2b7c79 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -172,7 +172,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) if ((modifier & KEYBOARD_PRIMARY_MODIFIER) && _session.Length) { SDL_SetClipboardText(_session.Buffer->c_str()); - ContextShowError(STR_COPY_INPUT_TO_CLIPBOARD, STR_NONE, {}); + ContextShowError(STR_COPY_INPUT_TO_CLIPBOARD, kStringIdNone, {}); } break; case SDLK_v: diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index e19194a059..f7938e6a92 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -63,7 +63,7 @@ using namespace OpenRCT2::Ui; class UiContext final : public IUiContext { private: - constexpr static uint32_t TOUCH_DOUBLE_TIMEOUT = 300; + constexpr static uint32_t kTouchDoubleTimeout = 300; const std::unique_ptr _platformUiContext; const std::unique_ptr _windowManager; @@ -176,12 +176,12 @@ public: void SetFullscreenMode(FULLSCREEN_MODE mode) override { - static constexpr int32_t _sdlFullscreenFlags[] = { + static constexpr int32_t kSDLFullscreenFlags[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP, }; - uint32_t windowFlags = _sdlFullscreenFlags[EnumValue(mode)]; + uint32_t windowFlags = kSDLFullscreenFlags[EnumValue(mode)]; // HACK Changing window size when in fullscreen usually has no effect if (mode == FULLSCREEN_MODE::FULLSCREEN) @@ -475,7 +475,7 @@ public: _cursorState.touchIsDouble = (!_cursorState.touchIsDouble - && e.tfinger.timestamp - _cursorState.touchDownTimestamp < TOUCH_DOUBLE_TIMEOUT); + && e.tfinger.timestamp - _cursorState.touchDownTimestamp < kTouchDoubleTimeout); if (_cursorState.touchIsDouble) { diff --git a/src/openrct2-ui/audio/AudioContext.cpp b/src/openrct2-ui/audio/AudioContext.cpp index 17ad6e709f..e20ffc5f8a 100644 --- a/src/openrct2-ui/audio/AudioContext.cpp +++ b/src/openrct2-ui/audio/AudioContext.cpp @@ -25,7 +25,7 @@ namespace OpenRCT2::Audio class AudioContext final : public IAudioContext { private: - static constexpr size_t STREAM_MIN_SIZE = 2 * 1024 * 1024; // 2 MiB + static constexpr size_t kStreamMinSize = 2 * 1024 * 1024; // 2 MiB std::unique_ptr _audioMixer; @@ -110,7 +110,7 @@ namespace OpenRCT2::Audio // Load whole stream into memory if small enough auto dataLength = source->GetLength(); - if (dataLength < STREAM_MIN_SIZE) + if (dataLength < kStreamMinSize) { auto& targetFormat = _audioMixer->GetFormat(); source = source->ToMemory(targetFormat); diff --git a/src/openrct2-ui/audio/SDLAudioSource.cpp b/src/openrct2-ui/audio/SDLAudioSource.cpp index 340566d9a5..ca267a3b8d 100644 --- a/src/openrct2-ui/audio/SDLAudioSource.cpp +++ b/src/openrct2-ui/audio/SDLAudioSource.cpp @@ -80,20 +80,20 @@ std::unique_ptr SDLAudioSource::ToMemory(const AudioFormat& targ static AudioCodecKind GetAudioCodec(SDL_RWops* rw) { - constexpr uint32_t MAGIC_FLAC = 0x43614C66; - constexpr uint32_t MAGIC_OGG = 0x5367674F; - constexpr uint32_t MAGIC_RIFF = 0x46464952; + constexpr uint32_t kMagicFLAC = 0x43614C66; + constexpr uint32_t kMagicOGG = 0x5367674F; + constexpr uint32_t kMagicRIFF = 0x46464952; auto originalPosition = SDL_RWtell(rw); auto magic = SDL_ReadLE32(rw); SDL_RWseek(rw, originalPosition, RW_SEEK_SET); switch (magic) { - case MAGIC_FLAC: + case kMagicFLAC: return AudioCodecKind::Flac; - case MAGIC_OGG: + case kMagicOGG: return AudioCodecKind::Ogg; - case MAGIC_RIFF: + case kMagicRIFF: return AudioCodecKind::Wav; default: return AudioCodecKind::Unknown; diff --git a/src/openrct2-ui/audio/WavAudioSource.cpp b/src/openrct2-ui/audio/WavAudioSource.cpp index a3ada6322f..5b6e12ff8b 100644 --- a/src/openrct2-ui/audio/WavAudioSource.cpp +++ b/src/openrct2-ui/audio/WavAudioSource.cpp @@ -20,11 +20,11 @@ namespace OpenRCT2::Audio class WavAudioSource final : public SDLAudioSource { private: - static constexpr uint32_t DATA = 0x61746164; - static constexpr uint32_t FMT = 0x20746D66; - static constexpr uint32_t RIFF = 0x46464952; - static constexpr uint32_t WAVE = 0x45564157; - static constexpr uint16_t pcmformat = 0x0001; + static constexpr uint32_t kChunkIdDATA = 0x61746164; + static constexpr uint32_t kChunkIdFMT = 0x20746D66; + static constexpr uint32_t kChunkIdRIFF = 0x46464952; + static constexpr uint32_t kChunkIdWAVE = 0x45564157; + static constexpr uint16_t kPCMFormat = 0x0001; SDL_RWops* _rw{}; AudioFormat _format = {}; @@ -36,7 +36,7 @@ namespace OpenRCT2::Audio : _rw(rw) { auto chunkId = SDL_ReadLE32(rw); - if (chunkId != RIFF) + if (chunkId != kChunkIdRIFF) { SDL_RWclose(rw); throw std::runtime_error("Not a WAV file"); @@ -45,13 +45,13 @@ namespace OpenRCT2::Audio // Read and discard chunk size SDL_ReadLE32(rw); auto chunkFormat = SDL_ReadLE32(rw); - if (chunkFormat != WAVE) + if (chunkFormat != kChunkIdWAVE) { SDL_RWclose(rw); throw std::runtime_error("Not in WAVE format"); } - auto fmtChunkSize = FindChunk(rw, FMT); + auto fmtChunkSize = FindChunk(rw, kChunkIdFMT); if (!fmtChunkSize) { SDL_RWclose(rw); @@ -61,7 +61,7 @@ namespace OpenRCT2::Audio auto chunkStart = SDL_RWtell(rw); auto encoding = SDL_ReadLE16(rw); - if (encoding != pcmformat) + if (encoding != kPCMFormat) { SDL_RWclose(rw); throw std::runtime_error("Not in PCM format"); @@ -87,7 +87,7 @@ namespace OpenRCT2::Audio SDL_RWseek(rw, chunkStart + fmtChunkSize, RW_SEEK_SET); - auto dataChunkSize = FindChunk(rw, DATA); + auto dataChunkSize = FindChunk(rw, kChunkIdDATA); if (dataChunkSize == 0) { SDL_RWclose(rw); @@ -155,11 +155,12 @@ namespace OpenRCT2::Audio { return subchunkSize; } - constexpr uint32_t FACT = 0x74636166; - constexpr uint32_t LIST = 0x5453494c; - constexpr uint32_t BEXT = 0x74786562; - constexpr uint32_t JUNK = 0x4B4E554A; - while (subchunkId == FACT || subchunkId == LIST || subchunkId == BEXT || subchunkId == JUNK) + constexpr uint32_t kChunkIdFACT = 0x74636166; + constexpr uint32_t kChunkIdLIST = 0x5453494c; + constexpr uint32_t kChunkIdBEXT = 0x74786562; + constexpr uint32_t kChunkIdJUNK = 0x4B4E554A; + while (subchunkId == kChunkIdFACT || subchunkId == kChunkIdLIST || subchunkId == kChunkIdBEXT + || subchunkId == kChunkIdJUNK) { SDL_RWseek(rw, subchunkSize, RW_SEEK_CUR); subchunkId = SDL_ReadLE32(rw); diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index 6b0d7f4d8d..d5ba5cfb5b 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -30,7 +30,7 @@ using namespace OpenRCT2::Ui; class HardwareDisplayDrawingEngine final : public X8DrawingEngine { private: - constexpr static uint32_t DIRTY_VISUAL_TIME = 32; + constexpr static uint32_t kDirtyVisualTime = 32; std::shared_ptr const _uiContext; SDL_Window* _window = nullptr; @@ -223,7 +223,7 @@ protected: { for (uint32_t y = top; y < bottom; y++) { - SetDirtyVisualTime(x, y, DIRTY_VISUAL_TIME); + SetDirtyVisualTime(x, y, kDirtyVisualTime); } } } diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp index 4663357757..16d2758d56 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp @@ -22,7 +22,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[4] = { +constexpr VDStruct kVertexData[4] = { { -1.0f, -1.0f, 0.0f, 0.0f }, { 1.0f, -1.0f, 1.0f, 0.0f }, { -1.0f, 1.0f, 0.0f, 1.0f }, @@ -38,7 +38,7 @@ ApplyPaletteShader::ApplyPaletteShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); glVertexAttribPointer( diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp index 14b9032439..3d4201ecee 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp @@ -22,7 +22,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[4] = { +constexpr VDStruct kVertexData[4] = { { -1.0f, -1.0f, 0.0f, 0.0f }, { 1.0f, -1.0f, 1.0f, 0.0f }, { -1.0f, 1.0f, 0.0f, 1.0f }, @@ -38,7 +38,7 @@ ApplyTransparencyShader::ApplyTransparencyShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); glVertexAttribPointer( diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp index 07f2aa8ba5..b3a47c9f16 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp @@ -23,7 +23,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[2] = { +constexpr VDStruct kVertexData[2] = { { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }, }; @@ -38,7 +38,7 @@ DrawLineShader::DrawLineShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); glVertexAttribPointer( diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp index 4de36de760..f9217295af 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp @@ -22,7 +22,7 @@ namespace }; } // namespace -constexpr VDStruct VertexData[4] = { +constexpr VDStruct kVertexData[4] = { { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f }, { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f }, @@ -42,7 +42,7 @@ DrawRectShader::DrawRectShader() glGenVertexArrays(1, &_vao); glBindBuffer(GL_ARRAY_BUFFER, _vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(VertexData), VertexData, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(kVertexData), kVertexData, GL_STATIC_DRAW); glBindVertexArray(_vao); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 6c46095015..52951d795f 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -47,7 +47,7 @@ struct OpenGLVersion GLint Minor; }; -constexpr OpenGLVersion OPENGL_MINIMUM_REQUIRED_VERSION = { 3, 3 }; +constexpr OpenGLVersion kOpenGLMinimumRequiredVersion = { 3, 3 }; constexpr uint8_t kCSInside = 0b0000; constexpr uint8_t kCSLeft = 0b0001; @@ -216,7 +216,7 @@ public: void Initialise() override { - OpenGLVersion requiredVersion = OPENGL_MINIMUM_REQUIRED_VERSION; + OpenGLVersion requiredVersion = kOpenGLMinimumRequiredVersion; SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, requiredVersion.Major); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, requiredVersion.Minor); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp index 445c0613a1..b9f86f0654 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp @@ -18,11 +18,11 @@ using namespace OpenRCT2::Ui; -constexpr GLuint BACKBUFFER_ID = 0; +constexpr GLuint kBackBufferID = 0; OpenGLFramebuffer::OpenGLFramebuffer(SDL_Window* window) { - _id = BACKBUFFER_ID; + _id = kBackBufferID; _texture = 0; _depth = 0; SDL_GL_GetDrawableSize(window, &_width, &_height); @@ -65,7 +65,7 @@ OpenGLFramebuffer::OpenGLFramebuffer(int32_t width, int32_t height, bool depth, OpenGLFramebuffer::~OpenGLFramebuffer() { - if (_id != BACKBUFFER_ID) + if (_id != kBackBufferID) { glDeleteTextures(1, &_texture); glDeleteTextures(1, &_depth); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp index 74a5db8141..88001df572 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp @@ -77,7 +77,7 @@ std::string OpenGLShader::ReadSourceCode(const std::string& path) auto fs = FileStream(path, FILE_MODE_OPEN); uint64_t fileLength = fs.GetLength(); - if (fileLength > MaxSourceSize) + if (fileLength > kMaxSourceSize) { throw IOException("Shader source too large."); } diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h index 167bcb75f5..2537e75c88 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h @@ -18,7 +18,7 @@ namespace OpenRCT2::Ui class OpenGLShader final { private: - static constexpr uint64_t MaxSourceSize = 8 * 1024 * 1024; // 8 MiB + static constexpr uint64_t kMaxSourceSize = 8 * 1024 * 1024; // 8 MiB GLenum _type; GLuint _id = 0; diff --git a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp index 86ebfbe548..3a85b1a6e8 100644 --- a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp @@ -15,9 +15,9 @@ using namespace OpenRCT2::Ui; -constexpr GLfloat depthValue[1] = { 1.0f }; -constexpr GLfloat depthValueTransparent[1] = { 0.0f }; -constexpr GLuint indexValue[4] = { 0, 0, 0, 0 }; +constexpr GLfloat kDepthValue[1] = { 1.0f }; +constexpr GLfloat kDepthValueTransparent[1] = { 0.0f }; +constexpr GLuint kIndexValue[4] = { 0, 0, 0, 0 }; SwapFramebuffer::SwapFramebuffer(int32_t width, int32_t height) : _opaqueFramebuffer(width, height) @@ -26,7 +26,7 @@ SwapFramebuffer::SwapFramebuffer(int32_t width, int32_t height) , _backDepth(OpenGLFramebuffer::CreateDepthTexture(width, height)) { _transparentFramebuffer.Bind(); - glClearBufferfv(GL_DEPTH, 0, depthValueTransparent); + glClearBufferfv(GL_DEPTH, 0, kDepthValueTransparent); } SwapFramebuffer::~SwapFramebuffer() @@ -48,8 +48,8 @@ void SwapFramebuffer::ApplyTransparency(ApplyTransparencyShader& shader, GLuint // Clear transparency buffers _transparentFramebuffer.Bind(); - glClearBufferuiv(GL_COLOR, 0, indexValue); - glClearBufferfv(GL_DEPTH, 0, depthValueTransparent); + glClearBufferuiv(GL_COLOR, 0, kIndexValue); + glClearBufferfv(GL_DEPTH, 0, kDepthValueTransparent); _opaqueFramebuffer.SwapColourBuffer(_mixFramebuffer); // Change binding to guarantee no undefined behavior @@ -59,7 +59,7 @@ void SwapFramebuffer::ApplyTransparency(ApplyTransparencyShader& shader, GLuint void SwapFramebuffer::Clear() { _opaqueFramebuffer.Bind(); - glClearBufferfv(GL_DEPTH, 0, depthValue); + glClearBufferfv(GL_DEPTH, 0, kDepthValue); } #endif /* DISABLE_OPENGL */ diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index 64a3b55ea7..9d65a71149 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -175,9 +175,9 @@ void TextureCache::CreateTextures() { // Determine width and height to use for texture atlases glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_atlasesTextureDimensions); - if (_atlasesTextureDimensions > TEXTURE_CACHE_MAX_ATLAS_SIZE) + if (_atlasesTextureDimensions > kTextureCacheMaxAtlasSize) { - _atlasesTextureDimensions = TEXTURE_CACHE_MAX_ATLAS_SIZE; + _atlasesTextureDimensions = kTextureCacheMaxAtlasSize; } // Determine maximum number of atlases (minimum of size and array limit) diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index 9e3772a1fc..1a1b4561dc 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -54,11 +54,11 @@ namespace OpenRCT2::Ui // This is the maximum width and height of each atlas, basically the // granularity at which new atlases are allocated (2048 -> 4 MB of VRAM) - constexpr int32_t TEXTURE_CACHE_MAX_ATLAS_SIZE = 2048; + constexpr int32_t kTextureCacheMaxAtlasSize = 2048; // Pixel dimensions of smallest supported slots in texture atlases // Must be a power of 2! - constexpr int32_t TEXTURE_CACHE_SMALLEST_SLOT = 32; + constexpr int32_t kTextureCacheSmallestSlot = 32; struct BasicTextureInfo { @@ -155,9 +155,9 @@ namespace OpenRCT2::Ui { int32_t actualSize = std::max(actualWidth, actualHeight); - if (actualSize < TEXTURE_CACHE_SMALLEST_SLOT) + if (actualSize < kTextureCacheSmallestSlot) { - actualSize = TEXTURE_CACHE_SMALLEST_SLOT; + actualSize = kTextureCacheSmallestSlot; } return static_cast(ceil(log2f(static_cast(actualSize)))); diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 13de6798b2..d9d652f865 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -81,10 +81,10 @@ void InputManager::QueueInputEvent(InputEvent&& e) void InputManager::CheckJoysticks() { - constexpr uint32_t CHECK_INTERVAL_MS = 5000; + constexpr uint32_t kCheckInternalMs = 5000; auto tick = SDL_GetTicks(); - if (tick > _lastJoystickCheck + CHECK_INTERVAL_MS) + if (tick > _lastJoystickCheck + kCheckInternalMs) { _lastJoystickCheck = tick; diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 2a6087a2d8..f4d64b15a3 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1142,7 +1142,7 @@ namespace OpenRCT2 { CursorID cursorId = CursorID::Arrow; auto ft = Formatter(); - ft.Add(STR_NONE); + ft.Add(kStringIdNone); SetMapTooltip(ft); auto* windowMgr = GetWindowManager(); @@ -1348,16 +1348,16 @@ namespace OpenRCT2 if (_clickRepeatTicks.has_value()) { // The initial amount of time in ticks to wait until the first click repeat. - constexpr auto ticksUntilRepeats = 16U; + constexpr auto kTicksUntilRepeats = 16u; // The amount of ticks between each click repeat. - constexpr auto eventDelayInTicks = 3U; + constexpr auto kEventDelayInTicks = 3u; // The amount of ticks since the last click repeat. const auto clickRepeatsDelta = gCurrentRealTimeTicks - _clickRepeatTicks.value(); // Handle click repeat, only start this when at least 16 ticks elapsed. - if (clickRepeatsDelta >= ticksUntilRepeats && (clickRepeatsDelta & eventDelayInTicks) == 0) + if (clickRepeatsDelta >= kTicksUntilRepeats && (clickRepeatsDelta & kEventDelayInTicks) == 0) { if (WidgetIsHoldable(*w, widgetIndex)) { @@ -1365,7 +1365,7 @@ namespace OpenRCT2 } // Subtract initial delay from here on we want the event each third tick. - _clickRepeatTicks = gCurrentRealTimeTicks - ticksUntilRepeats; + _clickRepeatTicks = gCurrentRealTimeTicks - kTicksUntilRepeats; } } @@ -1397,7 +1397,7 @@ namespace OpenRCT2 { dropdown_index = DropdownIndexFromPoint(screenCoords, w); dropdownCleanup = dropdown_index == -1 - || (dropdown_index < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) + || (dropdown_index < Dropdown::kItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) || gDropdownItems[dropdown_index].IsSeparator(); w = nullptr; // To be closed right next } @@ -1531,7 +1531,7 @@ namespace OpenRCT2 OpenRCT2String{ kColourToTip.at(ColourDropDownIndexToColour(dropdown_index)), {} }, screenCoords); } - if (dropdown_index < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) + if (dropdown_index < Dropdown::kItemsMaxSize && Dropdown::IsDisabled(dropdown_index)) { return; } diff --git a/src/openrct2-ui/input/ShortcutInput.cpp b/src/openrct2-ui/input/ShortcutInput.cpp index 21b8906aff..f49fe84bd6 100644 --- a/src/openrct2-ui/input/ShortcutInput.cpp +++ b/src/openrct2-ui/input/ShortcutInput.cpp @@ -20,7 +20,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; -constexpr uint32_t UsefulModifiers = KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_GUI; +constexpr uint32_t kUsefulModifiers = KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_GUI; static uint32_t ParseModifier(std::string_view text) { @@ -202,7 +202,7 @@ std::string_view ShortcutInput::GetModifierName(uint32_t key, bool localised) auto r = _keys.find(key); if (r != _keys.end()) { - if (localised && r->second.second != STR_NONE) + if (localised && r->second.second != kStringIdNone) { return LanguageGetString(r->second.second); } @@ -379,7 +379,7 @@ static bool HasModifier(uint32_t shortcut, uint32_t actual, uint32_t left, uint3 static bool CompareModifiers(uint32_t shortcut, uint32_t actual) { - shortcut &= UsefulModifiers; + shortcut &= kUsefulModifiers; return HasModifier(shortcut, actual, KMOD_LCTRL, KMOD_RCTRL) && HasModifier(shortcut, actual, KMOD_LSHIFT, KMOD_RSHIFT) && HasModifier(shortcut, actual, KMOD_LALT, KMOD_RALT) && HasModifier(shortcut, actual, KMOD_LGUI, KMOD_RGUI); } @@ -399,7 +399,7 @@ bool ShortcutInput::Matches(const InputEvent& e) const std::optional ShortcutInput::FromInputEvent(const InputEvent& e) { // Assume any side modifier (more specific configurations can be done by manually editing config file) - auto modifiers = e.Modifiers & UsefulModifiers; + auto modifiers = e.Modifiers & kUsefulModifiers; for (auto mod : { KMOD_CTRL, KMOD_SHIFT, KMOD_ALT, KMOD_GUI }) { if (modifiers & mod) diff --git a/src/openrct2-ui/input/ShortcutManager.cpp b/src/openrct2-ui/input/ShortcutManager.cpp index 99562b707c..b1423f7316 100644 --- a/src/openrct2-ui/input/ShortcutManager.cpp +++ b/src/openrct2-ui/input/ShortcutManager.cpp @@ -227,26 +227,26 @@ void ShortcutManager::LoadUserBindings() std::optional ShortcutManager::ConvertLegacyBinding(uint16_t binding) { - constexpr uint16_t nullBinding = 0xFFFF; - constexpr uint16_t shift = 0x100; - constexpr uint16_t ctrl = 0x200; - constexpr uint16_t alt = 0x400; - constexpr uint16_t cmd = 0x800; + constexpr uint16_t kNullBinding = 0xFFFF; + constexpr uint16_t kShift = 0x100; + constexpr uint16_t kCtrl = 0x200; + constexpr uint16_t kAlt = 0x400; + constexpr uint16_t kCmd = 0x800; - if (binding == nullBinding) + if (binding == kNullBinding) { return std::nullopt; } ShortcutInput result; result.Kind = InputDeviceKind::Keyboard; - if (binding & shift) + if (binding & kShift) result.Modifiers |= KMOD_SHIFT; - if (binding & ctrl) + if (binding & kCtrl) result.Modifiers |= KMOD_CTRL; - if (binding & alt) + if (binding & kAlt) result.Modifiers |= KMOD_ALT; - if (binding & cmd) + if (binding & kCmd) result.Modifiers |= KMOD_GUI; result.Button = SDL_GetKeyFromScancode(static_cast(binding & 0xFF)); return result; @@ -254,14 +254,14 @@ std::optional ShortcutManager::ConvertLegacyBinding(uint16_t bind void ShortcutManager::LoadLegacyBindings(const fs::path& path) { - constexpr int32_t SUPPORTED_FILE_VERSION = 1; - constexpr int32_t MAX_LEGACY_SHORTCUTS = 85; + constexpr int32_t kSupportedFileVersion = 1; + constexpr int32_t kMaxLegacyShortcuts = 85; auto fs = FileStream(path, FILE_MODE_OPEN); auto version = fs.ReadValue(); - if (version == SUPPORTED_FILE_VERSION) + if (version == kSupportedFileVersion) { - for (size_t i = 0; i < MAX_LEGACY_SHORTCUTS; i++) + for (size_t i = 0; i < kMaxLegacyShortcuts; i++) { auto value = fs.ReadValue(); auto shortcutId = GetLegacyShortcutId(i); diff --git a/src/openrct2-ui/input/ShortcutManager.h b/src/openrct2-ui/input/ShortcutManager.h index 52066f4c96..bbe6d9442d 100644 --- a/src/openrct2-ui/input/ShortcutManager.h +++ b/src/openrct2-ui/input/ShortcutManager.h @@ -57,7 +57,7 @@ namespace OpenRCT2::Ui { public: std::string Id; - StringId LocalisedName = STR_NONE; + StringId LocalisedName = kStringIdNone; std::string CustomName; std::vector Default; std::vector Current; diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index d80f3f7c16..dda8577925 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -18,10 +18,10 @@ namespace OpenRCT2::Dropdown { struct Item; - constexpr StringId SeparatorString = 0; - constexpr StringId FormatColourPicker = 0xFFFE; - constexpr StringId FormatLandPicker = 0xFFFF; - constexpr int32_t ItemsMaxSize = 512; + constexpr StringId kSeparatorString = 0; + constexpr StringId kFormatColourPicker = 0xFFFE; + constexpr StringId kFormatLandPicker = 0xFFFF; + constexpr int32_t kItemsMaxSize = 512; enum Flag { @@ -39,7 +39,7 @@ namespace OpenRCT2::Dropdown namespace OpenRCT2::Ui::Windows { extern int32_t gDropdownNumItems; - extern Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; + extern Dropdown::Item gDropdownItems[Dropdown::kItemsMaxSize]; extern bool gDropdownIsColour; extern int32_t gDropdownLastColourHover; extern int32_t gDropdownHighlightedIndex; @@ -81,7 +81,7 @@ namespace OpenRCT2::Dropdown constexpr bool IsSeparator() const { - return Format == SeparatorString; + return Format == kSeparatorString; } constexpr bool IsDisabled() const @@ -116,7 +116,7 @@ namespace OpenRCT2::Dropdown constexpr ItemExt Separator() { - return ItemExt(-1, Dropdown::SeparatorString, STR_EMPTY); + return ItemExt(-1, Dropdown::kSeparatorString, kStringIdEmpty); } template diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 470bf79a27..4074de17c6 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -41,7 +41,7 @@ static int32_t InGameConsoleGetLineHeight() void InGameConsole::WriteInitial() { - InteractiveConsole::WriteLine(OPENRCT2_NAME " " OPENRCT2_VERSION); + InteractiveConsole::WriteLine(OPENRCT2_NAME " " kOpenRCT2Version); InteractiveConsole::WriteLine(LanguageGetString(STR_CONSOLE_HELPER_TEXT)); InteractiveConsole::WriteLine(""); WritePrompt(); @@ -135,13 +135,13 @@ void InGameConsole::ClearInput() _consoleCurrentLine.clear(); if (_isOpen) { - _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, CONSOLE_INPUT_SIZE); + _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, kConsoleInputSize); } } void InGameConsole::HistoryAdd(const u8string& src) { - if (_consoleHistory.size() >= CONSOLE_HISTORY_SIZE) + if (_consoleHistory.size() >= kConsoleHistorySize) { _consoleHistory.pop_front(); } @@ -201,7 +201,7 @@ void InGameConsole::Open() _isOpen = true; ScrollToEnd(); RefreshCaret(); - _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, CONSOLE_INPUT_SIZE); + _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, kConsoleInputSize); } void InGameConsole::Close() @@ -242,9 +242,9 @@ void InGameConsole::WriteLine(const std::string& input, FormatToken colourFormat stringOffset = splitPos + 1; } - if (_consoleLines.size() > CONSOLE_MAX_LINES) + if (_consoleLines.size() > kConsoleMaxLines) { - const std::size_t linesToErase = _consoleLines.size() - CONSOLE_MAX_LINES; + const std::size_t linesToErase = _consoleLines.size() - kConsoleMaxLines; _consoleLines.erase(_consoleLines.begin(), _consoleLines.begin() + linesToErase); } } @@ -323,7 +323,7 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const INSET_RECT_FLAG_BORDER_INSET); std::string lineBuffer; - auto screenCoords = _consoleTopLeft + ScreenCoordsXY{ CONSOLE_EDGE_PADDING, CONSOLE_EDGE_PADDING }; + auto screenCoords = _consoleTopLeft + ScreenCoordsXY{ kConsoleEdgePadding, kConsoleEdgePadding }; // Draw text inside console for (std::size_t i = 0; i < _consoleLines.size() && i < static_cast(maxLines); i++) @@ -353,7 +353,7 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const screenCoords.y += lineHeight; } - screenCoords.y = _consoleBottomRight.y - lineHeight - CONSOLE_EDGE_PADDING - 1; + screenCoords.y = _consoleBottomRight.y - lineHeight - kConsoleEdgePadding - 1; // Draw current line if (textColour.colour == COLOUR_BLACK) @@ -367,11 +367,11 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const } // Draw caret - if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD) + if (_consoleCaretTicks < kConsoleCaretFlashThreshold) { auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight }; uint8_t caretColour = ColourMapA[textColour.colour].lightest; - GfxFillRect(dpi, { caret, caret + ScreenCoordsXY{ CONSOLE_CARET_WIDTH, 1 } }, caretColour); + GfxFillRect(dpi, { caret, caret + ScreenCoordsXY{ kConsoleCaretWidth, 1 } }, caretColour); } // What about border colours? diff --git a/src/openrct2-ui/interface/InGameConsole.h b/src/openrct2-ui/interface/InGameConsole.h index 31497b9a6c..e0d3b6b6bf 100644 --- a/src/openrct2-ui/interface/InGameConsole.h +++ b/src/openrct2-ui/interface/InGameConsole.h @@ -21,12 +21,12 @@ namespace OpenRCT2::Ui class InGameConsole final : public InteractiveConsole { private: - static constexpr int32_t CONSOLE_MAX_LINES = 300; - static constexpr int32_t CONSOLE_HISTORY_SIZE = 64; - static constexpr int32_t CONSOLE_INPUT_SIZE = 256; - static constexpr int32_t CONSOLE_CARET_FLASH_THRESHOLD = 15; - static constexpr int32_t CONSOLE_EDGE_PADDING = 4; - static constexpr int32_t CONSOLE_CARET_WIDTH = 6; + static constexpr int32_t kConsoleMaxLines = 300; + static constexpr int32_t kConsoleHistorySize = 64; + static constexpr int32_t kConsoleInputSize = 256; + static constexpr int32_t kConsoleCaretFlashThreshold = 15; + static constexpr int32_t kConsoleEdgePadding = 4; + static constexpr int32_t kConsoleCaretWidth = 6; bool _isInitialised = false; bool _isOpen = false; diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 661168ebbb..8c9c3c165e 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -68,7 +68,7 @@ void LandTool::ShowSurfaceStyleDropdown(WindowBase* w, Widget* widget, ObjectEnt if (surfaceObj->Colour != TerrainSurfaceObject::kNoValue) imageId = imageId.WithPrimary(surfaceObj->Colour); - gDropdownItems[itemIndex].Format = Dropdown::FormatLandPicker; + gDropdownItems[itemIndex].Format = Dropdown::kFormatLandPicker; Dropdown::SetImage(itemIndex, imageId); if (i == currentSurfaceType) { @@ -118,7 +118,7 @@ void LandTool::ShowEdgeStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryI // If fallback images are loaded, the RCT1 styles will just look like copies of already existing styles, so hide them. if (edgeObj != nullptr && !edgeObj->UsesFallbackImages()) { - gDropdownItems[itemIndex].Format = Dropdown::FormatLandPicker; + gDropdownItems[itemIndex].Format = Dropdown::kFormatLandPicker; Dropdown::SetImage(itemIndex, ImageId(edgeObj->IconImageId)); if (i == currentEdgeType) { diff --git a/src/openrct2-ui/interface/Objective.cpp b/src/openrct2-ui/interface/Objective.cpp index 702fea5992..fa161be184 100644 --- a/src/openrct2-ui/interface/Objective.cpp +++ b/src/openrct2-ui/interface/Objective.cpp @@ -37,7 +37,7 @@ namespace OpenRCT2::Ui { if (objective.Type == OBJECTIVE_BUILD_THE_BEST) { - StringId rideTypeString = STR_NONE; + StringId rideTypeString = kStringIdNone; auto rideTypeId = objective.RideId; if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) { diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 28dd7d7328..62bcf66c3f 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -896,7 +896,7 @@ static constexpr UIThemeWindowEntry PredefinedThemeRCT1_Entries[] = const WindowThemeDesc* desc = GetWindowThemeDescriptor(wc); if (desc == nullptr) { - return STR_EMPTY; + return kStringIdEmpty; } return desc->WindowName; } diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 75b8669152..0b5c1df1eb 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -506,7 +506,7 @@ namespace OpenRCT2::Ui { ft.Add(STR_BROKEN); } - ft.Add(pathAddEntry != nullptr ? pathAddEntry->name : STR_NONE); + ft.Add(pathAddEntry != nullptr ? pathAddEntry->name : kStringIdNone); SetMapTooltip(ft); return info; } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 17fe158387..52002e0389 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -227,7 +227,7 @@ namespace OpenRCT2::Ui // Get the widget auto& widget = w.widgets[widgetIndex]; - if (widget.type != WindowWidgetType::Tab && widget.image.GetIndex() == ImageIndexUndefined) + if (widget.type != WindowWidgetType::Tab && widget.image.GetIndex() == kImageIndexUndefined) return; if (widget.type == WindowWidgetType::Tab) @@ -235,7 +235,7 @@ namespace OpenRCT2::Ui if (WidgetIsDisabled(w, widgetIndex)) return; - if (widget.image.GetIndex() == ImageIndexUndefined) + if (widget.image.GetIndex() == kImageIndexUndefined) { // Set standard tab sprite to use. widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull); @@ -346,7 +346,7 @@ namespace OpenRCT2::Ui // Get the widget const auto& widget = w.widgets[widgetIndex]; - if (widget.text == STR_NONE) + if (widget.text == kStringIdNone) return; auto colour = w.colours[widget.colour]; @@ -391,7 +391,7 @@ namespace OpenRCT2::Ui // Get the widget const auto& widget = w.widgets[widgetIndex]; - if (widget.text == STR_NONE || widget.content == kWidgetContentEmpty) + if (widget.text == kStringIdNone || widget.content == kWidgetContentEmpty) return; auto colour = w.colours[widget.colour]; @@ -457,7 +457,7 @@ namespace OpenRCT2::Ui { if (widget.string == nullptr || widget.string[0] == '\0') { - stringId = STR_NONE; + stringId = kStringIdNone; formatArgs = nullptr; } else @@ -485,7 +485,7 @@ namespace OpenRCT2::Ui // Text auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget); - if (stringId != STR_NONE) + if (stringId != kStringIdNone) { auto colour = w.colours[widget.colour].withFlag(ColourFlag::translucent, false); if (WidgetIsDisabled(w, widgetIndex)) @@ -561,7 +561,7 @@ namespace OpenRCT2::Ui FilterPaletteID::PaletteDarken3); // Draw text - if (widget->text == STR_NONE) + if (widget->text == kStringIdNone) return; topLeft = w.windowPos + ScreenCoordsXY{ widget->left + 2, widget->top + 1 }; @@ -606,7 +606,7 @@ namespace OpenRCT2::Ui // Draw the button GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, press); - if (widget.text == STR_NONE) + if (widget.text == kStringIdNone) return; topLeft = w.windowPos + ScreenCoordsXY{ widget.midX() - 1, std::max(widget.top, widget.midY() - 5) }; @@ -652,7 +652,7 @@ namespace OpenRCT2::Ui } // draw the text - if (widget.text == STR_NONE) + if (widget.text == kStringIdNone) return; auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget); diff --git a/src/openrct2-ui/interface/Widget.h b/src/openrct2-ui/interface/Widget.h index 1442f79f1f..1404c9108a 100644 --- a/src/openrct2-ui/interface/Widget.h +++ b/src/openrct2-ui/interface/Widget.h @@ -19,7 +19,7 @@ namespace OpenRCT2::Ui { // clang-format off #define WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, CLOSE_STR) \ - { WindowWidgetType::Frame, 0, 0, WIDTH - 1, 0, HEIGHT - 1, 0xFFFFFFFF, STR_NONE }, \ + { WindowWidgetType::Frame, 0, 0, WIDTH - 1, 0, HEIGHT - 1, 0xFFFFFFFF, kStringIdNone }, \ { WindowWidgetType::Caption, 0, 1, WIDTH - 2, 1, 14, TITLE, STR_WINDOW_TITLE_TIP }, \ { WindowWidgetType::CloseBox, 0, WIDTH - 13, WIDTH - 3, 2, 13, CLOSE_STR, STR_CLOSE_WINDOW_TIP } @@ -52,7 +52,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, - uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { Widget out = {}; out.left = origin.x; @@ -69,7 +69,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageId image, - StringId tooltip = STR_NONE) + StringId tooltip = kStringIdNone) { Widget out = {}; out.left = origin.x; @@ -86,17 +86,17 @@ namespace OpenRCT2::Ui constexpr Widget MakeRemapWidget( const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageIndex content, - StringId tooltip = STR_NONE) + StringId tooltip = kStringIdNone) { return MakeWidget(origin, size, type, colour, ImageId(content, FilterPaletteID::PaletteNull), tooltip); } - constexpr Widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = STR_NONE) + constexpr Widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = kStringIdNone) { const ScreenSize size = kTabSize; const WindowWidgetType type = WindowWidgetType::Tab; const WindowColour colour = WindowColour::Secondary; - const auto content = ImageId(ImageIndexUndefined); + const auto content = ImageId(kImageIndexUndefined); return MakeWidget(origin, size, type, colour, content, tooltip); } @@ -113,7 +113,7 @@ namespace OpenRCT2::Ui out.type = WindowWidgetType::ProgressBar; out.colour = colour; out.content = 0 | (lowerBlinkBound << 8) | (upperBlinkBound << 16); - out.tooltip = STR_NONE; + out.tooltip = kStringIdNone; return out; } @@ -125,7 +125,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeSpinnerDecreaseWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { const int16_t xPos = origin.x + size.width - 26; const int16_t yPos = origin.y + 1; @@ -137,7 +137,7 @@ namespace OpenRCT2::Ui constexpr Widget MakeSpinnerIncreaseWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { const int16_t xPos = origin.x + size.width - 13; const int16_t yPos = origin.y + 1; @@ -152,14 +152,14 @@ namespace OpenRCT2::Ui constexpr Widget MakeDropdownBoxWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { return MakeWidget(origin, size, type, colour, content); } constexpr Widget MakeDropdownButtonWidget( const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = STR_NONE) + [[maybe_unused]] uint32_t content = kWidgetContentEmpty, StringId tooltip = kStringIdNone) { const int16_t xPos = origin.x + size.width - 11; const int16_t yPos = origin.y + 1; diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 82a567b29f..48376cecd8 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -37,7 +37,7 @@ namespace OpenRCT2 using namespace OpenRCT2::Ui; // The amount of pixels to scroll per wheel click - constexpr int32_t WindowScrollPixels = 17; + constexpr int32_t kWindowScrollPixels = 17; static int32_t _previousAbsoluteWheel = 0; @@ -259,7 +259,7 @@ namespace OpenRCT2 auto cursorState = ContextGetCursorState(); int32_t absolute_wheel = cursorState->wheel; int32_t relative_wheel = absolute_wheel - _previousAbsoluteWheel; - int32_t pixel_scroll = relative_wheel * WindowScrollPixels; + int32_t pixel_scroll = relative_wheel * kWindowScrollPixels; _previousAbsoluteWheel = absolute_wheel; if (relative_wheel == 0) diff --git a/src/openrct2-ui/ride/Construction.h b/src/openrct2-ui/ride/Construction.h index 519704e59f..93dd609d79 100644 --- a/src/openrct2-ui/ride/Construction.h +++ b/src/openrct2-ui/ride/Construction.h @@ -145,7 +145,7 @@ namespace OpenRCT2 TrackElemType::RightFlyerLargeHalfLoopInvertedUp, TrackElemType::RightFlyerLargeHalfLoopUninvertedDown, }; - constexpr size_t DropdownLength = DropdownOrder.size(); + constexpr size_t kDropdownLength = DropdownOrder.size(); // Update the magic number with the current number of track elements to silence static_assert(EnumValue(TrackElemType::Count) == 349, "Reminder to add new track element to special dropdown list"); diff --git a/src/openrct2-ui/scripting/CustomImages.cpp b/src/openrct2-ui/scripting/CustomImages.cpp index d66456854f..5cd5d65ef5 100644 --- a/src/openrct2-ui/scripting/CustomImages.cpp +++ b/src/openrct2-ui/scripting/CustomImages.cpp @@ -83,7 +83,7 @@ namespace OpenRCT2::Scripting images.resize(count); auto base = GfxObjectAllocateImages(images.data(), count); - if (base == ImageIndexUndefined) + if (base == kImageIndexUndefined) { return {}; } diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 5039e8162d..cb74e26c76 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -26,7 +26,7 @@ using namespace OpenRCT2::Ui::Windows; namespace OpenRCT2::Scripting { - constexpr size_t COLUMN_HEADER_HEIGHT = kListRowHeight + 1; + constexpr size_t kColumnHeaderHeight = kListRowHeight + 1; template<> ColumnSortOrder FromDuk(const DukValue& d) @@ -431,7 +431,7 @@ ScreenSize CustomListView::GetSize() result.height = static_cast(Items.size() * kListRowHeight); if (ShowColumnHeaders) { - result.height += COLUMN_HEADER_HEIGHT; + result.height += kColumnHeaderHeight; } } @@ -472,7 +472,7 @@ void CustomListView::MouseOver(const ScreenCoordsXY& pos, bool isMouseDown) HighlightedCell = hitResult; if (HighlightedCell != LastHighlightedCell) { - if (hitResult->Row != HEADER_ROW && OnHighlight.context() != nullptr && OnHighlight.is_function()) + if (hitResult->Row != kHeaderRow && OnHighlight.context() != nullptr && OnHighlight.is_function()) { auto ctx = OnHighlight.context(); duk_push_int(ctx, static_cast(HighlightedCell->Row)); @@ -489,7 +489,7 @@ void CustomListView::MouseOver(const ScreenCoordsXY& pos, bool isMouseDown) // Update the header currently held down if (isMouseDown) { - if (hitResult && hitResult->Row == HEADER_ROW) + if (hitResult && hitResult->Row == kHeaderRow) { ColumnHeaderPressedCurrentState = (hitResult->Column == ColumnHeaderPressed); Invalidate(); @@ -511,7 +511,7 @@ void CustomListView::MouseDown(const ScreenCoordsXY& pos) auto hitResult = GetItemIndexAt(pos); if (hitResult) { - if (hitResult->Row != HEADER_ROW) + if (hitResult->Row != kHeaderRow) { if (CanSelect) { @@ -531,7 +531,7 @@ void CustomListView::MouseDown(const ScreenCoordsXY& pos) } } } - if (hitResult && hitResult->Row == HEADER_ROW) + if (hitResult && hitResult->Row == kHeaderRow) { if (Columns[hitResult->Column].CanSort) { @@ -546,7 +546,7 @@ void CustomListView::MouseDown(const ScreenCoordsXY& pos) void CustomListView::MouseUp(const ScreenCoordsXY& pos) { auto hitResult = GetItemIndexAt(pos); - if (hitResult && hitResult->Row == HEADER_ROW) + if (hitResult && hitResult->Row == kHeaderRow) { if (hitResult->Column == ColumnHeaderPressed) { @@ -566,7 +566,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollArea* auto paletteIndex = ColourMapA[w->colours[1].colour].mid_light; GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, paletteIndex); - int32_t y = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0; + int32_t y = ShowColumnHeaders ? kColumnHeaderHeight : 0; for (size_t i = 0; i < Items.size(); i++) { if (y > dpi.y + dpi.height) @@ -787,12 +787,12 @@ std::optional CustomListView::GetItemIndexAt(const ScreenCoordsXY& po if (ShowColumnHeaders && absoluteY >= 0 && absoluteY < kListRowHeight) { result = RowColumn(); - result->Row = HEADER_ROW; + result->Row = kHeaderRow; } else { // Check what row we pressed - int32_t firstY = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0; + int32_t firstY = ShowColumnHeaders ? kColumnHeaderHeight : 0; int32_t row = (pos.y - firstY) / kListRowHeight; if (row >= 0 && row < static_cast(Items.size())) { diff --git a/src/openrct2-ui/scripting/CustomListView.h b/src/openrct2-ui/scripting/CustomListView.h index b28a7fa13f..f02268bb9c 100644 --- a/src/openrct2-ui/scripting/CustomListView.h +++ b/src/openrct2-ui/scripting/CustomListView.h @@ -94,7 +94,7 @@ namespace OpenRCT2::Ui::Windows class CustomListView { private: - static constexpr int32_t HEADER_ROW = -1; + static constexpr int32_t kHeaderRow = -1; WindowBase* ParentWindow{}; size_t ScrollIndex{}; diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index d085254a99..207157c8f4 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -259,7 +259,7 @@ namespace OpenRCT2::Scripting } else { - customTool.Filter = ViewportInteractionItemAll; + customTool.Filter = kViewportInteractionItemAll; } customTool.onStart = dukValue["onStart"]; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index ff5d1605e5..41e308b78b 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -641,7 +641,7 @@ namespace OpenRCT2::Ui::Windows widget--; auto selectedIndex = widgetDesc->SelectedIndex; const auto& items = widgetDesc->Items; - const auto numItems = std::min(items.size(), Dropdown::ItemsMaxSize); + const auto numItems = std::min(items.size(), Dropdown::kItemsMaxSize); for (size_t i = 0; i < numItems; i++) { gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; @@ -901,7 +901,7 @@ namespace OpenRCT2::Ui::Windows widget.top = 17; widget.bottom = 43; widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull); - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; widgetList.push_back(widget); _info.WidgetIndexMap.push_back(std::numeric_limits::max()); } @@ -958,7 +958,7 @@ namespace OpenRCT2::Ui::Windows widget.right = desc.X + desc.Width - 1; widget.bottom = desc.Y + desc.Height - 1; widget.content = std::numeric_limits::max(); - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; widget.sztooltip = const_cast(desc.Tooltip.c_str()); widget.flags |= WIDGET_FLAGS::TOOLTIP_IS_STRING; if (desc.IsDisabled) @@ -1030,7 +1030,7 @@ namespace OpenRCT2::Ui::Windows widget.top = desc.Y + 1; widget.bottom = desc.Y + desc.Height - 2; widget.text = STR_DROPDOWN_GLYPH; - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; if (desc.IsDisabled) widget.flags |= WIDGET_FLAGS::IS_DISABLED; widgetList.push_back(widget); @@ -1081,7 +1081,7 @@ namespace OpenRCT2::Ui::Windows widget.top = desc.Y + 1; widget.bottom = desc.Y + desc.Height - 2; widget.text = STR_NUMERIC_UP; - widget.tooltip = STR_NONE; + widget.tooltip = kStringIdNone; if (desc.IsDisabled) widget.flags |= WIDGET_FLAGS::IS_DISABLED; widget.flags |= WIDGET_FLAGS::IS_HOLDABLE; @@ -1103,7 +1103,7 @@ namespace OpenRCT2::Ui::Windows else if (desc.Type == "viewport") { widget.type = WindowWidgetType::Viewport; - widget.text = STR_NONE; + widget.text = kStringIdNone; widgetList.push_back(widget); } } diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 4c38829832..de18125a4a 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -238,15 +238,15 @@ namespace OpenRCT2::Scripting { try { - constexpr int32_t MaxLengthAllowed = 4096; + constexpr int32_t kMaxLengthAllowed = 4096; auto plugin = _scriptEngine.GetExecInfo().GetCurrentPlugin(); auto title = desc["title"].as_string(); auto description = desc["description"].as_string(); auto initialValue = AsOrDefault(desc["initialValue"], ""); - auto maxLength = AsOrDefault(desc["maxLength"], MaxLengthAllowed); + auto maxLength = AsOrDefault(desc["maxLength"], kMaxLengthAllowed); auto callback = desc["callback"]; WindowTextInputOpen( - title, description, initialValue, std::clamp(maxLength, 0, MaxLengthAllowed), + title, description, initialValue, std::clamp(maxLength, 0, kMaxLengthAllowed), [this, plugin, callback](std::string_view value) { auto dukValue = ToDuk(_scriptEngine.GetContext(), value); _scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false); diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 46478fd8d0..bdc06796fd 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -506,7 +506,7 @@ namespace OpenRCT2::Scripting auto widget = GetWidget(); if (widget != nullptr && (widget->type == WindowWidgetType::FlatBtn || widget->type == WindowWidgetType::ImgBtn)) { - if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) + if (GetTargetAPIVersion() <= kApiVersionG2Reorder) { return LegacyIconIndex(widget->image.GetIndex()); } diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 7724b10b54..276ddb8972 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -66,8 +66,8 @@ namespace OpenRCT2::Ui::Windows static constexpr Widget _windowAboutOpenRCT2Widgets[] = { WIDGETS_MAIN, MakeWidget({10, 60}, {WW - 20, 20}, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_ABOUT_OPENRCT2_DESCRIPTION), // Introduction - MakeWidget({30, 90}, {128, 128}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_NONE), // OpenRCT2 Logo - MakeWidget({168, 100}, {173, 24}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_NONE), // Build version + MakeWidget({30, 90}, {128, 128}, WindowWidgetType::Placeholder, WindowColour::Secondary, kStringIdNone), // OpenRCT2 Logo + MakeWidget({168, 100}, {173, 24}, WindowWidgetType::Placeholder, WindowColour::Secondary, kStringIdNone), // Build version MakeWidget({344, 100 }, {24, 24}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_COPY), STR_COPY_BUILD_HASH ), // "Copy build info" button MakeWidget({168, 115 + 20}, {200, 14}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_UPDATE_AVAILABLE ), // "new version" button MakeWidget({168, 115 + 40}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGELOG_ELLIPSIS), // changelog button diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index f27abb9144..f019929dc4 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -348,7 +348,7 @@ static constexpr Widget window_cheats_weather_widgets[] = { MAIN_CHEATS_WIDGETS, MakeWidget ({ 5, 48}, {238, 50}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_CHEAT_WEATHER_GROUP ), // Weather group - MakeWidget ({126, 62}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather + MakeWidget ({126, 62}, {111, 14}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather MakeWidget ({225, 63}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_CHANGE_WEATHER_TOOLTIP ), // Force weather MakeWidget ({ 11, 80}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_FREEZE_WEATHER, STR_CHEAT_FREEZE_WEATHER_TIP), // Freeze weather MakeWidget ({ 5, 102}, {238, 37}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_FAUNA ), // Fauna group diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 95b838b646..2346f2e299 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -47,7 +47,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget( { 27, 17 }, { 44, 32 }, WindowWidgetType::ImgBtn, WindowColour::Primary, SPR_LAND_TOOL_SIZE_0, - STR_NONE), // preview box + kStringIdNone), // preview box MakeRemapWidget( { 28, 18 }, { 16, 16 }, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP), // decrement size @@ -104,7 +104,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - TextInputOpen(WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + TextInputOpen( + WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); break; } case WIDX_SMALL_SCENERY: diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index c5882a1651..1ddf539031 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -43,7 +43,7 @@ namespace OpenRCT2::Ui::Windows static Widget window_custom_currency_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeSpinnerWidgets({100, 30}, {101, 11}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_CURRENCY_FORMAT), // NB: 3 widgets - MakeWidget ({120, 50}, { 81, 11}, WindowWidgetType::Button, WindowColour::Secondary, STR_EMPTY ), + MakeWidget ({120, 50}, { 81, 11}, WindowWidgetType::Button, WindowColour::Secondary, kStringIdEmpty ), MakeWidget ({220, 50}, {131, 11}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), MakeWidget ({339, 51}, { 11, 9}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), }; diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 80ddfec2ef..0190089edf 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -47,8 +47,8 @@ namespace OpenRCT2::Ui::Windows }; int32_t gDropdownNumItems; - Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; - static ImageId _dropdownItemsImages[Dropdown::ItemsMaxSize]; + Dropdown::Item gDropdownItems[Dropdown::kItemsMaxSize]; + static ImageId _dropdownItemsImages[Dropdown::kItemsMaxSize]; bool gDropdownIsColour; int32_t gDropdownLastColourHover; int32_t gDropdownHighlightedIndex; @@ -141,26 +141,26 @@ namespace OpenRCT2::Ui::Windows } StringId item = gDropdownItems[i].Format; - if (item == Dropdown::FormatLandPicker || item == Dropdown::FormatColourPicker) + if (item == Dropdown::kFormatLandPicker || item == Dropdown::kFormatColourPicker) { // Image item auto image = UseImages ? _dropdownItemsImages[i] : ImageId(static_cast(gDropdownItems[i].Args)); - if (item == Dropdown::FormatColourPicker && highlightedIndex == i) + if (item == Dropdown::kFormatColourPicker && highlightedIndex == i) image = image.WithIndexOffset(1); GfxDrawSprite(dpi, image, screenCoords); } else { // Text item - if (i < Dropdown::ItemsMaxSize && Dropdown::IsChecked(i)) + if (i < Dropdown::kItemsMaxSize && Dropdown::IsChecked(i)) item++; // Calculate colour ColourWithFlags colour = { colours[0].colour }; if (i == highlightedIndex) colour.colour = COLOUR_WHITE; - if (i < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(i)) + if (i < Dropdown::kItemsMaxSize && Dropdown::IsDisabled(i)) colour = { colours[0].colour, EnumToFlag(ColourFlag::inset) }; // Draw item string @@ -513,7 +513,7 @@ static constexpr colour_t kColoursDropdownOrder[] = { auto imageId = (orderedColour == COLOUR_INVISIBLE) ? ImageId(SPR_G2_ICON_PALETTE_INVISIBLE, COLOUR_WHITE) : ImageId(SPR_PALETTE_BTN, orderedColour); - gDropdownItems[i].Format = Dropdown::FormatColourPicker; + gDropdownItems[i].Format = Dropdown::kFormatColourPicker; Dropdown::SetImage(i, imageId); } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 518be08b66..27d34cd24b 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -105,7 +105,7 @@ namespace OpenRCT2::Ui::Windows } else if (!(gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)) { - if (GetNumFreeEntities() != MAX_ENTITIES || GetGameState().Park.Flags & PARK_FLAGS_SPRITES_INITIALISED) + if (GetNumFreeEntities() != kMaxEntities || GetGameState().Park.Flags & PARK_FLAGS_SPRITES_INITIALISED) { HidePreviousStepButton(); } @@ -141,7 +141,7 @@ namespace OpenRCT2::Ui::Windows if (widgetIndex == WIDX_PREVIOUS_STEP_BUTTON) { if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - || (GetNumFreeEntities() == MAX_ENTITIES && !(gameState.Park.Flags & PARK_FLAGS_SPRITES_INITIALISED))) + || (GetNumFreeEntities() == kMaxEntities && !(gameState.Park.Flags & PARK_FLAGS_SPRITES_INITIALISED))) { ((this)->*(_previousButtonMouseUp[EnumValue(gameState.EditorStep)]))(); } diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index e53405712b..d38d015389 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -523,7 +523,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[DDIX_FILTER_SEPARATOR].Format = 0; gDropdownItems[DDIX_FILTER_SELECTED].Format = STR_TOGGLE_OPTION; gDropdownItems[DDIX_FILTER_NONSELECTED].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_SEPARATOR].Args = STR_NONE; + gDropdownItems[DDIX_FILTER_SEPARATOR].Args = kStringIdNone; gDropdownItems[DDIX_FILTER_SELECTED].Args = STR_SELECTED_ONLY; gDropdownItems[DDIX_FILTER_NONSELECTED].Args = STR_NON_SELECTED_ONLY; } @@ -960,7 +960,7 @@ namespace OpenRCT2::Ui::Windows const auto numSubTabs = static_cast(currentPage.subTabs.size()); for (int8_t i = 0; i <= 6; i++) { - widgets[WIDX_SUB_TAB_0 + i].tooltip = i < numSubTabs ? currentPage.subTabs[i].tooltip : STR_NONE; + widgets[WIDX_SUB_TAB_0 + i].tooltip = i < numSubTabs ? currentPage.subTabs[i].tooltip : kStringIdNone; widgets[WIDX_SUB_TAB_0 + i].type = i < numSubTabs ? WindowWidgetType::Tab : WindowWidgetType::Empty; pressed_widgets &= ~(1uLL << (WIDX_SUB_TAB_0 + i)); } @@ -1085,7 +1085,7 @@ namespace OpenRCT2::Ui::Windows { auto ft = Formatter(); auto stringId = _listSortType == RIDE_SORT_TYPE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; + : kStringIdNone; ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortTypeWidget.left + 1, listSortTypeWidget.top + 1 }; DrawTextEllipsised(dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] }); @@ -1095,7 +1095,7 @@ namespace OpenRCT2::Ui::Windows { auto ft = Formatter(); auto stringId = _listSortType == RIDE_SORT_RIDE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; + : kStringIdNone; ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortRideWidget.left + 1, listSortRideWidget.top + 1 }; DrawTextEllipsised(dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] }); @@ -1528,7 +1528,7 @@ namespace OpenRCT2::Ui::Windows if (item->Type == ObjectType::Ride) { ride_type_t rideType = 0; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { if (item->RideInfo.RideType[i] != RIDE_TYPE_NULL) { @@ -1665,8 +1665,8 @@ namespace OpenRCT2::Ui::Windows static StringId GetRideTypeStringId(const ObjectRepositoryItem* item) { - StringId result = STR_NONE; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + StringId result = kStringIdNone; + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { auto rideType = item->RideInfo.RideType[i]; if (rideType != RIDE_TYPE_NULL) @@ -1732,7 +1732,7 @@ namespace OpenRCT2::Ui::Windows LoadPalette(); } if (showFallbackWarning) - ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); + ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, kStringIdEmpty, Formatter::Common()); } bool EditorObjectSelectionWindowCheck() diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 8b3a7ffdfe..fb019a519d 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -120,13 +120,13 @@ namespace OpenRCT2::Ui::Windows static constexpr Widget window_editor_objective_options_main_widgets[] = { MAIN_OBJECTIVE_OPTIONS_WIDGETS, - MakeWidget ({ 98, 48}, {344, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ), + MakeWidget ({ 98, 48}, {344, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ), MakeWidget ({430, 49}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_OBJECTIVE_FOR_THIS_SCENARIO_TIP ), MakeSpinnerWidgets({158, 65}, {120, 12}, WindowWidgetType::Button, WindowColour::Secondary ), // NB: 3 widgets MakeSpinnerWidgets({158, 82}, {120, 12}, WindowWidgetType::Button, WindowColour::Secondary ), // NB: 3 widgets MakeWidget ({370, 99}, { 75, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGE, STR_CHANGE_NAME_OF_PARK_TIP ), MakeWidget ({370, 116}, { 75, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGE, STR_CHANGE_NAME_OF_SCENARIO_TIP ), - MakeWidget ({ 98, 133}, {180, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN), + MakeWidget ({ 98, 133}, {180, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN), MakeWidget ({266, 134}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_WHICH_GROUP_THIS_SCENARIO_APPEARS_IN), MakeWidget ({370, 150}, { 75, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGE, STR_CHANGE_DETAIL_NOTES_ABOUT_PARK_SCENARIO_TIP), }; @@ -493,7 +493,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyLoanAndValueMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -504,7 +504,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_MONTHLY_FOOD_INCOME: if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyFoodMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -515,7 +515,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: if (gameState.ScenarioObjective.MinimumLength >= ObjectiveLengthMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -526,7 +526,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_FINISH_5_ROLLERCOASTERS: if (gameState.ScenarioObjective.MinimumExcitement >= ObjectiveExcitementMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -537,7 +537,7 @@ namespace OpenRCT2::Ui::Windows default: if (gameState.ScenarioObjective.NumGuests >= ObjectiveGuestsMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -558,7 +558,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyLoanAndValueMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -569,7 +569,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_MONTHLY_FOOD_INCOME: if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyFoodMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -580,7 +580,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: if (gameState.ScenarioObjective.MinimumLength <= ObjectiveLengthMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -591,7 +591,7 @@ namespace OpenRCT2::Ui::Windows case OBJECTIVE_FINISH_5_ROLLERCOASTERS: if (gameState.ScenarioObjective.MinimumExcitement <= ObjectiveExcitementMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -602,7 +602,7 @@ namespace OpenRCT2::Ui::Windows default: if (gameState.ScenarioObjective.NumGuests <= ObjectiveGuestsMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { @@ -618,7 +618,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = GetGameState(); if (gameState.ScenarioObjective.Year >= ObjectiveYearMax) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } else { @@ -632,7 +632,7 @@ namespace OpenRCT2::Ui::Windows auto& gameState = GetGameState(); if (gameState.ScenarioObjective.Year <= ObjectiveYearMin) { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } else { diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 8eb06b6479..fe7bb59881 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -40,7 +40,7 @@ namespace OpenRCT2::Ui::Windows struct EntranceSelection { ObjectEntryIndex entryIndex = OBJECT_ENTRY_INDEX_NULL; - StringId stringId = STR_NONE; + StringId stringId = kStringIdNone; ImageIndex imageId = kSpriteIdNull; }; @@ -61,7 +61,7 @@ namespace OpenRCT2::Ui::Windows static Widget _widgets[] = { WINDOW_SHIM(kWindowTitle, kWindowWidth, kWindowHeight), MakeWidget ({ 0, 43 }, { kWindowWidth, kWindowHeight - 43 }, WindowWidgetType::Resize, WindowColour::Secondary ), - MakeTab ({ 3, 17 }, STR_NONE ), + MakeTab ({ 3, 17 }, kStringIdNone ), MakeWidget ({ 2, 45 }, { kScrollWidth, kScrollHeight }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), MakeWidget ({ kWindowWidth - 26, 59 }, { 24, 24 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 ), }; diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 617ac2810b..76edebfceb 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -51,7 +51,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT }; - static constexpr StringId ClimateNames[] = { + static constexpr StringId kClimateNames[] = { STR_CLIMATE_COOL_AND_WET, STR_CLIMATE_WARM, STR_CLIMATE_HOT_AND_DRY, @@ -161,10 +161,10 @@ namespace OpenRCT2::Ui::Windows MakeRemapWidget ({ 65, 17}, { 31, 27}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB, STR_SCENARIO_OPTIONS_PARK_TIP ), MakeSpinnerWidgets({188, 48}, { 70, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets MakeSpinnerWidgets({188, 65}, { 70, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets - MakeWidget ({ 8, 82}, { 210, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP), + MakeWidget ({ 8, 82}, { 210, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP), MakeWidget ({206, 83}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_PAY_FOR_PARK_PAY_FOR_RIDES_TIP), MakeSpinnerWidgets({328, 82}, { 67, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets - MakeWidget ({188, 99}, { 207, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_SELECT_CLIMATE_TIP ), + MakeWidget ({188, 99}, { 207, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_SELECT_CLIMATE_TIP ), MakeWidget ({383, 100}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_CLIMATE_TIP ), MakeWidget ({ 8, 116}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORBID_TREE_REMOVAL, STR_FORBID_TREE_REMOVAL_TIP ), MakeWidget ({ 8, 133}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORBID_LANDSCAPE_CHANGES, STR_FORBID_LANDSCAPE_CHANGES_TIP ), @@ -417,7 +417,7 @@ namespace OpenRCT2::Ui::Windows for (i = 0; i < static_cast(ClimateType::Count); i++) { gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = ClimateNames[i]; + gDropdownItems[i].Args = kClimateNames[i]; } WindowDropdownShowTextCustomWidth( { windowPos.x + dropdownWidget.left, windowPos.y + dropdownWidget.top }, dropdownWidget.height() + 1, @@ -439,7 +439,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_CASH, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_CASH, kStringIdNone, {}); } Invalidate(); break; @@ -452,7 +452,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_CASH, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_CASH, kStringIdNone, {}); } Invalidate(); break; @@ -465,7 +465,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_INIT_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_INIT_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -478,7 +478,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_INIT_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_INIT_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -491,7 +491,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_MAX_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_MAX_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -504,7 +504,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_MAX_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_MAX_LOAN, kStringIdNone, {}); } Invalidate(); break; @@ -517,7 +517,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, kStringIdNone, {}); } Invalidate(); break; @@ -530,7 +530,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, kStringIdNone, {}); } Invalidate(); break; @@ -718,7 +718,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -731,7 +731,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -744,7 +744,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -757,7 +757,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -770,7 +770,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -783,7 +783,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -796,7 +796,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -809,7 +809,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -992,7 +992,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1005,7 +1005,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1018,7 +1018,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1031,7 +1031,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1044,7 +1044,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1057,7 +1057,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {}); } Invalidate(); break; @@ -1246,7 +1246,7 @@ namespace OpenRCT2::Ui::Windows // Climate value screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); - ft.Add(ClimateNames[EnumValue(gameState.Climate)]); + ft.Add(kClimateNames[EnumValue(gameState.Climate)]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 6992a2bdc8..beb778155e 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -722,7 +722,7 @@ namespace OpenRCT2::Ui::Windows } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index fdf0344045..1c9f2ceafa 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -705,7 +705,7 @@ namespace OpenRCT2::Ui::Windows defaultIndex = numPathTypes; } - gDropdownItems[numPathTypes].Format = STR_NONE; + gDropdownItems[numPathTypes].Format = kStringIdNone; Dropdown::SetImage(numPathTypes, ImageId(pathType->PreviewImageId)); _dropdownEntries.push_back({ ObjectType::FootpathSurface, i }); numPathTypes++; @@ -730,7 +730,7 @@ namespace OpenRCT2::Ui::Windows defaultIndex = numPathTypes; } - gDropdownItems[numPathTypes].Format = STR_NONE; + gDropdownItems[numPathTypes].Format = kStringIdNone; Dropdown::SetImage( numPathTypes, ImageId(showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage())); _dropdownEntries.push_back({ ObjectType::Paths, i }); @@ -764,7 +764,7 @@ namespace OpenRCT2::Ui::Windows defaultIndex = numRailingsTypes; } - gDropdownItems[numRailingsTypes].Format = STR_NONE; + gDropdownItems[numRailingsTypes].Format = kStringIdNone; Dropdown::SetImage(numRailingsTypes, ImageId(railingsEntry->PreviewImageId)); _dropdownEntries.push_back({ ObjectType::FootpathRailings, i }); numRailingsTypes++; diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 4a33c57e4a..e04f0e39ac 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -352,7 +352,7 @@ namespace OpenRCT2::Ui::Windows StringId stringId; auto ft = GetMapTooltip(); std::memcpy(&stringId, ft.Data(), sizeof(StringId)); - if (stringId == STR_NONE) + if (stringId == kStringIdNone) { // TODO: this string probably shouldn't be reused for this DrawTextWrapped( diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 15e5f9d15f..53ebb8b8f8 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -950,7 +950,7 @@ namespace OpenRCT2::Ui::Windows gPickupPeepImage = ImageId(); - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); + auto info = GetMapCoordinatesFromPos(screenCoords, kViewportInteractionItemAll); if (info.interactionType == ViewportInteractionItem::None) return; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 31b15cf339..4b36ad2bcc 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -223,7 +223,7 @@ namespace OpenRCT2::Ui::Windows auto guestRide = GetRide(RideId::FromUnderlying(index)); if (guestRide != nullptr) { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); guestRide->FormatNameTo(ft); _selectedFilter = GuestFilterType::GuestsThinking; @@ -459,7 +459,7 @@ namespace OpenRCT2::Ui::Windows { if (_selectedFilter) { - if (_filterArguments.GetFirstStringId() != STR_NONE) + if (_filterArguments.GetFirstStringId() != kStringIdNone) { format = GetFilterString(*_selectedFilter); } @@ -808,9 +808,9 @@ namespace OpenRCT2::Ui::Windows { auto guestViewType = _selectedFilter == GuestFilterType::Guests ? GuestViewType::Actions : GuestViewType::Thoughts; auto peepArgs = GetArgumentsFromPeep(peep, guestViewType); - if (_filterArguments.GetFirstStringId() == STR_NONE && _selectedFilter == GuestFilterType::GuestsThinking) + if (_filterArguments.GetFirstStringId() == kStringIdNone && _selectedFilter == GuestFilterType::GuestsThinking) { - Formatter(peepArgs.args).Add(STR_NONE); + Formatter(peepArgs.args).Add(kStringIdNone); } return _filterArguments == peepArgs; } @@ -865,7 +865,7 @@ namespace OpenRCT2::Ui::Windows // Remove empty group (basically guests with no thoughts) auto foundGroup = std::find_if(std::begin(_groups), std::end(_groups), [](GuestGroup& group) { - return group.Arguments.GetFirstStringId() == STR_EMPTY; + return group.Arguments.GetFirstStringId() == kStringIdEmpty; }); if (foundGroup != std::end(_groups)) { diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 91eb196d9f..2eb95ef92e 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -372,7 +372,7 @@ namespace OpenRCT2::Ui::Windows if (!Path::CreateDirectory(destPath)) { LOG_ERROR("Unable to create directory '%s'", destPath.c_str()); - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return; } @@ -381,7 +381,7 @@ namespace OpenRCT2::Ui::Windows if (File::Exists(destPath)) { LOG_INFO("%s already exists, prompting user for a different track design name", destPath.c_str()); - ContextShowError(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, kStringIdNone, {}); WindowTextInputRawOpen( this, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, {}, _trackName.c_str(), 255); @@ -394,7 +394,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); } } } @@ -405,7 +405,7 @@ namespace OpenRCT2::Ui::Windows auto trackDesign = TrackDesignImport(path); if (trackDesign == nullptr) { - ContextShowError(STR_UNABLE_TO_LOAD_FILE, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_LOAD_FILE, kStringIdNone, {}); return nullptr; } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index e0975597ed..0637b3ce13 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({19, 19}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP), STR_ENABLE_MOUNTAIN_TOOL_TIP), // mountain mode MakeWidget ({55, 19}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PAINTBRUSH), STR_DISABLE_ELEVATION), // paint mode - MakeWidget ({27, 48}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), STR_NONE), // preview box + MakeWidget ({27, 48}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box MakeRemapWidget({28, 49}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_LAND_TIP), // decrement size MakeRemapWidget({54, 63}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_TIP), // increment size MakeWidget ({ 2, 106}, {47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP), // floor texture @@ -82,7 +82,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } public: diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 19bee0c291..0af7231350 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -580,7 +580,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } }; diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index a356701ea1..a0339a1fc2 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -82,7 +82,7 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget window_loadsave_widgets[] = { - WINDOW_SHIM(STR_NONE, WW, WH), + WINDOW_SHIM(kStringIdNone, WW, WH), MakeWidget({ 0, 15 }, { WW, WH - 15 }, WindowWidgetType::Resize, WindowColour::Secondary ), // WIDX_RESIZE MakeWidget({ 4, 36 }, { 84, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_LOADSAVE_DEFAULT, STR_LOADSAVE_DEFAULT_TIP), // WIDX_DEFAULT MakeWidget({ 88, 36 }, { 84, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_FILEBROWSER_ACTION_UP ), // WIDX_UP @@ -284,7 +284,7 @@ namespace OpenRCT2::Ui::Windows { if (!IsValidPath(path)) { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); return; } @@ -444,7 +444,7 @@ namespace OpenRCT2::Ui::Windows { OpenRCT2::Ui::FileDialogDesc desc = {}; u8string extension; - StringId title = STR_NONE; + StringId title = kStringIdNone; switch (_type & 0x0E) { case LOADSAVETYPE_GAME: @@ -923,7 +923,7 @@ namespace OpenRCT2::Ui::Windows const auto drawButtonCaption = [dpi, this]( Widget& widget, StringId strId, FileBrowserSort ascSort, FileBrowserSort descSort) { - StringId indicatorId = STR_NONE; + StringId indicatorId = kStringIdNone; if (Config::Get().general.LoadSaveSort == ascSort) indicatorId = STR_UP; else if (Config::Get().general.LoadSaveSort == descSort) @@ -974,12 +974,13 @@ namespace OpenRCT2::Ui::Windows case WIDX_NEW_FILE: WindowTextInputOpen( - this, WIDX_NEW_FILE, STR_NONE, STR_FILEBROWSER_FILE_NAME_PROMPT, {}, STR_STRING, + this, WIDX_NEW_FILE, kStringIdNone, STR_FILEBROWSER_FILE_NAME_PROMPT, {}, STR_STRING, reinterpret_cast(_defaultPath.c_str()), 64); break; case WIDX_NEW_FOLDER: - WindowTextInputRawOpen(this, WIDX_NEW_FOLDER, STR_NONE, STR_FILEBROWSER_FOLDER_NAME_PROMPT, {}, "", 64); + WindowTextInputRawOpen( + this, WIDX_NEW_FOLDER, kStringIdNone, STR_FILEBROWSER_FOLDER_NAME_PROMPT, {}, "", 64); break; case WIDX_BROWSE: @@ -1121,7 +1122,7 @@ namespace OpenRCT2::Ui::Windows if (!Platform::IsFilenameValid(text)) { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); return; } @@ -1132,7 +1133,7 @@ namespace OpenRCT2::Ui::Windows const u8string path = Path::Combine(_directory, text); if (!Path::CreateDirectory(path)) { - ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, kStringIdNone, {}); return; } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 1f27a32131..b594ba5aa0 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1129,7 +1129,7 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kMinimumMapSizePractical); ft.Add(kMaximumMapSizePractical); - TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_NONE, STR_NONE, 4); + TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, kStringIdNone, kStringIdNone, 4); } CoordsXY ScreenToMap(ScreenCoordsXY screenCoords) diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 111460ad0e..cb644ed126 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -50,7 +50,7 @@ namespace OpenRCT2::Ui::Windows { StringId stringId; std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); - if (stringId == STR_NONE) + if (stringId == kStringIdNone) { return; } @@ -97,7 +97,7 @@ namespace OpenRCT2::Ui::Windows auto& im = GetInputManager(); auto* wm = GetWindowManager(); - if (_cursorHoldDuration < 25 || stringId == STR_NONE || im.IsModifierKeyPressed(ModifierKey::ctrl) + if (_cursorHoldDuration < 25 || stringId == kStringIdNone || im.IsModifierKeyPressed(ModifierKey::ctrl) || im.IsModifierKeyPressed(ModifierKey::shift) || wm->FindByClass(WindowClass::Error) != nullptr) { WindowCloseByClass(WindowClass::MapTooltip); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 7e6fa9aa16..0f35508d42 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -295,7 +295,7 @@ namespace OpenRCT2::Ui::Windows else { ft.Increment(4); - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index baeeb8a986..36ecc9c40f 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -65,7 +65,7 @@ namespace OpenRCT2::Ui::Windows #define MAIN_MULTIPLAYER_WIDGETS \ MakeWidget({ 0, 0}, {340, 240}, WindowWidgetType::Frame, WindowColour::Primary ), /* panel / background */ \ - MakeWidget({ 1, 1}, {338, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_NONE, STR_WINDOW_TITLE_TIP ), /* title bar */ \ + MakeWidget({ 1, 1}, {338, 14}, WindowWidgetType::Caption, WindowColour::Primary, kStringIdNone, STR_WINDOW_TITLE_TIP ), /* title bar */ \ MakeWidget({327, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP ), /* close x button */ \ MakeWidget({ 0, 43}, {340, 197}, WindowWidgetType::Resize, WindowColour::Secondary ), /* content panel */ \ MakeTab ({ 3, 17}, STR_SHOW_SERVER_INFO_TIP), /* tab */ \ diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index b38958ca77..f5ee64ef20 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -27,7 +27,7 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget window_network_status_widgets[] = { MakeWidget({ 0, 0}, {400, 91}, WindowWidgetType::Frame, WindowColour::Primary ), // panel / background - MakeWidget({ 1, 1}, {397, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_NONE, STR_WINDOW_TITLE_TIP), // title bar + MakeWidget({ 1, 1}, {397, 14}, WindowWidgetType::Caption, WindowColour::Primary, kStringIdNone, STR_WINDOW_TITLE_TIP), // title bar MakeWidget({388, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP), // close x button }; // clang-format on diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 26beebf5ff..765b015a72 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -26,7 +26,7 @@ namespace OpenRCT2::Ui::Windows { - static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr StringId WINDOW_TITLE = kStringIdNone; static constexpr int32_t WH = 109; static constexpr int32_t WW = 350; @@ -50,11 +50,11 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget window_new_campaign_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget ({ 14, 24}, {126, 12}, WindowWidgetType::Label, WindowColour::Primary, STR_EMPTY ), // ride label - MakeWidget ({100, 24}, {242, 12}, WindowWidgetType::DropdownMenu, WindowColour::Primary, STR_EMPTY ), // ride dropdown + MakeWidget ({ 14, 24}, {126, 12}, WindowWidgetType::Label, WindowColour::Primary, kStringIdEmpty ), // ride label + MakeWidget ({100, 24}, {242, 12}, WindowWidgetType::DropdownMenu, WindowColour::Primary, kStringIdEmpty ), // ride dropdown MakeWidget ({330, 25}, { 11, 10}, WindowWidgetType::Button, WindowColour::Primary, STR_DROPDOWN_GLYPH ), // ride dropdown button MakeWidget ({ 14, 41}, {126, 14}, WindowWidgetType::Label, WindowColour::Primary, STR_LENGTH_OF_TIME ), // weeks label - MakeSpinnerWidgets({120, 41}, {100, 14}, WindowWidgetType::Spinner, WindowColour::Primary, STR_EMPTY ), // weeks (3 widgets) + MakeSpinnerWidgets({120, 41}, {100, 14}, WindowWidgetType::Spinner, WindowColour::Primary, kStringIdEmpty ), // weeks (3 widgets) MakeWidget ({ 14, 89}, {322, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN), // start button }; // clang-format on @@ -160,10 +160,10 @@ namespace OpenRCT2::Ui::Windows } } - if (RideList.size() > Dropdown::ItemsMaxSize) + if (RideList.size() > Dropdown::kItemsMaxSize) { std::sort(RideList.begin(), RideList.end(), RideValueCompare); - RideList.resize(Dropdown::ItemsMaxSize); + RideList.resize(Dropdown::kItemsMaxSize); } // Sort rides by name @@ -209,7 +209,7 @@ namespace OpenRCT2::Ui::Windows if (!ShopItems.empty()) { int32_t numItems = 0; - int32_t maxSize = std::min(Dropdown::ItemsMaxSize, static_cast(ShopItems.size())); + int32_t maxSize = std::min(Dropdown::kItemsMaxSize, static_cast(ShopItems.size())); for (int32_t i = 0; i < maxSize; i++) { gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; @@ -353,7 +353,7 @@ namespace OpenRCT2::Ui::Windows } // Set current number of weeks spinner (moved to paint due to required parameter) - widgets[WIDX_WEEKS_SPINNER].text = STR_NONE; + widgets[WIDX_WEEKS_SPINNER].text = kStringIdNone; // Enable / disable start button based on ride dropdown WidgetSetDisabled(*this, WIDX_START_BUTTON, false); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 6a596e16d9..585b1dccd5 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -42,7 +42,7 @@ using namespace OpenRCT2::TrackMetaData; namespace OpenRCT2::Ui::Windows { - static constexpr StringId WindowTitle = STR_NONE; + static constexpr StringId WindowTitle = kStringIdNone; static constexpr int32_t WindowHeight = 382; static constexpr int32_t WindowWidth = 601; static constexpr int32_t RideListItemsMax = 384; @@ -640,7 +640,7 @@ namespace OpenRCT2::Ui::Windows { auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); auto obj = objMgr.GetLoadedObject(rideSelection.EntryIndex); - return obj == nullptr ? ImageIndexUndefined : obj->GetPreviewImage(rideSelection.Type); + return obj == nullptr ? kImageIndexUndefined : obj->GetPreviewImage(rideSelection.Type); } void PopulateRideList() diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 19d55ac6b5..103ffedc86 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -245,7 +245,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({155, 83}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_ARG_16_RESOLUTION_X_BY_Y ), MakeWidget ({288, 84}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DISPLAY_RESOLUTION_TIP ), MakeWidget ({ 10, 98}, {145, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_UI_SCALING_DESC, STR_WINDOW_SCALE_TIP ), // Scale - MakeSpinnerWidgets({155, 98}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_NONE, STR_WINDOW_SCALE_TIP ), // Scale spinner (3 widgets) + MakeSpinnerWidgets({155, 98}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, kStringIdNone, STR_WINDOW_SCALE_TIP ), // Scale spinner (3 widgets) MakeWidget ({ 10, 113}, {145, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_DRAWING_ENGINE, STR_DRAWING_ENGINE_TIP ), // Drawing engine MakeWidget ({155, 113}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Drawing engine MakeWidget ({288, 114}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DRAWING_ENGINE_TIP ), @@ -270,7 +270,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget({ 10, kFrameRenderingStart + 60}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_SHOW_GUEST_PURCHASES, STR_SHOW_GUEST_PURCHASES_TIP ), // Guest purchases MakeWidget({ 10, kFrameRenderingStart + 75}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TRANSPARENT_SCREENSHOT, STR_TRANSPARENT_SCREENSHOT_TIP), // Transparent screenshot MakeWidget({ 10, kFrameRenderingStart + 90}, {281, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_VIRTUAL_FLOOR_STYLE, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor - MakeWidget({155, kFrameRenderingStart + 90}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown + MakeWidget({155, kFrameRenderingStart + 90}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdNone, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown MakeWidget({288, kFrameRenderingStart + 91}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_VIRTUAL_FLOOR_STYLE_TIP ), // Virtual floor dropdown MakeWidget({ 5, kFrameEffectStart + 0}, {300, 94}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_EFFECTS_GROUP ), // Rendering group @@ -392,11 +392,11 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({165, 113}, {135, 13}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Autosave dropdown MakeWidget ({288, 114}, { 11, 11}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_AUTOSAVE_FREQUENCY_TIP ), // Autosave dropdown button MakeWidget ({ 23, 130}, {135, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_AUTOSAVE_AMOUNT, STR_AUTOSAVE_AMOUNT_TIP ), - MakeSpinnerWidgets({165, 130}, {135, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_NONE, STR_AUTOSAVE_AMOUNT_TIP ), // Autosave amount spinner + MakeSpinnerWidgets({165, 130}, {135, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, kStringIdNone, STR_AUTOSAVE_AMOUNT_TIP ), // Autosave amount spinner MakeWidget ({ 23, 145}, {276, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_PATH_TO_RCT1, STR_PATH_TO_RCT1_TIP ), // RCT 1 path text - MakeWidget ({ 24, 160}, {266, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_NONE, STR_STRING_TOOLTIP ), // RCT 1 path button + MakeWidget ({ 24, 160}, {266, 14}, WindowWidgetType::Button, WindowColour::Secondary, kStringIdNone, STR_STRING_TOOLTIP ), // RCT 1 path button MakeWidget ({289, 160}, { 11, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CLOSE_X, STR_PATH_TO_RCT1_CLEAR_TIP ), // RCT 1 path clear button - MakeWidget ({150, 176}, {150, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_EDIT_ASSET_PACKS_BUTTON, STR_NONE ), // Asset packs + MakeWidget ({150, 176}, {150, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_EDIT_ASSET_PACKS_BUTTON, kStringIdNone ), // Asset packs }; static constexpr std::span window_options_page_widgets[] = { @@ -1110,7 +1110,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[i].Args = CurrencyDescriptors[i].stringId; } - gDropdownItems[numOrdinaryCurrencies].Format = Dropdown::SeparatorString; + gDropdownItems[numOrdinaryCurrencies].Format = Dropdown::kSeparatorString; gDropdownItems[numOrdinaryCurrencies + 1].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[numOrdinaryCurrencies + 1].Args = CurrencyDescriptors[EnumValue(CurrencyType::Custom)] @@ -1224,7 +1224,7 @@ namespace OpenRCT2::Ui::Windows if (LanguageOpen(fallbackLanguage)) { // It worked, so we can say it with error message in-game - ContextShowError(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {}); + ContextShowError(STR_LANGUAGE_LOAD_FAILED, kStringIdNone, {}); } // report error to console regardless LOG_ERROR("Failed to open language file."); @@ -1260,7 +1260,7 @@ namespace OpenRCT2::Ui::Windows // Distance: metric / imperial / si { - StringId stringId = STR_NONE; + StringId stringId = kStringIdNone; switch (Config::Get().general.MeasurementFormat) { case MeasurementFormat::Imperial: @@ -1927,21 +1927,21 @@ namespace OpenRCT2::Ui::Windows Config::Get().general.RCT1Path = std::move(rct1path); Config::Get().interface.ScenarioselectLastTab = 0; Config::Save(); - ContextShowError(STR_RESTART_REQUIRED, STR_NONE, {}); + ContextShowError(STR_RESTART_REQUIRED, kStringIdNone, {}); } else { - ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, kStringIdNone, {}); } } else { - ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, kStringIdNone, {}); } } else { - ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, kStringIdNone, {}); } } Invalidate(); @@ -2051,7 +2051,7 @@ namespace OpenRCT2::Ui::Windows if (Config::Get().general.RCT1Path.empty()) { // No tooltip if the path is empty - return { STR_NONE, {} }; + return { kStringIdNone, {} }; } auto ft = Formatter(); diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index ab45c15289..733fb61816 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -869,8 +869,8 @@ namespace OpenRCT2::Ui::Windows PrepareWindowTitleText(); // Show a tooltip if the park is pay per ride. - widgets[WIDX_PRICE_LABEL].tooltip = STR_NONE; - widgets[WIDX_PRICE].tooltip = STR_NONE; + widgets[WIDX_PRICE_LABEL].tooltip = kStringIdNone; + widgets[WIDX_PRICE].tooltip = kStringIdNone; if (!Park::EntranceFeeUnlocked()) { diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index e2fcb7cb6d..cd34c9322f 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -263,7 +263,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } bool PatrolAreaToolIsActive() diff --git a/src/openrct2-ui/windows/ProgressWindow.cpp b/src/openrct2-ui/windows/ProgressWindow.cpp index e80b0188b0..a87bcf58db 100644 --- a/src/openrct2-ui/windows/ProgressWindow.cpp +++ b/src/openrct2-ui/windows/ProgressWindow.cpp @@ -220,7 +220,7 @@ namespace OpenRCT2::Ui::Windows void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format) { - if (format == STR_NONE) + if (format == kStringIdNone) _progressFormat = STR_STRING_M_OF_N; else _progressFormat = format; diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index e15635a210..edf45cfd8b 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -441,7 +441,7 @@ namespace OpenRCT2::Ui::Windows if (gameState.ResearchLastItem.has_value()) { - StringId lastDevelopmentFormat = STR_EMPTY; + StringId lastDevelopmentFormat = kStringIdEmpty; auto ft = Formatter(); if (gameState.ResearchLastItem->type == Research::EntryType::Scenery) { diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index aa5c262f8b..6e97dd41b1 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -280,7 +280,7 @@ namespace OpenRCT2::Ui::Windows MakeWidget ({ 7, 50}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), MakeWidget ({297, 51}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), MakeWidget ({ 7, 137}, {302, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_OPTION_REVERSE_TRAINS, STR_OPTION_REVERSE_TRAINS_TIP ), - MakeWidget ({ 7, 154}, {302, 43}, WindowWidgetType::Scroll, WindowColour::Secondary, STR_EMPTY ), + MakeWidget ({ 7, 154}, {302, 43}, WindowWidgetType::Scroll, WindowColour::Secondary, kStringIdEmpty ), MakeSpinnerWidgets({ 7, 203}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_RIDE_VEHICLE_COUNT, STR_MAX_VEHICLES_TIP ), MakeSpinnerWidgets({164, 203}, {145, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_1_CAR_PER_TRAIN, STR_MAX_CARS_PER_TRAIN_TIP), }; @@ -310,7 +310,7 @@ namespace OpenRCT2::Ui::Windows // 0x009AE190 static constexpr Widget _maintenanceWidgets[] = { MAIN_RIDE_WIDGETS, - MakeWidget({107, 71}, {202, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE), + MakeWidget({107, 71}, {202, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdEmpty, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE), MakeWidget({297, 72}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_HOW_OFTEN_A_MECHANIC_SHOULD_CHECK_THIS_RIDE), MakeWidget({289, 108}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_LOCATE_NEAREST_AVAILABLE_MECHANIC_TIP ), MakeWidget({265, 108}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_CONSTRUCTION), STR_REFURBISH_RIDE_TIP ), @@ -332,9 +332,9 @@ namespace OpenRCT2::Ui::Windows MakeWidget({301, 50}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), MakeWidget({289, 68}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PAINTBRUSH), STR_PAINT_INDIVIDUAL_AREA_TIP ), MakeWidget({245, 101}, { 68, 47}, WindowWidgetType::Spinner, WindowColour::Secondary ), - MakeWidget({103, 103}, {139, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY ), + MakeWidget({103, 103}, {139, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdEmpty ), MakeWidget({230, 104}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_STYLE_OF_ENTRANCE_EXIT_STATION_TIP), - MakeWidget({ 3, 157}, { 68, 47}, WindowWidgetType::Scroll, WindowColour::Secondary, STR_EMPTY ), + MakeWidget({ 3, 157}, { 68, 47}, WindowWidgetType::Scroll, WindowColour::Secondary, kStringIdEmpty ), MakeWidget({ 74, 157}, {239, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_ARG_6_STRINGID ), MakeWidget({301, 158}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_VEHICLE_COLOUR_SCHEME_TIP ), MakeWidget({ 74, 173}, {239, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), @@ -350,7 +350,7 @@ namespace OpenRCT2::Ui::Windows static constexpr Widget _musicWidgets[] = { MAIN_RIDE_WIDGETS, MakeWidget({ 7, 47}, {302, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_PLAY_MUSIC, STR_SELECT_MUSIC_TIP ), - MakeWidget({ 7, 62}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_EMPTY ), + MakeWidget({ 7, 62}, {302, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, kStringIdEmpty ), MakeWidget({297, 63}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_MUSIC_STYLE_TIP), MakeWidget({154, 90}, {114, 114}, WindowWidgetType::FlatBtn, WindowColour::Secondary ), MakeWidget({ 7, 90}, {500, 450}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_BOTH ), @@ -2070,7 +2070,7 @@ namespace OpenRCT2::Ui::Windows PopulateVehicleTypeDropdown(*ride); - size_t numItems = std::min(_vehicleDropdownData.size(), Dropdown::ItemsMaxSize); + size_t numItems = std::min(_vehicleDropdownData.size(), Dropdown::kItemsMaxSize); for (size_t i = 0; i < numItems; i++) { @@ -2452,7 +2452,7 @@ namespace OpenRCT2::Ui::Windows StringId GetStatusOverallView(Formatter& ft) const { - auto stringId = STR_NONE; + auto stringId = kStringIdNone; auto ride = GetRide(rideId); if (ride != nullptr) { @@ -2470,11 +2470,11 @@ namespace OpenRCT2::Ui::Windows { auto ride = GetRide(rideId); if (ride == nullptr) - return STR_EMPTY; + return kStringIdEmpty; auto vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); if (vehicle == nullptr) - return STR_EMPTY; + return kStringIdEmpty; auto& rtd = ride->GetRideTypeDescriptor(); if (vehicle->status != Vehicle::Status::Crashing && vehicle->status != Vehicle::Status::Crashed) @@ -2494,7 +2494,7 @@ namespace OpenRCT2::Ui::Windows } if (rtd.specialType == RtdSpecialType::miniGolf) - return STR_EMPTY; + return kStringIdEmpty; auto stringId = VehicleStatusNames[EnumValue(vehicle->status)]; if (ride->GetRideTypeDescriptor().HasFlag(RtdFlag::singleSession) @@ -2520,16 +2520,16 @@ namespace OpenRCT2::Ui::Windows { auto ride = GetRide(rideId); if (ride == nullptr) - return STR_NONE; + return kStringIdNone; const auto stationIndex = GetStationIndexFromViewSelection(); if (!stationIndex) { - return STR_NONE; + return kStringIdNone; } const auto& station = ride->GetStation(*stationIndex); - StringId stringId = STR_EMPTY; + StringId stringId = kStringIdEmpty; // Entrance / exit if (ride->status == RideStatus::Closed) { @@ -2544,7 +2544,7 @@ namespace OpenRCT2::Ui::Windows stringId = STR_EXIT_ONLY; } // Queue length - if (stringId == STR_EMPTY) + if (stringId == kStringIdEmpty) { stringId = STR_QUEUE_EMPTY; uint16_t queueLength = ride->GetStation(*stationIndex).QueueLength; @@ -2724,7 +2724,7 @@ namespace OpenRCT2::Ui::Windows { auto ride = GetRide(rideId); if (ride == nullptr) - return { STR_NONE, {} }; + return { kStringIdNone, {} }; switch (widgetIndex) { @@ -2751,7 +2751,7 @@ namespace OpenRCT2::Ui::Windows { auto rideEntry = ride->GetRideEntry(); if (rideEntry == nullptr) - return { STR_NONE, {} }; + return { kStringIdNone, {} }; auto ft = Formatter(); ft.Increment(16); @@ -3012,7 +3012,7 @@ namespace OpenRCT2::Ui::Windows VehicleColour vehicleColour = RideGetVehicleColour(*ride, vehicleColourIndex); ImageIndex imageIndex = carEntry.SpriteByYaw( - OpenRCT2::Entity::Yaw::BaseRotation / 2, SpriteGroupType::SlopeFlat); + OpenRCT2::Entity::Yaw::kBaseRotation / 2, SpriteGroupType::SlopeFlat); if (isReversed) { auto baseRotation = carEntry.NumRotationSprites(SpriteGroupType::SlopeFlat); @@ -3730,7 +3730,7 @@ namespace OpenRCT2::Ui::Windows mechanic = RideFindClosestMechanic(*ride, 1); if (mechanic == nullptr) - ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, kStringIdNone, {}); else { auto intent = Intent(WindowClass::Peep); @@ -3803,7 +3803,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_FORCE_BREAKDOWN: numItems = 1; - for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) break; @@ -3827,7 +3827,7 @@ namespace OpenRCT2::Ui::Windows } if (numItems == 1) { - ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, STR_NONE, {}); + ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, kStringIdNone, {}); } else { @@ -3943,7 +3943,7 @@ namespace OpenRCT2::Ui::Windows else { int32_t j; - for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) break; @@ -4115,11 +4115,11 @@ namespace OpenRCT2::Ui::Windows stringId = STR_MECHANIC_IS_FIXING_THE_RIDE; break; default: - stringId = STR_EMPTY; + stringId = kStringIdEmpty; break; } - if (stringId != STR_EMPTY) + if (stringId != kStringIdEmpty) { if (stringId == STR_CALLING_MECHANIC || stringId == STR_NO_MECHANICS_ARE_HIRED_MESSAGE) { @@ -4393,7 +4393,7 @@ namespace OpenRCT2::Ui::Windows stringId = ride->vehicleColourSettings == VehicleColourSettings::perTrain ? STR_RIDE_COLOUR_TRAIN_OPTION : STR_RIDE_COLOUR_VEHICLE_OPTION; auto dropdownIndex = 0; - for (auto i = 0; i < std::min(numItems, Dropdown::ItemsMaxSize); i++) + for (auto i = 0; i < std::min(numItems, Dropdown::kItemsMaxSize); i++) { if (ride->vehicleColourSettings == VehicleColourSettings::perCar) { @@ -4676,7 +4676,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu; widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Button; - auto stringId = STR_NONE; + auto stringId = kStringIdNone; auto stationObj = ride->GetStationObject(); if (stationObj != nullptr) { @@ -4899,7 +4899,7 @@ namespace OpenRCT2::Ui::Windows GfxClear(clippedDpi, PALETTE_INDEX_12); auto stationObj = ride->GetStationObject(); - if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined) + if (stationObj != nullptr && stationObj->BaseImageId != kImageIndexUndefined) { auto imageId = ImageId(stationObj->BaseImageId, trackColour.main, trackColour.additional); @@ -5185,7 +5185,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_MUSIC_DROPDOWN].left = width - 19; // Set selected music - StringId musicName = STR_NONE; + StringId musicName = kStringIdNone; auto musicObj = ride->GetMusicObject(); if (musicObj != nullptr) { @@ -5399,7 +5399,7 @@ namespace OpenRCT2::Ui::Windows } if (errMessage.HasMessage()) { - ContextShowError(errMessage.Message, STR_EMPTY, {}); + ContextShowError(errMessage.Message, kStringIdEmpty, {}); } } @@ -5990,7 +5990,7 @@ namespace OpenRCT2::Ui::Windows } else { - return { STR_NONE, {} }; + return { kStringIdNone, {} }; } return { fallback, {} }; } @@ -6525,8 +6525,8 @@ namespace OpenRCT2::Ui::Windows pressed_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); disabled_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE); - widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_NONE; - widgets[WIDX_PRIMARY_PRICE].tooltip = STR_NONE; + widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = kStringIdNone; + widgets[WIDX_PRIMARY_PRICE].tooltip = kStringIdNone; // If ride prices are locked, do not allow setting the price, unless we're dealing with a shop or toilet. const auto& rtd = ride->GetRideTypeDescriptor(); diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 37a5c44a87..90c83cde77 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2248,7 +2248,7 @@ namespace OpenRCT2::Ui::Windows _currentTrackPrice = kMoney64Undefined; _trackPlaceCost = kMoney64Undefined; - _trackPlaceErrorMessage = STR_NONE; + _trackPlaceErrorMessage = kStringIdNone; RideConstructionInvalidateCurrentTrack(); if (WindowRideConstructionUpdateState( &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, &properties)) @@ -2284,7 +2284,7 @@ namespace OpenRCT2::Ui::Windows else { _trackPlaceCost = res.Cost; - _trackPlaceErrorMessage = STR_NONE; + _trackPlaceErrorMessage = kStringIdNone; } if (res.Error != GameActions::Status::Ok) @@ -3624,7 +3624,7 @@ namespace OpenRCT2::Ui::Windows if (mazeSetTrackResult.Error == GameActions::Status::Ok) { _trackPlaceCost = mazeSetTrackResult.Cost; - _trackPlaceErrorMessage = STR_NONE; + _trackPlaceErrorMessage = kStringIdNone; } else { diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index f397053326..0dfdfbb79e 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -32,7 +32,7 @@ namespace OpenRCT2::Ui::Windows { - static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr StringId WINDOW_TITLE = kStringIdNone; static constexpr int32_t WH = 240; static constexpr int32_t WW = 340; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 3af8820646..d217caba43 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -42,8 +42,8 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget _savePromptWidgets[] = { - WINDOW_SHIM_WHITE(STR_NONE, WW_SAVE, WH_SAVE), - MakeWidget({ 2, 19}, {256, 12}, WindowWidgetType::LabelCentred, WindowColour::Primary, STR_EMPTY ), // question/label + WINDOW_SHIM_WHITE(kStringIdNone, WW_SAVE, WH_SAVE), + MakeWidget({ 2, 19}, {256, 12}, WindowWidgetType::LabelCentred, WindowColour::Primary, kStringIdEmpty ), // question/label MakeWidget({ 8, 35}, { 78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_SAVE ), // save MakeWidget({ 91, 35}, { 78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_DONT_SAVE), // don't save MakeWidget({174, 35}, { 78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL ), // cancel diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 7341aafffa..0f97bc6b35 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -548,7 +548,7 @@ namespace OpenRCT2::Ui::Windows continue; // Category heading - StringId headingStringId = STR_NONE; + StringId headingStringId = kStringIdNone; if (Config::Get().general.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) { if (selected_tab != static_cast(ScenarioSource::Real) && currentHeading != scenario->Category) @@ -582,7 +582,7 @@ namespace OpenRCT2::Ui::Windows } } - if (headingStringId != STR_NONE) + if (headingStringId != kStringIdNone) { ScenarioListItem headerItem; headerItem.type = ListItemType::Heading; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 074018defd..b445c2be32 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -66,7 +66,7 @@ using namespace OpenRCT2::Numerics; namespace OpenRCT2::Ui::Windows { - static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr StringId WINDOW_TITLE = kStringIdNone; constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634; constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 195; constexpr int32_t SCENERY_BUTTON_WIDTH = 66; @@ -627,7 +627,7 @@ namespace OpenRCT2::Ui::Windows } } } - return { STR_NONE, Formatter() }; + return { kStringIdNone, Formatter() }; } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 5775a10127..749cea1a9a 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -88,7 +88,7 @@ namespace OpenRCT2::Ui::Windows break; } WindowTextInputOpen( - this, widgetIndex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, maxLength); + this, widgetIndex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, maxLength); } void OnMouseUp(WidgetIndex widgetIndex) override diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index e8f6307966..e74135dce2 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -156,7 +156,7 @@ namespace OpenRCT2::Ui::Windows ServerListFetchServersBegin(); break; case WIDX_ADD_SERVER: - TextInputOpen(widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, STR_NONE, 0, 128); + TextInputOpen(widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, kStringIdNone, 0, 128); break; case WIDX_START_SERVER: ContextOpenWindow(WindowClass::ServerStart); @@ -265,7 +265,7 @@ namespace OpenRCT2::Ui::Windows selected_list_item = itemIndex; _showNetworkVersionTooltip = showNetworkVersionTooltip; - listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; + listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : kStringIdNone; WindowTooltipClose(); Invalidate(); @@ -465,7 +465,7 @@ namespace OpenRCT2::Ui::Windows { } - auto status = STR_NONE; + auto status = kStringIdNone; try { auto entries = wanF.get(); @@ -499,7 +499,7 @@ namespace OpenRCT2::Ui::Windows _serverList.WriteFavourites(); // Update favourites in case favourited server info changes _numPlayersOnline = _serverList.GetTotalPlayerCount(); _statusText = STR_X_PLAYERS_ONLINE; - if (statusText != STR_NONE) + if (statusText != kStringIdNone) { _statusText = statusText; } @@ -584,7 +584,7 @@ namespace OpenRCT2::Ui::Windows if (!NetworkBeginClient(address, port)) { - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, kStringIdNone, {}); } } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index ccf85a7475..75f54a5bbb 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -163,7 +163,7 @@ namespace OpenRCT2::Ui::Windows struct ShortcutStringPair { std::string ShortcutId; - ::StringId StringId = STR_NONE; + ::StringId StringId = kStringIdNone; std::string CustomString; std::string Binding; }; @@ -454,7 +454,7 @@ namespace OpenRCT2::Ui::Windows int32_t x = 3; for (size_t i = 0; i < _tabs.size(); i++) { - auto tab = MakeTab({ x, 17 }, STR_NONE); + auto tab = MakeTab({ x, 17 }, kStringIdNone); widgets.push_back(tab); x += 31; } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index b7a8290f91..40ee43cebf 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -684,7 +684,7 @@ namespace OpenRCT2::Ui::Windows gPickupPeepImage = ImageId(); - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); + auto info = GetMapCoordinatesFromPos(screenCoords, kViewportInteractionItemAll); if (info.interactionType == ViewportInteractionItem::None) return; @@ -859,7 +859,7 @@ namespace OpenRCT2::Ui::Windows } else { - widgets[WIDX_COSTUME_BOX].text = STR_EMPTY; + widgets[WIDX_COSTUME_BOX].text = kStringIdEmpty; widgets[WIDX_COSTUME_BOX].flags &= ~WIDGET_FLAGS::TEXT_IS_STRING; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index b66b2d280c..810cb5c6d7 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -87,8 +87,8 @@ namespace OpenRCT2::Ui::Windows MakeTab ({ 65, 17}, STR_STAFF_SECURITY_TAB_TIP ), // security guards tab MakeTab ({ 96, 17}, STR_STAFF_ENTERTAINERS_TAB_TIP ), // entertainers tab MakeWidget({ 3, 72}, {WW - 6, 195}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), // staff list - MakeWidget({130, 58}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, STR_NONE, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker - MakeWidget({165, 17}, { 145, 13}, WindowWidgetType::Button, WindowColour::Primary , STR_NONE, STR_HIRE_STAFF_TIP ), // hire button + MakeWidget({130, 58}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, kStringIdNone, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker + MakeWidget({165, 17}, { 145, 13}, WindowWidgetType::Button, WindowColour::Primary , kStringIdNone, STR_HIRE_STAFF_TIP ), // hire button MakeWidget({243, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_QUICK_FIRE_STAFF ), // quick fire staff MakeWidget({267, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PATROL_BTN), STR_SHOW_PATROL_AREA_TIP ), // show staff patrol area tool MakeWidget({291, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_MAP), STR_SHOW_STAFF_ON_MAP_TIP), // show staff on map button @@ -483,7 +483,7 @@ namespace OpenRCT2::Ui::Windows { auto ft = Formatter(); ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); - ContextShowError(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); + ContextShowError(STR_NO_THING_IN_PARK_YET, kStringIdNone, ft); } } } diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 931d5ad063..0a08a593b9 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -35,7 +35,7 @@ namespace OpenRCT2::Ui::Windows }; static constexpr Widget _textInputWidgets[] = { - WINDOW_SHIM(STR_NONE, WW, WH), + WINDOW_SHIM(kStringIdNone, WW, WH), MakeWidget({ 170, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_CANCEL), MakeWidget({ 10, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_OK), }; @@ -46,10 +46,10 @@ namespace OpenRCT2::Ui::Windows WidgetIdentifier _parentWidget{}; std::string _title; - StringId _titleStringId = STR_NONE; + StringId _titleStringId = kStringIdNone; std::string _description; - StringId _descriptionStringId = STR_NONE; + StringId _descriptionStringId = kStringIdNone; Formatter _descriptionArgs; std::function _callback; @@ -101,9 +101,9 @@ namespace OpenRCT2::Ui::Windows void SetTitle(std::string_view title, std::string_view description) { - _titleStringId = STR_NONE; + _titleStringId = kStringIdNone; _title = title; - _descriptionStringId = STR_NONE; + _descriptionStringId = kStringIdNone; _description = description; } @@ -182,7 +182,7 @@ namespace OpenRCT2::Ui::Windows widgets[WIDX_BACKGROUND].bottom = newHeight - 1; // Set window title argument - if (_titleStringId == STR_NONE) + if (_titleStringId == kStringIdNone) { auto ft = Formatter::Common(); ft.Add(_title.c_str()); @@ -203,7 +203,7 @@ namespace OpenRCT2::Ui::Windows int32_t no_lines = 0; - if (_descriptionStringId == STR_NONE) + if (_descriptionStringId == kStringIdNone) { auto ft = Formatter(); ft.Add(_description.c_str()); diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 79e6094e5f..3b3eb85b1b 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -529,7 +529,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_RIDE_LIGHTS: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -541,7 +541,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_PARK_LIGHTS: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -553,7 +553,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_SCENARIO_FONT: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -566,7 +566,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -597,7 +597,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_DELETE_BUTTON: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -607,7 +607,7 @@ namespace OpenRCT2::Ui::Windows case WIDX_THEMES_RENAME_BUTTON: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, kStringIdNone, {}); } else { @@ -673,12 +673,12 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, kStringIdNone, {}); } } else { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); } break; } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 02670ae7e8..a686f45ca9 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -301,8 +301,8 @@ namespace OpenRCT2::Ui::Windows MakeWidget(GhostFlagColumnXY, GhostFlagColumnSize, WindowWidgetType::TableHeader, WindowColour::Secondary, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, STR_TILE_INSPECTOR_FLAG_GHOST), /* Ghost flag */ \ MakeWidget(LastFlagColumnXY, LastFlagColumnSize, WindowWidgetType::TableHeader, WindowColour::Secondary, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, STR_TILE_INSPECTOR_FLAG_LAST), /* Last of tile flag */ \ /* Group boxes */ \ - MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_NONE, STR_NONE ), /* Details group box */ \ - MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, STR_NONE ) /* Properties group box */ + MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, kStringIdNone, kStringIdNone ), /* Details group box */ \ + MakeWidget({6, 0}, {WW - 12, 0}, WindowWidgetType::Groupbox, WindowColour::Secondary, STR_TILE_INSPECTOR_GROUPBOX_PROPERTIES, kStringIdNone ) /* Properties group box */ static constexpr Widget DefaultWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, @@ -1093,7 +1093,7 @@ static uint64_t PageDisabledWidgets[] = { { // Details // Terrain texture name - StringId terrainNameId = STR_EMPTY; + StringId terrainNameId = kStringIdEmpty; auto surfaceStyle = tileElement->AsSurface()->GetSurfaceObject(); if (surfaceStyle != nullptr) terrainNameId = surfaceStyle->NameStringId; @@ -1102,7 +1102,7 @@ static uint64_t PageDisabledWidgets[] = { DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] }); // Edge texture name - StringId terrainEdgeNameId = STR_EMPTY; + StringId terrainEdgeNameId = kStringIdEmpty; auto edgeStyle = tileElement->AsSurface()->GetEdgeObject(); if (edgeStyle != nullptr) terrainEdgeNameId = edgeStyle->NameStringId; diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 6c58d6d378..433fec9fa8 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -194,7 +194,7 @@ namespace OpenRCT2::Ui::Windows if (!hasCustomItems) { hasCustomItems = true; - gDropdownItems[i++].Format = STR_EMPTY; + gDropdownItems[i++].Format = kStringIdEmpty; } gDropdownItems[i].Format = STR_STRING; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 9382a3f9ea..bd67b7fa7c 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -195,7 +195,7 @@ namespace OpenRCT2::Ui::Windows gTooltipWidget.window_number = widgetWindow->number; gTooltipWidget.widget_index = widgetIndex; result = widgetWindow->OnTooltip(widgetIndex, stringId); - if (result.str == STR_NONE) + if (result.str == kStringIdNone) return; } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index b1cf496345..cbf749c37f 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -373,7 +373,7 @@ namespace OpenRCT2::Ui::Windows } else { - ContextShowError(STR_CHAT_UNAVAILABLE, STR_NONE, {}); + ContextShowError(STR_CHAT_UNAVAILABLE, kStringIdNone, {}); } break; } @@ -1179,7 +1179,7 @@ namespace OpenRCT2::Ui::Windows const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; if (!customMenuItems.empty()) { - gDropdownItems[i++].Format = STR_EMPTY; + gDropdownItems[i++].Format = kStringIdEmpty; for (const auto& item : customMenuItems) { if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Standard) @@ -1253,7 +1253,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[3].Format = STR_TOGGLE_OPTION; if (Config::Get().general.DebuggingTools) { - gDropdownItems[4].Format = STR_EMPTY; + gDropdownItems[4].Format = kStringIdEmpty; gDropdownItems[5].Format = STR_TOGGLE_OPTION; gDropdownItems[5].Args = STR_SPEED_HYPER; num_items = 6; @@ -1340,7 +1340,7 @@ namespace OpenRCT2::Ui::Windows { gDropdownItems[numItems++].Format = STR_SCREENSHOT; gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_ABOUT; gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; @@ -1348,7 +1348,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) gDropdownItems[numItems++].Format = STR_QUIT_ROLLERCOASTER_DESIGNER; @@ -1360,12 +1360,12 @@ namespace OpenRCT2::Ui::Windows else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) { gDropdownItems[numItems++].Format = STR_LOAD_LANDSCAPE; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SAVE_LANDSCAPE; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SCREENSHOT; gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_ABOUT; gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; @@ -1373,7 +1373,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_QUIT_SCENARIO_EDITOR; gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; } @@ -1381,13 +1381,13 @@ namespace OpenRCT2::Ui::Windows { gDropdownItems[numItems++].Format = STR_NEW_GAME; gDropdownItems[numItems++].Format = STR_LOAD_GAME; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SAVE_GAME; gDropdownItems[numItems++].Format = STR_SAVE_GAME_AS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_SCREENSHOT; gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_ABOUT; gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; @@ -1395,7 +1395,7 @@ namespace OpenRCT2::Ui::Windows gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = kStringIdEmpty; gDropdownItems[numItems++].Format = STR_QUIT_TO_MENU; gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 402c8bbee6..3bd1a85b48 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -159,7 +159,7 @@ namespace OpenRCT2::Ui::Windows } else if (text.empty()) { - ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, kStringIdNone, {}); return; } else if (!Platform::IsFilenameValid(text)) diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 4841a6a05b..29f1222217 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -154,7 +154,7 @@ namespace OpenRCT2::Ui::Windows if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED && (_loadedTrackDesign->gameStateData.hasFlag(TrackDesignGameStateFlag::VehicleUnavailable))) { - ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); + ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, kStringIdNone, {}); } auto intent = Intent(WindowClass::TrackDesignPlace); @@ -377,7 +377,7 @@ namespace OpenRCT2::Ui::Windows void OnPrepareDraw() override { - StringId stringId = STR_NONE; + StringId stringId = kStringIdNone; const auto* entry = GetRideEntryByIndex(_window_track_list_item.EntryIndex); if (entry != nullptr) diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 6656dcb31f..b1df9d24d0 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -75,12 +75,12 @@ namespace OpenRCT2::Ui::Windows MakeWidget({152, 17}, HIDE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_GUESTS), STR_SEE_THROUGH_GUESTS), MakeWidget({177, 17}, HIDE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SEE_THROUGH_STAFF), - MakeWidget({ 2, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_VEGETATION), - MakeWidget({ 27, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_SCENERY), - MakeWidget({ 52, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_PATHS), - MakeWidget({ 77, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_RIDES), - MakeWidget({102, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_VEHICLES), - MakeWidget({127, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, STR_NONE, STR_INVISIBLE_SUPPORTS), + MakeWidget({ 2, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_VEGETATION), + MakeWidget({ 27, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_SCENERY), + MakeWidget({ 52, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_PATHS), + MakeWidget({ 77, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_RIDES), + MakeWidget({102, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_VEHICLES), + MakeWidget({127, 42}, INVISIBLE_SIZE, WindowWidgetType::FlatBtn, WindowColour::Tertiary, kStringIdNone, STR_INVISIBLE_SUPPORTS), }; // clang-format on diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 2758f22886..06f9d467dc 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Ui::Windows WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({ 11, 19}, { 159, 11}, WindowWidgetType::Checkbox, WindowColour::Primary, STR_VIEW_CLIPPING_HEIGHT_ENABLE, STR_VIEW_CLIPPING_HEIGHT_ENABLE_TIP ), // clip enable/disable check box MakeWidget ({ 5, 36}, {WW - 10, 48}, WindowWidgetType::Groupbox, WindowColour::Primary, STR_VIEW_CLIPPING_VERTICAL_CLIPPING ), - MakeSpinnerWidgets({ 90, 51}, { 79, 12}, WindowWidgetType::Spinner, WindowColour::Primary, STR_NONE, STR_VIEW_CLIPPING_HEIGHT_VALUE_TOGGLE), // clip height (3 widgets) + MakeSpinnerWidgets({ 90, 51}, { 79, 12}, WindowWidgetType::Spinner, WindowColour::Primary, kStringIdNone, STR_VIEW_CLIPPING_HEIGHT_VALUE_TOGGLE), // clip height (3 widgets) MakeWidget ({ 11, 66}, { 158, 13}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_HORIZONTAL, STR_VIEW_CLIPPING_HEIGHT_SCROLL_TIP ), // clip height scrollbar MakeWidget ({ 5, 90}, {WW - 10, 60}, WindowWidgetType::Groupbox, WindowColour::Primary, STR_VIEW_CLIPPING_HORIZONTAL_CLIPPING ), MakeWidget ({ 11, 105}, { 158, 17}, WindowWidgetType::Button, WindowColour::Primary, STR_VIEW_CLIPPING_SELECT_AREA ), // selector diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 368e8fb701..42fe0f6eb6 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -151,7 +151,7 @@ namespace OpenRCT2::Ui::Windows if (mainWindow != nullptr) { auto info = GetMapCoordinatesFromPos( - { windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll); + { windowPos.x + (width / 2), windowPos.y + (height / 2) }, kViewportInteractionItemAll); WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); } break; diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 8d7e4c635a..74eb06e914 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -42,7 +42,7 @@ namespace OpenRCT2::Ui::Windows // clang-format off static constexpr Widget _waterWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget ({16, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), STR_NONE), // preview box + MakeWidget ({16, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), kStringIdNone), // preview box MakeRemapWidget({17, 18}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_WATER_TIP), // decrement size MakeRemapWidget({43, 32}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_WATER_TIP), // increment size }; @@ -419,7 +419,8 @@ namespace OpenRCT2::Ui::Windows Formatter ft; ft.Add(kLandToolMinimumSize); ft.Add(kLandToolMaximumSize); - WindowTextInputOpen(this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + WindowTextInputOpen( + this, WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, kStringIdNone, kStringIdNone, 3); } }; diff --git a/src/openrct2-ui/windows/Windows.h b/src/openrct2-ui/windows/Windows.h index 548abfc9b5..c29aa18285 100644 --- a/src/openrct2-ui/windows/Windows.h +++ b/src/openrct2-ui/windows/Windows.h @@ -199,7 +199,7 @@ namespace OpenRCT2::Ui::Windows // ProgressWindow WindowBase* ProgressWindowOpen(const std::string& text, CloseCallback onClose = nullptr); - void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE); + void ProgressWindowSet(uint32_t currentProgress, uint32_t totalCount, StringId format = kStringIdNone); void ProgressWindowClose(); // PatrolArea diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index d9df787f52..290f18239a 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -411,14 +411,14 @@ namespace OpenRCT2 CrashInit(); - if (String::equals(Config::Get().general.LastRunVersion, OPENRCT2_VERSION)) + if (String::equals(Config::Get().general.LastRunVersion, kOpenRCT2Version)) { gOpenRCT2ShowChangelog = false; } else { gOpenRCT2ShowChangelog = true; - Config::Get().general.LastRunVersion = OPENRCT2_VERSION; + Config::Get().general.LastRunVersion = kOpenRCT2Version; Config::Save(); } @@ -665,7 +665,7 @@ namespace OpenRCT2 ContextOpenIntent(&intent); } - void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE) override + void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = kStringIdNone) override { if (_forcedUpdateTimer.GetElapsedTime() < kForcedUpdateInterval) return; @@ -741,7 +741,7 @@ namespace OpenRCT2 SetActiveScene(GetTitleScene()); } auto windowManager = _uiContext->GetWindowManager(); - windowManager->ShowError(STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, STR_NONE, {}); + windowManager->ShowError(STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, kStringIdNone, {}); } return false; } @@ -867,14 +867,14 @@ namespace OpenRCT2 auto windowManager = _uiContext->GetWindowManager(); auto ft = Formatter(); ft.Add(result.TargetVersion); - ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + ft.Add(OpenRCT2::kParkFileCurrentVersion); windowManager->ShowError(STR_WARNING_PARK_VERSION_TITLE, STR_WARNING_PARK_VERSION_MESSAGE, ft); } else if (HasObjectsThatUseFallbackImages()) { Console::Error::WriteLine("Park has objects which require RCT1 linked. Fallback images will be used."); auto windowManager = _uiContext->GetWindowManager(); - windowManager->ShowError(STR_PARK_USES_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter()); + windowManager->ShowError(STR_PARK_USES_FALLBACK_IMAGES_WARNING, kStringIdEmpty, Formatter()); } CloseProgress(); @@ -909,7 +909,7 @@ namespace OpenRCT2 SetActiveScene(GetTitleScene()); } auto windowManager = _uiContext->GetWindowManager(); - windowManager->ShowError(STR_FILE_CONTAINS_UNSUPPORTED_RIDE_TYPES, STR_NONE, {}); + windowManager->ShowError(STR_FILE_CONTAINS_UNSUPPORTED_RIDE_TYPES, kStringIdNone, {}); } catch (const UnsupportedVersionException& e) { @@ -921,7 +921,7 @@ namespace OpenRCT2 } auto windowManager = _uiContext->GetWindowManager(); Formatter ft; - /*if (e.TargetVersion < PARK_FILE_MIN_SUPPORTED_VERSION) + /*if (e.TargetVersion < kParkFileMinSupportedVersion) { ft.Add(e.TargetVersion); windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_OLD_MESSAGE, ft); @@ -931,14 +931,14 @@ namespace OpenRCT2 if (e.MinVersion == e.TargetVersion) { ft.Add(e.TargetVersion); - ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + ft.Add(OpenRCT2::kParkFileCurrentVersion); windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE_2, ft); } else { ft.Add(e.TargetVersion); ft.Add(e.MinVersion); - ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + ft.Add(OpenRCT2::kParkFileCurrentVersion); windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE, ft); } } diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 1a8649e6d8..737b6415e8 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -160,7 +160,7 @@ namespace OpenRCT2 virtual void DisposeDrawingEngine() = 0; virtual void OpenProgress(StringId captionStringId) = 0; - virtual void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = STR_NONE) = 0; + virtual void SetProgress(uint32_t currentProgress, uint32_t totalCount, StringId format = kStringIdNone) = 0; virtual void CloseProgress() = 0; virtual bool LoadParkFromFile(const u8string& path, bool loadTitleScreenOnFail = false, bool asScenario = false) = 0; diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 9639c82e57..67089f25a5 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -421,7 +421,7 @@ namespace OpenRCT2::Editor const bool isTrackDesignerManager = gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER); if (isTrackDesignerManager) { - return { ObjectType::None, STR_NONE }; + return { ObjectType::None, kStringIdNone }; } if (!EditorCheckObjectGroupAtLeastOneSurfaceSelected(false)) @@ -465,7 +465,7 @@ namespace OpenRCT2::Editor } } - return { ObjectType::None, STR_NONE }; + return { ObjectType::None, kStringIdNone }; } /** @@ -509,7 +509,7 @@ namespace OpenRCT2::Editor return { false, STR_PEEP_SPAWNS_NOT_SET }; } - return { true, STR_NONE }; + return { true, kStringIdNone }; } uint8_t GetSelectedObjectFlags(ObjectType objectType, size_t index) diff --git a/src/openrct2/FileClassifier.cpp b/src/openrct2/FileClassifier.cpp index a435f21a81..ab0dfcedc7 100644 --- a/src/openrct2/FileClassifier.cpp +++ b/src/openrct2/FileClassifier.cpp @@ -82,7 +82,7 @@ static bool TryClassifyAsPark(OpenRCT2::IStream* stream, ClassifiedFileInfo* res try { auto magic = stream->ReadValue(); - if (magic == OpenRCT2::PARK_FILE_MAGIC) + if (magic == OpenRCT2::kParkFileMagic) { result->Type = FILE_TYPE::PARK; result->Version = 0; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 9ca7527c5d..4c6d5032f5 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -437,7 +437,7 @@ void GameNotifyMapChanged() */ void ResetAllSpriteQuadrantPlacements() { - for (EntityId::UnderlyingType i = 0; i < MAX_ENTITIES; i++) + for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { auto* spr = GetEntity(EntityId::FromUnderlying(i)); if (spr != nullptr && spr->Type != EntityType::Null) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 8e0f694a21..708d3dad5c 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -90,7 +90,7 @@ namespace OpenRCT2 std::string ScenarioFileName; std::vector Banners; - Entity_t Entities[MAX_ENTITIES]{}; + Entity_t Entities[kMaxEntities]{}; // Ride storage for all the rides in the park, rides with RideId::Null are considered free. std::array Rides{}; size_t RidesEndOfUsedRange{}; diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 3dc5039e34..3f5bfec345 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -23,8 +23,8 @@ #include "entity/Staff.h" #include "ride/Vehicle.h" -static constexpr size_t MaximumGameStateSnapshots = 32; -static constexpr uint32_t InvalidTick = 0xFFFFFFFF; +static constexpr size_t kMaximumGameStateSnapshots = 32; +static constexpr uint32_t kInvalidTick = 0xFFFFFFFF; #pragma pack(push, 1) union EntitySnapshot @@ -48,7 +48,7 @@ struct GameStateSnapshot_t return *this; } - uint32_t tick = InvalidTick; + uint32_t tick = kInvalidTick; uint32_t srand0 = 0; OpenRCT2::MemoryStream storedSprites; @@ -187,7 +187,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots virtual void Capture(GameStateSnapshot_t& snapshot) override final { snapshot.SerialiseSprites( - [](const EntityId index) { return reinterpret_cast(GetEntity(index)); }, MAX_ENTITIES, true); + [](const EntityId index) { return reinterpret_cast(GetEntity(index)); }, kMaxEntities, true); // LOG_INFO("Snapshot size: %u bytes", static_cast(snapshot.storedSprites.GetLength())); } @@ -213,7 +213,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots std::vector BuildSpriteList(GameStateSnapshot_t& snapshot) const { std::vector spriteList; - spriteList.resize(MAX_ENTITIES); + spriteList.resize(kMaxEntities); for (auto& sprite : spriteList) { @@ -222,7 +222,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots } snapshot.SerialiseSprites( - [&spriteList](const EntityId index) { return &spriteList[index.ToUnderlying()]; }, MAX_ENTITIES, false); + [&spriteList](const EntityId index) { return &spriteList[index.ToUnderlying()]; }, kMaxEntities, false); return spriteList; } @@ -789,7 +789,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots } private: - CircularBuffer, MaximumGameStateSnapshots> _snapshots; + CircularBuffer, kMaximumGameStateSnapshots> _snapshots; }; std::unique_ptr CreateGameStateSnapshots() diff --git a/src/openrct2/Limits.h b/src/openrct2/Limits.h index b2fcefa742..907367531b 100644 --- a/src/openrct2/Limits.h +++ b/src/openrct2/Limits.h @@ -20,8 +20,8 @@ namespace OpenRCT2::Limits constexpr uint16_t kMaxInversions = RCT12::Limits::kMaxInversions; constexpr uint16_t kMaxTrainsPerRide = 255; constexpr uint16_t kMaxCarsPerTrain = 255; - constexpr const uint16_t kMaxVehicleColours = kMaxTrainsPerRide; // this should really be kMaxTrainsPerRide * - // kMaxCarsPerTrain + constexpr uint16_t kMaxVehicleColours = kMaxTrainsPerRide; // this should really be kMaxTrainsPerRide * + // kMaxCarsPerTrain // kMaxVehicleColours should be set to kMaxTrainsPerRide or kMaxCarsPerTrain, whichever is higher. // Sadly, using std::max() will cause compilation failures when using kMaxVehicleColours as an array size, // hence the usage of static asserts. diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 1ff63ab9a1..16ef59f68f 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -20,7 +20,7 @@ using namespace OpenRCT2; -static constexpr const char* DirectoryNamesRCT2[] = { +static constexpr const char* kDirectoryNamesRCT2[] = { "Data", // DATA "Landscapes", // LANDSCAPE nullptr, // LANGUAGE @@ -38,7 +38,7 @@ static constexpr const char* DirectoryNamesRCT2[] = { "Tracks", // TRACK }; -static constexpr u8string_view DirectoryNamesOpenRCT2[] = { +static constexpr u8string_view kDirectoryNamesOpenRCT2[] = { u8"data", // DATA u8"landscape", // LANDSCAPE u8"language", // LANGUAGE @@ -62,7 +62,7 @@ static constexpr u8string_view DirectoryNamesOpenRCT2[] = { u8"scenario_patches", // SCENARIO_PATCHES }; -static constexpr u8string_view FileNames[] = { +static constexpr u8string_view kFileNames[] = { u8"config.ini", // CONFIG u8"hotkeys.dat", // CONFIG_SHORTCUTS_LEGACY u8"shortcuts.json", // CONFIG_SHORTCUTS @@ -83,13 +83,13 @@ static constexpr u8string_view FileNames[] = { class PlatformEnvironment final : public IPlatformEnvironment { private: - u8string _basePath[DIRBASE_COUNT]; + u8string _basePath[kDirBaseCount]; bool _usingRCTClassic{}; public: explicit PlatformEnvironment(DIRBASE_VALUES basePaths) { - for (size_t i = 0; i < DIRBASE_COUNT; i++) + for (size_t i = 0; i < kDirBaseCount; i++) { _basePath[i] = basePaths[i]; } @@ -108,15 +108,15 @@ public: { default: case DIRBASE::RCT1: - directoryName = DirectoryNamesRCT2[EnumValue(did)]; + directoryName = kDirectoryNamesRCT2[EnumValue(did)]; break; case DIRBASE::RCT2: - directoryName = _usingRCTClassic ? "Assets" : DirectoryNamesRCT2[EnumValue(did)]; + directoryName = _usingRCTClassic ? "Assets" : kDirectoryNamesRCT2[EnumValue(did)]; break; case DIRBASE::OPENRCT2: case DIRBASE::USER: case DIRBASE::CONFIG: - directoryName = DirectoryNamesOpenRCT2[EnumValue(did)]; + directoryName = kDirectoryNamesOpenRCT2[EnumValue(did)]; break; } @@ -127,7 +127,7 @@ public: { auto dirbase = GetDefaultBaseDirectory(pathid); auto basePath = GetDirectoryPath(dirbase); - auto fileName = FileNames[EnumValue(pathid)]; + auto fileName = kFileNames[EnumValue(pathid)]; return Path::Combine(basePath, fileName); } @@ -225,7 +225,7 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() auto subDirectory = GetOpenRCT2DirectoryName(); // Set default paths - std::string basePaths[DIRBASE_COUNT]; + std::string basePaths[kDirBaseCount]; basePaths[EnumValue(DIRBASE::OPENRCT2)] = Platform::GetInstallPath(); basePaths[EnumValue(DIRBASE::USER)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_DATA), subDirectory); basePaths[EnumValue(DIRBASE::CONFIG)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CONFIG), subDirectory); diff --git a/src/openrct2/PlatformEnvironment.h b/src/openrct2/PlatformEnvironment.h index 120970ac67..cffd7c33df 100644 --- a/src/openrct2/PlatformEnvironment.h +++ b/src/openrct2/PlatformEnvironment.h @@ -26,8 +26,8 @@ namespace OpenRCT2 CACHE, // Base directory for OpenRCT2 cache files. DOCUMENTATION, // Base directory for OpenRCT2 doc files. }; - constexpr size_t DIRBASE_COUNT = 7; - using DIRBASE_VALUES = u8string[DIRBASE_COUNT]; + constexpr size_t kDirBaseCount = 7; + using DIRBASE_VALUES = u8string[kDirBaseCount]; enum class DIRID { diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp index 49874fd291..1f528fed4c 100644 --- a/src/openrct2/Version.cpp +++ b/src/openrct2/Version.cpp @@ -26,7 +26,7 @@ const char gVersionInfoTag[] = #ifdef OPENRCT2_VERSION_TAG OPENRCT2_VERSION_TAG #else - "v" OPENRCT2_VERSION + "v" kOpenRCT2Version #endif ; @@ -34,7 +34,7 @@ const char gVersionInfoFull[] = OPENRCT2_NAME ", " #ifdef OPENRCT2_VERSION_TAG OPENRCT2_VERSION_TAG #else - "v" OPENRCT2_VERSION + "v" kOpenRCT2Version #endif #if defined(OPENRCT2_BRANCH) || defined(OPENRCT2_COMMIT_SHA1_SHORT) || !defined(NDEBUG) " (" diff --git a/src/openrct2/Version.h b/src/openrct2/Version.h index 5519257d49..02390cdeda 100644 --- a/src/openrct2/Version.h +++ b/src/openrct2/Version.h @@ -12,7 +12,7 @@ #include #define OPENRCT2_NAME "OpenRCT2" -#define OPENRCT2_VERSION "0.4.18" +#define kOpenRCT2Version "0.4.18" #if defined(__amd64__) || defined(_M_AMD64) #define OPENRCT2_ARCHITECTURE "x86-64" diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index ab12b88c4a..64639edde7 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -66,21 +66,21 @@ GameActions::Result BannerRemoveAction::Query() const if (bannerElement == nullptr) { LOG_ERROR("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); @@ -105,21 +105,21 @@ GameActions::Result BannerRemoveAction::Execute() const if (bannerElement == nullptr) { LOG_ERROR("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 669b7cce45..10b78d19d7 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -92,7 +92,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const if (banner == nullptr) { LOG_ERROR("Invalid banner index %u", index); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 8251910049..7a8c96fa0a 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -93,7 +93,7 @@ GameActions::Result BannerSetStyleAction::Query() const if (tileElement->AsBanner() == nullptr) { LOG_ERROR("Tile element was not a banner."); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } break; default: @@ -125,7 +125,7 @@ GameActions::Result BannerSetStyleAction::Execute() const if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex &u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } switch (_type) diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index 63c256e90d..4b79c27d5a 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -81,7 +81,7 @@ GameActions::Result ClearAction::QueryExecute(bool executing) const auto noValidTiles = true; auto error = GameActions::Status::Ok; - StringId errorMessage = STR_NONE; + StringId errorMessage = kStringIdNone; money64 totalCost = 0; auto validRange = ClampRangeWithinMap(_range); diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 7188613a20..062be3aea1 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -141,7 +141,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const // Check if there is something on the path already if (pathElement->HasAddition()) { - return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_POSITION_THIS_HERE, kStringIdNone); } } return res; diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 1c044de47a..7f8c5e3554 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -87,7 +87,7 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const if (!pathElement->AdditionIsGhost() && (GetFlags() & GAME_COMMAND_FLAG_GHOST)) { LOG_WARNING("Tried to remove non ghost during ghost removal."); - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, kStringIdNone); } auto res = GameActions::Result(); res.Position = _loc; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 406d1c28d7..0d39c07b49 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -219,7 +219,7 @@ GameActions::Result FootpathPlaceAction::ElementUpdateQuery(PathElement* pathEle if (GetFlags() & GAME_COMMAND_FLAG_GHOST && !pathElement->IsGhost()) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } return res; } @@ -283,7 +283,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result if (!MapCheckCapacityAndReorganise(_loc)) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_BUILD_FOOTPATH_HERE, kStringIdNone); } res.Cost = 12.00_GBP; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 603eb97755..61e2ccc316 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -119,7 +119,7 @@ GameActions::Result FootpathRemoveAction::Execute() const } else { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, kStringIdNone); } res.Cost += GetRefundPrice(footpathElement); diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index d70cdb7666..78c65fe1b6 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -259,10 +259,10 @@ template struct GameActionBase : GameAction { public: - static constexpr GameCommand TYPE = TType; + static constexpr GameCommand kType = TType; GameActionBase() - : GameAction(TYPE) + : GameAction(kType) { } }; diff --git a/src/openrct2/actions/GameActionRegistry.cpp b/src/openrct2/actions/GameActionRegistry.cpp index 04b9d6bb7e..810c3a9a3a 100644 --- a/src/openrct2/actions/GameActionRegistry.cpp +++ b/src/openrct2/actions/GameActionRegistry.cpp @@ -121,7 +121,7 @@ namespace OpenRCT2::GameActions static constexpr void Register(GameActionRegistry& registry, const char* name) { GameActionFactory factory = []() -> GameAction* { return new T(); }; - Register(registry, factory, name); + Register(registry, factory, name); } static constexpr GameActionRegistry BuildRegistry() diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 137729e0f6..6c2065050d 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -57,8 +57,8 @@ namespace OpenRCT2::GameActions using StringVariant = std::variant; OpenRCT2::GameActions::Status Error = OpenRCT2::GameActions::Status::Ok; - StringVariant ErrorTitle = STR_NONE; - StringVariant ErrorMessage = STR_NONE; + StringVariant ErrorTitle = kStringIdNone; + StringVariant ErrorMessage = kStringIdNone; std::array ErrorMessageArgs{}; CoordsXYZ Position = { kLocationNull, kLocationNull, kLocationNull }; money64 Cost = 0; diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index 8620da0af2..6333df89f4 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -46,7 +46,7 @@ GameActions::Result GuestSetFlagsAction::Query() const if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); } return GameActions::Result(); } @@ -57,7 +57,7 @@ GameActions::Result GuestSetFlagsAction::Execute() const if (peep == nullptr) { LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, kStringIdNone); } peep->PeepFlags = _newFlags; diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 73d055cee5..665c38970b 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -58,7 +58,7 @@ void GuestSetNameAction::Serialise(DataSerialiser& stream) GameActions::Result GuestSetNameAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -67,7 +67,7 @@ GameActions::Result GuestSetNameAction::Query() const if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); } return GameActions::Result(); @@ -79,7 +79,7 @@ GameActions::Result GuestSetNameAction::Execute() const if (guest == nullptr) { LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, kStringIdNone); } auto curName = guest->GetName(); @@ -90,7 +90,7 @@ GameActions::Result GuestSetNameAction::Execute() const if (!guest->SetName(_name)) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone); } // Easter egg functions are for guests only diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index a894325740..203a2bb13d 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -114,7 +114,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& if (_setting >= LandBuyRightSetting::Count) { LOG_ERROR("Invalid land buying setting %u", _setting); - return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); + return GameActions::Result(GameActions::Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); @@ -122,7 +122,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& { LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); return GameActions::Result( - GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); + GameActions::Status::InvalidParameters, kErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto res = GameActions::Result(); @@ -138,7 +138,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& || (surfaceElement->GetOwnership() & OWNERSHIP_AVAILABLE) == 0) { return GameActions::Result( - GameActions::Status::NotOwned, _ErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE); + GameActions::Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_LAND_NOT_FOR_SALE); } if (isExecuting) { @@ -158,7 +158,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& || (surfaceElement->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) == 0) { return GameActions::Result( - GameActions::Status::NotOwned, _ErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE); + GameActions::Status::NotOwned, kErrorTitles[EnumValue(_setting)], STR_CONSTRUCTION_RIGHTS_NOT_FOR_SALE); } if (isExecuting) @@ -172,6 +172,6 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& default: LOG_ERROR("Invalid land buying setting %u", _setting); - return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); + return GameActions::Result(GameActions::Status::InvalidParameters, kErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } } diff --git a/src/openrct2/actions/LandBuyRightsAction.h b/src/openrct2/actions/LandBuyRightsAction.h index d0df59ae0f..7f2cf7a918 100644 --- a/src/openrct2/actions/LandBuyRightsAction.h +++ b/src/openrct2/actions/LandBuyRightsAction.h @@ -24,7 +24,7 @@ private: MapRange _range; LandBuyRightSetting _setting{ LandBuyRightSetting::Count }; - constexpr static StringId _ErrorTitles[] = { + constexpr static StringId kErrorTitles[] = { STR_CANT_BUY_LAND, STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE, }; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index a5b83dbc38..7481e4bec4 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -63,20 +63,20 @@ GameActions::Result LandSetHeightAction::Query() const auto& gameState = GetGameState(); if (gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { - return GameActions::Result(GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, kStringIdNone); } StringId errorMessage = CheckParameters(); - if (errorMessage != STR_NONE) + if (errorMessage != kStringIdNone) { - return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, errorMessage); + return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, errorMessage); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gameState.Cheats.sandboxMode) { if (!MapIsLocationInPark(_coords)) { - return GameActions::Result(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, kStringIdNone); } } @@ -89,7 +89,7 @@ GameActions::Result LandSetHeightAction::Query() const TileElement* tileElement = CheckTreeObstructions(); if (tileElement != nullptr) { - auto res = GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -101,9 +101,9 @@ GameActions::Result LandSetHeightAction::Query() const if (!gameState.Cheats.disableSupportLimits) { errorMessage = CheckRideSupports(); - if (errorMessage != STR_NONE) + if (errorMessage != kStringIdNone) { - return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, errorMessage); + return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, errorMessage); } } @@ -118,13 +118,13 @@ GameActions::Result LandSetHeightAction::Query() const auto* pathElement = MapGetFootpathElement(oldCoords); if (pathElement != nullptr && pathElement->AsPath()->IsLevelCrossing(oldCoords)) { - return GameActions::Result(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, kStringIdNone); } TileElement* tileElement = CheckFloatingStructures(reinterpret_cast(surfaceElement), _height); if (tileElement != nullptr) { - auto res = GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -212,7 +212,7 @@ StringId LandSetHeightAction::CheckParameters() const return STR_TOO_HIGH; } - return STR_NONE; + return kStringIdNone; } TileElement* LandSetHeightAction::CheckTreeObstructions() const @@ -297,7 +297,7 @@ StringId LandSetHeightAction::CheckRideSupports() const return STR_SUPPORTS_CANT_BE_EXTENDED; } } - return STR_NONE; + return kStringIdNone; } TileElement* LandSetHeightAction::CheckFloatingStructures(TileElement* surfaceElement, uint8_t zCorner) const @@ -327,7 +327,7 @@ TileElement* LandSetHeightAction::CheckFloatingStructures(TileElement* surfaceEl money64 LandSetHeightAction::GetSurfaceHeightChangeCost(SurfaceElement* surfaceElement) const { money64 cost{ 0 }; - for (Direction i : ALL_DIRECTIONS) + for (Direction i : kAllDirections) { int32_t cornerHeight = TileElementGetCornerHeight(surfaceElement, i); cornerHeight -= MapGetCornerHeight(_height, _style & kTileSlopeMask, i); diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 4c7edd8ef7..a95a3d0574 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -87,7 +87,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_NONE, STR_LAND_NOT_FOR_SALE); + return GameActions::Result(GameActions::Status::NotInEditorMode, kStringIdNone, STR_LAND_NOT_FOR_SALE); } // Game command modified to accept selection size diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 2404959504..58a5f8322f 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -346,7 +346,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const int32_t centreZ = TileElementHeight(_coords); auto res = GameActions::Result(); - res.ErrorTitle = _ErrorTitles[_isLowering ? 0 : 1]; + res.ErrorTitle = kErrorTitles[_isLowering ? 0 : 1]; res.Expenditure = ExpenditureType::Landscaping; res.Position = { _coords.x, _coords.y, centreZ }; diff --git a/src/openrct2/actions/LandSmoothAction.h b/src/openrct2/actions/LandSmoothAction.h index efefffb5b3..1b367c71be 100644 --- a/src/openrct2/actions/LandSmoothAction.h +++ b/src/openrct2/actions/LandSmoothAction.h @@ -19,7 +19,7 @@ private: uint8_t _selectionType{}; bool _isLowering{}; - constexpr static StringId _ErrorTitles[] = { + constexpr static StringId kErrorTitles[] = { STR_CANT_LOWER_LAND_HERE, STR_CANT_RAISE_LAND_HERE, }; diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 597d8f7304..7009ceaf6d 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -224,7 +224,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const if (sceneryEntry->tiles.empty()) { LOG_ERROR("Invalid large scenery object, sceneryType = %u", _sceneryType); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, kStringIdNone); } int16_t maxHeight = GetMaxSurfaceHeight(sceneryEntry->tiles); diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 2d2a0bdb33..e21cc0abbe 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -153,7 +153,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const if (sceneryEntry == nullptr) { LOG_WARNING("Scenery entry at x = %d, y = %d not removed because it is an unknown object type", _loc.x, _loc.y); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, kStringIdNone); } tileElement->RemoveBannerEntry(); diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index ef33766932..96f2768bb7 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -100,7 +100,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) LOG_ERROR( "Could not find large scenery at: x = %d, y = %d, z = %d, direction = %d, tileIndex = %u", _loc.x, _loc.y, _loc.z, _loc.direction, _tileIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(largeElement->IsGhost())) @@ -113,7 +113,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (sceneryEntry == nullptr) { LOG_ERROR("Scenery element doesn't have scenery entry"); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } // Work out the base tile coordinates (Tile with index 0) auto rotatedBaseCoordsOffset = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].offset }.Rotate(_loc.direction), @@ -147,7 +147,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) LOG_ERROR( "Large scenery element not found at: x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } if (isExecuting) { diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index ad61274616..52b0d96d38 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -33,7 +33,7 @@ using namespace OpenRCT2::TrackMetaData; // clang-format off /** rct2: 0x00993CE9 */ -static constexpr uint8_t Byte993CE9[] = { +static constexpr uint8_t kByte993CE9[] = { 0xFF, 0xE0, 0xFF, 14, 0, 1, 2, 6, 2, 4, 5, @@ -42,7 +42,7 @@ static constexpr uint8_t Byte993CE9[] = { }; /** rct2: 0x00993CFC */ -static constexpr uint8_t Byte993CFC[] = { +static constexpr uint8_t kByte993CFC[] = { 5, 12, 0xFF, 0xFF, 9, 0, 0xFF, 0xFF, 13, 4, 0xFF, 0xFF, @@ -50,7 +50,7 @@ static constexpr uint8_t Byte993CFC[] = { }; /** rct2: 0x00993D0C */ -static constexpr uint8_t Byte993D0C[] = { +static constexpr uint8_t kByte993D0C[] = { 3, 0, 0xFF, 0xFF, 0, 1, 0xFF, 0xFF, 1, 2, 0xFF, 0xFF, @@ -253,10 +253,10 @@ GameActions::Result MazeSetTrackAction::Execute() const if (!_initialPlacement) { - segmentOffset = Byte993CE9[(_loc.direction + segmentOffset)]; + segmentOffset = kByte993CE9[(_loc.direction + segmentOffset)]; tileElement->AsTrack()->MazeEntrySubtract(1 << segmentOffset); - uint8_t temp_edx = Byte993CFC[segmentOffset]; + uint8_t temp_edx = kByte993CFC[segmentOffset]; if (temp_edx != 0xFF) { auto previousElementLoc = CoordsXY{ _loc }.ToTileStart() - CoordsDirectionDelta[_loc.direction]; @@ -311,7 +311,7 @@ GameActions::Result MazeSetTrackAction::Execute() const { tileElement->AsTrack()->MazeEntryAdd(1 << segmentBit); - uint32_t direction1 = Byte993D0C[segmentBit]; + uint32_t direction1 = kByte993D0C[segmentBit]; auto nextElementLoc = previousSegment.ToTileStart() + CoordsDirectionDelta[direction1]; TileElement* tmp_tileElement = MapGetTrackElementAtOfTypeFromRide( @@ -319,7 +319,7 @@ GameActions::Result MazeSetTrackAction::Execute() const if (tmp_tileElement != nullptr) { - uint8_t edx11 = Byte993CFC[segmentBit]; + uint8_t edx11 = kByte993CFC[segmentBit]; tmp_tileElement->AsTrack()->MazeEntryAdd(1 << (edx11)); } diff --git a/src/openrct2/actions/ParkEntrancePlaceAction.cpp b/src/openrct2/actions/ParkEntrancePlaceAction.cpp index 9867ab78a9..19ddcf144b 100644 --- a/src/openrct2/actions/ParkEntrancePlaceAction.cpp +++ b/src/openrct2/actions/ParkEntrancePlaceAction.cpp @@ -58,7 +58,7 @@ GameActions::Result ParkEntrancePlaceAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } auto res = GameActions::Result(); @@ -111,7 +111,7 @@ GameActions::Result ParkEntrancePlaceAction::Query() const EntranceElement* entranceElement = MapGetParkEntranceElementAt(entranceLoc, false); if (entranceElement != nullptr) { - return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index 49a8f687ff..906f718f34 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -45,7 +45,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, kStringIdNone); } auto res = GameActions::Result(); @@ -60,7 +60,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const if (ParkEntranceGetIndex(_loc) == -1) { LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } return res; } @@ -76,7 +76,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const if (entranceIndex == -1) { LOG_ERROR("No park entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, kStringIdNone); } auto& gameState = GetGameState(); diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index d10a5764bb..7257fa4925 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -46,12 +46,12 @@ GameActions::Result ParkSetEntranceFeeAction::Query() const if ((GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY) != 0) { LOG_ERROR("Can't set park entrance fee because the park has no money"); - return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); } else if (!Park::EntranceFeeUnlocked()) { LOG_ERROR("Park entrance fee is locked"); - return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, kStringIdNone); } else if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE) { diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index ccc1efc2b6..ac6f34ec0e 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -51,7 +51,7 @@ GameActions::Result ParkSetParameterAction::Query() const } auto res = GameActions::Result(); - res.ErrorTitle = _ErrorTitles[EnumValue(_parameter)]; + res.ErrorTitle = kErrorTitles[EnumValue(_parameter)]; return res; } @@ -85,6 +85,6 @@ GameActions::Result ParkSetParameterAction::Execute() const } auto res = GameActions::Result(); - res.ErrorTitle = _ErrorTitles[EnumValue(_parameter)]; + res.ErrorTitle = kErrorTitles[EnumValue(_parameter)]; return res; } diff --git a/src/openrct2/actions/ParkSetParameterAction.h b/src/openrct2/actions/ParkSetParameterAction.h index 7a4f598c1f..cfbcd9126a 100644 --- a/src/openrct2/actions/ParkSetParameterAction.h +++ b/src/openrct2/actions/ParkSetParameterAction.h @@ -25,11 +25,11 @@ private: ParkParameter _parameter{ ParkParameter::Count }; uint64_t _value{}; - constexpr static StringId _ErrorTitles[] = { + constexpr static StringId kErrorTitles[] = { STR_CANT_CLOSE_PARK, STR_CANT_OPEN_PARK, - STR_NONE, - STR_NONE, + kStringIdNone, + kStringIdNone, }; public: diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index c5ad69606f..0814f35cda 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -47,22 +47,22 @@ void PeepPickupAction::Serialise(DataSerialiser& stream) GameActions::Result PeepPickupAction::Query() const { - if (_entityId.ToUnderlying() >= MAX_ENTITIES || _entityId.IsNull()) + if (_entityId.ToUnderlying() >= kMaxEntities || _entityId.IsNull()) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } if (!_loc.IsNull() && !LocationValid(_loc)) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto* const peep = TryGetEntity(_entityId); if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto res = GameActions::Result(); @@ -74,7 +74,7 @@ GameActions::Result PeepPickupAction::Query() const res.Position = peep->GetLocation(); if (!peep->CanBePickedUp()) { - return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } Peep* existing = NetworkGetPickupPeep(_owner); if (existing != nullptr) @@ -99,7 +99,7 @@ GameActions::Result PeepPickupAction::Query() const res.Position = _loc; if (NetworkGetPickupPeep(_owner) != peep) { - return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } if (auto res2 = peep->Place(TileCoordsXYZ(_loc), false); res2.Error != GameActions::Status::Ok) @@ -109,7 +109,7 @@ GameActions::Result PeepPickupAction::Query() const break; default: LOG_ERROR("Invalid peep pickup type %u", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } return res; } @@ -120,7 +120,7 @@ GameActions::Result PeepPickupAction::Execute() const if (peep == nullptr) { LOG_ERROR("Failed to pick up peep for sprite %d", _entityId); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } auto res = GameActions::Result(); @@ -178,7 +178,7 @@ GameActions::Result PeepPickupAction::Execute() const break; default: LOG_ERROR("Invalid peep pickup type %u", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } return res; } diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index fd66c785da..71f7452def 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -47,7 +47,7 @@ GameActions::Result PeepSpawnPlaceAction::Query() const { if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.sandboxMode) { - return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, kStringIdNone); } auto res = GameActions::Result(); diff --git a/src/openrct2/actions/ResultWithMessage.h b/src/openrct2/actions/ResultWithMessage.h index fda9921ed2..f78b8b5b75 100644 --- a/src/openrct2/actions/ResultWithMessage.h +++ b/src/openrct2/actions/ResultWithMessage.h @@ -14,10 +14,10 @@ struct ResultWithMessage { bool Successful{}; - StringId Message = STR_NONE; + StringId Message = kStringIdNone; bool HasMessage() const { - return Message != STR_NONE; + return Message != kStringIdNone; } }; diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 235106cf61..6a081539cc 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -117,7 +117,7 @@ GameActions::Result RideCreateAction::Query() const const auto* presetList = rideEntry->vehicle_preset_list; if ((presetList->count > 0 && presetList->count != 255) && _colour2 >= presetList->count) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } auto res = GameActions::Result(); @@ -206,7 +206,7 @@ GameActions::Result RideCreateAction::Execute() const if (!(gameState.Park.Flags & PARK_FLAGS_NO_MONEY)) { - for (auto i = 0; i < RCT2::ObjectLimits::MaxShopItemsPerRideEntry; i++) + for (auto i = 0; i < RCT2::ObjectLimits::kMaxShopItemsPerRideEntry; i++) { ride->price[i] = rtd.DefaultPrices[i]; } @@ -244,7 +244,7 @@ GameActions::Result RideCreateAction::Execute() const } } - for (auto i = 0; i < RCT2::ObjectLimits::MaxShopItemsPerRideEntry; i++) + for (auto i = 0; i < RCT2::ObjectLimits::kMaxShopItemsPerRideEntry; i++) { if (rideEntry->shop_item[i] != ShopItem::None) { diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index a878603ff0..165f7b8d9f 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -242,15 +242,15 @@ money64 RideDemolishAction::DemolishTracks() const } else { - static constexpr CoordsXY DirOffsets[] = { + static constexpr CoordsXY kDirOffsets[] = { { 0, 0 }, { 0, 16 }, { 16, 16 }, { 16, 0 }, }; - for (Direction dir : ALL_DIRECTIONS) + for (Direction dir : kAllDirections) { - const CoordsXYZ off = { DirOffsets[dir], 0 }; + const CoordsXYZ off = { kDirOffsets[dir], 0 }; money64 removePrice = MazeRemoveTrack({ location + off, dir }); if (removePrice != kMoney64Undefined) { diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index b2f8655391..79367b7f03 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -77,12 +77,12 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_MUST_BE_CLOSED_FIRST, kStringIdNone); } if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_NOT_ALLOWED_TO_MODIFY_STATION, kStringIdNone); } if (!LocationValid(_loc)) diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index b4e1eb9af4..f294c373d6 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -69,7 +69,7 @@ GameActions::Result RideSetPriceAction::Query() const if (_price < kRideMinPrice || _price > kRideMaxPrice) { LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_EMPTY); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } return GameActions::Result(); @@ -98,7 +98,7 @@ GameActions::Result RideSetPriceAction::Execute() const if (_price < kRideMinPrice || _price > kRideMaxPrice) { LOG_ERROR("Attempting to set an invalid price for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_EMPTY); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, kStringIdEmpty); } if (!ride->overall_view.IsNull()) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index aba738295f..996a00365e 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -152,7 +152,7 @@ GameActions::Result RideSetSettingAction::Query() const if (!GetGameState().Cheats.allowArbitraryRideTypeChanges) { LOG_ERROR("Arbitrary ride type changes not allowed."); - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, kStringIdNone); } break; default: diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index b3d4e86c86..e6b5eced97 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -73,7 +73,7 @@ GameActions::Result RideSetStatusAction::Query() const LOG_ERROR("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = kStringIdNone; return res; } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index eae246e1e3..b090c1c407 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -28,7 +28,7 @@ using namespace OpenRCT2; -constexpr static StringId SetVehicleTypeErrorTitle[] = { +constexpr static StringId kSetVehicleTypeErrorTitle[] = { STR_RIDE_SET_VEHICLE_SET_NUM_TRAINS_FAIL, STR_RIDE_SET_VEHICLE_SET_NUM_CARS_PER_TRAIN_FAIL, STR_RIDE_SET_VEHICLE_TYPE_FAIL, @@ -68,7 +68,7 @@ GameActions::Result RideSetVehicleAction::Query() const { LOG_ERROR("Invalid ride vehicle type %d", _type); } - auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; + auto errTitle = kSetVehicleTypeErrorTitle[EnumValue(_type)]; auto ride = GetRide(_rideIndex); if (ride == nullptr) @@ -104,7 +104,7 @@ GameActions::Result RideSetVehicleAction::Query() const if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for _value %d", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } // Validate preset @@ -127,7 +127,7 @@ GameActions::Result RideSetVehicleAction::Query() const GameActions::Result RideSetVehicleAction::Execute() const { - auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; + auto errTitle = kSetVehicleTypeErrorTitle[EnumValue(_type)]; auto ride = GetRide(_rideIndex); if (ride == nullptr) { @@ -155,7 +155,7 @@ GameActions::Result RideSetVehicleAction::Execute() const if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for index %d", ride->subtype); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } uint8_t clampValue = _value; static_assert(sizeof(clampValue) == sizeof(ride->proposed_num_cars_per_train)); @@ -178,7 +178,7 @@ GameActions::Result RideSetVehicleAction::Execute() const if (rideEntry == nullptr) { LOG_ERROR("Ride entry not found for index %d", ride->subtype); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } RideSetVehicleColoursToRandomPreset(*ride, _colour); @@ -201,7 +201,7 @@ GameActions::Result RideSetVehicleAction::Execute() const default: LOG_ERROR("Invalid ride vehicle setting %d", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, kStringIdNone); } ride->num_circuits = 1; diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index fa55743634..64a4b150ef 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -49,7 +49,7 @@ GameActions::Result SignSetNameAction::Query() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); } return GameActions::Result(); } @@ -60,7 +60,7 @@ GameActions::Result SignSetNameAction::Execute() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, kStringIdNone); } if (!_name.empty()) diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 94535f2339..ca19498d8c 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -56,7 +56,7 @@ GameActions::Result SignSetStyleAction::Query() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (_isLarge) @@ -65,13 +65,13 @@ GameActions::Result SignSetStyleAction::Query() const if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if (tileElement->GetType() != TileElementType::LargeScenery) { LOG_ERROR( "Tile element has type %u, expected %d (LargeScenery)", tileElement->GetType(), TileElementType::LargeScenery); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } else @@ -81,7 +81,7 @@ GameActions::Result SignSetStyleAction::Query() const if (wallElement == nullptr) { LOG_ERROR("Wall element not found for bannerIndex", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } @@ -94,7 +94,7 @@ GameActions::Result SignSetStyleAction::Execute() const if (banner == nullptr) { LOG_ERROR("Invalid banner id %u", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } CoordsXY coords = banner->position.ToCoordsXY(); @@ -106,7 +106,7 @@ GameActions::Result SignSetStyleAction::Execute() const { coords, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour)) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } } else diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index 4e32022422..0d2ff36d64 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -97,7 +97,7 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting) if (sceneryElement == nullptr) { LOG_ERROR("Small scenery not found at: x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(sceneryElement->IsGhost())) diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 6846b722cb..acb1719086 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -39,7 +39,7 @@ void StaffFireAction::Serialise(DataSerialiser& stream) GameActions::Result StaffFireAction::Query() const { - if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull()) + if (_spriteId.ToUnderlying() >= kMaxEntities || _spriteId.IsNull()) { LOG_ERROR("Invalid spriteId %u", _spriteId); return GameActions::Result( @@ -55,11 +55,11 @@ GameActions::Result StaffFireAction::Query() const if (staff->State == PeepState::Fixing) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, kStringIdNone); } else if (staff->State == PeepState::Inspecting) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, kStringIdNone); } return GameActions::Result(); diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 42de88d8a9..32428ceaf8 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -46,7 +46,7 @@ void StaffSetCostumeAction::Serialise(DataSerialiser& stream) GameActions::Result StaffSetCostumeAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index 02553e497f..2dea03bb70 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -49,7 +49,7 @@ void StaffSetNameAction::Serialise(DataSerialiser& stream) GameActions::Result StaffSetNameAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( @@ -85,7 +85,7 @@ GameActions::Result StaffSetNameAction::Execute() const if (!staff->SetName(_name)) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_NAME_GUEST, kStringIdNone); } GfxInvalidateScreen(); diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index f301dfc43f..9bb33b41bb 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -45,7 +45,7 @@ void StaffSetOrdersAction::Serialise(DataSerialiser& stream) GameActions::Result StaffSetOrdersAction::Query() const { - if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) + if (_spriteIndex.ToUnderlying() >= kMaxEntities || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index e990603a2f..0476492c13 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -84,7 +84,7 @@ GameActions::Result TrackDesignAction::Query() const auto r = GameActions::ExecuteNested(&rideCreateAction); if (r.Error != GameActions::Status::Ok) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } const auto rideIndex = r.GetData(); @@ -158,7 +158,7 @@ GameActions::Result TrackDesignAction::Execute() const auto r = GameActions::ExecuteNested(&rideCreateAction); if (r.Error != GameActions::Status::Ok) { - return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result(GameActions::Status::NoFreeElements, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, kStringIdNone); } const auto rideIndex = r.GetData(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 592388f56b..dffddd7d03 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -103,7 +103,7 @@ GameActions::Result TrackPlaceAction::Query() const if (_rideType != ride->type && !gameState.Cheats.allowArbitraryRideTypeChanges) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, kStringIdNone); } if (_rideType > RIDE_TYPE_COUNT) diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index 3fc1843853..ba362afdb1 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -75,7 +75,7 @@ GameActions::Result TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting) con if (_brakeSpeed > kMaximumTrackSpeed) { LOG_WARNING("Invalid speed for track, speed = %d", _brakeSpeed); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_SPEED_TOO_HIGH, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_SPEED_TOO_HIGH, kStringIdNone); } if (isExecuting) diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 7db7bbd276..158067f1a5 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -114,7 +114,7 @@ GameActions::Result WallPlaceAction::Query() const if (_edge > 3) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, kStringIdNone); } uint8_t edgeSlope = 0; @@ -536,7 +536,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( int32_t direction = tileElement->GetDirection(); if (_edge == direction) { - auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); MapGetObstructionErrorText(tileElement, res); return res; } @@ -544,7 +544,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( } if (tileElement->GetOccupiedQuadrants() == 0) continue; - auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE); + auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, kStringIdNone); switch (elementType) { case TileElementType::Entrance: diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index dd5b90c541..7293988486 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -92,7 +92,7 @@ GameActions::Result WallSetColourAction::Query() const LOG_ERROR( "Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } if (_primaryColour >= COLOUR_COUNT) @@ -110,7 +110,7 @@ GameActions::Result WallSetColourAction::Query() const if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Tertiary colour invalid: colour = %d", _tertiaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } } return res; @@ -130,7 +130,7 @@ GameActions::Result WallSetColourAction::Execute() const { LOG_ERROR( "Could not find wall element at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, kStringIdNone); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost())) @@ -144,7 +144,7 @@ GameActions::Result WallSetColourAction::Execute() const LOG_ERROR( "Wall element does not have wall entry at x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, kStringIdNone); } wallElement->SetPrimaryColour(_primaryColour); diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 0296a3f4e7..1940e75885 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -55,25 +55,25 @@ GameActions::Result WaterSetHeightAction::Query() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gameState.Cheats.sandboxMode && gameState.Park.Flags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { - return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); + return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); } StringId errorMsg = CheckParameters(); - if (errorMsg != STR_NONE) + if (errorMsg != kStringIdNone) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, errorMsg); + return GameActions::Result(GameActions::Status::InvalidParameters, kStringIdNone, errorMsg); } if (!LocationValid(_coords)) { - return GameActions::Result(GameActions::Status::NotOwned, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK); + return GameActions::Result(GameActions::Status::NotOwned, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gameState.Cheats.sandboxMode) { if (!MapIsLocationInPark(_coords)) { - return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK); + return GameActions::Result(GameActions::Status::Disallowed, kStringIdNone, STR_LAND_NOT_OWNED_BY_PARK); } } @@ -165,5 +165,5 @@ StringId WaterSetHeightAction::CheckParameters() const return STR_TOO_HIGH; } - return STR_NONE; + return kStringIdNone; } diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 92dac3b61f..437bab4836 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -503,9 +503,9 @@ namespace OpenRCT2::Audio float DStoMixerPan(int32_t pan) { - constexpr int32_t DSBPAN_LEFT = -10000; - constexpr int32_t DSBPAN_RIGHT = 10000; - return ((static_cast(pan) + -DSBPAN_LEFT) / DSBPAN_RIGHT) / 2; + constexpr int32_t kDSBPanLeft = -10000; + constexpr int32_t kDSBPanRight = 10000; + return ((static_cast(pan) + -kDSBPanLeft) / kDSBPanRight) / 2; } double DStoMixerRate(int32_t frequency) diff --git a/src/openrct2/command_line/CommandLine.cpp b/src/openrct2/command_line/CommandLine.cpp index 2e2cd73766..fd0f56ba8d 100644 --- a/src/openrct2/command_line/CommandLine.cpp +++ b/src/openrct2/command_line/CommandLine.cpp @@ -95,8 +95,8 @@ bool CommandLineArgEnumerator::TryPopString(const char** result) namespace OpenRCT2::CommandLine { - constexpr const char* HelpText = "openrct2 -ha shows help for all commands. " - "openrct2 -h will show help and details for a given command."; + constexpr const char* kHelpText = "openrct2 -ha shows help for all commands. " + "openrct2 -h will show help and details for a given command."; static void PrintHelpFor(const CommandLineCommand* commands); static void PrintOptions(const CommandLineOptionDefinition* options); @@ -143,7 +143,7 @@ namespace OpenRCT2::CommandLine } else { - Console::WriteLine(HelpText); + Console::WriteLine(kHelpText); } } diff --git a/src/openrct2/command_line/CommandLine.hpp b/src/openrct2/command_line/CommandLine.hpp index edea0669be..88081bc7c2 100644 --- a/src/openrct2/command_line/CommandLine.hpp +++ b/src/openrct2/command_line/CommandLine.hpp @@ -87,10 +87,10 @@ enum CMDLINE_TYPE_STRING, }; -constexpr char NAC = '\0'; +constexpr char kNAC = '\0'; constexpr CommandLineExample kExampleTableEnd = CommandLineExample{ nullptr, nullptr }; -constexpr CommandLineOptionDefinition kOptionTableEnd = CommandLineOptionDefinition{ UINT8_MAX, nullptr, NAC, nullptr, +constexpr CommandLineOptionDefinition kOptionTableEnd = CommandLineOptionDefinition{ UINT8_MAX, nullptr, kNAC, nullptr, nullptr }; constexpr CommandLineCommand kCommandTableEnd = CommandLineCommand{ nullptr, nullptr, nullptr, nullptr, nullptr }; diff --git a/src/openrct2/command_line/ParkInfoCommands.cpp b/src/openrct2/command_line/ParkInfoCommands.cpp index 2038bb0e11..d952de3915 100644 --- a/src/openrct2/command_line/ParkInfoCommands.cpp +++ b/src/openrct2/command_line/ParkInfoCommands.cpp @@ -19,7 +19,7 @@ using namespace OpenRCT2; // clang-format off -static constexpr CommandLineOptionDefinition NoOptions[] +static constexpr CommandLineOptionDefinition kNoOptions[] { kOptionTableEnd }; @@ -28,7 +28,7 @@ static exitcode_t HandleObjectsInfo(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::ParkInfoCommands[]{ // Main commands - DefineCommand("objects", "", NoOptions, HandleObjectsInfo), + DefineCommand("objects", "", kNoOptions, HandleObjectsInfo), kCommandTableEnd }; diff --git a/src/openrct2/command_line/RootCommands.cpp b/src/openrct2/command_line/RootCommands.cpp index 8887e37521..9f9fc56483 100644 --- a/src/openrct2/command_line/RootCommands.cpp +++ b/src/openrct2/command_line/RootCommands.cpp @@ -65,27 +65,27 @@ static u8string _rct2DataPath = {}; static bool _silentBreakpad = false; // clang-format off -static constexpr CommandLineOptionDefinition StandardOptions[] +static constexpr CommandLineOptionDefinition kStandardOptions[] { { CMDLINE_TYPE_SWITCH, &_help, 'h', "help", "show this help message and exit" }, { CMDLINE_TYPE_SWITCH, &_version, 'v', "version", "show version information and exit" }, { CMDLINE_TYPE_SWITCH, &_noInstall, 'n', "no-install", "do not install scenario if passed" }, { CMDLINE_TYPE_SWITCH, &_all, 'a', "all", "show help for all commands" }, - { CMDLINE_TYPE_SWITCH, &_about, NAC, "about", "show information about " OPENRCT2_NAME }, - { CMDLINE_TYPE_SWITCH, &_verbose, NAC, "verbose", "log verbose messages" }, - { CMDLINE_TYPE_SWITCH, &_headless, NAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD }, - { CMDLINE_TYPE_SWITCH, &_silentReplays, NAC, "silent-replays", "use unobtrusive replays" }, + { CMDLINE_TYPE_SWITCH, &_about, kNAC, "about", "show information about " OPENRCT2_NAME }, + { CMDLINE_TYPE_SWITCH, &_verbose, kNAC, "verbose", "log verbose messages" }, + { CMDLINE_TYPE_SWITCH, &_headless, kNAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD }, + { CMDLINE_TYPE_SWITCH, &_silentReplays, kNAC, "silent-replays", "use unobtrusive replays" }, #ifndef DISABLE_NETWORK - { CMDLINE_TYPE_INTEGER, &_port, NAC, "port", "port to use for hosting or joining a server" }, - { CMDLINE_TYPE_STRING, &_address, NAC, "address", "address to listen on when hosting a server" }, + { CMDLINE_TYPE_INTEGER, &_port, kNAC, "port", "port to use for hosting or joining a server" }, + { CMDLINE_TYPE_STRING, &_address, kNAC, "address", "address to listen on when hosting a server" }, #endif - { CMDLINE_TYPE_STRING, &_password, NAC, "password", "password needed to join the server" }, - { CMDLINE_TYPE_STRING, &_userDataPath, NAC, "user-data-path", "path to the user data directory (containing config.ini)" }, - { CMDLINE_TYPE_STRING, &_openrct2DataPath, NAC, "openrct2-data-path", "path to the OpenRCT2 data directory (containing languages)" }, - { CMDLINE_TYPE_STRING, &_rct1DataPath, NAC, "rct1-data-path", "path to the RollerCoaster Tycoon 1 data directory (containing data/csg1.dat)" }, - { CMDLINE_TYPE_STRING, &_rct2DataPath, NAC, "rct2-data-path", "path to the RollerCoaster Tycoon 2 data directory (containing data/g1.dat)" }, + { CMDLINE_TYPE_STRING, &_password, kNAC, "password", "password needed to join the server" }, + { CMDLINE_TYPE_STRING, &_userDataPath, kNAC, "user-data-path", "path to the user data directory (containing config.ini)" }, + { CMDLINE_TYPE_STRING, &_openrct2DataPath, kNAC, "openrct2-data-path", "path to the OpenRCT2 data directory (containing languages)" }, + { CMDLINE_TYPE_STRING, &_rct1DataPath, kNAC, "rct1-data-path", "path to the RollerCoaster Tycoon 1 data directory (containing data/csg1.dat)" }, + { CMDLINE_TYPE_STRING, &_rct2DataPath, kNAC, "rct2-data-path", "path to the RollerCoaster Tycoon 2 data directory (containing data/g1.dat)" }, #ifdef USE_BREAKPAD - { CMDLINE_TYPE_SWITCH, &_silentBreakpad, NAC, "silent-breakpad", "make breakpad crash reporting silent" }, + { CMDLINE_TYPE_SWITCH, &_silentBreakpad, kNAC, "silent-breakpad", "make breakpad crash reporting silent" }, #endif // USE_BREAKPAD kOptionTableEnd }; @@ -121,21 +121,21 @@ const CommandLineCommand CommandLine::RootCommands[] { // Main commands #ifndef DISABLE_HTTP - DefineCommand("", "", StandardOptions, HandleNoCommand ), - DefineCommand("edit", "", StandardOptions, HandleCommandEdit ), + DefineCommand("", "", kStandardOptions, HandleNoCommand ), + DefineCommand("edit", "", kStandardOptions, HandleCommandEdit ), #else - DefineCommand("", "", StandardOptions, HandleNoCommand ), - DefineCommand("edit", "", StandardOptions, HandleCommandEdit ), + DefineCommand("", "", kStandardOptions, HandleNoCommand ), + DefineCommand("edit", "", kStandardOptions, HandleCommandEdit ), #endif - DefineCommand("intro", "", StandardOptions, HandleCommandIntro ), + DefineCommand("intro", "", kStandardOptions, HandleCommandIntro ), #ifndef DISABLE_NETWORK - DefineCommand("host", "", StandardOptions, HandleCommandHost ), - DefineCommand("join", "", StandardOptions, HandleCommandJoin ), + DefineCommand("host", "", kStandardOptions, HandleCommandHost ), + DefineCommand("join", "", kStandardOptions, HandleCommandJoin ), #endif - DefineCommand("set-rct2", "", StandardOptions, HandleCommandSetRCT2), - DefineCommand("convert", " ", StandardOptions, CommandLine::HandleCommandConvert), - DefineCommand("scan-objects", "", StandardOptions, HandleCommandScanObjects), - DefineCommand("handle-uri", "openrct2://.../", StandardOptions, CommandLine::HandleCommandUri), + DefineCommand("set-rct2", "", kStandardOptions, HandleCommandSetRCT2), + DefineCommand("convert", " ", kStandardOptions, CommandLine::HandleCommandConvert), + DefineCommand("scan-objects", "", kStandardOptions, HandleCommandScanObjects), + DefineCommand("handle-uri", "openrct2://.../", kStandardOptions, CommandLine::HandleCommandUri), #if defined(_WIN32) DefineCommand("register-shell", "", RegisterShellOptions, HandleCommandRegisterShell), @@ -455,15 +455,15 @@ static void PrintVersion() Console::WriteFormat("Network version: %s", NetworkGetVersion().c_str()); Console::WriteLine(); #ifdef ENABLE_SCRIPTING - Console::WriteFormat("Plugin API version: %d", OpenRCT2::Scripting::OPENRCT2_PLUGIN_API_VERSION); + Console::WriteFormat("Plugin API version: %d", OpenRCT2::Scripting::kPluginApiVersion); Console::WriteLine(); #else Console::WriteFormat("Plugin API not enabled in this build"); Console::WriteLine(); #endif - Console::WriteFormat("Current park file version: %d", OpenRCT2::PARK_FILE_CURRENT_VERSION); + Console::WriteFormat("Current park file version: %d", OpenRCT2::kParkFileCurrentVersion); Console::WriteLine(); - Console::WriteFormat("Minimum park file version: %d", OpenRCT2::PARK_FILE_MIN_VERSION); + Console::WriteFormat("Minimum park file version: %d", OpenRCT2::kParkFileMinVersion); Console::WriteLine(); #ifdef USE_BREAKPAD Console::WriteFormat("With breakpad support enabled"); diff --git a/src/openrct2/command_line/ScreenshotCommands.cpp b/src/openrct2/command_line/ScreenshotCommands.cpp index 0414d8f1a3..d9ef9a4684 100644 --- a/src/openrct2/command_line/ScreenshotCommands.cpp +++ b/src/openrct2/command_line/ScreenshotCommands.cpp @@ -15,18 +15,18 @@ using namespace OpenRCT2; static ScreenshotOptions _options; // clang-format off -static constexpr CommandLineOptionDefinition ScreenshotOptionsDef[] +static constexpr CommandLineOptionDefinition kScreenshotOptionsDef[] { - { CMDLINE_TYPE_INTEGER, &_options.weather, NAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, - { CMDLINE_TYPE_SWITCH, &_options.hide_guests, NAC, "no-peeps", "hide peeps" }, - { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, NAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, - { CMDLINE_TYPE_SWITCH, &_options.clear_grass, NAC, "clear-grass", "set all grass to be clear of weeds" }, - { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, NAC, "mowed-grass", "set all grass to be mowed" }, - { CMDLINE_TYPE_SWITCH, &_options.water_plants, NAC, "water-plants", "water plants for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, NAC, "fix-vandalism", "fix vandalism for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.remove_litter, NAC, "remove-litter", "remove litter for the screenshot" }, - { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, NAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, - { CMDLINE_TYPE_SWITCH, &_options.transparent, NAC, "transparent", "make the background transparent" }, + { CMDLINE_TYPE_INTEGER, &_options.weather, kNAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, + { CMDLINE_TYPE_SWITCH, &_options.hide_guests, kNAC, "no-peeps", "hide peeps" }, + { CMDLINE_TYPE_SWITCH, &_options.hide_sprites, kNAC, "no-sprites", "hide all sprites (e.g. balloons, vehicles, guests)" }, + { CMDLINE_TYPE_SWITCH, &_options.clear_grass, kNAC, "clear-grass", "set all grass to be clear of weeds" }, + { CMDLINE_TYPE_SWITCH, &_options.mowed_grass, kNAC, "mowed-grass", "set all grass to be mowed" }, + { CMDLINE_TYPE_SWITCH, &_options.water_plants, kNAC, "water-plants", "water plants for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.fix_vandalism, kNAC, "fix-vandalism", "fix vandalism for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.remove_litter, kNAC, "remove-litter", "remove litter for the screenshot" }, + { CMDLINE_TYPE_SWITCH, &_options.tidy_up_park, kNAC, "tidy-up-park", "clear grass, water plants, fix vandalism and remove litter" }, + { CMDLINE_TYPE_SWITCH, &_options.transparent, kNAC, "transparent", "make the background transparent" }, kOptionTableEnd }; @@ -35,8 +35,8 @@ static exitcode_t HandleScreenshot(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::ScreenshotCommands[] { // Main commands - DefineCommand("", " [ ]", ScreenshotOptionsDef, HandleScreenshot), - DefineCommand("", " giant ", ScreenshotOptionsDef, HandleScreenshot), + DefineCommand("", " [ ]", kScreenshotOptionsDef, HandleScreenshot), + DefineCommand("", " giant ", kScreenshotOptionsDef, HandleScreenshot), kCommandTableEnd }; // clang-format on diff --git a/src/openrct2/command_line/SpriteCommands.cpp b/src/openrct2/command_line/SpriteCommands.cpp index 608fae7f69..9998f7badb 100644 --- a/src/openrct2/command_line/SpriteCommands.cpp +++ b/src/openrct2/command_line/SpriteCommands.cpp @@ -25,7 +25,7 @@ ImportMode gSpriteMode = ImportMode::Default; static const char* _mode; // clang-format off -static constexpr CommandLineOptionDefinition SpriteOptions[] +static constexpr CommandLineOptionDefinition kSpriteOptions[] { { CMDLINE_TYPE_STRING, &_mode, 'm', "mode", "the type of sprite conversion <" SZ_DEFAULT "|" SZ_CLOSEST "|" SZ_DITHERING ">" }, kOptionTableEnd @@ -36,14 +36,14 @@ static exitcode_t HandleSprite(CommandLineArgEnumerator *argEnumerator); const CommandLineCommand CommandLine::SpriteCommands[] { // Main commands - DefineCommand("append", " [x_offset y_offset]", SpriteOptions, HandleSprite), - DefineCommand("build", " [silent]", SpriteOptions, HandleSprite), - DefineCommand("combine", " ", SpriteOptions, HandleSprite), - DefineCommand("create", "", SpriteOptions, HandleSprite), - DefineCommand("details", " [idx]", SpriteOptions, HandleSprite), - DefineCommand("export", " ", SpriteOptions, HandleSprite), - DefineCommand("exportall", " ", SpriteOptions, HandleSprite), - DefineCommand("exportalldat", " ", SpriteOptions, HandleSprite), + DefineCommand("append", " [x_offset y_offset]", kSpriteOptions, HandleSprite), + DefineCommand("build", " [silent]", kSpriteOptions, HandleSprite), + DefineCommand("combine", " ", kSpriteOptions, HandleSprite), + DefineCommand("create", "", kSpriteOptions, HandleSprite), + DefineCommand("details", " [idx]", kSpriteOptions, HandleSprite), + DefineCommand("export", " ", kSpriteOptions, HandleSprite), + DefineCommand("exportall", " ", kSpriteOptions, HandleSprite), + DefineCommand("exportalldat", " ", kSpriteOptions, HandleSprite), kCommandTableEnd }; diff --git a/src/openrct2/core/BitSet.hpp b/src/openrct2/core/BitSet.hpp index 8872860d5d..232aba9e7e 100644 --- a/src/openrct2/core/BitSet.hpp +++ b/src/openrct2/core/BitSet.hpp @@ -23,19 +23,19 @@ namespace OpenRCT2 { namespace BitSet { - static constexpr size_t BitsPerByte = std::numeric_limits>::digits; + static constexpr size_t kBitsPerByte = std::numeric_limits>::digits; template static constexpr size_t ByteAlignBits() { - const auto reminder = TNumBits % BitsPerByte; + const auto reminder = TNumBits % kBitsPerByte; if constexpr (reminder == 0u) { return TNumBits; } else { - return TNumBits + (BitsPerByte - (TNumBits % BitsPerByte)); + return TNumBits + (kBitsPerByte - (TNumBits % kBitsPerByte)); } } @@ -59,7 +59,7 @@ namespace OpenRCT2 } else { - const auto numBytes = numBits / BitsPerByte; + const auto numBytes = numBits / kBitsPerByte; auto mask = 1u; while (mask < numBytes) { @@ -70,14 +70,14 @@ namespace OpenRCT2 } template - static constexpr size_t ComputeBlockCount() + static constexpr size_t ComputekBlockCount() { size_t numBits = TNumBits; size_t numBlocks = 0; while (numBits > 0) { numBlocks++; - numBits -= std::min(TBlockSizeBytes * BitsPerByte, numBits); + numBits -= std::min(TBlockSizeBytes * kBitsPerByte, numBits); } return numBlocks; } @@ -149,20 +149,20 @@ namespace OpenRCT2 using StorageBlockType = typename Detail::BitSet::storage_block_type_aligned::value_type; - static constexpr size_t BlockByteSize = sizeof(StorageBlockType); - static constexpr size_t BlockBitSize = BlockByteSize * Detail::BitSet::BitsPerByte; - static constexpr size_t BlockCount = Detail::BitSet::ComputeBlockCount(); - static constexpr size_t CapacityBits = BlockCount * BlockBitSize; + static constexpr size_t kBlockByteSize = sizeof(StorageBlockType); + static constexpr size_t kBlockBitSize = kBlockByteSize * Detail::BitSet::kBitsPerByte; + static constexpr size_t kBlockCount = Detail::BitSet::ComputekBlockCount(); + static constexpr size_t kCapacityBits = kBlockCount * kBlockBitSize; - static constexpr StorageBlockType BlockValueZero = StorageBlockType{ 0u }; - static constexpr StorageBlockType BlockValueOne = StorageBlockType{ 1u }; - static constexpr StorageBlockType BlockValueMask = static_cast(~BlockValueZero); + static constexpr StorageBlockType kBlockValueZero = StorageBlockType{ 0u }; + static constexpr StorageBlockType kBlockValueOne = StorageBlockType{ 1u }; + static constexpr StorageBlockType kBlockValueMask = static_cast(~kBlockValueZero); - static constexpr bool RequiresTrim = TBitSize != CapacityBits; + static constexpr bool kRequiresTrim = TBitSize != kCapacityBits; public: using BlockType = StorageBlockType; - using Storage = std::array; + using Storage = std::array; // Proxy object to access the bits as single value. template @@ -183,9 +183,9 @@ namespace OpenRCT2 constexpr reference_base& operator=(const bool value) noexcept { if (!value) - _storage[_blockIndex] &= ~(BlockValueOne << _blockOffset); + _storage[_blockIndex] &= ~(kBlockValueOne << _blockOffset); else - _storage[_blockIndex] |= (BlockValueOne << _blockOffset); + _storage[_blockIndex] |= (kBlockValueOne << _blockOffset); return *this; } @@ -196,7 +196,7 @@ namespace OpenRCT2 constexpr bool value() const noexcept { - return (_storage[_blockIndex] & (BlockValueOne << _blockOffset)) != BlockValueZero; + return (_storage[_blockIndex] & (kBlockValueOne << _blockOffset)) != kBlockValueZero; } constexpr operator bool() const noexcept @@ -317,7 +317,7 @@ namespace OpenRCT2 constexpr size_t capacity() const noexcept { - return CapacityBits; + return kCapacityBits; } constexpr Storage& data() noexcept @@ -335,9 +335,9 @@ namespace OpenRCT2 const auto blockIndex = ComputeBlockIndex(index); const auto blockOffset = ComputeBlockOffset(index); if (!value) - _data[blockIndex] &= ~(BlockValueOne << blockOffset); + _data[blockIndex] &= ~(kBlockValueOne << blockOffset); else - _data[blockIndex] |= (BlockValueOne << blockOffset); + _data[blockIndex] |= (kBlockValueOne << blockOffset); return *this; } @@ -345,7 +345,7 @@ namespace OpenRCT2 { const auto blockIndex = ComputeBlockIndex(index); const auto blockOffset = ComputeBlockOffset(index); - return (_data[blockIndex] & (BlockValueOne << blockOffset)) != BlockValueZero; + return (_data[blockIndex] & (kBlockValueOne << blockOffset)) != kBlockValueZero; } constexpr bool operator[](const size_t index) const noexcept @@ -367,9 +367,9 @@ namespace OpenRCT2 { for (auto& data : _data) { - data ^= BlockValueMask; + data ^= kBlockValueMask; } - if constexpr (RequiresTrim) + if constexpr (kRequiresTrim) { Trim(); } @@ -378,8 +378,8 @@ namespace OpenRCT2 constexpr BitSet& reset() noexcept { - std::fill(_data.begin(), _data.end(), BlockValueZero); - if constexpr (RequiresTrim) + std::fill(_data.begin(), _data.end(), kBlockValueZero); + if constexpr (kRequiresTrim) { Trim(); } @@ -422,7 +422,7 @@ namespace OpenRCT2 constexpr BitSet operator^(const BitSet& other) const noexcept { BitSet res = *this; - ApplyOp>(res, other, std::make_index_sequence{}); + ApplyOp>(res, other, std::make_index_sequence{}); return res; } @@ -435,7 +435,7 @@ namespace OpenRCT2 constexpr BitSet operator|(const BitSet& other) const noexcept { BitSet res = *this; - ApplyOp>(res, other, std::make_index_sequence{}); + ApplyOp>(res, other, std::make_index_sequence{}); return res; } @@ -448,7 +448,7 @@ namespace OpenRCT2 constexpr BitSet operator&(const BitSet& other) const noexcept { BitSet res = *this; - ApplyOp>(res, other, std::make_index_sequence{}); + ApplyOp>(res, other, std::make_index_sequence{}); return res; } @@ -465,7 +465,7 @@ namespace OpenRCT2 { res._data[i] = ~res._data[i]; } - if constexpr (RequiresTrim) + if constexpr (kRequiresTrim) { res.Trim(); } @@ -502,7 +502,7 @@ namespace OpenRCT2 { TOperator op{}; ((dst._data[TIndex] = op(dst._data[TIndex], src._data[TIndex])), ...); - if constexpr (RequiresTrim) + if constexpr (kRequiresTrim) { dst.Trim(); } @@ -510,39 +510,39 @@ namespace OpenRCT2 static constexpr size_t ComputeBlockIndex(size_t idx) noexcept { - if constexpr (BlockCount == 1) + if constexpr (kBlockCount == 1) { return 0; } else { - return idx / BlockBitSize; + return idx / kBlockBitSize; } } static constexpr size_t ComputeBlockOffset(size_t idx) noexcept { - if constexpr (BlockCount == 1) + if constexpr (kBlockCount == 1) { return idx; } else { - return idx % BlockBitSize; + return idx % kBlockBitSize; } } // Some operations require to trim of the excess. constexpr void Trim() noexcept { - const auto byteIdx = TBitSize / BlockBitSize; - const auto bitIdx = TBitSize % BlockBitSize; + const auto byteIdx = TBitSize / kBlockBitSize; + const auto bitIdx = TBitSize % kBlockBitSize; if constexpr (bitIdx == 0) return; - auto trimMask = BlockValueMask; - trimMask <<= (BlockBitSize - bitIdx); - trimMask >>= (BlockBitSize - bitIdx); + auto trimMask = kBlockValueMask; + trimMask <<= (kBlockBitSize - bitIdx); + trimMask >>= (kBlockBitSize - bitIdx); _data[byteIdx] &= trimMask; } diff --git a/src/openrct2/core/ChecksumStream.cpp b/src/openrct2/core/ChecksumStream.cpp index d79dc10d34..77a4c54391 100644 --- a/src/openrct2/core/ChecksumStream.cpp +++ b/src/openrct2/core/ChecksumStream.cpp @@ -20,7 +20,7 @@ namespace OpenRCT2 : _checksum(buf) { uint64_t* hash = reinterpret_cast(_checksum.data()); - *hash = Seed; + *hash = kSeed; } void ChecksumStream::Write(const void* buffer, uint64_t length) @@ -39,7 +39,7 @@ namespace OpenRCT2 #endif *hash ^= temp; - *hash *= Prime; + *hash *= kPrime; } } diff --git a/src/openrct2/core/ChecksumStream.h b/src/openrct2/core/ChecksumStream.h index 6d3174510d..f9064e6c92 100644 --- a/src/openrct2/core/ChecksumStream.h +++ b/src/openrct2/core/ChecksumStream.h @@ -23,8 +23,8 @@ namespace OpenRCT2 // FIXME: Move the checksum implementation out. std::array& _checksum; - static constexpr uint64_t Seed = 0xcbf29ce484222325ULL; - static constexpr uint64_t Prime = 0x00000100000001B3ULL; + static constexpr uint64_t kSeed = 0xcbf29ce484222325ULL; + static constexpr uint64_t kPrime = 0x00000100000001B3ULL; public: ChecksumStream(std::array& buf); diff --git a/src/openrct2/core/Compression.cpp b/src/openrct2/core/Compression.cpp index d902ab60d4..03b78aebbf 100644 --- a/src/openrct2/core/Compression.cpp +++ b/src/openrct2/core/Compression.cpp @@ -18,7 +18,7 @@ namespace OpenRCT2::Compression { - constexpr size_t CHUNK = 128 * 1024; + constexpr size_t kChunkSize = 128 * 1024; // Compress the source to gzip-compatible stream, write to dest. // Mainly used for compressing the crashdumps @@ -34,8 +34,8 @@ namespace OpenRCT2::Compression strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; - unsigned char in[CHUNK]; - unsigned char out[CHUNK]; + unsigned char in[kChunkSize]; + unsigned char out[kChunkSize]; int windowBits = 15; int GZIP_ENCODING = 16; ret = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, windowBits | GZIP_ENCODING, 8, Z_DEFAULT_STRATEGY); @@ -46,7 +46,7 @@ namespace OpenRCT2::Compression } do { - strm.avail_in = uInt(fread(in, 1, CHUNK, source)); + strm.avail_in = uInt(fread(in, 1, kChunkSize, source)); if (ferror(source)) { deflateEnd(&strm); @@ -57,7 +57,7 @@ namespace OpenRCT2::Compression strm.next_in = in; do { - strm.avail_out = CHUNK; + strm.avail_out = kChunkSize; strm.next_out = out; ret = deflate(&strm, flush); if (ret == Z_STREAM_ERROR) @@ -65,7 +65,7 @@ namespace OpenRCT2::Compression LOG_ERROR("Failed to compress data"); return false; } - have = CHUNK - strm.avail_out; + have = kChunkSize - strm.avail_out; if (fwrite(out, 1, have, dest) != have || ferror(dest)) { deflateEnd(&strm); @@ -101,7 +101,7 @@ namespace OpenRCT2::Compression size_t srcRemaining = dataLen; do { - const auto nextBlockSize = std::min(srcRemaining, CHUNK); + const auto nextBlockSize = std::min(srcRemaining, kChunkSize); srcRemaining -= nextBlockSize; flush = srcRemaining == 0 ? Z_FINISH : Z_NO_FLUSH; @@ -149,7 +149,7 @@ namespace OpenRCT2::Compression size_t srcRemaining = dataLen; do { - const auto nextBlockSize = std::min(srcRemaining, CHUNK); + const auto nextBlockSize = std::min(srcRemaining, kChunkSize); srcRemaining -= nextBlockSize; flush = srcRemaining == 0 ? Z_FINISH : Z_NO_FLUSH; diff --git a/src/openrct2/core/Crypt.OpenRCT2.cpp b/src/openrct2/core/Crypt.OpenRCT2.cpp index d771a53d64..9add20257a 100644 --- a/src/openrct2/core/Crypt.OpenRCT2.cpp +++ b/src/openrct2/core/Crypt.OpenRCT2.cpp @@ -19,10 +19,10 @@ using namespace OpenRCT2::Crypt; class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm { private: - static constexpr uint64_t Offset = 0xCBF29CE484222325ULL; - static constexpr uint64_t Prime = 0x00000100000001B3ULL; + static constexpr uint64_t kOffset = 0xCBF29CE484222325ULL; + static constexpr uint64_t kPrime = 0x00000100000001B3ULL; - uint64_t _data = Offset; + uint64_t _data = kOffset; uint8_t _rem[8]{}; size_t _remLen{}; @@ -33,7 +33,7 @@ private: uint64_t temp{}; std::memcpy(&temp, _rem, _remLen); _data ^= temp; - _data *= Prime; + _data *= kPrime; _remLen = 0; } } @@ -41,7 +41,7 @@ private: public: HashAlgorithm* Clear() override { - _data = Offset; + _data = kOffset; return this; } @@ -68,7 +68,7 @@ public: { auto temp = *src++; _data ^= temp; - _data *= Prime; + _data *= kPrime; dataLen -= sizeof(uint64_t); } diff --git a/src/openrct2/core/DateTime.h b/src/openrct2/core/DateTime.h index e340c57708..95132e23a3 100644 --- a/src/openrct2/core/DateTime.h +++ b/src/openrct2/core/DateTime.h @@ -18,4 +18,4 @@ // Time (represented as number of 100-nanosecond intervals since 0001-01-01T00:00:00Z) using datetime64 = uint64_t; -constexpr datetime64 DATETIME64_MIN = 0; +constexpr datetime64 kDatetime64Min = 0; diff --git a/src/openrct2/core/EnumMap.hpp b/src/openrct2/core/EnumMap.hpp index abaa7a887e..7aeccf0fb5 100644 --- a/src/openrct2/core/EnumMap.hpp +++ b/src/openrct2/core/EnumMap.hpp @@ -25,8 +25,8 @@ private: std::vector> _map; bool _continiousValueIndex{ false }; - static constexpr size_t BucketSize = 43; - std::array, BucketSize> _buckets; + static constexpr size_t kBucketSize = 43; + std::array, kBucketSize> _buckets; static constexpr bool ValueIndexable() { @@ -84,7 +84,7 @@ public: for (auto& kv : _map) { auto hash = MakeHash(kv.first); - auto bucketIndex = hash % BucketSize; + auto bucketIndex = hash % kBucketSize; auto& bucket = _buckets[bucketIndex]; bucket.push_back(index); index++; @@ -116,7 +116,7 @@ public: auto find(const std::string_view k) const { const auto hash = MakeHash(k); - const auto bucketIndex = hash % BucketSize; + const auto bucketIndex = hash % kBucketSize; const auto& bucket = _buckets[bucketIndex]; for (auto index : bucket) diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 5541453ea0..8113f4ec0b 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -62,7 +62,7 @@ private: }; // Index file format version which when incremented forces a rebuild - static constexpr uint8_t FILE_INDEX_VERSION = 4; + static constexpr uint8_t kFileIndexVersion = 4; std::string const _name; uint32_t const _magicNumber; @@ -224,7 +224,7 @@ private: // Read header, check if we need to re-scan auto header = fs.ReadValue(); if (header.HeaderSize == sizeof(FileIndexHeader) && header.MagicNumber == _magicNumber - && header.VersionA == FILE_INDEX_VERSION && header.VersionB == _version && header.LanguageId == language + && header.VersionA == kFileIndexVersion && header.VersionB == _version && header.LanguageId == language && header.Stats.TotalFiles == stats.TotalFiles && header.Stats.TotalFileSize == stats.TotalFileSize && header.Stats.FileDateModifiedChecksum == stats.FileDateModifiedChecksum && header.Stats.PathChecksum == stats.PathChecksum) @@ -265,7 +265,7 @@ private: // Write header FileIndexHeader header; header.MagicNumber = _magicNumber; - header.VersionA = FILE_INDEX_VERSION; + header.VersionA = kFileIndexVersion; header.VersionB = _version; header.LanguageId = language; header.Stats = stats; diff --git a/src/openrct2/core/Guard.cpp b/src/openrct2/core/Guard.cpp index 4dbab00e9e..e602dc8d75 100644 --- a/src/openrct2/core/Guard.cpp +++ b/src/openrct2/core/Guard.cpp @@ -26,7 +26,7 @@ namespace OpenRCT2::Guard { - constexpr const utf8* ASSERTION_MESSAGE = "An assertion failed, please report this to the OpenRCT2 developers."; + static constexpr const utf8* kAssertionMessage = "An assertion failed, please report this to the OpenRCT2 developers."; // The default behaviour when an assertion is raised. static ASSERT_BEHAVIOUR _assertBehaviour = @@ -67,7 +67,7 @@ namespace OpenRCT2::Guard if (expression) return; - Console::Error::WriteLine(ASSERTION_MESSAGE); + Console::Error::WriteLine(kAssertionMessage); Console::Error::WriteLine("Version: %s", gVersionInfoFull); // This is never freed, but acceptable considering we are about to crash out @@ -130,7 +130,7 @@ namespace OpenRCT2::Guard [[nodiscard]] static std::wstring CreateDialogAssertMessage(std::string_view formattedMessage) { StringBuilder sb; - sb.Append(ASSERTION_MESSAGE); + sb.Append(kAssertionMessage); sb.Append("\n\n"); sb.Append("Version: "); sb.Append(gVersionInfoFull); diff --git a/src/openrct2/core/Http.Android.cpp b/src/openrct2/core/Http.Android.cpp index 9978bbca5e..08a1010a9f 100644 --- a/src/openrct2/core/Http.Android.cpp +++ b/src/openrct2/core/Http.Android.cpp @@ -18,14 +18,14 @@ #include #include - #define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION + #define kOpenRCT2UserAgent "OpenRCT2/" kOpenRCT2Version namespace OpenRCT2::Http { Response Do(const Request& req) { std::map headers = req.header; - headers["User-Agent"] = OPENRCT2_USER_AGENT; + headers["User-Agent"] = kOpenRCT2UserAgent; // Lambda to convert jstring to string auto jstringToString = [](JNIEnv* env, jstring jstr) -> std::string { if (jstr == nullptr) diff --git a/src/openrct2/core/Http.WinHttp.cpp b/src/openrct2/core/Http.WinHttp.cpp index 1219ba03dc..a18cc5a733 100644 --- a/src/openrct2/core/Http.WinHttp.cpp +++ b/src/openrct2/core/Http.WinHttp.cpp @@ -22,7 +22,7 @@ namespace OpenRCT2::Http { - static constexpr char OPENRCT2_USER_AGENT[] = "OpenRCT2/" OPENRCT2_VERSION; + static constexpr char kOpenRCT2UserAgent[] = "OpenRCT2/" kOpenRCT2Version; static void ThrowWin32Exception(const char* methodName) { @@ -75,10 +75,10 @@ namespace OpenRCT2::Http std::map headers; std::wstring wKey, wValue; - constexpr int32_t STATE_EXPECT_KEY = 0; - constexpr int32_t STATE_EXPECT_WHITESPACE_VALUE = 1; - constexpr int32_t STATE_EXPECT_VALUE = 2; - int32_t state = STATE_EXPECT_KEY; + constexpr int32_t kStateExpectKey = 0; + constexpr int32_t kStateExpectWhitespaceValue = 1; + constexpr int32_t kStateExpectValue = 2; + int32_t state = kStateExpectKey; int32_t index = 0; for (auto c : buffer) { @@ -95,24 +95,24 @@ namespace OpenRCT2::Http wKey.clear(); wValue.clear(); index++; - state = STATE_EXPECT_KEY; + state = kStateExpectKey; continue; } - if (state == STATE_EXPECT_KEY && c == ':') + if (state == kStateExpectKey && c == ':') { - state = STATE_EXPECT_WHITESPACE_VALUE; + state = kStateExpectWhitespaceValue; } else if (state == 1 && c == ' ') { - state = STATE_EXPECT_VALUE; + state = kStateExpectValue; } - else if (state == STATE_EXPECT_KEY) + else if (state == kStateExpectKey) { wKey.push_back(c); } else { - state = STATE_EXPECT_VALUE; + state = kStateExpectValue; wValue.push_back(c); } } @@ -166,7 +166,7 @@ namespace OpenRCT2::Http if (!WinHttpCrackUrl(wUrl.c_str(), 0, 0, &url)) throw std::invalid_argument("Unable to parse URI."); - auto userAgent = String::toWideChar(OPENRCT2_USER_AGENT); + auto userAgent = String::toWideChar(kOpenRCT2UserAgent); hSession = WinHttpOpen( userAgent.c_str(), WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); if (hSession == nullptr) diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index c1c953a614..447a5ed0b6 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -25,7 +25,7 @@ #endif #include - #define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION + #define kOpenRCT2UserAgent "OpenRCT2/" kOpenRCT2Version namespace OpenRCT2::Http { @@ -120,7 +120,7 @@ namespace OpenRCT2::Http curl_easy_setopt(curl, CURLOPT_HEADERDATA, static_cast(&res)); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true); - curl_easy_setopt(curl, CURLOPT_USERAGENT, OPENRCT2_USER_AGENT); + curl_easy_setopt(curl, CURLOPT_USERAGENT, kOpenRCT2UserAgent); curl_slist* chunk = nullptr; std::shared_ptr __(nullptr, [chunk](...) { curl_slist_free_all(chunk); }); diff --git a/src/openrct2/core/Imaging.cpp b/src/openrct2/core/Imaging.cpp index 184c48ef88..a1dfc7857b 100644 --- a/src/openrct2/core/Imaging.cpp +++ b/src/openrct2/core/Imaging.cpp @@ -28,7 +28,7 @@ namespace OpenRCT2::Imaging { - constexpr auto EXCEPTION_IMAGE_FORMAT_UNKNOWN = "Unknown image format."; + static constexpr auto kExceptionImageFormatUnknown = "Unknown image format."; static std::unordered_map _readerImplementations; @@ -300,7 +300,7 @@ namespace OpenRCT2::Imaging { return impl(istream, format); } - throw std::runtime_error(EXCEPTION_IMAGE_FORMAT_UNKNOWN); + throw std::runtime_error(kExceptionImageFormatUnknown); } } } @@ -339,7 +339,7 @@ namespace OpenRCT2::Imaging break; } default: - throw std::runtime_error(EXCEPTION_IMAGE_FORMAT_UNKNOWN); + throw std::runtime_error(kExceptionImageFormatUnknown); } } } // namespace OpenRCT2::Imaging diff --git a/src/openrct2/core/Json.hpp b/src/openrct2/core/Json.hpp index bb24c37df6..d9039752e5 100644 --- a/src/openrct2/core/Json.hpp +++ b/src/openrct2/core/Json.hpp @@ -24,7 +24,7 @@ using json_t = nlohmann::json; namespace OpenRCT2::Json { // Don't try to load JSON files that exceed 64 MiB - constexpr uint64_t MAX_JSON_SIZE = 64 * 1024 * 1024; + constexpr uint64_t kMaxJSONSize = 64 * 1024 * 1024; /** * Read JSON file and parse contents @@ -33,7 +33,7 @@ namespace OpenRCT2::Json * @return A JSON representation of the file * @note This function will throw an exception if the JSON file cannot be parsed */ - json_t ReadFromFile(u8string_view path, size_t maxSize = MAX_JSON_SIZE); + json_t ReadFromFile(u8string_view path, size_t maxSize = kMaxJSONSize); /** * Read JSON file and parse the contents diff --git a/src/openrct2/core/OrcaStream.hpp b/src/openrct2/core/OrcaStream.hpp index d59cdb53cc..a6e681f480 100644 --- a/src/openrct2/core/OrcaStream.hpp +++ b/src/openrct2/core/OrcaStream.hpp @@ -36,8 +36,11 @@ namespace OpenRCT2 WRITING, }; - static constexpr uint32_t COMPRESSION_NONE = 0; - static constexpr uint32_t COMPRESSION_GZIP = 1; + enum class CompressionType : uint32_t + { + none, + gzip, + }; private: #pragma pack(push, 1) @@ -48,7 +51,7 @@ namespace OpenRCT2 uint32_t MinVersion{}; uint32_t NumChunks{}; uint64_t UncompressedSize{}; - uint32_t Compression{}; + CompressionType Compression{}; uint64_t CompressedSize{}; std::array FNV1a{}; uint8_t padding[20]; @@ -99,7 +102,7 @@ namespace OpenRCT2 } while (bytesLeft > 0); // Uncompress - if (_header.Compression == COMPRESSION_GZIP) + if (_header.Compression == CompressionType::gzip) { auto uncompressedData = Compression::ungzip(_buffer.GetData(), _buffer.GetLength()); if (_header.UncompressedSize != uncompressedData.size()) @@ -113,7 +116,7 @@ namespace OpenRCT2 else { _header = {}; - _header.Compression = COMPRESSION_GZIP; + _header.Compression = CompressionType::gzip; _buffer = MemoryStream{}; } @@ -135,7 +138,7 @@ namespace OpenRCT2 // Compress data std::optional> compressedBytes; - if (_header.Compression == COMPRESSION_GZIP) + if (_header.Compression == CompressionType::gzip) { compressedBytes = Compression::gzip(uncompressedData, uncompressedSize); if (compressedBytes) @@ -145,7 +148,7 @@ namespace OpenRCT2 else { // Compression failed - _header.Compression = COMPRESSION_NONE; + _header.Compression = CompressionType::none; } } diff --git a/src/openrct2/core/RTL.FriBidi.cpp b/src/openrct2/core/RTL.FriBidi.cpp index da98bb1a53..b428716eab 100644 --- a/src/openrct2/core/RTL.FriBidi.cpp +++ b/src/openrct2/core/RTL.FriBidi.cpp @@ -21,11 +21,11 @@ extern "C" { #include } -static constexpr uint16_t BufferLength = 1024; +static constexpr uint16_t kBufferLength = 1024; std::string FixRTL(std::string& input) { - FriBidiChar utf32String[BufferLength] = { 0 }; + FriBidiChar utf32String[kBufferLength] = { 0 }; auto len = static_cast(input.length() + 1); fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, input.c_str(), len, utf32String); @@ -38,13 +38,13 @@ std::string FixRTL(std::string& input) } } - FriBidiChar reorderedStr[BufferLength] = { 0 }; + FriBidiChar reorderedStr[kBufferLength] = { 0 }; // All our strings start in LTR direction due to the "STR_0001: prefix", even fully Arabic ones. FriBidiCharType pbase_dir = FRIBIDI_TYPE_LTR; fribidi_log2vis(utf32String, utf32len, &pbase_dir, reorderedStr, nullptr, nullptr, nullptr); - char outputString[BufferLength]; + char outputString[kBufferLength]; fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, reorderedStr, len, outputString); return std::string(outputString); diff --git a/src/openrct2/core/Random.hpp b/src/openrct2/core/Random.hpp index 7ccf2f27e0..03b5ddb955 100644 --- a/src/openrct2/core/Random.hpp +++ b/src/openrct2/core/Random.hpp @@ -34,11 +34,11 @@ namespace OpenRCT2::Random using result_type = uint32_t; static constexpr size_t N = TNum; - static constexpr result_type default_seed = 0x1234567F; + static constexpr result_type kDefaultSeed = 0x1234567F; explicit FixedSeedSequence() { - std::fill(v.begin(), v.end(), default_seed); + std::fill(v.begin(), v.end(), kDefaultSeed); } template< @@ -110,7 +110,7 @@ namespace OpenRCT2::Random static constexpr result_type x = TX; static constexpr size_t r1 = TR1; static constexpr size_t r2 = TR2; - static constexpr result_type default_seed = 1; + static constexpr result_type kDefaultSeed = 1; static constexpr result_type min() { @@ -141,7 +141,7 @@ namespace OpenRCT2::Random seed(seed_seq); } - void seed(result_type s = default_seed) + void seed(result_type s = kDefaultSeed) { s0 = s; s1 = s; diff --git a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp index c11544a3a6..0075ad7d54 100644 --- a/src/openrct2/drawing/Drawing.Sprite.BMP.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.BMP.cpp @@ -90,28 +90,28 @@ void FASTCALL GfxBmpSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& arg if (imageId.IsBlended()) { // Copy non-transparent bitmap data but blend src and dst pixel using the palette map. - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } else { // Copy non-transparent bitmap data but re-colour using the palette map. - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } } else if (imageId.IsBlended()) { // Image is only a transparency mask. Just colour the pixels using the palette map. // Used for glass. - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } else if (!(args.SourceImage.flags & G1_FLAG_HAS_TRANSPARENCY)) { // Copy raw bitmap data to target - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } else { // Copy raw bitmap data to target but exclude transparent pixels - DrawBMPSprite(dpi, args); + DrawBMPSprite(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp index b1d175633d..edb6ac3285 100644 --- a/src/openrct2/drawing/Drawing.Sprite.RLE.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.RLE.cpp @@ -129,7 +129,7 @@ static void FASTCALL DrawRLESpriteMinify(DrawPixelInfo& dpi, const DrawSpriteArg numPixels = std::min(numPixels, width - x); auto dst = dstLineStart + (x >> TZoom); - if constexpr ((TBlendOp & BLEND_SRC) == 0 && (TBlendOp & BLEND_DST) == 0 && TZoom == 0) + if constexpr ((TBlendOp & kBlendSrc) == 0 && (TBlendOp & kBlendDst) == 0 && TZoom == 0) { // Since we're sampling each pixel at this zoom level, just do a straight std::memcpy if (numPixels > 0) @@ -192,19 +192,19 @@ void FASTCALL GfxRleSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& arg { if (args.Image.IsBlended()) { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } else { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } } else if (args.Image.IsBlended()) { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } else { - DrawRLESprite(dpi, args); + DrawRLESprite(dpi, args); } } diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index 78fac26d2b..3bb943b897 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -435,7 +435,7 @@ static void MaskMagnify( static Gx _g1 = {}; static Gx _g2 = {}; static Gx _csg = {}; -static G1Element _scrollingText[MaxScrollingTextEntries]{}; +static G1Element _scrollingText[kMaxScrollingTextEntries]{}; static bool _csgLoaded = false; static G1Element _g1Temp = {}; @@ -1010,7 +1010,7 @@ const G1Element* GfxGetG1Element(ImageIndex image_id) Guard::Assert(!gOpenRCT2NoGraphics, "GfxGetG1Element called on headless instance"); auto offset = static_cast(image_id); - if (offset == 0x7FFFF || offset == ImageIndexUndefined) + if (offset == kImageIndexUndefined) { return nullptr; } diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 148f3bc88b..2aa1ee6d32 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -160,12 +160,12 @@ int32_t GfxClipString(utf8* text, int32_t width, FontStyle fontStyle) */ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8string* outWrappedText, int32_t* outNumLines) { - constexpr size_t NULL_INDEX = std::numeric_limits::max(); + constexpr size_t kNullIndex = std::numeric_limits::max(); u8string buffer; size_t currentLineIndex = 0; - size_t splitIndex = NULL_INDEX; - size_t bestSplitIndex = NULL_INDEX; + size_t splitIndex = kNullIndex; + size_t bestSplitIndex = kNullIndex; size_t numLines = 0; int32_t maxWidth = 0; @@ -182,14 +182,14 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 buffer.append(cb); auto lineWidth = GfxGetStringWidth(&buffer[currentLineIndex], fontStyle); - if (lineWidth <= width || (splitIndex == NULL_INDEX && bestSplitIndex == NULL_INDEX)) + if (lineWidth <= width || (splitIndex == kNullIndex && bestSplitIndex == kNullIndex)) { if (codepoint == ' ') { // Mark line split here splitIndex = buffer.size() - 1; } - else if (splitIndex == NULL_INDEX) + else if (splitIndex == kNullIndex) { // Mark line split here (this is after first character of line) bestSplitIndex = buffer.size(); @@ -198,7 +198,7 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 else { // Insert new line before current word - if (splitIndex == NULL_INDEX) + if (splitIndex == kNullIndex) { splitIndex = bestSplitIndex; } @@ -210,8 +210,8 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 numLines++; currentLineIndex = splitIndex + 1; - splitIndex = NULL_INDEX; - bestSplitIndex = NULL_INDEX; + splitIndex = kNullIndex; + bestSplitIndex = kNullIndex; // Trim the beginning of the new line while (buffer[currentLineIndex] == ' ') @@ -230,8 +230,8 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 numLines++; currentLineIndex = buffer.size(); - splitIndex = NULL_INDEX; - bestSplitIndex = NULL_INDEX; + splitIndex = kNullIndex; + bestSplitIndex = kNullIndex; } else { diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 78d9f4c510..ccefd11f85 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -286,7 +286,7 @@ enum SPR_PALETTE_GLASS_VOID, }; -static constexpr FilterPaletteID GlassPaletteIds[COLOUR_COUNT] = { +static constexpr FilterPaletteID kGlassPaletteIds[COLOUR_COUNT] = { FilterPaletteID::PaletteGlassBlack, FilterPaletteID::PaletteGlassGrey, FilterPaletteID::PaletteGlassWhite, @@ -347,7 +347,7 @@ static constexpr FilterPaletteID GlassPaletteIds[COLOUR_COUNT] = { // Previously 0x97FCBC use it to get the correct palette from g1_elements // clang-format off -static constexpr uint16_t palette_to_g1_offset[kPaletteTotalOffsets] = { +static constexpr uint16_t kPaletteToG1Offset[kPaletteTotalOffsets] = { SPR_PALETTE_BLACK, SPR_PALETTE_GREY, SPR_PALETTE_WHITE, @@ -728,7 +728,7 @@ void LoadPalette() auto water_type = OpenRCT2::ObjectManager::GetObjectEntry(0); if (water_type != nullptr) { - Guard::Assert(water_type->image_id != ImageIndexUndefined, "Failed to load water palette"); + Guard::Assert(water_type->image_id != kImageIndexUndefined, "Failed to load water palette"); palette = water_type->image_id; } @@ -849,7 +849,7 @@ std::optional GetPaletteG1Index(colour_t paletteId) { if (paletteId < kPaletteTotalOffsets) { - return palette_to_g1_offset[paletteId]; + return kPaletteToG1Offset[paletteId]; } return std::nullopt; } @@ -887,7 +887,7 @@ DrawPixelInfo DrawPixelInfo::Crop(const ScreenCoordsXY& pos, const ScreenSize& s FilterPaletteID GetGlassPaletteId(colour_t c) { - return GlassPaletteIds[c]; + return kGlassPaletteIds[c]; } void UpdatePalette(std::span palette, int32_t start_index, int32_t num_colours) diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 0d01df3923..d91fcc1e29 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -159,25 +159,25 @@ enum using DrawBlendOp = uint8_t; -constexpr DrawBlendOp BLEND_NONE = 0; +constexpr DrawBlendOp kBlendNone = 0; /** * Only supported by BITMAP. RLE images always encode transparency via the encoding. * Pixel value of 0 represents transparent. */ -constexpr DrawBlendOp BLEND_TRANSPARENT = 1 << 0; +constexpr DrawBlendOp kBlendTransparent = 1 << 0; /** * Whether to use the pixel value from the source image. * This is usually only unset for glass images where there the src is only a transparency mask. */ -constexpr DrawBlendOp BLEND_SRC = 1 << 1; +constexpr DrawBlendOp kBlendSrc = 1 << 1; /** * Whether to use the pixel value of the destination image for blending. * This is used for any image that filters the target image, e.g. glass or water. */ -constexpr DrawBlendOp BLEND_DST = 2 << 2; +constexpr DrawBlendOp kBlendDst = 2 << 2; enum { @@ -417,7 +417,7 @@ struct DrawSpriteArgs template bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& paletteMap) { - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { // Ignore transparent pixels if (*src == 0) @@ -426,10 +426,10 @@ bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& pale } } - if constexpr (((TBlendOp & BLEND_SRC) != 0) && ((TBlendOp & BLEND_DST) != 0)) + if constexpr (((TBlendOp & kBlendSrc) != 0) && ((TBlendOp & kBlendDst) != 0)) { auto pixel = paletteMap.Blend(*src, *dst); - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { if (pixel == 0) { @@ -439,10 +439,10 @@ bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& pale *dst = pixel; return true; } - else if constexpr ((TBlendOp & BLEND_SRC) != 0) + else if constexpr ((TBlendOp & kBlendSrc) != 0) { auto pixel = paletteMap[*src]; - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { if (pixel == 0) { @@ -452,10 +452,10 @@ bool FASTCALL BlitPixel(const uint8_t* src, uint8_t* dst, const PaletteMap& pale *dst = pixel; return true; } - else if constexpr ((TBlendOp & BLEND_DST) != 0) + else if constexpr ((TBlendOp & kBlendDst) != 0) { auto pixel = paletteMap[*dst]; - if constexpr (TBlendOp & BLEND_TRANSPARENT) + if constexpr (TBlendOp & kBlendTransparent) { if (pixel == 0) { diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index da24d5e1d3..5d73486da2 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -25,13 +25,13 @@ using namespace OpenRCT2; -static constexpr int32_t SpriteFontLineHeight[FontStyleCount] = { +static constexpr int32_t kSpriteFontLineHeight[FontStyleCount] = { 10, 10, 6, }; -static uint8_t _spriteFontCharacterWidths[FontStyleCount][FONT_SPRITE_GLYPH_COUNT]; +static uint8_t _spriteFontCharacterWidths[FontStyleCount][kSpriteFontGlyphCount]; static uint8_t _additionalSpriteFontCharacterWidth[FontStyleCount][SPR_G2_GLYPH_COUNT] = {}; #ifndef NO_TTF @@ -269,8 +269,8 @@ void FontSpriteInitialiseCharacters() for (const auto& fontStyle : FontStyles) { - int32_t glyphOffset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT; - for (uint8_t glyphIndex = 0; glyphIndex < FONT_SPRITE_GLYPH_COUNT; glyphIndex++) + int32_t glyphOffset = EnumValue(fontStyle) * kSpriteFontGlyphCount; + for (uint8_t glyphIndex = 0; glyphIndex < kSpriteFontGlyphCount; glyphIndex++) { const G1Element* g1 = GfxGetG1Element(glyphIndex + SPR_CHAR_START + glyphOffset); int32_t width = 0; @@ -323,7 +323,7 @@ int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint) { int32_t glyphIndex = FontSpriteGetCodepointOffset(codepoint); auto baseFontIndex = EnumValue(fontStyle); - if (glyphIndex >= FONT_SPRITE_GLYPH_COUNT) + if (glyphIndex >= kSpriteFontGlyphCount) { glyphIndex = (SPR_CHAR_START + glyphIndex) - SPR_G2_CHAR_BEGIN; @@ -335,7 +335,7 @@ int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint) return _additionalSpriteFontCharacterWidth[baseFontIndex][glyphIndex]; } - if (glyphIndex < 0 || glyphIndex >= static_cast(FONT_SPRITE_GLYPH_COUNT)) + if (glyphIndex < 0 || glyphIndex >= static_cast(kSpriteFontGlyphCount)) { LOG_WARNING("Invalid glyph index %u", glyphIndex); glyphIndex = 0; @@ -345,9 +345,9 @@ int32_t FontSpriteGetCodepointWidth(FontStyle fontStyle, int32_t codepoint) ImageId FontSpriteGetCodepointSprite(FontStyle fontStyle, int32_t codepoint) { - int32_t offset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT; + int32_t offset = EnumValue(fontStyle) * kSpriteFontGlyphCount; auto codePointOffset = FontSpriteGetCodepointOffset(codepoint); - if (codePointOffset > FONT_SPRITE_GLYPH_COUNT) + if (codePointOffset > kSpriteFontGlyphCount) { offset = EnumValue(fontStyle) * SPR_G2_GLYPH_COUNT; } @@ -364,7 +364,7 @@ int32_t FontGetLineHeight(FontStyle fontStyle) return gCurrentTTFFontSet->size[fontSize].line_height; } #endif // NO_TTF - return SpriteFontLineHeight[fontSize]; + return kSpriteFontLineHeight[fontSize]; } int32_t FontGetLineHeightSmall(FontStyle fontStyle) diff --git a/src/openrct2/drawing/Font.h b/src/openrct2/drawing/Font.h index df0d7c2402..5dca83bdd0 100644 --- a/src/openrct2/drawing/Font.h +++ b/src/openrct2/drawing/Font.h @@ -14,7 +14,7 @@ #include -constexpr uint16_t FONT_SPRITE_GLYPH_COUNT = 224; +constexpr uint16_t kSpriteFontGlyphCount = 224; enum class FontStyle : uint8_t { diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index 1ac088264e..cbf98553a6 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -21,8 +21,8 @@ using namespace OpenRCT2; -constexpr uint32_t BASE_IMAGE_ID = SPR_IMAGE_LIST_BEGIN; -constexpr uint32_t MAX_IMAGES = SPR_IMAGE_LIST_END - BASE_IMAGE_ID; +constexpr uint32_t kBaseImageID = SPR_IMAGE_LIST_BEGIN; +constexpr uint32_t kMaxImages = SPR_IMAGE_LIST_END - kBaseImageID; static bool _initialised = false; static std::list _freeLists; @@ -65,7 +65,7 @@ static bool AllocatedListRemove(uint32_t baseImageId, uint32_t count) static uint32_t GetNumFreeImagesRemaining() { - return MAX_IMAGES - _allocatedImageCount; + return kMaxImages - _allocatedImageCount; } static void InitialiseImageList() @@ -73,7 +73,7 @@ static void InitialiseImageList() Guard::Assert(!_initialised, GUARD_LINE); _freeLists.clear(); - _freeLists.push_back({ BASE_IMAGE_ID, MAX_IMAGES }); + _freeLists.push_back({ kBaseImageID, kMaxImages }); #ifdef DEBUG_LEVEL_1 _allocatedLists.clear(); #endif @@ -129,7 +129,7 @@ static uint32_t TryAllocateImageList(uint32_t count) return imageList.BaseId; } } - return ImageIndexUndefined; + return kImageIndexUndefined; } static uint32_t AllocateImageList(uint32_t count) @@ -141,12 +141,12 @@ static uint32_t AllocateImageList(uint32_t count) InitialiseImageList(); } - uint32_t baseImageId = ImageIndexUndefined; + uint32_t baseImageId = kImageIndexUndefined; uint32_t freeImagesRemaining = GetNumFreeImagesRemaining(); if (freeImagesRemaining >= count) { baseImageId = TryAllocateImageList(count); - if (baseImageId == ImageIndexUndefined) + if (baseImageId == kImageIndexUndefined) { // Defragment and try again MergeFreeLists(); @@ -159,7 +159,7 @@ static uint32_t AllocateImageList(uint32_t count) static void FreeImageList(uint32_t baseImageId, uint32_t count) { Guard::Assert(_initialised, GUARD_LINE); - Guard::Assert(baseImageId >= BASE_IMAGE_ID, GUARD_LINE); + Guard::Assert(baseImageId >= kBaseImageID, GUARD_LINE); #ifdef DEBUG_LEVEL_1 if (!AllocatedListRemove(baseImageId, count)) @@ -192,14 +192,14 @@ uint32_t GfxObjectAllocateImages(const G1Element* images, uint32_t count) { if (count == 0 || gOpenRCT2NoGraphics) { - return ImageIndexUndefined; + return kImageIndexUndefined; } uint32_t baseImageId = AllocateImageList(count); - if (baseImageId == ImageIndexUndefined) + if (baseImageId == kImageIndexUndefined) { LOG_ERROR("Reached maximum image limit."); - return ImageIndexUndefined; + return kImageIndexUndefined; } uint32_t imageId = baseImageId; @@ -215,7 +215,7 @@ uint32_t GfxObjectAllocateImages(const G1Element* images, uint32_t count) void GfxObjectFreeImages(uint32_t baseImageId, uint32_t count) { - if (baseImageId != 0 && baseImageId != ImageIndexUndefined) + if (baseImageId != 0 && baseImageId != kImageIndexUndefined) { // Zero the G1 elements so we don't have invalid pointers // and data lying about @@ -250,7 +250,7 @@ size_t ImageListGetUsedCount() size_t ImageListGetMaximum() { - return MAX_IMAGES; + return kMaxImages; } const std::list& GetAvailableAllocationRanges() diff --git a/src/openrct2/drawing/ImageId.hpp b/src/openrct2/drawing/ImageId.hpp index 476beb6c78..8a0cdaaa45 100644 --- a/src/openrct2/drawing/ImageId.hpp +++ b/src/openrct2/drawing/ImageId.hpp @@ -18,7 +18,7 @@ using colour_t = uint8_t; enum class FilterPaletteID : int32_t; -static constexpr ImageIndex ImageIndexUndefined = std::numeric_limits::max(); +static constexpr ImageIndex kImageIndexUndefined = std::numeric_limits::max(); enum class ImageCatalogue { @@ -42,24 +42,9 @@ FilterPaletteID GetGlassPaletteId(colour_t); struct ImageId { private: - // clang-format off - static constexpr uint32_t MASK_INDEX = 0b00000000000001111111111111111111; - static constexpr uint32_t MASK_REMAP = 0b00000111111110000000000000000000; - static constexpr uint32_t MASK_PRIMARY = 0b00000000111110000000000000000000; - static constexpr uint32_t MASK_SECONDARY = 0b00011111000000000000000000000000; - static constexpr uint32_t FLAG_PRIMARY = 0b00100000000000000000000000000000; - static constexpr uint32_t FLAG_BLEND = 0b01000000000000000000000000000000; - static constexpr uint32_t FLAG_SECONDARY = 0b10000000000000000000000000000000; - static constexpr uint32_t SHIFT_REMAP = 19; - static constexpr uint32_t SHIFT_PRIMARY = 19; - static constexpr uint32_t SHIFT_SECONDARY = 24; - static constexpr uint32_t INDEX_UNDEFINED = 0b00000000000001111111111111111111; - static constexpr uint32_t VALUE_UNDEFINED = INDEX_UNDEFINED; - - static constexpr uint8_t NEW_FLAG_PRIMARY = 1; - static constexpr uint8_t NEW_FLAG_BLEND = 2; - static constexpr uint8_t NEW_FLAG_SECONDARY = 4; - // clang-format on + static constexpr uint8_t kFlagPrimary = 1; + static constexpr uint8_t kFlagBlend = 2; + static constexpr uint8_t kFlagSecondary = 4; // NONE = No remap // BLENDED = No source copy, remap destination only (glass) @@ -68,7 +53,7 @@ private: // PRIMARY | SECONDARY = Remap with primary and secondary colours // SECONDARY = Remap with primary, secondary and tertiary colours - ImageIndex _index = ImageIndexUndefined; + ImageIndex _index = kImageIndexUndefined; uint8_t _primary = 0; uint8_t _secondary = 0; uint8_t _tertiary = 0; @@ -78,7 +63,7 @@ public: ImageId() = default; explicit constexpr ImageId(ImageIndex index) - : _index(index == INDEX_UNDEFINED ? ImageIndexUndefined : index) + : _index(index) { } @@ -104,32 +89,32 @@ public: bool HasValue() const { - return GetIndex() != ImageIndexUndefined; + return GetIndex() != kImageIndexUndefined; } bool HasPrimary() const { - return (_flags & NEW_FLAG_PRIMARY) || (_flags & NEW_FLAG_SECONDARY); + return (_flags & kFlagPrimary) || (_flags & kFlagSecondary); } bool HasSecondary() const { - return _flags & NEW_FLAG_SECONDARY; + return _flags & kFlagSecondary; } bool HasTertiary() const { - return !(_flags & NEW_FLAG_PRIMARY) && (_flags & NEW_FLAG_SECONDARY); + return !(_flags & kFlagPrimary) && (_flags & kFlagSecondary); } bool IsRemap() const { - return (_flags & NEW_FLAG_PRIMARY) && !(_flags & NEW_FLAG_SECONDARY); + return (_flags & kFlagPrimary) && !(_flags & kFlagSecondary); } bool IsBlended() const { - return _flags & NEW_FLAG_BLEND; + return _flags & kFlagBlend; } ImageIndex GetIndex() const @@ -184,8 +169,8 @@ public: result._primary = paletteId; result._secondary = 0; result._tertiary = 0; - result._flags |= NEW_FLAG_PRIMARY; - result._flags &= ~NEW_FLAG_SECONDARY; + result._flags |= kFlagPrimary; + result._flags &= ~kFlagSecondary; return result; } @@ -193,7 +178,7 @@ public: { ImageId result = *this; result._primary = colour; - result._flags |= NEW_FLAG_PRIMARY; + result._flags |= kFlagPrimary; return result; } @@ -201,7 +186,7 @@ public: { ImageId result = *this; result._secondary = colour; - result._flags |= NEW_FLAG_SECONDARY; + result._flags |= kFlagSecondary; return result; } @@ -209,7 +194,7 @@ public: { ImageId result = *this; result._secondary = 0; - result._flags &= ~NEW_FLAG_SECONDARY; + result._flags &= ~kFlagSecondary; return result; } @@ -217,9 +202,9 @@ public: { ImageId result = *this; result._tertiary = tertiary; - result._flags &= ~NEW_FLAG_PRIMARY; - result._flags |= NEW_FLAG_SECONDARY; - if (!(_flags & NEW_FLAG_SECONDARY)) + result._flags &= ~kFlagPrimary; + result._flags |= kFlagSecondary; + if (!(_flags & kFlagSecondary)) { // Tertiary implies primary and secondary, so if colour was remap (8-bit primary) then // we need to zero the secondary colour. @@ -239,7 +224,7 @@ public: result._primary = static_cast(palette); result._secondary = 0; result._tertiary = 0; - result._flags = NEW_FLAG_BLEND; + result._flags = kFlagBlend; return result; } @@ -247,9 +232,9 @@ public: { ImageId result = *this; if (value) - result._flags |= NEW_FLAG_BLEND; + result._flags |= kFlagBlend; else - result._flags &= ~NEW_FLAG_BLEND; + result._flags &= ~kFlagBlend; return result; } diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index e8ee12011a..2814e871d7 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -18,7 +18,7 @@ namespace OpenRCT2::Drawing { - constexpr int32_t PALETTE_TRANSPARENT = -1; + static constexpr int32_t kPaletteTransparent = -1; ImageImporter::ImportResult ImageImporter::Import(const Image& image, ImageImportMeta& meta) const { @@ -101,7 +101,7 @@ namespace OpenRCT2::Drawing // The 1st index is always transparent if (paletteIndex == 0) { - paletteIndex = PALETTE_TRANSPARENT; + paletteIndex = kPaletteTransparent; } palettedSrc += 1; buffer.push_back(paletteIndex); @@ -133,7 +133,7 @@ namespace OpenRCT2::Drawing for (auto i = 0; i < bufferLength; i++) { auto p = pixels[i]; - buffer[i] = (p == PALETTE_TRANSPARENT ? 0 : static_cast(p)); + buffer[i] = (p == kPaletteTransparent ? 0 : static_cast(p)); } return buffer; } @@ -166,7 +166,7 @@ namespace OpenRCT2::Drawing for (auto x = 0; x < size.width; x++) { int32_t paletteIndex = *src++; - if (paletteIndex == PALETTE_TRANSPARENT) + if (paletteIndex == kPaletteTransparent) { if (npixels != 0) { @@ -315,7 +315,7 @@ namespace OpenRCT2::Drawing } } } - return PALETTE_TRANSPARENT; + return kPaletteTransparent; } bool ImageImporter::IsTransparentPixel(const int16_t* colour) @@ -328,7 +328,7 @@ namespace OpenRCT2::Drawing */ bool ImageImporter::IsInPalette(const GamePalette& palette, int16_t* colour) { - return !(GetPaletteIndex(palette, colour) == PALETTE_TRANSPARENT && !IsTransparentPixel(colour)); + return !(GetPaletteIndex(palette, colour) == kPaletteTransparent && !IsTransparentPixel(colour)); } /** @@ -363,7 +363,7 @@ namespace OpenRCT2::Drawing int32_t ImageImporter::GetClosestPaletteIndex(const GamePalette& palette, const int16_t* colour) { auto smallestError = static_cast(-1); - auto bestMatch = PALETTE_TRANSPARENT; + auto bestMatch = kPaletteTransparent; for (uint32_t x = 0; x < kGamePaletteSize; x++) { if (IsChangablePixel(x)) diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index ac39ca0ca0..f86d150d4d 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -308,7 +308,8 @@ namespace OpenRCT2::Drawing::LightFx PaintSession* session = PaintSessionAlloc(dpi, w->viewport->flags, w->viewport->rotation); PaintSessionGenerate(*session); PaintSessionArrange(*session); - auto info = SetInteractionInfoFromPaintSession(session, w->viewport->flags, ViewportInteractionItemAll); + auto info = SetInteractionInfoFromPaintSession( + session, w->viewport->flags, kViewportInteractionItemAll); PaintSessionFree(session); // LOG_WARNING("[%i, %i]", dpi->x, dpi->y); @@ -693,7 +694,7 @@ namespace OpenRCT2::Drawing::LightFx return _lightPolution_front; } - static constexpr int16_t offsetLookup[] = { + static constexpr int16_t kOffsetLookup[] = { 10, 10, 9, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -9, -10, -10, -10, -9, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 9, 10, }; void AddLightsMagicVehicle_ObservationTower(const Vehicle* vehicle) @@ -708,8 +709,8 @@ namespace OpenRCT2::Drawing::LightFx { if (vehicle == vehicle->TrainHead()) { - int16_t place_x = vehicle->x - offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - int16_t place_y = vehicle->y - offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + int16_t place_x = vehicle->x - kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + int16_t place_y = vehicle->y - kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 0, { place_x, place_y, vehicle->z }, LightType::Spot3); } } @@ -728,11 +729,11 @@ namespace OpenRCT2::Drawing::LightFx } int16_t place_x = vehicle_draw->x; int16_t place_y = vehicle_draw->y; - place_x -= offsetLookup[(vehicle_draw->Orientation + 0) % 32]; - place_y -= offsetLookup[(vehicle_draw->Orientation + 8) % 32]; + place_x -= kOffsetLookup[(vehicle_draw->Orientation + 0) % 32]; + place_y -= kOffsetLookup[(vehicle_draw->Orientation + 8) % 32]; Add3DLight(*vehicle, 0, { place_x, place_y, vehicle_draw->z }, LightType::Spot2); - place_x -= offsetLookup[(vehicle_draw->Orientation + 0) % 32]; - place_y -= offsetLookup[(vehicle_draw->Orientation + 8) % 32]; + place_x -= kOffsetLookup[(vehicle_draw->Orientation + 0) % 32]; + place_y -= kOffsetLookup[(vehicle_draw->Orientation + 8) % 32]; Add3DLight(*vehicle, 1, { place_x, place_y, vehicle_draw->z }, LightType::Spot2); } void AddLightsMagicVehicle_Monorail(const Vehicle* vehicle) @@ -742,20 +743,20 @@ namespace OpenRCT2::Drawing::LightFx int16_t place_y = vehicle->y; if (vehicle == vehicle->TrainHead()) { - place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x -= kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y -= kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 3; - place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 3; + place_x -= kOffsetLookup[(vehicle->Orientation + 0) % 32] * 3; + place_y -= kOffsetLookup[(vehicle->Orientation + 8) % 32] * 3; Add3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } if (vehicle == vehicle->TrainTail()) { - place_x += offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y += offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x += kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y += kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 3, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x += offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y += offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x += kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y += kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 4, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } } @@ -763,11 +764,11 @@ namespace OpenRCT2::Drawing::LightFx { if (vehicle == vehicle->TrainHead()) { - int16_t place_x = vehicle->x - offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - int16_t place_y = vehicle->y - offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + int16_t place_x = vehicle->x - kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + int16_t place_y = vehicle->y - kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 2; - place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 2; + place_x -= kOffsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y -= kOffsetLookup[(vehicle->Orientation + 8) % 32] * 2; Add3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } else diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index 6e63c9b18b..2277e252da 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -208,7 +208,7 @@ void GfxDrawDashedLine( const auto drawingEngine = dpi.DrawingEngine; if (drawingEngine != nullptr) { - constexpr int32_t precisionFactor = 1000; + constexpr int32_t kPrecisionFactor = 1000; const int32_t dashedLineLength = std::hypot( screenLine.GetX2() - screenLine.GetX1(), screenLine.GetY2() - screenLine.GetY1()); @@ -220,15 +220,15 @@ void GfxDrawDashedLine( const int32_t lineXDist = std::abs(screenLine.GetX2() - screenLine.GetX1()); const int32_t lineYDist = std::abs(screenLine.GetY2() - screenLine.GetY1()); - const int32_t dxPrecise = precisionFactor * lineXDist / lineSegmentCount / 2; - const int32_t dyPrecise = precisionFactor * lineYDist / lineSegmentCount / 2; + const int32_t dxPrecise = kPrecisionFactor * lineXDist / lineSegmentCount / 2; + const int32_t dyPrecise = kPrecisionFactor * lineYDist / lineSegmentCount / 2; IDrawingContext* dc = drawingEngine->GetDrawingContext(); for (int32_t i = 0, x, y; i < lineSegmentCount; ++i) { - x = screenLine.GetX1() + dxPrecise * i * 2 / precisionFactor; - y = screenLine.GetY1() + dyPrecise * i * 2 / precisionFactor; - dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } }); + x = screenLine.GetX1() + dxPrecise * i * 2 / kPrecisionFactor; + y = screenLine.GetY1() + dyPrecise * i * 2 / kPrecisionFactor; + dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / kPrecisionFactor, y + dyPrecise / kPrecisionFactor } }); } } } diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 79c2c742f6..12b549c38a 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -38,8 +38,8 @@ struct DrawScrollText uint8_t bitmap[64 * 40]; }; -static DrawScrollText _drawScrollTextList[OpenRCT2::MaxScrollingTextEntries]; -static uint8_t _characterBitmaps[FONT_SPRITE_GLYPH_COUNT + SPR_G2_GLYPH_COUNT][8]; +static DrawScrollText _drawScrollTextList[OpenRCT2::kMaxScrollingTextEntries]; +static uint8_t _characterBitmaps[kSpriteFontGlyphCount + SPR_G2_GLYPH_COUNT][8]; static uint32_t _drawSCrollNextIndex = 0; static std::mutex _scrollingTextMutex; @@ -80,7 +80,7 @@ static void ScrollingTextInitialiseCharacterBitmaps(uint32_t glyphStart, uint16_ static void ScrollingTextInitialiseScrollingText() { - for (int32_t i = 0; i < OpenRCT2::MaxScrollingTextEntries; i++) + for (int32_t i = 0; i < OpenRCT2::kMaxScrollingTextEntries; i++) { const int32_t imageId = SPR_SCROLLING_TEXT_START + i; @@ -105,17 +105,17 @@ static void ScrollingTextInitialiseScrollingText() void ScrollingTextInitialiseBitmaps() { - ScrollingTextInitialiseCharacterBitmaps(SPR_CHAR_START, 0, FONT_SPRITE_GLYPH_COUNT, gTinyFontAntiAliased); - ScrollingTextInitialiseCharacterBitmaps(SPR_G2_CHAR_BEGIN, FONT_SPRITE_GLYPH_COUNT, SPR_G2_GLYPH_COUNT, false); + ScrollingTextInitialiseCharacterBitmaps(SPR_CHAR_START, 0, kSpriteFontGlyphCount, gTinyFontAntiAliased); + ScrollingTextInitialiseCharacterBitmaps(SPR_G2_CHAR_BEGIN, kSpriteFontGlyphCount, SPR_G2_GLYPH_COUNT, false); ScrollingTextInitialiseScrollingText(); } static uint8_t* FontSpriteGetCodepointBitmap(int32_t codepoint) { auto offset = FontSpriteGetCodepointOffset(codepoint); - if (offset >= FONT_SPRITE_GLYPH_COUNT) + if (offset >= kSpriteFontGlyphCount) { - return _characterBitmaps[offset - (SPR_G2_CHAR_BEGIN - SPR_CHAR_START) + FONT_SPRITE_GLYPH_COUNT]; + return _characterBitmaps[offset - (SPR_G2_CHAR_BEGIN - SPR_CHAR_START) + kSpriteFontGlyphCount]; } return _characterBitmaps[offset]; @@ -167,7 +167,7 @@ consteval int16_t ScrollPos(const int16_t x, const int16_t y) } // clang-format off -static constexpr int16_t _scrollpos0[] = { +static constexpr int16_t kScrollPos0[] = { ScrollPos( 35, 12 ), ScrollPos( 36, 12 ), ScrollPos( 37, 11 ), @@ -194,7 +194,7 @@ static constexpr int16_t _scrollpos0[] = { ScrollPos( 58, 1 ), -1, }; -static constexpr int16_t _scrollpos1[] = { +static constexpr int16_t kScrollPos1[] = { ScrollPos( 5, 1 ), ScrollPos( 6, 1 ), ScrollPos( 7, 2 ), @@ -221,7 +221,7 @@ static constexpr int16_t _scrollpos1[] = { ScrollPos( 28, 12 ), -1, }; -static constexpr int16_t _scrollpos2[] = { +static constexpr int16_t kScrollPos2[] = { ScrollPos( 12, 1 ), ScrollPos( 13, 1 ), ScrollPos( 14, 2 ), @@ -263,7 +263,7 @@ static constexpr int16_t _scrollpos2[] = { ScrollPos( 50, 1 ), -1, }; -static constexpr int16_t _scrollpos3[] = { +static constexpr int16_t kScrollPos3[] = { ScrollPos( 16, 0 ), ScrollPos( 17, 1 ), ScrollPos( 18, 1 ), @@ -299,7 +299,7 @@ static constexpr int16_t _scrollpos3[] = { ScrollPos( 48, 16 ), -1, }; -static constexpr int16_t _scrollpos4[] = { +static constexpr int16_t kScrollPos4[] = { ScrollPos( 15, 17 ), ScrollPos( 16, 17 ), ScrollPos( 17, 16 ), @@ -336,7 +336,7 @@ static constexpr int16_t _scrollpos4[] = { ScrollPos( 48, 0 ), -1, }; -static constexpr int16_t _scrollpos5[] = { +static constexpr int16_t kScrollPos5[] = { ScrollPos( 4, 12 ), ScrollPos( 5, 12 ), ScrollPos( 6, 11 ), @@ -363,7 +363,7 @@ static constexpr int16_t _scrollpos5[] = { ScrollPos( 27, 1 ), -1, }; -static constexpr int16_t _scrollpos6[] = { +static constexpr int16_t kScrollPos6[] = { ScrollPos( 36, 1 ), ScrollPos( 37, 1 ), ScrollPos( 38, 2 ), @@ -390,7 +390,7 @@ static constexpr int16_t _scrollpos6[] = { ScrollPos( 59, 12 ), -1, }; -static constexpr int16_t _scrollpos7[] = { +static constexpr int16_t kScrollPos7[] = { ScrollPos( 8, 11 ), ScrollPos( 9, 11 ), ScrollPos( 10, 10 ), @@ -415,7 +415,7 @@ static constexpr int16_t _scrollpos7[] = { ScrollPos( 29, 1 ), -1, }; -static constexpr int16_t _scrollpos8[] = { +static constexpr int16_t kScrollPos8[] = { ScrollPos( 36, 2 ), ScrollPos( 37, 2 ), ScrollPos( 38, 3 ), @@ -438,7 +438,7 @@ static constexpr int16_t _scrollpos8[] = { ScrollPos( 55, 11 ), -1, }; -static constexpr int16_t _scrollpos9[] = { +static constexpr int16_t kScrollPos9[] = { ScrollPos( 11, 9 ), ScrollPos( 12, 9 ), ScrollPos( 13, 9 ), @@ -460,7 +460,7 @@ static constexpr int16_t _scrollpos9[] = { ScrollPos( 29, 1 ), -1, }; -static constexpr int16_t _scrollpos10[] = { +static constexpr int16_t kScrollPos10[] = { ScrollPos( 34, 1 ), ScrollPos( 35, 2 ), ScrollPos( 36, 3 ), @@ -482,7 +482,7 @@ static constexpr int16_t _scrollpos10[] = { ScrollPos( 52, 9 ), -1, }; -static constexpr int16_t _scrollpos11[] = { +static constexpr int16_t kScrollPos11[] = { ScrollPos( 14, 10 ), ScrollPos( 15, 9 ), ScrollPos( 16, 9 ), @@ -506,7 +506,7 @@ static constexpr int16_t _scrollpos11[] = { ScrollPos( 34, 0 ), -1, }; -static constexpr int16_t _scrollpos12[] = { +static constexpr int16_t kScrollPos12[] = { ScrollPos( 33, 1 ), ScrollPos( 34, 2 ), ScrollPos( 35, 2 ), @@ -530,7 +530,7 @@ static constexpr int16_t _scrollpos12[] = { ScrollPos( 53, 11 ), -1, }; -static constexpr int16_t _scrollpos13[] = { +static constexpr int16_t kScrollPos13[] = { ScrollPos( 12, 11 ), ScrollPos( 13, 10 ), ScrollPos( 14, 10 ), @@ -553,7 +553,7 @@ static constexpr int16_t _scrollpos13[] = { ScrollPos( 31, 1 ), -1, }; -static constexpr int16_t _scrollpos14[] = { +static constexpr int16_t kScrollPos14[] = { ScrollPos( 33, 1 ), ScrollPos( 34, 2 ), ScrollPos( 35, 2 ), @@ -577,7 +577,7 @@ static constexpr int16_t _scrollpos14[] = { ScrollPos( 53, 11 ), -1, }; -static constexpr int16_t _scrollpos15[] = { +static constexpr int16_t kScrollPos15[] = { ScrollPos( 10, 10 ), ScrollPos( 11, 10 ), ScrollPos( 12, 9 ), @@ -602,7 +602,7 @@ static constexpr int16_t _scrollpos15[] = { ScrollPos( 31, 0 ), -1, }; -static constexpr int16_t _scrollpos16[] = { +static constexpr int16_t kScrollPos16[] = { ScrollPos( 33, 0 ), ScrollPos( 34, 0 ), ScrollPos( 35, 1 ), @@ -627,7 +627,7 @@ static constexpr int16_t _scrollpos16[] = { ScrollPos( 54, 10 ), -1, }; -static constexpr int16_t _scrollpos17[] = { +static constexpr int16_t kScrollPos17[] = { ScrollPos( 6, 11 ), ScrollPos( 7, 11 ), ScrollPos( 8, 10 ), @@ -654,7 +654,7 @@ static constexpr int16_t _scrollpos17[] = { ScrollPos( 29, 0 ), -1, }; -static constexpr int16_t _scrollpos18[] = { +static constexpr int16_t kScrollPos18[] = { ScrollPos( 34, 0 ), ScrollPos( 35, 0 ), ScrollPos( 36, 1 ), @@ -681,7 +681,7 @@ static constexpr int16_t _scrollpos18[] = { ScrollPos( 57, 11 ), -1, }; -static constexpr int16_t _scrollpos19[] = { +static constexpr int16_t kScrollPos19[] = { ScrollPos( 13, 1 ), ScrollPos( 14, 1 ), ScrollPos( 15, 2 ), @@ -723,7 +723,7 @@ static constexpr int16_t _scrollpos19[] = { ScrollPos( 51, 1 ), -1, }; -static constexpr int16_t _scrollpos20[] = { +static constexpr int16_t kScrollPos20[] = { ScrollPos( 12, 1 ), ScrollPos( 13, 3 ), ScrollPos( 14, 4 ), @@ -764,7 +764,7 @@ static constexpr int16_t _scrollpos20[] = { ScrollPos( 49, 3 ), -1, }; -static constexpr int16_t _scrollpos21[] = { +static constexpr int16_t kScrollPos21[] = { ScrollPos( 12, 1 ), ScrollPos( 13, 1 ), ScrollPos( 14, 2 ), @@ -805,7 +805,7 @@ static constexpr int16_t _scrollpos21[] = { ScrollPos( 49, 1 ), -1, }; -static constexpr int16_t _scrollpos22[] = { +static constexpr int16_t kScrollPos22[] = { ScrollPos( 16, 1 ), ScrollPos( 17, 1 ), ScrollPos( 18, 2 ), @@ -841,7 +841,7 @@ static constexpr int16_t _scrollpos22[] = { ScrollPos( 48, 1 ), -1, }; -static constexpr int16_t _scrollpos23[] = { +static constexpr int16_t kScrollPos23[] = { ScrollPos( 15, 1 ), ScrollPos( 16, 2 ), ScrollPos( 17, 2 ), @@ -878,7 +878,7 @@ static constexpr int16_t _scrollpos23[] = { ScrollPos( 48, 1 ), -1, }; -static constexpr int16_t _scrollpos24[] = { +static constexpr int16_t kScrollPos24[] = { ScrollPos( 8, 9 ), ScrollPos( 9, 9 ), ScrollPos( 10, 8 ), @@ -901,7 +901,7 @@ static constexpr int16_t _scrollpos24[] = { ScrollPos( 27, 0 ), -1, }; -static constexpr int16_t _scrollpos25[] = { +static constexpr int16_t kScrollPos25[] = { ScrollPos( 36, 0 ), ScrollPos( 37, 0 ), ScrollPos( 38, 1 ), @@ -924,7 +924,7 @@ static constexpr int16_t _scrollpos25[] = { ScrollPos( 55, 9 ), -1, }; -static constexpr int16_t _scrollpos26[] = { +static constexpr int16_t kScrollPos26[] = { ScrollPos( 4, 13 ), ScrollPos( 5, 13 ), ScrollPos( 6, 12 ), @@ -955,7 +955,7 @@ static constexpr int16_t _scrollpos26[] = { ScrollPos( 31, 0 ), -1, }; -static constexpr int16_t _scrollpos27[] = { +static constexpr int16_t kScrollPos27[] = { ScrollPos( 32, 0 ), ScrollPos( 33, 0 ), ScrollPos( 34, 1 ), @@ -986,7 +986,7 @@ static constexpr int16_t _scrollpos27[] = { ScrollPos( 59, 13 ), -1, }; -static constexpr int16_t _scrollpos28[] = { +static constexpr int16_t kScrollPos28[] = { ScrollPos( 6, 13 ), ScrollPos( 7, 13 ), ScrollPos( 8, 12 ), @@ -1017,7 +1017,7 @@ static constexpr int16_t _scrollpos28[] = { ScrollPos( 33, 0 ), -1, }; -static constexpr int16_t _scrollpos29[] = { +static constexpr int16_t kScrollPos29[] = { ScrollPos( 30, 0 ), ScrollPos( 31, 0 ), ScrollPos( 32, 1 ), @@ -1048,7 +1048,7 @@ static constexpr int16_t _scrollpos29[] = { ScrollPos( 57, 13 ), -1, }; -static constexpr int16_t _scrollpos30[] = { +static constexpr int16_t kScrollPos30[] = { ScrollPos( 2, 30 ), ScrollPos( 3, 30 ), ScrollPos( 4, 29 ), @@ -1112,7 +1112,7 @@ static constexpr int16_t _scrollpos30[] = { ScrollPos( 62, 0 ), -1, }; -static constexpr int16_t _scrollpos31[] = { +static constexpr int16_t kScrollPos31[] = { ScrollPos( 1, 0 ), ScrollPos( 2, 1 ), ScrollPos( 3, 1 ), @@ -1176,7 +1176,7 @@ static constexpr int16_t _scrollpos31[] = { ScrollPos( 61, 30 ), -1, }; -static constexpr int16_t _scrollpos32[] = { +static constexpr int16_t kScrollPos32[] = { ScrollPos( 12, 0 ), ScrollPos( 13, 1 ), ScrollPos( 14, 1 ), @@ -1218,7 +1218,7 @@ static constexpr int16_t _scrollpos32[] = { ScrollPos( 50, 19 ), -1, }; -static constexpr int16_t _scrollpos33[] = { +static constexpr int16_t kScrollPos33[] = { ScrollPos( 12, 20 ), ScrollPos( 13, 20 ), ScrollPos( 14, 19 ), @@ -1261,7 +1261,7 @@ static constexpr int16_t _scrollpos33[] = { ScrollPos( 51, 1 ), -1, }; -static constexpr int16_t _scrollpos34[] = { +static constexpr int16_t kScrollPos34[] = { ScrollPos( 2, 14 ), ScrollPos( 3, 14 ), ScrollPos( 4, 13 ), @@ -1293,7 +1293,7 @@ static constexpr int16_t _scrollpos34[] = { ScrollPos( 30, 0 ), -1, }; -static constexpr int16_t _scrollpos35[] = { +static constexpr int16_t kScrollPos35[] = { ScrollPos( 33, 0 ), ScrollPos( 34, 0 ), ScrollPos( 35, 1 ), @@ -1325,7 +1325,7 @@ static constexpr int16_t _scrollpos35[] = { ScrollPos( 61, 14 ), -1, }; -static constexpr int16_t _scrollpos36[] = { +static constexpr int16_t kScrollPos36[] = { ScrollPos( 4, 0 ), ScrollPos( 5, 1 ), ScrollPos( 6, 2 ), @@ -1355,7 +1355,7 @@ static constexpr int16_t _scrollpos36[] = { ScrollPos( 30, 12 ), -1, }; -static constexpr int16_t _scrollpos37[] = { +static constexpr int16_t kScrollPos37[] = { ScrollPos( 32, 13 ), ScrollPos( 33, 12 ), ScrollPos( 34, 12 ), @@ -1386,45 +1386,45 @@ static constexpr int16_t _scrollpos37[] = { -1, }; -static constexpr const int16_t* _scrollPositions[kMaxScrollingTextModes] = { - _scrollpos0, - _scrollpos1, - _scrollpos2, - _scrollpos3, - _scrollpos4, - _scrollpos5, - _scrollpos6, - _scrollpos7, - _scrollpos8, - _scrollpos9, - _scrollpos10, - _scrollpos11, - _scrollpos12, - _scrollpos13, - _scrollpos14, - _scrollpos15, - _scrollpos16, - _scrollpos17, - _scrollpos18, - _scrollpos19, - _scrollpos20, - _scrollpos21, - _scrollpos22, - _scrollpos23, - _scrollpos24, - _scrollpos25, - _scrollpos26, - _scrollpos27, - _scrollpos28, - _scrollpos29, - _scrollpos30, - _scrollpos31, - _scrollpos32, - _scrollpos33, - _scrollpos34, - _scrollpos35, - _scrollpos36, - _scrollpos37, +static constexpr const int16_t* kScrollPositions[kMaxScrollingTextModes] = { + kScrollPos0, + kScrollPos1, + kScrollPos2, + kScrollPos3, + kScrollPos4, + kScrollPos5, + kScrollPos6, + kScrollPos7, + kScrollPos8, + kScrollPos9, + kScrollPos10, + kScrollPos11, + kScrollPos12, + kScrollPos13, + kScrollPos14, + kScrollPos15, + kScrollPos16, + kScrollPos17, + kScrollPos18, + kScrollPos19, + kScrollPos20, + kScrollPos21, + kScrollPos22, + kScrollPos23, + kScrollPos24, + kScrollPos25, + kScrollPos26, + kScrollPos27, + kScrollPos28, + kScrollPos29, + kScrollPos30, + kScrollPos31, + kScrollPos32, + kScrollPos33, + kScrollPos34, + kScrollPos35, + kScrollPos36, + kScrollPos37, }; // clang-format on @@ -1466,7 +1466,7 @@ ImageId ScrollingTextSetup( utf8 scrollString[256]; ScrollingTextFormat(scrollString, 256, scrollText); - const int16_t* scrollingModePositions = _scrollPositions[scrollingMode]; + const int16_t* scrollingModePositions = kScrollPositions[scrollingMode]; std::fill_n(scrollText->bitmap, 320 * 8, 0x00); if (LocalisationService_UseTrueTypeFont()) diff --git a/src/openrct2/drawing/ScrollingText.h b/src/openrct2/drawing/ScrollingText.h index ec3f10100c..014003c411 100644 --- a/src/openrct2/drawing/ScrollingText.h +++ b/src/openrct2/drawing/ScrollingText.h @@ -2,7 +2,7 @@ namespace OpenRCT2 { - static auto constexpr MaxScrollingTextLegacyEntries = 32; - static auto constexpr MaxScrollingTextEntries = 256; + static auto constexpr kMaxScrollingTextLegacyEntries = 32; + static auto constexpr kMaxScrollingTextEntries = 256; } // namespace OpenRCT2 diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index c5f537b3f7..8aee4e9abe 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -91,14 +91,14 @@ static void DrawLightRain( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 0x18; y_start = (currentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); } /** @@ -115,28 +115,28 @@ static void DrawHeavyRain( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 0x10; y_start = (currentTicks * 6) + 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 8; y_start = (currentTicks * 3) + 7; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); x_start = -static_cast(currentTicks) + 0x18; y_start = (currentTicks * 4) + 0x0D; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, RainPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kRainPattern); } static void DrawLightSnow( @@ -153,14 +153,14 @@ static void DrawLightSnow( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = negT + 16 + (cos(cosTick) * 6); y_start = t + 16; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); } static void DrawHeavySnow( @@ -173,26 +173,26 @@ static void DrawHeavySnow( y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = -static_cast(currentTicks * 4) + 6; y_start = currentTicks + 5; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = -static_cast(currentTicks * 2) + 11; y_start = currentTicks + 18; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); x_start = -static_cast(currentTicks * 3) + 17; y_start = currentTicks + 11; y_start = -y_start; x_start += left; y_start += top; - weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, SnowPattern); + weatherDrawer->Draw(dpi, left, top, width, height, x_start, y_start, kSnowPattern); } diff --git a/src/openrct2/drawing/Weather.h b/src/openrct2/drawing/Weather.h index 7b30e49fdc..37d7721a76 100644 --- a/src/openrct2/drawing/Weather.h +++ b/src/openrct2/drawing/Weather.h @@ -19,7 +19,7 @@ namespace OpenRCT2::Drawing } // clang-format off -static constexpr uint8_t RainPattern[] = +static constexpr uint8_t kRainPattern[] = { 32, 32, 0, 12, 0, 14, 0, 16, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, @@ -27,7 +27,7 @@ static constexpr uint8_t RainPattern[] = 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 0, 0 }; -static constexpr uint8_t SnowPattern[] = +static constexpr uint8_t kSnowPattern[] = { 32, 32, 0, 32, 0, 32, 0, 16, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index cd89bf052a..53def4d799 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -476,7 +476,7 @@ void X8DrawingContext::Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) /** rct2: 0x0097FF04 */ // clang-format off -static constexpr uint16_t Pattern[] = { +static constexpr uint16_t kPattern[] = { 0b0111111110000000, 0b0011111111000000, 0b0001111111100000, @@ -496,7 +496,7 @@ static constexpr uint16_t Pattern[] = { }; /** rct2: 0x0097FF14 */ -static constexpr uint16_t PatternInverse[] = { +static constexpr uint16_t kPatternInverse[] = { 0b1000000001111111, 0b1100000000111111, 0b1110000000011111, @@ -516,9 +516,9 @@ static constexpr uint16_t PatternInverse[] = { }; /** rct2: 0x0097FEFC */ -static constexpr const uint16_t* Patterns[] = { - Pattern, - PatternInverse, +static constexpr const uint16_t* kPatterns[] = { + kPattern, + kPatternInverse, }; // clang-format on @@ -538,12 +538,12 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef if (top >= dpi.y + dpi.height) return; - uint16_t crossPattern = 0; + uint16_t crosskPattern = 0; int32_t startX = left - dpi.x; if (startX < 0) { - crossPattern ^= startX; + crosskPattern ^= startX; startX = 0; } @@ -556,7 +556,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef int32_t startY = top - dpi.y; if (startY < 0) { - crossPattern ^= startY; + crosskPattern ^= startY; startY = 0; } @@ -576,7 +576,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef for (int32_t i = 0; i < height; i++) { uint8_t* nextdst = dst + dpi.LineStride(); - uint32_t p = Numerics::ror32(crossPattern, 1); + uint32_t p = Numerics::ror32(crosskPattern, 1); p = (p & 0xFFFF0000) | width; // Fill every other pixel with the colour @@ -589,7 +589,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef } dst++; } - crossPattern ^= 1; + crosskPattern ^= 1; dst = nextdst; } } @@ -607,10 +607,10 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef // The pattern loops every 15 pixels this is which // part the pattern is on. - int32_t startPatternX = (startX + dpi.x) % 16; - int32_t patternX = startPatternX; + int32_t startkPatternX = (startX + dpi.x) % 16; + int32_t patternX = startkPatternX; - const uint16_t* patternsrc = Patterns[colour >> 28]; // or possibly uint8_t)[esi*4] ? + const uint16_t* patternsrc = kPatterns[colour >> 28]; // or possibly uint8_t)[esi*4] ? for (int32_t numLines = height; numLines > 0; numLines--) { @@ -626,7 +626,7 @@ void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t lef patternX = (patternX + 1) % 16; dst++; } - patternX = startPatternX; + patternX = startkPatternX; patternY = (patternY + 1) % 16; dst = nextdst; } diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index 61fa380d83..ec6e9ab611 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -45,9 +45,9 @@ namespace OpenRCT2 uint8_t Colour; }; - static constexpr uint32_t MaxWeatherPixels = 0xFFFE; + static constexpr uint32_t kMaxWeatherPixels = 0xFFFE; - size_t _weatherPixelsCapacity = MaxWeatherPixels; + size_t _weatherPixelsCapacity = kMaxWeatherPixels; uint32_t _weatherPixelsCount = 0; WeatherPixel* _weatherPixels = nullptr; diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index ab72c37fec..f592c727c7 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -40,7 +40,7 @@ static constexpr uint8_t kDuckAnimationFlyToWater[] = 8, 9, 10, 11, 12, 13 }; -static constexpr uint8_t kkDuckAnimationswim[] = +static constexpr uint8_t kDuckAnimationSwim[] = { 0 }; @@ -60,17 +60,16 @@ static constexpr uint8_t kDuckAnimationFlyAway[] = { 8, 9, 10, 11, 12, 13 }; - -static constexpr const uint8_t * kDuckAnimations[] = -{ - kDuckAnimationFlyToWater, // FLY_TO_WATER - kkDuckAnimationswim, // SWIM - kDuckAnimationDrink, // DRINK - kDuckAnimationDoubleDrink, // DOUBLE_DRINK - kDuckAnimationFlyAway, // FLY_AWAY -}; // clang-format on +static constexpr const uint8_t* kDuckAnimations[] = { + kDuckAnimationFlyToWater, // DuckState::FlyToWater, + kDuckAnimationSwim, // DuckState::Swim, + kDuckAnimationDrink, // DuckState::Drink, + kDuckAnimationDoubleDrink, // DuckState::DoubleDrink, + kDuckAnimationFlyAway, // DuckState::FlyAway, +}; + template<> bool EntityBase::Is() const { diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index f4592de1d0..7791b65977 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -44,7 +44,7 @@ using namespace OpenRCT2; static std::array, EnumValue(EntityType::Count)> gEntityLists; static std::vector _freeIdList; -static bool _entityFlashingList[MAX_ENTITIES]; +static bool _entityFlashingList[kMaxEntities]; static constexpr const uint32_t kSpatialIndexSize = (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) + 1; static constexpr uint32_t kSpatialIndexNullBucket = kSpatialIndexSize - 1; @@ -114,7 +114,7 @@ EntityBase* TryGetEntity(EntityId entityIndex) { auto& gameState = GetGameState(); const auto idx = entityIndex.ToUnderlying(); - return idx >= MAX_ENTITIES ? nullptr : &gameState.Entities[idx].base; + return idx >= kMaxEntities ? nullptr : &gameState.Entities[idx].base; } EntityBase* GetEntity(EntityId entityIndex) @@ -123,7 +123,7 @@ EntityBase* GetEntity(EntityId entityIndex) { return nullptr; } - Guard::Assert(entityIndex.ToUnderlying() < MAX_ENTITIES, "Tried getting entity %u", entityIndex.ToUnderlying()); + Guard::Assert(entityIndex.ToUnderlying() < kMaxEntities, "Tried getting entity %u", entityIndex.ToUnderlying()); return TryGetEntity(entityIndex); } @@ -143,7 +143,7 @@ static void ResetEntityLists() static void ResetFreeIds() { _freeIdList.clear(); - _freeIdList.resize(MAX_ENTITIES); + _freeIdList.resize(kMaxEntities); // List needs to be back to front to simplify removing auto nextId = 0; @@ -165,7 +165,7 @@ const std::list& GetEntityList(const EntityType id) void ResetAllEntities() { // Free all associated Entity pointers prior to zeroing memory - for (int32_t i = 0; i < MAX_ENTITIES; ++i) + for (int32_t i = 0; i < kMaxEntities; ++i) { auto* spr = GetEntity(EntityId::FromUnderlying(i)); if (spr == nullptr) @@ -179,7 +179,7 @@ void ResetAllEntities() std::fill(std::begin(gameState.Entities), std::end(gameState.Entities), Entity_t()); OpenRCT2::RideUse::GetHistory().Clear(); OpenRCT2::RideUse::GetTypeHistory().Clear(); - for (int32_t i = 0; i < MAX_ENTITIES; ++i) + for (int32_t i = 0; i < kMaxEntities; ++i) { auto* spr = GetEntity(EntityId::FromUnderlying(i)); if (spr == nullptr) @@ -210,7 +210,7 @@ void ResetEntitySpatialIndices() { vec.clear(); } - for (EntityId::UnderlyingType i = 0; i < MAX_ENTITIES; i++) + for (EntityId::UnderlyingType i = 0; i < kMaxEntities; i++) { auto* entity = GetEntity(EntityId::FromUnderlying(i)); if (entity != nullptr && entity->Type != EntityType::Null) @@ -269,7 +269,7 @@ static void EntityReset(EntityBase* entity) entity->Type = EntityType::Null; } -static constexpr uint16_t MAX_MISC_SPRITES = 1600; +static constexpr uint16_t kMaxMiscEntities = 1600; static void AddToEntityList(EntityBase* entity) { @@ -338,13 +338,13 @@ EntityBase* CreateEntity(EntityType type) if (EntityTypeIsMiscEntity(type)) { // Misc sprites are commonly used for effects, give other entity types higher priority. - if (GetMiscEntityCount() >= MAX_MISC_SPRITES) + if (GetMiscEntityCount() >= kMaxMiscEntities) { return nullptr; } - // If there are less than MAX_MISC_SPRITES free slots, ensure other entities can be created. - if (_freeIdList.size() < MAX_MISC_SPRITES) + // If there are less than kMaxMiscEntities free slots, ensure other entities can be created. + if (_freeIdList.size() < kMaxMiscEntities) { return nullptr; } @@ -584,12 +584,12 @@ uint16_t RemoveFloatingEntities() void EntitySetFlashing(EntityBase* entity, bool flashing) { - assert(entity->Id.ToUnderlying() < MAX_ENTITIES); + assert(entity->Id.ToUnderlying() < kMaxEntities); _entityFlashingList[entity->Id.ToUnderlying()] = flashing; } bool EntityGetFlashing(EntityBase* entity) { - assert(entity->Id.ToUnderlying() < MAX_ENTITIES); + assert(entity->Id.ToUnderlying() < kMaxEntities); return _entityFlashingList[entity->Id.ToUnderlying()]; } diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index ebb1a27eae..28fb5768d9 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -27,7 +27,7 @@ namespace OpenRCT2 }; } // namespace OpenRCT2 -constexpr uint16_t MAX_ENTITIES = 65535; +constexpr uint16_t kMaxEntities = 65535; EntityBase* GetEntity(EntityId sprite_idx); diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index 6ecde530dc..dc4b7c2844 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -58,8 +58,8 @@ static constexpr std::array _fountainDirectionsPositive = { CoordsXY{ 0, 0 }, CoordsXY{ 0, kCoordsXYStep }, }; -constexpr auto _FountainChanceOfStoppingEdgeMode = 0x3333; // 0.200 -constexpr auto _FountainChanceOfStoppingRandomMode = 0x2000; // 0.125 +static constexpr auto kFountainChanceOfStoppingEdgeMode = 0x3333; // 0.200 +static constexpr auto kFountainChanceOfStoppingRandomMode = 0x2000; // 0.125 // rct2: 0x0097F040 const uint8_t _fountainDirections[] = { @@ -300,7 +300,7 @@ void JumpingFountain::GoToEdge(const CoordsXYZ& newLoc, const int32_t availableD } const uint32_t randomIndex = ScenarioRand(); - if ((randomIndex & 0xFFFF) < _FountainChanceOfStoppingEdgeMode) + if ((randomIndex & 0xFFFF) < kFountainChanceOfStoppingEdgeMode) { return; } @@ -370,7 +370,7 @@ void JumpingFountain::Split(const CoordsXYZ& newLoc, int32_t availableDirections void JumpingFountain::Random(const CoordsXYZ& newLoc, int32_t availableDirections) const { const uint32_t randomIndex = ScenarioRand(); - if ((randomIndex & 0xFFFF) >= _FountainChanceOfStoppingRandomMode) + if ((randomIndex & 0xFFFF) >= kFountainChanceOfStoppingRandomMode) { int32_t direction = randomIndex & 7; while (!(availableDirections & (1 << direction))) @@ -409,8 +409,8 @@ void JumpingFountain::Paint(PaintSession& session, int32_t imageDirection) const PROFILED_FUNCTION(); // TODO: Move into sprites.h - constexpr uint32_t JumpingFountainSnowBaseImage = 23037; - constexpr uint32_t JumpingFountainWaterBaseImage = 22973; + constexpr uint32_t kJumpingFountainSnowBaseImage = 23037; + constexpr uint32_t kJumpingFountainWaterBaseImage = 22973; DrawPixelInfo& dpi = session.DPI; if (dpi.zoom_level > ZoomLevel{ 0 }) @@ -433,8 +433,8 @@ void JumpingFountain::Paint(PaintSession& session, int32_t imageDirection) const isAntiClockwise = !isAntiClockwise; } - uint32_t baseImageId = (FountainType == JumpingFountainType::Snow) ? JumpingFountainSnowBaseImage - : JumpingFountainWaterBaseImage; + uint32_t baseImageId = (FountainType == JumpingFountainType::Snow) ? kJumpingFountainSnowBaseImage + : kJumpingFountainWaterBaseImage; auto imageId = ImageId(baseImageId + imageDirection * 16 + frame); constexpr std::array antiClockWiseBoundingBoxes = { CoordsXY{ -kCoordsXYStep, -3 }, diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 560183e494..006ca7eea6 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -86,7 +86,7 @@ using namespace OpenRCT2::Numerics; // entrance of the slide. Up to 4 waypoints for each 4 sides that an ride entrance can be located // and 4 different rotations of the ride. 4 * 4 * 4 = 64 locations. // clang-format off -static constexpr CoordsXY SpiralSlideWalkingPath[64] = { +static constexpr CoordsXY kSpiralSlideWalkingPath[64] = { { 56, 8 }, { 8, 8 }, { 8, 32 }, @@ -154,7 +154,7 @@ static constexpr CoordsXY SpiralSlideWalkingPath[64] = { }; /** rct2: 0x00981F4C, 0x00981F4E */ -static constexpr CoordsXY _WatchingPositionOffsets[] = { +static constexpr CoordsXY kWatchingPositionOffsets[] = { { 7, 5 }, { 5, 25 }, { 25, 5 }, @@ -197,7 +197,7 @@ static constexpr ride_rating NauseaMaximumThresholds[] = { }; /** rct2: 009823AC */ -static constexpr PeepThoughtType crowded_thoughts[] = { +static constexpr PeepThoughtType kCrowdedThoughts[] = { PeepThoughtType::Lost, PeepThoughtType::Tired, PeepThoughtType::BadLitter, @@ -436,7 +436,7 @@ static struct }; // These arrays contain the base minimum and maximum nausea ratings for peeps, based on their nausea tolerance level. -static constexpr ride_rating NauseaMinimumThresholds[] = { +static constexpr ride_rating kNauseaMinimumThresholds[] = { 0, 0, 200, @@ -929,7 +929,7 @@ void Guest::Tick128UpdateGuest(uint32_t index) * is executed to once every four calls. */ if (PeepFlags & PEEP_FLAGS_CROWDED) { - PeepThoughtType thought_type = crowded_thoughts[ScenarioRand() & 0xF]; + PeepThoughtType thought_type = kCrowdedThoughts[ScenarioRand() & 0xF]; if (thought_type != PeepThoughtType::None) { InsertNewThought(thought_type); @@ -2797,7 +2797,7 @@ static int16_t PeepCalculateRideIntensityNauseaSatisfaction(Guest* peep, const R // Although it's not shown in the interface, a peep with Average or High nausea tolerance // has a minimum preferred nausea value. (For peeps with None or Low, this is set to zero.) - ride_rating minNausea = NauseaMinimumThresholds[(EnumValue(peep->NauseaTolerance) & 3)]; + ride_rating minNausea = kNauseaMinimumThresholds[(EnumValue(peep->NauseaTolerance) & 3)]; ride_rating maxNausea = NauseaMaximumThresholds[(EnumValue(peep->NauseaTolerance) & 3)]; if (minNausea <= ride.ratings.nausea && maxNausea >= ride.ratings.nausea) { @@ -3187,12 +3187,12 @@ static void PeepHeadForNearestRide(Guest* peep, bool considerOnlyCloseRides, T p else { // Take nearby rides into consideration - constexpr auto searchRadius = 10 * 32; + constexpr auto kSearchRadius = 10 * 32; int32_t cx = floor2(peep->x, 32); int32_t cy = floor2(peep->y, 32); - for (auto x = cx - searchRadius; x <= cx + searchRadius; x += kCoordsXYStep) + for (auto x = cx - kSearchRadius; x <= cx + kSearchRadius; x += kCoordsXYStep) { - for (auto y = cy - searchRadius; y <= cy + searchRadius; y += kCoordsXYStep) + for (auto y = cy - kSearchRadius; y <= cy + kSearchRadius; y += kCoordsXYStep) { auto location = CoordsXY{ x, y }; if (!MapIsLocationValid(location)) @@ -3590,7 +3590,7 @@ void PeepUpdateRideLeaveEntranceSpiralSlide(Guest* peep, Ride& ride, CoordsXYZD& peep->Var37 = (entrance_loc.direction << 2) | (direction_track << 4); - entrance_loc += SpiralSlideWalkingPath[peep->Var37]; + entrance_loc += kSpiralSlideWalkingPath[peep->Var37]; peep->SetDestination(entrance_loc); peep->CurrentCar = 0; @@ -4715,7 +4715,7 @@ void Guest::UpdateRideApproachSpiralSlide() CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; assert(rtd.specialType == RtdSpecialType::spiralSlide); - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); RideSubState = PeepRideSubState::LeaveSpiralSlide; @@ -4729,13 +4729,13 @@ void Guest::UpdateRideApproachSpiralSlide() CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; assert(rtd.specialType == RtdSpecialType::spiralSlide); - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); } /** rct2: 0x00981F0C, 0x00981F0E */ -static constexpr CoordsXY _SpiralSlideEnd[] = { +static constexpr CoordsXY kSpiralSlideEnd[] = { { 25, 56 }, { 56, 7 }, { 7, -24 }, @@ -4743,7 +4743,7 @@ static constexpr CoordsXY _SpiralSlideEnd[] = { }; /** rct2: 0x00981F1C, 0x00981F1E */ -static constexpr CoordsXY _SpiralSlideEndWaypoint[] = { +static constexpr CoordsXY kSpiralSlideEndWaypoint[] = { { 8, 56 }, { 56, 24 }, { 24, -24 }, @@ -4797,12 +4797,12 @@ void Guest::UpdateRideOnSpiralSlide() uint8_t dir = (Var37 / 4) & 3; // Set the location that the peep walks to go on slide again - destination = newLocation + _SpiralSlideEndWaypoint[dir]; + destination = newLocation + kSpiralSlideEndWaypoint[dir]; SetDestination(destination); // Move the peep sprite to just at the end of the slide - newLocation.x += _SpiralSlideEnd[dir].x; - newLocation.y += _SpiralSlideEnd[dir].y; + newLocation.x += kSpiralSlideEnd[dir].x; + newLocation.y += kSpiralSlideEnd[dir].y; MoveTo({ newLocation, z }); @@ -4827,7 +4827,7 @@ void Guest::UpdateRideOnSpiralSlide() CoordsXY targetLoc = ride->GetStation(CurrentRideStation).Start; - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); RideSubState = PeepRideSubState::ApproachSpiralSlide; @@ -4868,7 +4868,7 @@ void Guest::UpdateRideLeaveSpiralSlide() [[maybe_unused]] const auto& rtd = ride->GetRideTypeDescriptor(); assert(rtd.specialType == RtdSpecialType::spiralSlide); - targetLoc += SpiralSlideWalkingPath[Var37]; + targetLoc += kSpiralSlideWalkingPath[Var37]; SetDestination(targetLoc); return; @@ -4894,7 +4894,7 @@ void Guest::UpdateRideLeaveSpiralSlide() } /** rct2: 0x00981FE4 */ -static constexpr uint8_t _MazeGetNewDirectionFromEdge[][4] = { +static constexpr uint8_t kMazeGetNewDirectionFromEdge[][4] = { { 15, 7, 15, 7 }, { 11, 3, 11, 3 }, { 7, 15, 7, 15 }, @@ -4902,7 +4902,7 @@ static constexpr uint8_t _MazeGetNewDirectionFromEdge[][4] = { }; /** rct2: 0x00981FF4 */ -static constexpr uint8_t _MazeCurrentDirectionToOpenHedge[][4] = { +static constexpr uint8_t kMazeCurrentDirectionToOpenHedge[][4] = { { 1, 2, 14, 0 }, { 4, 5, 6, 2 }, { 6, 8, 9, 10 }, @@ -4960,7 +4960,7 @@ void Guest::UpdateRideMazePathfinding() uint8_t mazeReverseLastEdge = DirectionReverse(MazeLastEdge); for (uint8_t i = 0; i < kNumOrthogonalDirections; ++i) { - if (!(mazeEntry & (1 << _MazeCurrentDirectionToOpenHedge[Var37 / 4][i])) && i != mazeReverseLastEdge) + if (!(mazeEntry & (1 << kMazeCurrentDirectionToOpenHedge[Var37 / 4][i])) && i != mazeReverseLastEdge) { hedges[openCount++] = i; } @@ -4968,7 +4968,7 @@ void Guest::UpdateRideMazePathfinding() if (openCount == 0) { - if ((mazeEntry & (1 << _MazeCurrentDirectionToOpenHedge[Var37 / 4][mazeReverseLastEdge]))) + if ((mazeEntry & (1 << kMazeCurrentDirectionToOpenHedge[Var37 / 4][mazeReverseLastEdge]))) { return; } @@ -5018,7 +5018,7 @@ void Guest::UpdateRideMazePathfinding() return; case maze_type::hedge: SetDestination(targetLoc); - Var37 = _MazeGetNewDirectionFromEdge[Var37 / 4][chosenEdge]; + Var37 = kMazeGetNewDirectionFromEdge[Var37 / 4][chosenEdge]; MazeLastEdge = chosenEdge; break; case maze_type::entrance_or_exit: @@ -5552,8 +5552,8 @@ void Guest::UpdateWalking() SetState(PeepState::Watching); SubState = 0; - int32_t destX = (x & 0xFFE0) + _WatchingPositionOffsets[Var37 & 0x1F].x; - int32_t destY = (y & 0xFFE0) + _WatchingPositionOffsets[Var37 & 0x1F].y; + int32_t destX = (x & 0xFFE0) + kWatchingPositionOffsets[Var37 & 0x1F].x; + int32_t destY = (y & 0xFFE0) + kWatchingPositionOffsets[Var37 & 0x1F].y; SetDestination({ destX, destY }, 3); @@ -6957,7 +6957,7 @@ void PeepThoughtSetFormatArgs(const PeepThought* thought, Formatter& ft) } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } else if (flags & PEEP_THOUGHT_ACTION_FLAG_SHOP_ITEM_SINGULAR) @@ -6972,7 +6972,7 @@ void PeepThoughtSetFormatArgs(const PeepThought* thought, Formatter& ft) void Guest::InsertNewThought(PeepThoughtType thought_type) { - InsertNewThought(thought_type, PeepThoughtItemNone); + InsertNewThought(thought_type, kPeepThoughtItemNone); } void Guest::InsertNewThought(PeepThoughtType thought_type, ShopItem shopItem) @@ -7043,7 +7043,7 @@ static constexpr PeepNauseaTolerance nausea_tolerance_distribution[] = { }; /** rct2: 0x009823BC */ -static constexpr uint8_t trouser_colours[] = { +static constexpr uint8_t kTrouserColours[] = { COLOUR_BLACK, COLOUR_GREY, COLOUR_LIGHT_BROWN, @@ -7076,7 +7076,7 @@ static constexpr uint8_t trouser_colours[] = { }; /** rct2: 0x009823D5 */ -static constexpr uint8_t tshirt_colours[] = { +static constexpr uint8_t kTshirtColours[] = { COLOUR_BLACK, COLOUR_GREY, COLOUR_LIGHT_BROWN, @@ -7296,11 +7296,11 @@ Guest* Guest::Generate(const CoordsXYZ& coords) peep->Angriness = 0; peep->TimeLost = 0; - uint8_t tshirtColour = static_cast(ScenarioRand() % std::size(tshirt_colours)); - peep->TshirtColour = tshirt_colours[tshirtColour]; + uint8_t tshirtColour = static_cast(ScenarioRand() % std::size(kTshirtColours)); + peep->TshirtColour = kTshirtColours[tshirtColour]; - uint8_t trousersColour = static_cast(ScenarioRand() % std::size(trouser_colours)); - peep->TrousersColour = trouser_colours[trousersColour]; + uint8_t trousersColour = static_cast(ScenarioRand() % std::size(kTrouserColours)); + peep->TrousersColour = kTrouserColours[trousersColour]; /* Minimum energy is capped at 32 and maximum at 128, so this initialises * a peep with approx 34%-100% energy. (65 - 32) / (128 - 32) ≈ 34% */ @@ -7346,7 +7346,7 @@ enum PEEP_FACE_OFFSET_VERY_VERY_HAPPY, }; -static constexpr int32_t face_sprite_small[] = { +static constexpr int32_t kFaceSpriteSmall[] = { SPR_PEEP_SMALL_FACE_ANGRY, SPR_PEEP_SMALL_FACE_VERY_VERY_SICK, SPR_PEEP_SMALL_FACE_VERY_SICK, @@ -7362,7 +7362,7 @@ static constexpr int32_t face_sprite_small[] = { SPR_PEEP_SMALL_FACE_VERY_VERY_HAPPY, }; -static constexpr int32_t face_sprite_large[] = { +static constexpr int32_t kFaceSpriteLarge[] = { SPR_PEEP_LARGE_FACE_ANGRY_0, SPR_PEEP_LARGE_FACE_VERY_VERY_SICK_0, SPR_PEEP_LARGE_FACE_VERY_SICK_0, @@ -7420,7 +7420,7 @@ static int32_t GetFaceSpriteOffset(Guest* peep) */ int32_t GetPeepFaceSpriteSmall(Guest* peep) { - return face_sprite_small[GetFaceSpriteOffset(peep)]; + return kFaceSpriteSmall[GetFaceSpriteOffset(peep)]; } /** @@ -7429,7 +7429,7 @@ int32_t GetPeepFaceSpriteSmall(Guest* peep) */ int32_t GetPeepFaceSpriteLarge(Guest* peep) { - return face_sprite_large[GetFaceSpriteOffset(peep)]; + return kFaceSpriteLarge[GetFaceSpriteOffset(peep)]; } /** @@ -7682,7 +7682,7 @@ void Guest::RemoveRideFromMemory(RideId rideId) // Last slot is now free. auto& lastEntry = Thoughts.back(); lastEntry.type = PeepThoughtType::None; - lastEntry.item = PeepThoughtItemNone; + lastEntry.item = kPeepThoughtItemNone; } } diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index 03598938c4..41c6b85a94 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -185,7 +185,7 @@ enum class PeepNauseaTolerance : uint8_t High }; -static constexpr uint16_t PeepThoughtItemNone = std::numeric_limits::max(); +static constexpr uint16_t kPeepThoughtItemNone = std::numeric_limits::max(); struct PeepThought { diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 12177c7516..b0f45d58d3 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -141,7 +141,7 @@ static const StringId litterNames[12] = { StringId Litter::GetName() const { if (EnumValue(SubType) >= std::size(litterNames)) - return STR_NONE; + return kStringIdNone; return litterNames[EnumValue(SubType)]; } @@ -165,7 +165,7 @@ struct LitterSprite }; /** rct2: 0x0097EF6C */ -static constexpr LitterSprite _litterSprites[] = { +static constexpr LitterSprite kLitterSprites[] = { { SPR_LITTER_SICK, 0x1 }, { SPR_LITTER_SICK_ALT, 0x1 }, { SPR_LITTER_EMPTY_CAN, 0x1 }, @@ -192,9 +192,9 @@ void Litter::Paint(PaintSession& session, int32_t imageDirection) const imageDirection >>= 3; // Some litter types have only 1 direction so remove // anything that isn't required. - imageDirection &= _litterSprites[EnumValue(SubType)].direction_mask; + imageDirection &= kLitterSprites[EnumValue(SubType)].direction_mask; - uint32_t image_id = imageDirection + _litterSprites[EnumValue(SubType)].base_id; + uint32_t image_id = imageDirection + kLitterSprites[EnumValue(SubType)].base_id; // In the following call to PaintAddImageAsParent, we add 4 (instead of 2) to the // bound_box_offset_z to make sure litter is drawn on top of railways diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index cf4f9b9d58..c47a56b101 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -25,7 +25,7 @@ using namespace OpenRCT2; -static constexpr CoordsXY _moneyEffectMoveOffset[] = { +static constexpr CoordsXY kMoneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, @@ -132,8 +132,8 @@ void MoneyEffect::Update() { newZ += 1; } - newY += _moneyEffectMoveOffset[GetCurrentRotation()].y; - newX += _moneyEffectMoveOffset[GetCurrentRotation()].x; + newY += kMoneyEffectMoveOffset[GetCurrentRotation()].y; + newX += kMoneyEffectMoveOffset[GetCurrentRotation()].x; MoveTo({ newX, newY, newZ }); diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index 540ff84989..489772deb8 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -20,7 +20,7 @@ #include // TODO: Create constants in sprites.h -static constexpr uint32_t _VehicleCrashParticleSprites[kCrashedVehicleParticleNumberTypes] = { +static constexpr uint32_t kVehicleCrashParticleSprites[kCrashedVehicleParticleNumberTypes] = { 22577, 22589, 22601, 22613, 22625, }; @@ -177,7 +177,7 @@ void VehicleCrashParticle::Paint(PaintSession& session, int32_t imageDirection) return; } - uint32_t imageId = _VehicleCrashParticleSprites[crashed_sprite_base] + frame / 256; + uint32_t imageId = kVehicleCrashParticleSprites[crashed_sprite_base] + frame / 256; auto image = ImageId(imageId, colour[0], colour[1]); PaintAddImageAsParent(session, image, { 0, 0, z }, { 1, 1, 0 }); } diff --git a/src/openrct2/entity/PatrolArea.h b/src/openrct2/entity/PatrolArea.h index f0c1793fd9..3f1de627d7 100644 --- a/src/openrct2/entity/PatrolArea.h +++ b/src/openrct2/entity/PatrolArea.h @@ -17,8 +17,8 @@ // The number of elements in the GameState_t.StaffPatrolAreas array per staff member. Every bit in the array represents a 4x4 // square. Right now, it's a 32-bit array like in RCT2. 32 * 128 = 4096 bits, which is also the number of 4x4 squares on a // 256x256 map. -constexpr size_t STAFF_PATROL_AREA_BLOCKS_PER_LINE = kMaximumMapSizeTechnical / 4; -constexpr size_t STAFF_PATROL_AREA_SIZE = (STAFF_PATROL_AREA_BLOCKS_PER_LINE * STAFF_PATROL_AREA_BLOCKS_PER_LINE) / 32; +constexpr size_t kStaffPatrolAreaBlocksPerLine = kMaximumMapSizeTechnical / 4; +constexpr size_t kStaffPatrolAreaSize = (kStaffPatrolAreaBlocksPerLine * kStaffPatrolAreaBlocksPerLine) / 32; class PatrolArea { diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 95ae2d9957..c1e7560561 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -400,7 +400,7 @@ void Peep::StateReset() } /** rct2: 0x00981D7C, 0x00981D7E */ -static constexpr CoordsXY walkingOffsetByDirection[kNumOrthogonalDirections] = { +static constexpr CoordsXY kWalkingOffsetByDirection[kNumOrthogonalDirections] = { { -2, 0 }, { 0, 2 }, { 2, 0 }, @@ -517,7 +517,7 @@ std::optional Peep::UpdateWalkingAction(const CoordsXY& differenceLoc, Orientation = nextDirection * 8; CoordsXY loc = { x, y }; - loc += walkingOffsetByDirection[nextDirection]; + loc += kWalkingOffsetByDirection[nextDirection]; UpdateWalkingAnimation(); @@ -662,7 +662,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) } if (tileElement == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, kStringIdNone); } // Set the coordinate of destination to be exactly @@ -1452,7 +1452,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_ON_RIDE).Add(STR_NONE); + ft.Add(STR_ON_RIDE).Add(kStringIdNone); } break; } @@ -1466,7 +1466,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } @@ -1560,7 +1560,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } break; @@ -1574,7 +1574,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } @@ -1588,7 +1588,7 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } @@ -1602,14 +1602,14 @@ void Peep::FormatActionTo(Formatter& ft) const } else { - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } break; } } } -static constexpr StringId _staffNames[] = { +static constexpr StringId kStaffNames[] = { STR_HANDYMAN_X, STR_MECHANIC_X, STR_SECURITY_GUARD_X, @@ -1642,12 +1642,12 @@ void Peep::FormatNameTo(Formatter& ft) const else if (isStaff) { auto staffNameIndex = static_cast(staff->AssignedStaffType); - if (staffNameIndex >= std::size(_staffNames)) + if (staffNameIndex >= std::size(kStaffNames)) { staffNameIndex = 0; } - ft.Add(_staffNames[staffNameIndex]); + ft.Add(kStaffNames[staffNameIndex]); ft.Add(PeepId); } else diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index f18a1dc478..0365ed88e2 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -25,7 +25,7 @@ constexpr uint8_t kPeepMinEnergy = 32; constexpr uint8_t kPeepMaxEnergy = 128; constexpr uint8_t kPeepMaxEnergyTarget = 255; // Oddly, this differs from max energy! -constexpr auto PEEP_CLEARANCE_HEIGHT = 4 * kCoordsZStep; +constexpr auto kPeepClearanceHeight = 4 * kCoordsZStep; class Formatter; struct TileElement; diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 0aec15ce01..ae7136ccc1 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -130,7 +130,7 @@ bool Staff::CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) cons uint8_t total = 0; uint8_t pathcount = 0; uint8_t widecount = 0; - for (Direction adjac_dir : ALL_DIRECTIONS) + for (Direction adjac_dir : kAllDirections) { auto adjacPos = staffPos + CoordsXYZ{ CoordsDirectionDelta[adjac_dir].x, CoordsDirectionDelta[adjac_dir].y, 0 }; @@ -585,10 +585,10 @@ Direction Staff::DirectionSurface(Direction initialDirection) const direction &= 3; - if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, direction)) + if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + kPeepClearanceHeight }, direction)) continue; - if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, DirectionReverse(direction))) + if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + kPeepClearanceHeight }, DirectionReverse(direction))) continue; CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[direction]; @@ -989,7 +989,7 @@ GameActions::Result StaffSetColour(StaffType staffType, colour_t value) } /** rct2: 0x009929C8 */ -static constexpr CoordsXY _MowingWaypoints[] = { +static constexpr CoordsXY kMowingWaypoints[] = { { 28, 28 }, { 28, 4 }, { 20, 4 }, { 20, 28 }, { 12, 28 }, { 12, 4 }, { 4, 4 }, { 4, 28 }, }; @@ -1018,13 +1018,13 @@ void Staff::UpdateMowing() SwitchToSpecialSprite(2); } - if (Var37 == std::size(_MowingWaypoints)) + if (Var37 == std::size(kMowingWaypoints)) { StateReset(); return; } - auto destination = _MowingWaypoints[Var37] + NextLoc; + auto destination = kMowingWaypoints[Var37] + NextLoc; SetDestination(destination); if (Var37 != 7) @@ -1436,7 +1436,7 @@ void Staff::UpdateAnswering() } /** rct2: 0x00992A5C */ -static constexpr CoordsXY _WateringUseOffsets[] = { +static constexpr CoordsXY kWateringUseOffsets[] = { { 3, 16 }, { 16, 29 }, { 29, 16 }, { 16, 3 }, { 3, 29 }, { 29, 29 }, { 29, 3 }, { 3, 3 }, }; @@ -1502,7 +1502,7 @@ bool Staff::UpdatePatrollingFindWatering() Var37 = chosen_position; SubState = 0; - auto destination = _WateringUseOffsets[chosen_position] + GetLocation().ToTileStart(); + auto destination = kWateringUseOffsets[chosen_position] + GetLocation().ToTileStart(); SetDestination(destination, 3); return true; @@ -1599,7 +1599,7 @@ bool Staff::UpdatePatrollingFindGrass() Var37 = 0; // Original code used .y for both x and y. Changed to .x to make more sense (both x and y are 28) - auto destination = _MowingWaypoints[0] + NextLoc; + auto destination = kMowingWaypoints[0] + NextLoc; SetDestination(destination, 3); return true; } @@ -2114,7 +2114,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, const Ride& ride) } /** rct2: 0x00992A3C */ -static constexpr CoordsXY _StationFixingOffsets[] = { +static constexpr CoordsXY kStationFixingOffsets[] = { { -12, 0 }, { 0, 12 }, { 12, 0 }, @@ -2151,7 +2151,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride& ride) } int32_t trackDirection = tileElement->GetDirection(); - CoordsXY offset = _StationFixingOffsets[trackDirection]; + CoordsXY offset = kStationFixingOffsets[trackDirection]; stationPos.x += 16 + offset.x; if (offset.x == 0) @@ -2258,7 +2258,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride& ride) // Loc6C12ED: auto destination = CoordsXY{ input.x + 16, input.y + 16 }; - auto offset = _StationFixingOffsets[stationDirection]; + auto offset = kStationFixingOffsets[stationDirection]; destination.x -= offset.x; if (offset.x == 0) diff --git a/src/openrct2/entity/Yaw.hpp b/src/openrct2/entity/Yaw.hpp index df2f214b0d..1c43168e25 100644 --- a/src/openrct2/entity/Yaw.hpp +++ b/src/openrct2/entity/Yaw.hpp @@ -29,10 +29,10 @@ namespace OpenRCT2::Entity::Yaw // Sprites32 represents the precision of the base rotation precision. Base rotation is the precision of // EntityBase.sprite_direction - constexpr int32_t BaseRotation = 32; + constexpr int32_t kBaseRotation = 32; // The first value represents None, the last value represents 64 which has not yet been implemented - constexpr uint8_t PrecisionOffset[] = { 5, 5, 4, 3, 2, 1, 0, 0 }; + constexpr uint8_t kPrecisionOffset[] = { 5, 5, 4, 3, 2, 1, 0, 0 }; [[nodiscard]] constexpr int32_t Add(int32_t yaw1, int32_t yaw2) { @@ -65,7 +65,7 @@ namespace OpenRCT2::Entity::Yaw [[nodiscard]] constexpr int32_t YawToPrecision(int32_t yaw, SpritePrecision precision) { - return yaw >> PrecisionOffset[EnumValue(precision)]; + return yaw >> kPrecisionOffset[EnumValue(precision)]; } [[nodiscard]] constexpr uint8_t NumSpritesPrecision(SpritePrecision precision) diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index b732633506..00e086b554 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -87,7 +87,7 @@ using namespace OpenRCT2; using arguments_t = std::vector; using OpenRCT2::Date; -static constexpr const char* ClimateNames[] = { +static constexpr const char* kClimateNames[] = { "cool_and_wet", "warm", "hot_and_dry", @@ -675,7 +675,7 @@ static void ConsoleCommandGet(InteractiveConsole& console, const arguments_t& ar else if (argv[0] == "climate") { console.WriteFormatLine( - "climate %s (%d)", ClimateNames[EnumValue(gameState.Climate)], EnumValue(gameState.Climate)); + "climate %s (%d)", kClimateNames[EnumValue(gameState.Climate)], EnumValue(gameState.Climate)); } else if (argv[0] == "game_speed") { @@ -925,7 +925,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar { for (newClimate = 0; newClimate < static_cast(ClimateType::Count); newClimate++) { - if (argv[1] == ClimateNames[newClimate]) + if (argv[1] == kClimateNames[newClimate]) { invalidArgs = false; break; @@ -1113,7 +1113,7 @@ static void ConsoleCommandLoadObject(InteractiveConsole& console, const argument // Automatically research the ride so it's supported by the game. const auto* rideEntry = GetRideEntryByIndex(groupIndex); - for (int32_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (int32_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { auto rideType = rideEntry->ride_type[j]; if (rideType != RIDE_TYPE_NULL) @@ -1282,7 +1282,7 @@ static void ConsoleCommandShowLimits(InteractiveConsole& console, [[maybe_unused auto bannerCount = GetNumBanners(); - console.WriteFormatLine("Sprites: %d/%d", spriteCount, MAX_ENTITIES); + console.WriteFormatLine("Sprites: %d/%d", spriteCount, kMaxEntities); console.WriteFormatLine("Map Elements: %zu/%d", tileElementCount, MAX_TILE_ELEMENTS); console.WriteFormatLine("Banners: %d/%zu", bannerCount, MAX_BANNERS); console.WriteFormatLine("Rides: %d/%d", rideCount, OpenRCT2::Limits::kMaxRidesInPark); diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index b2f4942862..8c1cc80880 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -98,11 +98,11 @@ void ScreenshotCheck() Formatter ft; ft.Add(STR_STRING); ft.Add(filename.c_str()); - ContextShowError(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft, true); + ContextShowError(STR_SCREENSHOT_SAVED_AS, kStringIdNone, ft, true); } else { - ContextShowError(STR_SCREENSHOT_FAILED, STR_NONE, {}, true); + ContextShowError(STR_SCREENSHOT_FAILED, kStringIdNone, {}, true); } // redraw_weather(); @@ -360,12 +360,12 @@ void ScreenshotGiant() Formatter ft; ft.Add(STR_STRING); ft.Add(filename.c_str()); - ContextShowError(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft, true); + ContextShowError(STR_SCREENSHOT_SAVED_AS, kStringIdNone, ft, true); } catch (const std::exception& e) { LOG_ERROR("%s", e.what()); - ContextShowError(STR_SCREENSHOT_FAILED, STR_NONE, {}, true); + ContextShowError(STR_SCREENSHOT_FAILED, kStringIdNone, {}, true); } ReleaseDPI(dpi); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index bc4daf17e2..ce878ff588 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -315,14 +315,14 @@ namespace OpenRCT2 auto mapSizeMinus2 = GetMapSizeMinus2(); if (pos.x > mapSizeMinus2.x && pos.y > mapSizeMinus2.y) { - static constexpr CoordsXY corr[] = { + static constexpr CoordsXY kCorr[] = { { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 }, }; - pos.x += corr[rotation].x * height; - pos.y += corr[rotation].y * height; + pos.x += kCorr[rotation].x * height; + pos.y += kCorr[rotation].y * height; } } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 3b43670f68..fc2e3a2efe 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -109,7 +109,7 @@ enum class ViewportVisibility : uint8_t namespace OpenRCT2 { - constexpr uint16_t ViewportInteractionItemAll = std::numeric_limits::max(); + constexpr uint16_t kViewportInteractionItemAll = std::numeric_limits::max(); struct InteractionInfo { diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index e89826f95a..f6ef3ec91d 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -82,7 +82,7 @@ namespace OpenRCT2 StringId text; utf8* string; }; - StringId tooltip{ STR_NONE }; + StringId tooltip{ kStringIdNone }; // New properties WidgetFlags flags{}; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 184c3351e4..80463d2fe4 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2 // converted from uint16_t values at 0x009A41EC - 0x009A4230 // these are percentage coordinates of the viewport to centre to, if a window is obscuring a location, the next is tried // clang-format off -static constexpr float window_scroll_locations[][2] = { +static constexpr float kWindowScrollLocations[][2] = { { 0.5f, 0.5f }, { 0.75f, 0.5f }, { 0.25f, 0.5f }, @@ -598,8 +598,8 @@ static constexpr float window_scroll_locations[][2] = { bool found = false; while (!found) { - auto x2 = w.viewport->pos.x + static_cast(w.viewport->width * window_scroll_locations[i][0]); - auto y2 = w.viewport->pos.y + static_cast(w.viewport->height * window_scroll_locations[i][1]); + auto x2 = w.viewport->pos.x + static_cast(w.viewport->width * kWindowScrollLocations[i][0]); + auto y2 = w.viewport->pos.y + static_cast(w.viewport->height * kWindowScrollLocations[i][1]); auto it = WindowGetIterator(&w); for (; it != g_window_list.end(); it++) @@ -622,7 +622,7 @@ static constexpr float window_scroll_locations[][2] = { { found = true; } - if (i >= static_cast(std::size(window_scroll_locations))) + if (i >= static_cast(std::size(kWindowScrollLocations))) { i = 0; found = true; @@ -635,8 +635,8 @@ static constexpr float window_scroll_locations[][2] = { if (!(w.flags & WF_NO_SCROLLING)) { w.savedViewPos = screenCoords - - ScreenCoordsXY{ static_cast(w.viewport->ViewWidth() * window_scroll_locations[i][0]), - static_cast(w.viewport->ViewHeight() * window_scroll_locations[i][1]) }; + - ScreenCoordsXY{ static_cast(w.viewport->ViewWidth() * kWindowScrollLocations[i][0]), + static_cast(w.viewport->ViewHeight() * kWindowScrollLocations[i][1]) }; w.flags |= WF_SCROLLING_TO_LOCATION; } } @@ -1240,7 +1240,7 @@ static constexpr float window_scroll_locations[][2] = { void WindowFollowSprite(WindowBase& w, EntityId spriteIndex) { - if (spriteIndex.ToUnderlying() < MAX_ENTITIES || spriteIndex.IsNull()) + if (spriteIndex.ToUnderlying() < kMaxEntities || spriteIndex.IsNull()) { w.viewport_smart_follow_sprite = spriteIndex; } diff --git a/src/openrct2/localisation/LocalisationService.cpp b/src/openrct2/localisation/LocalisationService.cpp index f96f68ea84..b5a702db94 100644 --- a/src/openrct2/localisation/LocalisationService.cpp +++ b/src/openrct2/localisation/LocalisationService.cpp @@ -24,13 +24,13 @@ using namespace OpenRCT2; using namespace OpenRCT2::Localisation; -static constexpr uint16_t BASE_OBJECT_STRING_ID = 0x2000; -static constexpr uint16_t MAX_OBJECT_CACHED_STRINGS = 0x5000 - BASE_OBJECT_STRING_ID; +static constexpr uint16_t kBaseObjectStringID = 0x2000; +static constexpr uint16_t kMaxObjectCachedStrings = 0x5000 - kBaseObjectStringID; LocalisationService::LocalisationService(const std::shared_ptr& env) : _env(env) { - for (StringId stringId = BASE_OBJECT_STRING_ID + MAX_OBJECT_CACHED_STRINGS; stringId >= BASE_OBJECT_STRING_ID; stringId--) + for (StringId stringId = kBaseObjectStringID + kMaxObjectCachedStrings; stringId >= kBaseObjectStringID; stringId--) { _availableObjectStringIds.push(stringId); } @@ -41,13 +41,13 @@ LocalisationService::~LocalisationService() = default; const char* LocalisationService::GetString(StringId id) const { - if (id == STR_EMPTY) + if (id == kStringIdEmpty) { return ""; } - else if (id >= BASE_OBJECT_STRING_ID && id < BASE_OBJECT_STRING_ID + MAX_OBJECT_CACHED_STRINGS) + else if (id >= kBaseObjectStringID && id < kBaseObjectStringID + kMaxObjectCachedStrings) { - size_t index = id - BASE_OBJECT_STRING_ID; + size_t index = id - kBaseObjectStringID; if (index < _objectStrings.size()) { return _objectStrings[index].c_str(); @@ -55,7 +55,7 @@ const char* LocalisationService::GetString(StringId id) const return "(unallocated string)"; } - else if (id != STR_NONE) + else if (id != kStringIdNone) { for (const auto& language : _loadedLanguages) { @@ -147,13 +147,13 @@ StringId LocalisationService::AllocateObjectString(const std::string& target) { if (_availableObjectStringIds.empty()) { - return STR_EMPTY; + return kStringIdEmpty; } auto stringId = _availableObjectStringIds.top(); _availableObjectStringIds.pop(); - size_t index = stringId - BASE_OBJECT_STRING_ID; + size_t index = stringId - kBaseObjectStringID; if (index >= _objectStrings.size()) { _objectStrings.resize(index + 1); @@ -165,9 +165,9 @@ StringId LocalisationService::AllocateObjectString(const std::string& target) void LocalisationService::FreeObjectString(StringId stringId) { - if (stringId != STR_EMPTY) + if (stringId != kStringIdEmpty) { - size_t index = stringId - BASE_OBJECT_STRING_ID; + size_t index = stringId - kBaseObjectStringID; if (index < _objectStrings.size()) { _objectStrings[index] = {}; diff --git a/src/openrct2/localisation/StringIdType.h b/src/openrct2/localisation/StringIdType.h index 0513ce9fe4..522a962eea 100644 --- a/src/openrct2/localisation/StringIdType.h +++ b/src/openrct2/localisation/StringIdType.h @@ -13,8 +13,8 @@ using StringId = uint16_t; -constexpr StringId STR_NONE = 0xFFFF; -constexpr StringId STR_EMPTY = 0; +constexpr StringId kStringIdNone = 0xFFFF; +constexpr StringId kStringIdEmpty = 0; constexpr uint16_t kRealNameStart = 0xA000; constexpr uint16_t kRealNameEnd = 0xDFFF; diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 8e3e17b3a1..46f52224ce 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -232,7 +232,7 @@ void ResearchFinishItem(const ResearchItem& researchItem) const auto* rideEntry2 = GetRideEntryByIndex(i); if (rideEntry2 != nullptr) { - for (uint8_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (uint8_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (rideEntry2->ride_type[j] == base_ride_type) { @@ -728,7 +728,7 @@ StringId ResearchItem::GetName() const const auto* rideEntry = GetRideEntryByIndex(entryIndex); if (rideEntry == nullptr) { - return STR_EMPTY; + return kStringIdEmpty; } return rideEntry->naming.Name; @@ -737,7 +737,7 @@ StringId ResearchItem::GetName() const const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); if (sceneryEntry == nullptr) { - return STR_EMPTY; + return kStringIdEmpty; } return sceneryEntry->name; @@ -848,7 +848,7 @@ static void ResearchAddAllMissingItems(bool isResearched) const auto* rideEntry = GetRideEntryByIndex(i); if (rideEntry != nullptr) { - for (uint8_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (uint8_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (seenBaseEntry[rideEntry->ride_type[j]]) { @@ -875,7 +875,7 @@ static void ResearchAddAllMissingItems(bool isResearched) if (rideEntry != nullptr) { bool baseSeen = false; - for (uint8_t j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + for (uint8_t j = 0; j < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; j++) { if (seenBaseEntry[rideEntry->ride_type[j]]) { diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 927cdba6b3..7a736e0f15 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -52,7 +52,7 @@ using namespace OpenRCT2; constexpr uint8_t kNetworkStreamVersion = 4; -const std::string kNetworkStreamID = std::string(OPENRCT2_VERSION) + "-" + std::to_string(kNetworkStreamVersion); +const std::string kNetworkStreamID = std::string(kOpenRCT2Version) + "-" + std::to_string(kNetworkStreamVersion); static Peep* _pickup_peep = nullptr; static int32_t _pickup_peep_old_x = kLocationNull; @@ -616,7 +616,7 @@ void NetworkBase::UpdateClient() Close(); ContextForceCloseWindowByClass(WindowClass::NetworkStatus); - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, kStringIdNone, {}); break; } } @@ -3578,23 +3578,23 @@ GameActions::Result NetworkSetPlayerGroup( NetworkGroup* fromgroup = network.GetGroupByID(actionPlayerId); if (player == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, kStringIdNone); } if (network.GetGroupByID(groupId) == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, kStringIdNone); } if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { return GameActions::Result( - GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, STR_NONE); + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_GROUP_THAT_THE_HOST_BELONGS_TO, kStringIdNone); } if (groupId == 0 && fromgroup != nullptr && fromgroup->Id != 0) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); } if (isExecuting) @@ -3642,7 +3642,7 @@ GameActions::Result NetworkModifyGroups( NetworkGroup* newgroup = network.AddGroup(); if (newgroup == nullptr) { - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_CANT_DO_THIS, kStringIdNone); } } } @@ -3651,14 +3651,14 @@ GameActions::Result NetworkModifyGroups( { if (groupId == 0) { - return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); } for (const auto& it : network.player_list) { if ((it.get())->Group == groupId) { return GameActions::Result( - GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, STR_NONE); + GameActions::Status::Disallowed, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO, kStringIdNone); } } if (isExecuting) @@ -3671,7 +3671,7 @@ GameActions::Result NetworkModifyGroups( { if (groupId == 0) { // can't change admin group permissions - return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_THIS_GROUP_CANNOT_BE_MODIFIED, kStringIdNone); } NetworkGroup* mygroup = nullptr; NetworkPlayer* player = network.GetPlayerByID(actionPlayerId); @@ -3682,7 +3682,8 @@ GameActions::Result NetworkModifyGroups( if (mygroup == nullptr || !mygroup->CanPerformAction(networkPermission)) { return GameActions::Result( - GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, STR_NONE); + GameActions::Status::Disallowed, STR_CANT_MODIFY_PERMISSION_THAT_YOU_DO_NOT_HAVE_YOURSELF, + kStringIdNone); } } if (isExecuting) @@ -3717,7 +3718,7 @@ GameActions::Result NetworkModifyGroups( NetworkGroup* group = network.GetGroupByID(groupId); if (group == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_GROUP, kStringIdNone); } const char* oldName = group->GetName().c_str(); @@ -3746,7 +3747,7 @@ GameActions::Result NetworkModifyGroups( { if (groupId == 0) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_SET_TO_THIS_GROUP, kStringIdNone); } if (isExecuting) { @@ -3778,7 +3779,7 @@ GameActions::Result NetworkKickPlayer(NetworkPlayerId_t playerId, bool isExecuti if (player->Flags & NETWORK_PLAYER_FLAG_ISSERVER) { - return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_KICK_THE_HOST, kStringIdNone); } if (isExecuting) @@ -3814,7 +3815,7 @@ StringId NetworkGetActionNameStringID(uint32_t index) return NetworkActions::Actions[index].Name; } - return STR_NONE; + return kStringIdNone; } int32_t NetworkCanPerformAction(uint32_t groupindex, NetworkPermission index) diff --git a/src/openrct2/object/EntranceObject.cpp b/src/openrct2/object/EntranceObject.cpp index e1a79de643..acab82bdea 100644 --- a/src/openrct2/object/EntranceObject.cpp +++ b/src/openrct2/object/EntranceObject.cpp @@ -71,7 +71,7 @@ void EntranceObject::ReadJson(IReadObjectContext* context, json_t& root) ImageIndex EntranceObject::GetImage(uint8_t sequence, Direction direction) const { if (sequence > 2) - return ImageIndexUndefined; + return kImageIndexUndefined; return _legacyType.image_id + ((direction & 3) * 3) + sequence; } diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index a143dff6ea..351a38391a 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -53,7 +53,7 @@ void FootpathRailingsObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int3 { auto x = width / 2; auto y = height / 2; - auto helper = ImageId(ImageIndexUndefined); + auto helper = ImageId(kImageIndexUndefined); if (Colour != COLOUR_NULL) helper = helper.WithPrimary(Colour); diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index 9299a6c709..036370c030 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -209,7 +209,7 @@ std::string Object::GetName(int32_t language) const ImageIndex Object::LoadImages() { - if (_baseImageId == ImageIndexUndefined) + if (_baseImageId == kImageIndexUndefined) { _baseImageId = GfxObjectAllocateImages(GetImageTable().GetImages(), GetImageTable().GetCount()); } @@ -218,10 +218,10 @@ ImageIndex Object::LoadImages() void Object::UnloadImages() { - if (_baseImageId != ImageIndexUndefined) + if (_baseImageId != kImageIndexUndefined) { GfxObjectFreeImages(_baseImageId, GetImageTable().GetCount()); - _baseImageId = ImageIndexUndefined; + _baseImageId = kImageIndexUndefined; } } diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 5a2871710b..5c13fccefc 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -196,7 +196,7 @@ private: ObjectGeneration _generation{}; bool _usesFallbackImages{}; bool _isCompatibilityObject{}; - ImageIndex _baseImageId{ ImageIndexUndefined }; + ImageIndex _baseImageId{ kImageIndexUndefined }; protected: StringTable& GetStringTable() diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index 484b2c52ee..4251fb4096 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -52,8 +52,8 @@ struct ObjectRepositoryItem struct { uint8_t RideFlags; - uint8_t RideCategory[OpenRCT2::RCT2::ObjectLimits::MaxCategoriesPerRide]; - ride_type_t RideType[OpenRCT2::RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; + uint8_t RideCategory[OpenRCT2::RCT2::ObjectLimits::kMaxCategoriesPerRide]; + ride_type_t RideType[OpenRCT2::RCT2::ObjectLimits::kMaxRideTypesPerRideEntry]; } RideInfo; struct { diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 3c2fc8eb21..d370f5f603 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -119,7 +119,7 @@ static constexpr SpritePrecision PrecisionFromNumFrames(uint32_t numRotationFram static void RideObjectUpdateRideType(RideObjectEntry& rideEntry) { - for (auto i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (auto i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { auto oldRideType = rideEntry.ride_type[i]; if (oldRideType != RIDE_TYPE_NULL) @@ -202,7 +202,7 @@ void RideObject::ReadLegacy(IReadObjectContext* context, IStream* stream) } // Read peep loading positions - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxCarTypesPerRideEntry; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxCarTypesPerRideEntry; i++) { _peepLoadingWaypoints[i].clear(); _peepLoadingPositions[i].clear(); @@ -274,8 +274,8 @@ void RideObject::Load() _legacyType.images_offset = LoadImages(); _legacyType.vehicle_preset_list = &_presetColours; - int32_t currentCarImagesOffset = _legacyType.images_offset + RCT2::ObjectLimits::MaxRideTypesPerRideEntry; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxCarTypesPerRideEntry; i++) + int32_t currentCarImagesOffset = _legacyType.images_offset + RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxCarTypesPerRideEntry; i++) { CarEntry& carEntry = _legacyType.Cars[i]; if (carEntry.GroupEnabled(SpriteGroupType::SlopeFlat)) @@ -378,7 +378,7 @@ ImageIndex RideObject::GetPreviewImage(ride_type_t type) auto it = std::find(std::begin(_legacyType.ride_type), std::end(_legacyType.ride_type), type); if (it == std::end(_legacyType.ride_type)) { - return ImageIndexUndefined; + return kImageIndexUndefined; } return _legacyType.images_offset + std::distance(std::begin(_legacyType.ride_type), it); @@ -390,11 +390,11 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem* item) const auto firstRideType = _legacyType.GetFirstNonNullRideType(); uint8_t category = GetRideTypeDescriptor(firstRideType).Category; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { item->RideInfo.RideType[i] = _legacyType.ride_type[i]; } - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxCategoriesPerRide; i++) + for (int32_t i = 0; i < RCT2::ObjectLimits::kMaxCategoriesPerRide; i++) { item->RideInfo.RideCategory[i] = category; } @@ -526,7 +526,7 @@ void RideObject::ReadJson(IReadObjectContext* context, json_t& root) json_t rideTypes = Json::AsArray(properties["type"]); size_t numRideTypes = rideTypes.size(); - for (size_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (size_t i = 0; i < RCT2::ObjectLimits::kMaxRideTypesPerRideEntry; i++) { auto rideType = RIDE_TYPE_NULL; @@ -572,7 +572,7 @@ void RideObject::ReadJson(IReadObjectContext* context, json_t& root) // Shop item auto rideSells = Json::AsArray(properties["sells"]); - auto numShopItems = std::min(static_cast(RCT2::ObjectLimits::MaxShopItemsPerRideEntry), rideSells.size()); + auto numShopItems = std::min(static_cast(RCT2::ObjectLimits::kMaxShopItemsPerRideEntry), rideSells.size()); for (size_t i = 0; i < numShopItems; i++) { auto shopItem = ParseShopItem(Json::GetString(rideSells[i])); diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index aae4b3bc3e..d2b6581271 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -22,8 +22,8 @@ class RideObject final : public Object private: RideObjectEntry _legacyType = {}; VehicleColourPresetList _presetColours = {}; - std::vector _peepLoadingPositions[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; - std::vector> _peepLoadingWaypoints[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + std::vector _peepLoadingPositions[OpenRCT2::RCT2::ObjectLimits::kMaxCarTypesPerRideEntry]; + std::vector> _peepLoadingWaypoints[OpenRCT2::RCT2::ObjectLimits::kMaxCarTypesPerRideEntry]; public: static constexpr ObjectType kObjectType = ObjectType::Ride; diff --git a/src/openrct2/object/StationObject.cpp b/src/openrct2/object/StationObject.cpp index 428ace48e0..e009773f0b 100644 --- a/src/openrct2/object/StationObject.cpp +++ b/src/openrct2/object/StationObject.cpp @@ -42,8 +42,8 @@ void StationObject::Unload() UnloadImages(); NameStringId = 0; - BaseImageId = ImageIndexUndefined; - ShelterImageId = ImageIndexUndefined; + BaseImageId = kImageIndexUndefined; + ShelterImageId = kImageIndexUndefined; } void StationObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int32_t height) const diff --git a/src/openrct2/object/StationObject.h b/src/openrct2/object/StationObject.h index 89a97eeb58..f15d559598 100644 --- a/src/openrct2/object/StationObject.h +++ b/src/openrct2/object/StationObject.h @@ -27,8 +27,8 @@ public: static constexpr ObjectType kObjectType = ObjectType::Station; StringId NameStringId{}; - ImageIndex BaseImageId = ImageIndexUndefined; - ImageIndex ShelterImageId = ImageIndexUndefined; + ImageIndex BaseImageId = kImageIndexUndefined; + ImageIndex ShelterImageId = kImageIndexUndefined; uint32_t Flags{}; int32_t Height{}; uint8_t ScrollingMode{}; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 42b8794887..52f7fcdd41 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -130,7 +130,7 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3 } auto stationObj = ride->GetStationObject(); - if (stationObj == nullptr || stationObj->BaseImageId == ImageIndexUndefined) + if (stationObj == nullptr || stationObj->BaseImageId == kImageIndexUndefined) { return; } diff --git a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp index ddf3c65bc1..943e3c66ca 100644 --- a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp +++ b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp @@ -43,7 +43,7 @@ static ImageIndex GetFootpathLampImage(const PathAdditionEntry& pathAdditionEntr { auto offset = GetEdgeImageOffset(edge); if (offset == 0) - return ImageIndexUndefined; + return kImageIndexUndefined; return pathAdditionEntry.image + offset + (isBroken ? 4 : 0); } @@ -51,7 +51,7 @@ static ImageIndex GetFootpathBinImage(const PathAdditionEntry& pathAdditionEntry { auto offset = GetEdgeImageOffset(edge); if (offset == 0) - return ImageIndexUndefined; + return kImageIndexUndefined; auto stateOffset = isBroken ? 4 : (isFull ? 8 : 0); return pathAdditionEntry.image + offset + stateOffset; @@ -61,7 +61,7 @@ static ImageIndex GetFootpathBenchImage(const PathAdditionEntry& pathAdditionEnt { auto offset = GetEdgeImageOffset(edge); if (offset == 0) - return ImageIndexUndefined; + return kImageIndexUndefined; return pathAdditionEntry.image + offset + (isBroken ? 4 : 0); } diff --git a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp index 56762e7b82..4249fea446 100644 --- a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp @@ -606,7 +606,7 @@ static void classicStandUpRCTrackLeftEighthBankToDiag( kClassicStandUpRcLeftBankedOrthogonalToDiag2_1, kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 }, { kClassicStandUpRcLeftBankedOrthogonalToDiag0_2, kClassicStandUpRcLeftBankedOrthogonalToDiag1_2, kClassicStandUpRcLeftBankedOrthogonalToDiag2_2, kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined }, { kClassicStandUpRcLeftBankedOrthogonalToDiag0_3, kClassicStandUpRcLeftBankedOrthogonalToDiag1_3, kClassicStandUpRcLeftBankedOrthogonalToDiag2_3, kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 }, }; @@ -760,7 +760,7 @@ static void classicStandUpRCTrackRightEighthBankToDiag( kClassicStandUpRcRightBankedOrthogonalToDiag2_1, kClassicStandUpRcRightBankedOrthogonalToDiag3_1 }, { kClassicStandUpRcRightBankedOrthogonalToDiag0_2, kClassicStandUpRcRightBankedOrthogonalToDiag1_2, kClassicStandUpRcRightBankedOrthogonalToDiag2_2, kClassicStandUpRcRightBankedOrthogonalToDiag3_2 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined }, { kClassicStandUpRcRightBankedOrthogonalToDiag0_3, kClassicStandUpRcRightBankedOrthogonalToDiag1_3, kClassicStandUpRcRightBankedOrthogonalToDiag2_3, kClassicStandUpRcRightBankedOrthogonalToDiag3_3 }, }; @@ -928,7 +928,7 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( static constexpr ImageIndex map[4][kNumOrthogonalDirections] = { { kClassicStandUpRcRightTurn3TilesBanked0_0, kClassicStandUpRcRightTurn3TilesBanked1_0, kClassicStandUpRcRightTurn3TilesBanked2_0, kClassicStandUpRcRightTurn3TilesBanked3_0 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined, kImageIndexUndefined }, { kClassicStandUpRcRightTurn3TilesBanked0_1, kClassicStandUpRcRightTurn3TilesBanked1_1, kClassicStandUpRcRightTurn3TilesBanked2_1, kClassicStandUpRcRightTurn3TilesBanked3_1 }, diff --git a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp index 49da80a587..3b4a541df5 100644 --- a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp @@ -233,7 +233,7 @@ static constexpr std::array kFlatT }, { SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_FRONT_NW_SE, }, { @@ -241,7 +241,7 @@ static constexpr std::array kFlatT }, { SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_SE_NW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_FLAT_TO_LEFT_BANK_FRONT_SE_NW, }, } }; @@ -255,7 +255,7 @@ static constexpr std::array kFlatT }, { SPR_CLASSIC_WOODEN_RC_FLAT_TO_RIGHT_BANK_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_FLAT_TO_RIGHT_BANK_FRONT_NE_SW, }, { @@ -276,12 +276,12 @@ static constexpr std::array kUp25T }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_LEFT_BANK_FRONT_NE_SW, }, { @@ -295,12 +295,12 @@ static constexpr std::array kUp25T }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_25_UP_TO_RIGHT_BANK_FRONT_NE_SW, }, { @@ -314,12 +314,12 @@ static constexpr std::array kLeftB }, { SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_LEFT_BANK_TO_25_UP_FRONT_NE_SW, }, { @@ -332,12 +332,12 @@ static constexpr std::array kRight }, { SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_NW_SE, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_FRONT_NW_SE, }, { SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_NE_SW, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_RIGHT_BANK_TO_25_UP_FRONT_NE_SW, }, { @@ -348,7 +348,7 @@ static constexpr std::array kRight static constexpr std::array kDiagFlatToLeftBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_FRONT_0, }, { @@ -356,7 +356,7 @@ static constexpr std::array kDiagF }, { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_LEFT_BANK_FRONT_2, }, { @@ -367,7 +367,7 @@ static constexpr std::array kDiagF static constexpr std::array kDiagFlatToRightBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_FRONT_0, }, { @@ -375,7 +375,7 @@ static constexpr std::array kDiagF }, { SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_FLAT_TO_RIGHT_BANK_FRONT_2, }, { @@ -386,7 +386,7 @@ static constexpr std::array kDiagF static constexpr std::array kDiagLeftBankTo25DegUpImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_FRONT_0, }, { @@ -394,7 +394,7 @@ static constexpr std::array kDiagL }, { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_TO_25_UP_FRONT_2, }, { @@ -405,7 +405,7 @@ static constexpr std::array kDiagL static constexpr std::array kDiagRightBankTo25DegUpImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_FRONT_0, }, { @@ -413,7 +413,7 @@ static constexpr std::array kDiagR }, { SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_RIGHT_BANK_TO_25_UP_FRONT_2, }, { @@ -424,7 +424,7 @@ static constexpr std::array kDiagR static constexpr std::array kDiagUp25ToLeftBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_FRONT_0, }, { @@ -432,7 +432,7 @@ static constexpr std::array kDiagU }, { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_LEFT_BANK_FRONT_2, }, { @@ -443,7 +443,7 @@ static constexpr std::array kDiagU static constexpr std::array kDiagLeftBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_FRONT_0, }, { @@ -451,7 +451,7 @@ static constexpr std::array kDiagL }, { SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_LEFT_BANK_FRONT_2, }, { @@ -462,7 +462,7 @@ static constexpr std::array kDiagL static constexpr std::array kDiagUp25ToRightBankImages = { { { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_0, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_FRONT_0, }, { @@ -470,7 +470,7 @@ static constexpr std::array kDiagU }, { SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_2, - ImageIndexUndefined, + kImageIndexUndefined, SPR_CLASSIC_WOODEN_RC_DIAG_25_UP_TO_RIGHT_BANK_FRONT_2, }, { @@ -485,7 +485,7 @@ static constexpr std::array( session, direction, imageIds[direction].track, imageIds[direction].handrail, { 0, 0, height }, { { 0, 3, height }, { 32, 25, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, { 0, 0, height }, @@ -194,7 +194,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -210,7 +210,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -231,7 +231,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -247,7 +247,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -268,7 +268,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -284,7 +284,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -323,7 +323,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -339,7 +339,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -360,7 +360,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -376,7 +376,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -397,7 +397,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -413,7 +413,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -434,7 +434,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -450,7 +450,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -471,7 +471,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 32, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -487,7 +487,7 @@ static void WoodenRCTrackBankedRightQuarterTurn5( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -549,7 +549,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -569,7 +569,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -635,7 +635,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -651,7 +651,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -683,7 +683,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -703,7 +703,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -747,7 +747,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][3].track, imageIds[0][3].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][3].frontTrack != ImageIndexUndefined) + if (imageIds[0][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][3].frontTrack, imageIds[0][3].frontHandrail, { 0, 0, height }, @@ -767,7 +767,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][1].track, imageIds[0][1].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][1].frontTrack != ImageIndexUndefined) + if (imageIds[0][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][1].frontTrack, imageIds[0][1].frontHandrail, { 0, 0, height }, @@ -840,7 +840,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][3].track, imageIds[1][3].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][3].frontTrack != ImageIndexUndefined) + if (imageIds[1][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][3].frontTrack, imageIds[1][3].frontHandrail, { 0, 0, height }, @@ -856,7 +856,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][1].track, imageIds[1][1].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][1].frontTrack != ImageIndexUndefined) + if (imageIds[1][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][1].frontTrack, imageIds[1][1].frontHandrail, { 0, 0, height }, @@ -886,7 +886,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][3].track, imageIds[2][3].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[2][3].frontTrack != ImageIndexUndefined) + if (imageIds[2][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][3].frontTrack, imageIds[2][3].frontHandrail, { 0, 0, height }, @@ -906,7 +906,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][1].track, imageIds[2][1].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[2][1].frontTrack != ImageIndexUndefined) + if (imageIds[2][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][1].frontTrack, imageIds[2][1].frontHandrail, { 0, 0, height }, @@ -963,7 +963,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -983,7 +983,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -1051,7 +1051,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1067,7 +1067,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1097,7 +1097,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1117,7 +1117,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1175,7 +1175,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][2].track, imageIds[0][2].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][2].frontTrack != ImageIndexUndefined) + if (imageIds[0][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][2].frontTrack, imageIds[0][2].frontHandrail, { 0, 0, height }, @@ -1195,7 +1195,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[0][0].track, imageIds[0][0].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][0].frontTrack != ImageIndexUndefined) + if (imageIds[0][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][0].frontTrack, imageIds[0][0].frontHandrail, { 0, 0, height }, @@ -1266,7 +1266,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][2].track, imageIds[1][2].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[1][2].frontTrack != ImageIndexUndefined) + if (imageIds[1][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][2].frontTrack, imageIds[1][2].frontHandrail, { 0, 0, height }, @@ -1282,7 +1282,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[1][0].track, imageIds[1][0].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[1][0].frontTrack != ImageIndexUndefined) + if (imageIds[1][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][0].frontTrack, imageIds[1][0].frontHandrail, { 0, 0, height }, @@ -1314,7 +1314,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][2].track, imageIds[2][2].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[2][2].frontTrack != ImageIndexUndefined) + if (imageIds[2][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][2].frontTrack, imageIds[2][2].frontHandrail, { 0, 0, height }, @@ -1334,7 +1334,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( WoodenRCTrackPaint( session, direction, imageIds[2][0].track, imageIds[2][0].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[2][0].frontTrack != ImageIndexUndefined) + if (imageIds[2][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][0].frontTrack, imageIds[2][0].frontHandrail, { 0, 0, height }, @@ -1391,7 +1391,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -1411,7 +1411,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -1466,7 +1466,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1486,7 +1486,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -1520,7 +1520,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1540,7 +1540,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -1591,7 +1591,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -1611,7 +1611,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -1645,7 +1645,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -1665,7 +1665,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -1709,7 +1709,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][3].track, imageIds[0][3].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][3].frontTrack != ImageIndexUndefined) + if (imageIds[0][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][3].frontTrack, imageIds[0][3].frontHandrail, { 0, 0, height }, @@ -1729,7 +1729,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][1].track, imageIds[0][1].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[0][1].frontTrack != ImageIndexUndefined) + if (imageIds[0][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][1].frontTrack, imageIds[0][1].frontHandrail, { 0, 0, height }, @@ -1788,7 +1788,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][3].track, imageIds[1][3].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][3].frontTrack != ImageIndexUndefined) + if (imageIds[1][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][3].frontTrack, imageIds[1][3].frontHandrail, { 0, 0, height }, @@ -1808,7 +1808,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][1].track, imageIds[1][1].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][1].frontTrack != ImageIndexUndefined) + if (imageIds[1][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][1].frontTrack, imageIds[1][1].frontHandrail, { 0, 0, height }, @@ -1842,7 +1842,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][3].track, imageIds[2][3].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][3].frontTrack != ImageIndexUndefined) + if (imageIds[2][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][3].frontTrack, imageIds[2][3].frontHandrail, { 0, 0, height }, @@ -1862,7 +1862,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][1].track, imageIds[2][1].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][1].frontTrack != ImageIndexUndefined) + if (imageIds[2][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][1].frontTrack, imageIds[2][1].frontHandrail, { 0, 0, height }, @@ -1911,7 +1911,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][3].track, imageIds[3][3].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[3][3].frontTrack != ImageIndexUndefined) + if (imageIds[3][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][3].frontTrack, imageIds[3][3].frontHandrail, { 0, 0, height }, @@ -1931,7 +1931,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][1].track, imageIds[3][1].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[3][1].frontTrack != ImageIndexUndefined) + if (imageIds[3][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][1].frontTrack, imageIds[3][1].frontHandrail, { 0, 0, height }, @@ -1965,7 +1965,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][3].track, imageIds[4][3].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[4][3].frontTrack != ImageIndexUndefined) + if (imageIds[4][3].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][3].frontTrack, imageIds[4][3].frontHandrail, { 0, 0, height }, @@ -1985,7 +1985,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][1].track, imageIds[4][1].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[4][1].frontTrack != ImageIndexUndefined) + if (imageIds[4][1].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][1].frontTrack, imageIds[4][1].frontHandrail, { 0, 0, height }, @@ -2042,7 +2042,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2062,7 +2062,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2116,7 +2116,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2136,7 +2136,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2170,7 +2170,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -2190,7 +2190,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -2239,7 +2239,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -2259,7 +2259,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -2293,7 +2293,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -2313,7 +2313,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][direction].track, imageIds[4][direction].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[4][direction].frontTrack != ImageIndexUndefined) + if (imageIds[4][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][direction].frontTrack, imageIds[4][direction].frontHandrail, @@ -2371,7 +2371,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][2].track, imageIds[0][2].handrail, { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - if (imageIds[0][2].frontTrack != ImageIndexUndefined) + if (imageIds[0][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][2].frontTrack, imageIds[0][2].frontHandrail, { 0, 0, height }, @@ -2391,7 +2391,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[0][0].track, imageIds[0][0].handrail, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[0][0].frontTrack != ImageIndexUndefined) + if (imageIds[0][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][0].frontTrack, imageIds[0][0].frontHandrail, { 0, 0, height }, @@ -2451,7 +2451,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][2].track, imageIds[1][2].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][2].frontTrack != ImageIndexUndefined) + if (imageIds[1][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][2].frontTrack, imageIds[1][2].frontHandrail, { 0, 0, height }, @@ -2471,7 +2471,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[1][0].track, imageIds[1][0].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 32, 2 } }); - if (imageIds[1][0].frontTrack != ImageIndexUndefined) + if (imageIds[1][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][0].frontTrack, imageIds[1][0].frontHandrail, { 0, 0, height }, @@ -2505,7 +2505,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][2].track, imageIds[2][2].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][2].frontTrack != ImageIndexUndefined) + if (imageIds[2][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][2].frontTrack, imageIds[2][2].frontHandrail, { 0, 0, height }, @@ -2525,7 +2525,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[2][0].track, imageIds[2][0].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][0].frontTrack != ImageIndexUndefined) + if (imageIds[2][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][0].frontTrack, imageIds[2][0].frontHandrail, { 0, 0, height }, @@ -2576,7 +2576,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][2].track, imageIds[3][2].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 16, 2 } }); - if (imageIds[3][2].frontTrack != ImageIndexUndefined) + if (imageIds[3][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][2].frontTrack, imageIds[3][2].frontHandrail, { 0, 0, height }, @@ -2596,7 +2596,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[3][0].track, imageIds[3][0].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[3][0].frontTrack != ImageIndexUndefined) + if (imageIds[3][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][0].frontTrack, imageIds[3][0].frontHandrail, { 0, 0, height }, @@ -2630,7 +2630,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][2].track, imageIds[4][2].handrail, { 0, 0, height }, { { 0, 2, height }, { 32, 27, 2 } }); - if (imageIds[4][2].frontTrack != ImageIndexUndefined) + if (imageIds[4][2].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][2].frontTrack, imageIds[4][2].frontHandrail, { 0, 0, height }, @@ -2650,7 +2650,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( WoodenRCTrackPaint( session, direction, imageIds[4][0].track, imageIds[4][0].handrail, { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 2 } }); - if (imageIds[4][0].frontTrack != ImageIndexUndefined) + if (imageIds[4][0].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[4][0].frontTrack, imageIds[4][0].frontHandrail, { 0, 0, height }, @@ -2707,7 +2707,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2727,7 +2727,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2772,7 +2772,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2785,7 +2785,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2798,7 +2798,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2838,7 +2838,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2858,7 +2858,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 6, height }, { { 0, 6, height }, { 32, 20, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -2903,7 +2903,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2916,7 +2916,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2929,7 +2929,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 6, 0, height }, { { 6, 0, height }, { 20, 32, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -2986,7 +2986,7 @@ static void WoodenRCTrackDiagFlatToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3002,7 +3002,7 @@ static void WoodenRCTrackDiagFlatToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3054,7 +3054,7 @@ static void WoodenRCTrackDiagBankTo25DegUp( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3070,7 +3070,7 @@ static void WoodenRCTrackDiagBankTo25DegUp( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3122,7 +3122,7 @@ static void WoodenRCTrackDiagUp25ToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3138,7 +3138,7 @@ static void WoodenRCTrackDiagUp25ToBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3190,7 +3190,7 @@ static void WoodenRCTrackDiagLeftBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3206,7 +3206,7 @@ static void WoodenRCTrackDiagLeftBank( WoodenRCTrackPaint( session, direction, imageIds[direction].track, imageIds[direction].handrail, { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); - if (imageIds[direction].frontTrack != ImageIndexUndefined) + if (imageIds[direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[direction].frontTrack, imageIds[direction].frontHandrail, @@ -3253,7 +3253,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3269,7 +3269,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3294,7 +3294,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 34, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3310,7 +3310,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3331,7 +3331,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 16, 16, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3347,7 +3347,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3368,7 +3368,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 16, 18, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -3384,7 +3384,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 16, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -3416,7 +3416,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3432,7 +3432,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[0][direction].track, imageIds[0][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 2 } }); - if (imageIds[0][direction].frontTrack != ImageIndexUndefined) + if (imageIds[0][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[0][direction].frontTrack, imageIds[0][direction].frontHandrail, @@ -3457,7 +3457,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 32, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3473,7 +3473,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[1][direction].track, imageIds[1][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 34, 16, 2 } }); - if (imageIds[1][direction].frontTrack != ImageIndexUndefined) + if (imageIds[1][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[1][direction].frontTrack, imageIds[1][direction].frontHandrail, @@ -3494,7 +3494,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 0, 0, height }, { 16, 16, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3510,7 +3510,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[2][direction].track, imageIds[2][direction].handrail, { 0, 0, height }, { { 4, 4, height }, { 28, 28, 2 } }); - if (imageIds[2][direction].frontTrack != ImageIndexUndefined) + if (imageIds[2][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[2][direction].frontTrack, imageIds[2][direction].frontHandrail, @@ -3531,7 +3531,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 16, 0, height }, { 16, 16, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, @@ -3547,7 +3547,7 @@ static void WoodenRCTrackRightEighthBankToDiag( WoodenRCTrackPaint( session, direction, imageIds[3][direction].track, imageIds[3][direction].handrail, { 0, 0, height }, { { 0, 16, height }, { 16, 18, 2 } }); - if (imageIds[3][direction].frontTrack != ImageIndexUndefined) + if (imageIds[3][direction].frontTrack != kImageIndexUndefined) { WoodenRCTrackPaint( session, direction, imageIds[3][direction].frontTrack, imageIds[3][direction].frontHandrail, diff --git a/src/openrct2/paint/vehicle/VehiclePaint.cpp b/src/openrct2/paint/vehicle/VehiclePaint.cpp index 953b8da286..a85c51f1cb 100644 --- a/src/openrct2/paint/vehicle/VehiclePaint.cpp +++ b/src/openrct2/paint/vehicle/VehiclePaint.cpp @@ -4301,8 +4301,8 @@ void VehicleVisualDefault( if (vehicle->HasFlag(VehicleFlags::CarIsReversed)) { auto imagePitch = PitchInvertTable[vehicle->Pitch]; - auto imageYaw = (imageDirection + (OpenRCT2::Entity::Yaw::BaseRotation / 2)) - & (OpenRCT2::Entity::Yaw::BaseRotation - 1); + auto imageYaw = (imageDirection + (OpenRCT2::Entity::Yaw::kBaseRotation / 2)) + & (OpenRCT2::Entity::Yaw::kBaseRotation - 1); PaintFunctionsByPitch[imagePitch](session, vehicle, imageYaw, z, carEntry); } else diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index b6df72a670..661d86b6e7 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -117,7 +117,7 @@ namespace OpenRCT2 void ThrowIfIncompatibleVersion() { const auto& header = _os->GetHeader(); - if (/*header.TargetVersion < PARK_FILE_MIN_SUPPORTED_VERSION || */ header.MinVersion > PARK_FILE_CURRENT_VERSION) + if (/*header.TargetVersion < kParkFileMinSupportedVersion || */ header.MinVersion > kParkFileCurrentVersion) { throw UnsupportedVersionException(header.MinVersion, header.TargetVersion); } @@ -129,7 +129,7 @@ namespace OpenRCT2 const auto& header = _os->GetHeader(); minVersion = header.MinVersion; targetVersion = header.TargetVersion; - return targetVersion > PARK_FILE_CURRENT_VERSION; + return targetVersion > kParkFileCurrentVersion; } void Load(const std::string_view path) @@ -179,9 +179,9 @@ namespace OpenRCT2 OrcaStream os(stream, OrcaStream::Mode::WRITING); auto& header = os.GetHeader(); - header.Magic = PARK_FILE_MAGIC; - header.TargetVersion = PARK_FILE_CURRENT_VERSION; - header.MinVersion = PARK_FILE_MIN_VERSION; + header.Magic = kParkFileMagic; + header.TargetVersion = kParkFileCurrentVersion; + header.MinVersion = kParkFileMinVersion; ReadWriteAuthoringChunk(os); ReadWriteObjectsChunk(os); @@ -1924,7 +1924,7 @@ namespace OpenRCT2 cs.ReadWrite(item); if (item == 255) { - thought.item = PeepThoughtItemNone; + thought.item = kPeepThoughtItemNone; } else { diff --git a/src/openrct2/park/ParkFile.h b/src/openrct2/park/ParkFile.h index e4ed437652..0d4fafcf72 100644 --- a/src/openrct2/park/ParkFile.h +++ b/src/openrct2/park/ParkFile.h @@ -11,16 +11,16 @@ namespace OpenRCT2 struct GameState_t; // Current version that is saved. - constexpr uint32_t PARK_FILE_CURRENT_VERSION = 50; + constexpr uint32_t kParkFileCurrentVersion = 50; // The minimum version that is forwards compatible with the current version. - constexpr uint32_t PARK_FILE_MIN_VERSION = 50; + constexpr uint32_t kParkFileMinVersion = 50; // The minimum version that is backwards compatible with the current version. // If this is increased beyond 0, uncomment the checks in ParkFile.cpp and Context.cpp! - constexpr uint32_t PARK_FILE_MIN_SUPPORTED_VERSION = 0x0; + constexpr uint32_t kParkFileMinSupportedVersion = 0x0; - constexpr uint32_t PARK_FILE_MAGIC = 0x4B524150; // PARK + constexpr uint32_t kParkFileMagic = 0x4B524150; // PARK struct IStream; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index d243574cd7..cce333e31a 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -467,7 +467,7 @@ namespace OpenRCT2::PathFinding edges &= ~(1 << DirectionReverse(chosenDirection)); loc.z = tileElement->BaseHeight; - for (Direction dir : ALL_DIRECTIONS) + for (Direction dir : kAllDirections) { if (!(edges & (1 << dir))) continue; @@ -1911,7 +1911,7 @@ namespace OpenRCT2::PathFinding /* If this tileElement is adjacent to any non-wide paths, * remove all of the edges to wide paths. */ uint8_t adjustedEdges = edges; - for (Direction chosenDirection : ALL_DIRECTIONS) + for (Direction chosenDirection : kAllDirections) { // If there is no path in that direction try another if (!(adjustedEdges & (1 << chosenDirection))) @@ -1981,7 +1981,7 @@ namespace OpenRCT2::PathFinding if (!peep.HasFoodOrDrink() && (ScenarioRand() & 0xFFFF) >= 2184) { uint8_t adjustedEdges = edges; - for (Direction chosenDirection : ALL_DIRECTIONS) + for (Direction chosenDirection : kAllDirections) { // If there is no path in that direction try another if (!(adjustedEdges & (1 << chosenDirection))) diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index b808612d15..2b4d67fc13 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -169,7 +169,7 @@ static bool OnCrash( wprintf(L"Dump Path: %s\n", dumpPath); wprintf(L"Dump File Path: %s\n", dumpFilePath); wprintf(L"Dump Id: %s\n", miniDumpId); - wprintf(L"Version: %s\n", WSZ(OPENRCT2_VERSION)); + wprintf(L"Version: %s\n", WSZ(kOpenRCT2Version)); wprintf(L"Commit: %s\n", _wszCommitSha1Short); bool savedGameDumped = false; @@ -253,7 +253,7 @@ static bool OnCrash( L"We would like to upload the crash dump for automated analysis, do you agree?\n" L"The automated analysis is done by courtesy of https://backtrace.io/"; wchar_t message[MAX_PATH * 2]; - swprintf_s(message, MessageFormat, dumpFilePath, WSZ(OPENRCT2_VERSION), _wszCommitSha1Short); + swprintf_s(message, MessageFormat, dumpFilePath, WSZ(kOpenRCT2Version), _wszCommitSha1Short); // Cannot use platform_show_messagebox here, it tries to set parent window already dead. int answer = MessageBoxW(nullptr, message, WSZ(OPENRCT2_NAME), MB_YESNO | MB_ICONERROR); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 34be3cf4f9..bea9e9f18a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2920,7 +2920,7 @@ namespace OpenRCT2::RCT1 auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->Type); if (srcThought->Item == RCT12PeepThoughtItemNone) - dstThought->item = PeepThoughtItemNone; + dstThought->item = kPeepThoughtItemNone; else dstThought->item = srcThought->Item; dstThought->freshness = srcThought->Freshness; diff --git a/src/openrct2/rct2/DATLimits.h b/src/openrct2/rct2/DATLimits.h index 7753557762..06c9dda639 100644 --- a/src/openrct2/rct2/DATLimits.h +++ b/src/openrct2/rct2/DATLimits.h @@ -12,10 +12,10 @@ namespace OpenRCT2::RCT2::ObjectLimits { - constexpr uint8_t MaxCategoriesPerRide = 2; - constexpr uint8_t MaxRideTypesPerRideEntry = 3; + constexpr uint8_t kMaxCategoriesPerRide = 2; + constexpr uint8_t kMaxRideTypesPerRideEntry = 3; // The max number of different types of car. // Examples of cars here are the locomotive, tender and carriage of the Miniature Railway. - constexpr uint8_t MaxCarTypesPerRideEntry = 4; - constexpr uint8_t MaxShopItemsPerRideEntry = 2; + constexpr uint8_t kMaxCarTypesPerRideEntry = 4; + constexpr uint8_t kMaxShopItemsPerRideEntry = 2; } // namespace OpenRCT2::RCT2::ObjectLimits diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index d4cdd8cb63..bbe8ce81c8 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -26,10 +26,10 @@ enum class VehicleColourSettings : uint8_t; namespace OpenRCT2::RCT2 { - constexpr StringId RCT2_RIDE_STRING_START = 2; + constexpr StringId kRCT2RideStringStart = 2; // clang-format off - constexpr uint16_t RCT2_OBJECT_ENTRY_COUNT = + constexpr uint16_t kRCT2ObjectEntryCount = Limits::kMaxRideObjects + Limits::kMaxSmallSceneryObjects + Limits::kMaxLargeSceneryObjects + @@ -42,10 +42,10 @@ namespace OpenRCT2::RCT2 Limits::kMaxWaterObjects + Limits::kMaxScenarioTextObjects; // clang-format on - static_assert(RCT2_OBJECT_ENTRY_COUNT == 721); + static_assert(kRCT2ObjectEntryCount == 721); // clang-format off - constexpr int32_t RCT2ObjectEntryGroupCounts[] = { + constexpr int32_t kRCT2ObjectEntryGroupCounts[] = { Limits::kMaxRideObjects, Limits::kMaxSmallSceneryObjects, Limits::kMaxLargeSceneryObjects, @@ -784,7 +784,7 @@ namespace OpenRCT2::RCT2 // SC6[3] union { - RCTObjectEntry Objects[RCT2_OBJECT_ENTRY_COUNT]; + RCTObjectEntry Objects[kRCT2ObjectEntryCount]; struct { RCTObjectEntry RideObjects[Limits::kMaxRideObjects]; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 3f3b960d8a..6097ad1b3a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -450,7 +450,7 @@ namespace OpenRCT2::RCT2 // In RCT2, the ride string IDs start at index STR_0002 and are directly mappable. // This is not always the case in OpenRCT2, so we use the actual ride ID. if (gameState.ScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST) - gameState.ScenarioObjective.RideId = _s6.ObjectiveGuests - RCT2_RIDE_STRING_START; + gameState.ScenarioObjective.RideId = _s6.ObjectiveGuests - kRCT2RideStringStart; else gameState.ScenarioObjective.NumGuests = _s6.ObjectiveGuests; ImportMarketingCampaigns(); @@ -1809,7 +1809,7 @@ namespace OpenRCT2::RCT2 ObjectEntryIndex railingCount = 0; for (int16_t objectType = EnumValue(ObjectType::Ride); objectType <= EnumValue(ObjectType::Water); objectType++) { - for (int16_t i = 0; i < RCT2ObjectEntryGroupCounts[objectType]; i++, objectIt++) + for (int16_t i = 0; i < kRCT2ObjectEntryGroupCounts[objectType]; i++, objectIt++) { auto entry = ObjectEntryDescriptor(_s6.Objects[objectIt]); if (entry.HasValue()) @@ -2081,7 +2081,7 @@ namespace OpenRCT2::RCT2 auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->Type); if (srcThought->Item == RCT12PeepThoughtItemNone) - dstThought->item = PeepThoughtItemNone; + dstThought->item = kPeepThoughtItemNone; else dstThought->item = srcThought->Item; dstThought->freshness = srcThought->Freshness; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 86a2a351bd..7ac809134a 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -117,7 +117,7 @@ static Ride _previewRide{}; struct StationIndexWithMessage { ::StationIndex StationIndex; - StringId Message = STR_NONE; + StringId Message = kStringIdNone; }; // Static function declarations @@ -852,7 +852,7 @@ void Ride::FormatStatusTo(Formatter& ft) const else { ft.Add(STR_RACE_WON_BY); - ft.Add(STR_NONE); + ft.Add(kStringIdNone); } } else if (!GetRideTypeDescriptor().HasFlag(RtdFlag::isShopOrFacility)) @@ -997,13 +997,13 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons { if (!(lifecycle_flags & RIDE_LIFECYCLE_TESTED)) { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return nullptr; } if (!RideHasRatings(*this)) { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, kStringIdNone, {}); return nullptr; } @@ -1016,7 +1016,7 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons } if (errMessage.HasMessage()) { - ContextShowError(errMessage.Message, STR_EMPTY, {}); + ContextShowError(errMessage.Message, kStringIdEmpty, {}); } return td; @@ -2157,7 +2157,7 @@ std::pair Ride::GetMeasurement() measurement->last_use_tick = GetGameState().CurrentTicks; if (measurement->flags & 1) { - return { measurement.get(), { STR_EMPTY, {} } }; + return { measurement.get(), { kStringIdEmpty, {} } }; } auto ft = Formatter(); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 2587501506..45465e7e3e 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -201,7 +201,7 @@ struct Ride uint16_t num_customers_timeout{}; // Customer count in the last 10 * 960 game ticks (sliding window) uint16_t num_customers[OpenRCT2::Limits::kCustomerHistorySize]{}; - money64 price[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; + money64 price[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]{}; TileCoordsXYZ ChairliftBullwheelLocation[2]; RatingTuple ratings{}; money64 value{}; diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 28cfb166ad..d82ea4b07a 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -297,7 +297,7 @@ struct TrackDrawerEntry RideTrackGroups extraTrackGroups{}; ImageIndex icon = kSpriteIdNull; - StringId tooltip = STR_NONE; + StringId tooltip = kStringIdNone; void GetAvailableTrackGroups(RideTrackGroups& res) const; bool SupportsTrackGroup(const TrackGroup trackGroup) const; @@ -491,7 +491,7 @@ struct RideTypeDescriptor UpkeepCostsDescriptor UpkeepCosts{}; // rct2: 0x0097DD78 RideBuildCost BuildCosts{}; - money64 DefaultPrices[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; + money64 DefaultPrices[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]{}; std::string_view DefaultMusic{}; /** rct2: 0x0097D7CB */ ShopItemIndex PhotoItem{}; diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index 4e27256904..c8787a0a78 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -49,7 +49,7 @@ struct RideObjectEntry // The first three images are previews. They correspond to the ride_type[] array. uint32_t images_offset; uint32_t flags; - ride_type_t ride_type[OpenRCT2::RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; + ride_type_t ride_type[OpenRCT2::RCT2::ObjectLimits::kMaxRideTypesPerRideEntry]; uint8_t min_cars_in_train; uint8_t max_cars_in_train; uint8_t cars_per_flat_ride; @@ -64,13 +64,13 @@ struct RideObjectEntry uint8_t RearCar; uint8_t ThirdCar; uint8_t BuildMenuPriority; - CarEntry Cars[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + CarEntry Cars[OpenRCT2::RCT2::ObjectLimits::kMaxCarTypesPerRideEntry]; VehicleColourPresetList* vehicle_preset_list; int8_t excitement_multiplier; int8_t intensity_multiplier; int8_t nausea_multiplier; uint8_t max_height; - ShopItem shop_item[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]; + ShopItem shop_item[OpenRCT2::RCT2::ObjectLimits::kMaxShopItemsPerRideEntry]; StringId capacity; uint8_t Clearance; diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index f344ef1cd6..dde6a07ec1 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -55,10 +55,10 @@ constexpr ShopItemDescriptor ShopItems[EnumValue(ShopItem::Count)] = { /* ShopItem::Lemonade */ { 0.40_GBP, 1.10_GBP, 2.10_GBP, 1.00_GBP, 1.20_GBP, SPR_SHOP_ITEM_LEMONADE, { STR_SHOP_ITEM_PRICE_LABEL_LEMONADE, STR_SHOP_ITEM_SINGULAR_LEMONADE, STR_SHOP_ITEM_PLURAL_LEMONADE, STR_SHOP_ITEM_INDEFINITE_LEMONADE, STR_SHOP_ITEM_DISPLAY_LEMONADE }, SHOP_ITEM_FLAG_IS_DRINK, Litter::Type::EmptyBottle, 115, ShopItem::EmptyBottle, PeepThoughtType::LemonadeMuch, PeepThoughtType::Lemonade }, /* ShopItem::EmptyBox */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOX, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOX, STR_SHOP_ITEM_SINGULAR_EMPTY_BOX, STR_SHOP_ITEM_PLURAL_EMPTY_BOX, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOX, STR_SHOP_ITEM_DISPLAY_EMPTY_BOX }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBox, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, /* ShopItem::EmptyBottle */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_EMPTY_BOTTLE, { STR_SHOP_ITEM_PRICE_LABEL_EMPTY_BOTTLE, STR_SHOP_ITEM_SINGULAR_EMPTY_BOTTLE, STR_SHOP_ITEM_PLURAL_EMPTY_BOTTLE, STR_SHOP_ITEM_INDEFINITE_EMPTY_BOTTLE, STR_SHOP_ITEM_DISPLAY_EMPTY_BOTTLE }, SHOP_ITEM_FLAG_IS_CONTAINER, Litter::Type::EmptyBottle, 0, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 28 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 29 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* 30 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, - /* ShopItem::Admission */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { STR_NONE, STR_NONE, STR_NONE, STR_NONE, STR_NONE }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* 28 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* 29 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* 30 */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, + /* ShopItem::Admission */ { 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0.00_GBP, 0, { kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone, kStringIdNone }, 0, Litter::Type::Vomit, 0xFF, ShopItem::None, PeepThoughtType::None, PeepThoughtType::None }, /* ShopItem::Photo2 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO2, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo2Much, PeepThoughtType::Photo2 }, /* ShopItem::Photo3 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO3, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo3Much, PeepThoughtType::Photo3 }, /* ShopItem::Photo4 */ { 0.20_GBP, 3.00_GBP, 3.00_GBP, 3.00_GBP, 0.00_GBP, SPR_SHOP_ITEM_PHOTO4, { STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO, STR_SHOP_ITEM_SINGULAR_ON_RIDE_PHOTO, STR_SHOP_ITEM_PLURAL_ON_RIDE_PHOTO, STR_SHOP_ITEM_INDEFINITE_ON_RIDE_PHOTO, STR_SHOP_ITEM_DISPLAY_ON_RIDE_PHOTO }, SHOP_ITEM_FLAG_IS_PHOTO | SHOP_ITEM_FLAG_IS_SOUVENIR, Litter::Type::Rubbish, 0, ShopItem::None, PeepThoughtType::Photo4Much, PeepThoughtType::Photo4 }, diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index a20fd4d171..70c36a5550 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -4479,58 +4479,58 @@ namespace OpenRCT2::TrackMetaData } static constexpr StringId RideConfigurationStringIds[] = { - STR_EMPTY, // 0 + kStringIdEmpty, // 0 STR_STATION_PLATFORM, // 1 - STR_EMPTY, // 2 - STR_EMPTY, // 3 - STR_EMPTY, // 4 - STR_EMPTY, // 5 - STR_EMPTY, // 6 - STR_EMPTY, // 7 - STR_EMPTY, // 8 - STR_EMPTY, // 9 - STR_EMPTY, // 10 - STR_EMPTY, // 11 - STR_EMPTY, // 12 - STR_EMPTY, // 13 - STR_EMPTY, // 14 - STR_EMPTY, // 15 - STR_EMPTY, // 16 - STR_EMPTY, // 17 - STR_EMPTY, // 18 - STR_EMPTY, // 19 - STR_EMPTY, // 20 - STR_EMPTY, // 21 - STR_EMPTY, // 22 - STR_EMPTY, // 23 - STR_EMPTY, // 24 - STR_EMPTY, // 25 - STR_EMPTY, // 26 - STR_EMPTY, // 27 - STR_EMPTY, // 28 - STR_EMPTY, // 29 - STR_EMPTY, // 30 - STR_EMPTY, // 31 - STR_EMPTY, // 32 - STR_EMPTY, // 33 - STR_EMPTY, // 34 - STR_EMPTY, // 35 - STR_EMPTY, // 36 - STR_EMPTY, // 37 + kStringIdEmpty, // 2 + kStringIdEmpty, // 3 + kStringIdEmpty, // 4 + kStringIdEmpty, // 5 + kStringIdEmpty, // 6 + kStringIdEmpty, // 7 + kStringIdEmpty, // 8 + kStringIdEmpty, // 9 + kStringIdEmpty, // 10 + kStringIdEmpty, // 11 + kStringIdEmpty, // 12 + kStringIdEmpty, // 13 + kStringIdEmpty, // 14 + kStringIdEmpty, // 15 + kStringIdEmpty, // 16 + kStringIdEmpty, // 17 + kStringIdEmpty, // 18 + kStringIdEmpty, // 19 + kStringIdEmpty, // 20 + kStringIdEmpty, // 21 + kStringIdEmpty, // 22 + kStringIdEmpty, // 23 + kStringIdEmpty, // 24 + kStringIdEmpty, // 25 + kStringIdEmpty, // 26 + kStringIdEmpty, // 27 + kStringIdEmpty, // 28 + kStringIdEmpty, // 29 + kStringIdEmpty, // 30 + kStringIdEmpty, // 31 + kStringIdEmpty, // 32 + kStringIdEmpty, // 33 + kStringIdEmpty, // 34 + kStringIdEmpty, // 35 + kStringIdEmpty, // 36 + kStringIdEmpty, // 37 STR_S_BEND_LEFT, // 38 STR_S_BEND_RIGHT, // 39 STR_VERTICAL_LOOP_LEFT, // 40 STR_VERTICAL_LOOP_RIGHT, // 41 - STR_EMPTY, // 42 - STR_EMPTY, // 43 - STR_EMPTY, // 44 - STR_EMPTY, // 45 - STR_EMPTY, // 46 - STR_EMPTY, // 47 - STR_EMPTY, // 48 - STR_EMPTY, // 49 - STR_EMPTY, // 50 - STR_EMPTY, // 51 + kStringIdEmpty, // 42 + kStringIdEmpty, // 43 + kStringIdEmpty, // 44 + kStringIdEmpty, // 45 + kStringIdEmpty, // 46 + kStringIdEmpty, // 47 + kStringIdEmpty, // 48 + kStringIdEmpty, // 49 + kStringIdEmpty, // 50 + kStringIdEmpty, // 51 STR_IN_LINE_TWIST_LEFT, // 52 STR_IN_LINE_TWIST_RIGHT, // 53 STR_IN_LINE_TWIST_LEFT, // 54 @@ -4541,31 +4541,31 @@ namespace OpenRCT2::TrackMetaData STR_HALF_CORKSCREW_RIGHT, // 59 STR_HALF_CORKSCREW_LEFT, // 60 STR_HALF_CORKSCREW_RIGHT, // 61 - STR_EMPTY, // 62 - STR_EMPTY, // 63 - STR_EMPTY, // 64 - STR_EMPTY, // 65 + kStringIdEmpty, // 62 + kStringIdEmpty, // 63 + kStringIdEmpty, // 64 + kStringIdEmpty, // 65 STR_ENTRY_EXIT_PLATFORM, // 66 STR_VERTICAL_TOWER, // 67 - STR_EMPTY, // 68 - STR_EMPTY, // 69 - STR_EMPTY, // 70 - STR_EMPTY, // 71 - STR_EMPTY, // 72 - STR_EMPTY, // 73 - STR_EMPTY, // 74 - STR_EMPTY, // 75 - STR_EMPTY, // 76 - STR_EMPTY, // 77 - STR_EMPTY, // 78 - STR_EMPTY, // 79 - STR_EMPTY, // 80 - STR_EMPTY, // 81 - STR_EMPTY, // 82 + kStringIdEmpty, // 68 + kStringIdEmpty, // 69 + kStringIdEmpty, // 70 + kStringIdEmpty, // 71 + kStringIdEmpty, // 72 + kStringIdEmpty, // 73 + kStringIdEmpty, // 74 + kStringIdEmpty, // 75 + kStringIdEmpty, // 76 + kStringIdEmpty, // 77 + kStringIdEmpty, // 78 + kStringIdEmpty, // 79 + kStringIdEmpty, // 80 + kStringIdEmpty, // 81 + kStringIdEmpty, // 82 STR_S_BEND_LEFT, // 83 STR_S_BEND_RIGHT, // 84 - STR_EMPTY, // 85 - STR_EMPTY, // 86 + kStringIdEmpty, // 85 + kStringIdEmpty, // 86 STR_HELIX_UP_SMALL, // 87 STR_HELIX_UP_SMALL, // 88 STR_HELIX_DOWN_SMALL, // 89 @@ -4574,13 +4574,13 @@ namespace OpenRCT2::TrackMetaData STR_HELIX_UP_LARGE, // 92 STR_HELIX_DOWN_LARGE, // 93 STR_HELIX_DOWN_LARGE, // 94 - STR_EMPTY, // 95 - STR_EMPTY, // 96 - STR_EMPTY, // 97 - STR_EMPTY, // 98 + kStringIdEmpty, // 95 + kStringIdEmpty, // 96 + kStringIdEmpty, // 97 + kStringIdEmpty, // 98 STR_BRAKES, // 99 STR_BOOSTER, // 100 - STR_EMPTY, // 101 + kStringIdEmpty, // 101 STR_HELIX_UP_LARGE, // 102 STR_HELIX_UP_LARGE, // 103 STR_HELIX_DOWN_LARGE, // 104 @@ -4589,78 +4589,78 @@ namespace OpenRCT2::TrackMetaData STR_HELIX_UP_RIGHT, // 107 STR_HELIX_DOWN_LEFT, // 108 STR_HELIX_DOWN_RIGHT, // 109 - STR_EMPTY, // TrackElemType::Up25LeftBanked - STR_EMPTY, // TrackElemType::Up25RighBanked + kStringIdEmpty, // TrackElemType::Up25LeftBanked + kStringIdEmpty, // TrackElemType::Up25RighBanked STR_WATERFALLS, // 112 STR_RAPIDS, // 113 STR_ON_RIDE_PHOTO_SECTION, // 114 - STR_EMPTY, // TrackElemType::Down25LeftBanked - STR_EMPTY, // TrackElemType::Down25RightBanked + kStringIdEmpty, // TrackElemType::Down25LeftBanked + kStringIdEmpty, // TrackElemType::Down25RightBanked STR_WATER_SPLASH, // 117 - STR_EMPTY, // 118 - STR_EMPTY, // 119 + kStringIdEmpty, // 118 + kStringIdEmpty, // 119 STR_WHIRLPOOL, // 120 - STR_EMPTY, // 121 - STR_EMPTY, // 122 + kStringIdEmpty, // 121 + kStringIdEmpty, // 122 STR_CABLE_LIFT_HILL, // 123 STR_SLOPE_UP_TO_VERTICAL, // 124 STR_VERTICAL_TRACK, // 125 - STR_EMPTY, // 126 - STR_EMPTY, // 127 - STR_EMPTY, // 128 - STR_EMPTY, // 129 - STR_EMPTY, // 130 - STR_EMPTY, // 131 + kStringIdEmpty, // 126 + kStringIdEmpty, // 127 + kStringIdEmpty, // 128 + kStringIdEmpty, // 129 + kStringIdEmpty, // 130 + kStringIdEmpty, // 131 STR_HOLDING_BRAKE_FOR_DROP, // 132 - STR_EMPTY, // 133 - STR_EMPTY, // 134 - STR_EMPTY, // 135 - STR_EMPTY, // 136 - STR_EMPTY, // 137 - STR_EMPTY, // 138 - STR_EMPTY, // 139 - STR_EMPTY, // 140 - STR_EMPTY, // 141 - STR_EMPTY, // 142 - STR_EMPTY, // 143 - STR_EMPTY, // 144 - STR_EMPTY, // 145 - STR_EMPTY, // 146 - STR_EMPTY, // 147 - STR_EMPTY, // 148 - STR_EMPTY, // 149 - STR_EMPTY, // 150 - STR_EMPTY, // 151 - STR_EMPTY, // 152 - STR_EMPTY, // 153 - STR_EMPTY, // 154 - STR_EMPTY, // 155 - STR_EMPTY, // 156 - STR_EMPTY, // 157 - STR_EMPTY, // 158 - STR_EMPTY, // 159 - STR_EMPTY, // 160 - STR_EMPTY, // 161 - STR_EMPTY, // 162 - STR_EMPTY, // 163 - STR_EMPTY, // 164 - STR_EMPTY, // 165 - STR_EMPTY, // 166 - STR_EMPTY, // 167 - STR_EMPTY, // 168 - STR_EMPTY, // 169 - STR_EMPTY, // 170 - STR_EMPTY, // 171 + kStringIdEmpty, // 133 + kStringIdEmpty, // 134 + kStringIdEmpty, // 135 + kStringIdEmpty, // 136 + kStringIdEmpty, // 137 + kStringIdEmpty, // 138 + kStringIdEmpty, // 139 + kStringIdEmpty, // 140 + kStringIdEmpty, // 141 + kStringIdEmpty, // 142 + kStringIdEmpty, // 143 + kStringIdEmpty, // 144 + kStringIdEmpty, // 145 + kStringIdEmpty, // 146 + kStringIdEmpty, // 147 + kStringIdEmpty, // 148 + kStringIdEmpty, // 149 + kStringIdEmpty, // 150 + kStringIdEmpty, // 151 + kStringIdEmpty, // 152 + kStringIdEmpty, // 153 + kStringIdEmpty, // 154 + kStringIdEmpty, // 155 + kStringIdEmpty, // 156 + kStringIdEmpty, // 157 + kStringIdEmpty, // 158 + kStringIdEmpty, // 159 + kStringIdEmpty, // 160 + kStringIdEmpty, // 161 + kStringIdEmpty, // 162 + kStringIdEmpty, // 163 + kStringIdEmpty, // 164 + kStringIdEmpty, // 165 + kStringIdEmpty, // 166 + kStringIdEmpty, // 167 + kStringIdEmpty, // 168 + kStringIdEmpty, // 169 + kStringIdEmpty, // 170 + kStringIdEmpty, // 171 STR_REVERSER_TURNTABLE, // 172 STR_SPINNING_TUNNEL, // 173 STR_BARREL_ROLL_LEFT, // 174 STR_BARREL_ROLL_RIGHT, // 175 STR_BARREL_ROLL_LEFT, // 176 STR_BARREL_ROLL_RIGHT, // 177 - STR_EMPTY, // 178 - STR_EMPTY, // 179 - STR_EMPTY, // 180 - STR_EMPTY, // 181 + kStringIdEmpty, // 178 + kStringIdEmpty, // 179 + kStringIdEmpty, // 180 + kStringIdEmpty, // 181 STR_LAUNCHED_LIFT_HILL, // 182 STR_LARGE_HALF_LOOP_LEFT, // 183 STR_LARGE_HALF_LOOP_RIGHT, // 184 @@ -4696,56 +4696,56 @@ namespace OpenRCT2::TrackMetaData STR_VERTICAL_TRACK, // 214 STR_SLOPE_TO_LEVEL, // 215 STR_BLOCK_BRAKES, // 216 - STR_EMPTY, // 217 - STR_EMPTY, // 218 - STR_EMPTY, // 219 - STR_EMPTY, // 220 - STR_EMPTY, // 221 - STR_EMPTY, // 222 - STR_EMPTY, // 223 - STR_EMPTY, // 224 - STR_EMPTY, // 225 - STR_EMPTY, // 226 - STR_EMPTY, // 227 - STR_EMPTY, // 228 - STR_EMPTY, // 229 - STR_EMPTY, // 230 - STR_EMPTY, // 231 - STR_EMPTY, // 232 - STR_EMPTY, // 233 - STR_EMPTY, // 234 - STR_EMPTY, // 235 - STR_EMPTY, // 236 - STR_EMPTY, // 237 - STR_EMPTY, // 238 - STR_EMPTY, // 239 - STR_EMPTY, // 240 - STR_EMPTY, // 241 - STR_EMPTY, // 242 - STR_EMPTY, // 243 - STR_EMPTY, // 244 - STR_EMPTY, // 245 - STR_EMPTY, // 246 - STR_EMPTY, // 247 - STR_EMPTY, // 248 - STR_EMPTY, // 249 - STR_EMPTY, // 250 - STR_EMPTY, // 251 - STR_EMPTY, // 252 + kStringIdEmpty, // 217 + kStringIdEmpty, // 218 + kStringIdEmpty, // 219 + kStringIdEmpty, // 220 + kStringIdEmpty, // 221 + kStringIdEmpty, // 222 + kStringIdEmpty, // 223 + kStringIdEmpty, // 224 + kStringIdEmpty, // 225 + kStringIdEmpty, // 226 + kStringIdEmpty, // 227 + kStringIdEmpty, // 228 + kStringIdEmpty, // 229 + kStringIdEmpty, // 230 + kStringIdEmpty, // 231 + kStringIdEmpty, // 232 + kStringIdEmpty, // 233 + kStringIdEmpty, // 234 + kStringIdEmpty, // 235 + kStringIdEmpty, // 236 + kStringIdEmpty, // 237 + kStringIdEmpty, // 238 + kStringIdEmpty, // 239 + kStringIdEmpty, // 240 + kStringIdEmpty, // 241 + kStringIdEmpty, // 242 + kStringIdEmpty, // 243 + kStringIdEmpty, // 244 + kStringIdEmpty, // 245 + kStringIdEmpty, // 246 + kStringIdEmpty, // 247 + kStringIdEmpty, // 248 + kStringIdEmpty, // 249 + kStringIdEmpty, // 250 + kStringIdEmpty, // 251 + kStringIdEmpty, // 252 STR_QUARTER_LOOP, // 253 STR_QUARTER_LOOP, // 254 STR_QUARTER_LOOP, // 255 STR_SPINNING_CONTROL_TOGGLE_TRACK, // 256 - STR_EMPTY, // TrackElemType::FlatTrack1x4A + kStringIdEmpty, // TrackElemType::FlatTrack1x4A STR_BASE_SIZE_2_X_2, // TrackElemType::FlatTrack2x2 STR_BASE_SIZE_4_X_4, // TrackElemType::FlatTrack4x4 STR_BASE_SIZE_2_X_4, // TrackElemType::FlatTrack2x4 STR_BASE_SIZE_5_X_1, // TrackElemType::FlatTrack1x5 - STR_EMPTY, // TrackElemType::FlatTrack1x1A - STR_EMPTY, // TrackElemType::FlatTrack1x4B - STR_EMPTY, // TrackElemType::FlatTrack1x1B - STR_EMPTY, // TrackElemType::FlatTrack1x4C - STR_EMPTY, // TrackElemType::FlatTrack3x3 + kStringIdEmpty, // TrackElemType::FlatTrack1x1A + kStringIdEmpty, // TrackElemType::FlatTrack1x4B + kStringIdEmpty, // TrackElemType::FlatTrack1x1B + kStringIdEmpty, // TrackElemType::FlatTrack1x4C + kStringIdEmpty, // TrackElemType::FlatTrack3x3 STR_LARGE_HALF_CORKSCREW_LEFT, // TrackElemType::LeftCorkscrewUp STR_LARGE_HALF_CORKSCREW_RIGHT, // TrackElemType::RightCorkscrewUp STR_LARGE_HALF_CORKSCREW_LEFT, // TrackElemType::LeftCorkscrewDown @@ -4772,58 +4772,58 @@ namespace OpenRCT2::TrackMetaData STR_LARGE_HALF_LOOP_RIGHT, // TrackElemType::RightFlyerLargeHalfLoopUninvertedDown STR_HALF_LOOP, // TrackElemType::FlyerHalfLoopInvertedUp STR_HALF_LOOP, // TrackElemType::FlyerHalfLoopUninvertedDown - STR_EMPTY, // TrackElemType::LeftEighthToDiagUp25 - STR_EMPTY, // TrackElemType::RightEighthToDiagUp25 - STR_EMPTY, // TrackElemType::LeftEighthToDiagDown25 - STR_EMPTY, // TrackElemType::RightEighthToDiagDown25 - STR_EMPTY, // TrackElemType::LeftEighthToOrthogonalUp25 - STR_EMPTY, // TrackElemType::RightEighthToOrthogonalUp25 - STR_EMPTY, // TrackElemType::LeftEighthToOrthogonalDown25 - STR_EMPTY, // TrackElemType::RightEighthToOrthogonalDown25 - STR_EMPTY, // TrackElemType::DiagUp25ToLeftBankedUp25 - STR_EMPTY, // TrackElemType::DiagUp25ToRightBankedUp25 - STR_EMPTY, // TrackElemType::DiagLeftBankedUp25ToUp25 - STR_EMPTY, // TrackElemType::DiagRightBankedUp25ToUp25 - STR_EMPTY, // TrackElemType::DiagDown25ToLeftBankedDown25 - STR_EMPTY, // TrackElemType::DiagDown25ToRightBankedDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedDown25ToDown25 - STR_EMPTY, // TrackElemType::DiagRightBankedDown25ToDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 - STR_EMPTY, // TrackElemType::DiagRightBankedFlatToRightBankedUp25 - STR_EMPTY, // TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat - STR_EMPTY, // TrackElemType::DiagRightBankedUp25ToRightBankedFlat - STR_EMPTY, // TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 - STR_EMPTY, // TrackElemType::DiagRightBankedFlatToRightBankedDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat - STR_EMPTY, // TrackElemType::DiagRightBankedDown25ToRightBankedFlat - STR_EMPTY, // TrackElemType::DiagFlatToLeftBankedUp25 - STR_EMPTY, // TrackElemType::DiagFlatToRightBankedUp25 - STR_EMPTY, // TrackElemType::DiagLeftBankedUp25ToFlat - STR_EMPTY, // TrackElemType::DiagRightBankedUp25ToFlat - STR_EMPTY, // TrackElemType::DiagFlatToLeftBankedDown25 - STR_EMPTY, // TrackElemType::DiagFlatToRightBankedDown25 - STR_EMPTY, // TrackElemType::DiagLeftBankedDown25ToFlat - STR_EMPTY, // TrackElemType::DiagRightBankedDown25ToFlat - STR_EMPTY, // TrackElemType::Up25LeftBanked - STR_EMPTY, // TrackElemType::Up25RightBanked - STR_EMPTY, // TrackElemType::Down25LeftBanked - STR_EMPTY, // TrackElemType::Down25RightBanked - STR_EMPTY, // TrackElemType::LeftEighthBankToDiagUp25 - STR_EMPTY, // TrackElemType::RightEighthBankToDiagUp25 - STR_EMPTY, // TrackElemType::LeftEighthBankToDiagDown25 - STR_EMPTY, // TrackElemType::RightEighthBankToDiagDown25 - STR_EMPTY, // TrackElemType::LeftEighthBankToOrthogonalUp25 - STR_EMPTY, // TrackElemType::RightEighthBankToOrthogonalUp25 - STR_EMPTY, // TrackElemType::LeftEighthBankToOrthogonalDown25 - STR_EMPTY, // TrackElemType::RightEighthBankToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::LeftEighthToDiagUp25 + kStringIdEmpty, // TrackElemType::RightEighthToDiagUp25 + kStringIdEmpty, // TrackElemType::LeftEighthToDiagDown25 + kStringIdEmpty, // TrackElemType::RightEighthToDiagDown25 + kStringIdEmpty, // TrackElemType::LeftEighthToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::RightEighthToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::LeftEighthToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::RightEighthToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::DiagUp25ToLeftBankedUp25 + kStringIdEmpty, // TrackElemType::DiagUp25ToRightBankedUp25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedUp25ToUp25 + kStringIdEmpty, // TrackElemType::DiagRightBankedUp25ToUp25 + kStringIdEmpty, // TrackElemType::DiagDown25ToLeftBankedDown25 + kStringIdEmpty, // TrackElemType::DiagDown25ToRightBankedDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedDown25ToDown25 + kStringIdEmpty, // TrackElemType::DiagRightBankedDown25ToDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 + kStringIdEmpty, // TrackElemType::DiagRightBankedFlatToRightBankedUp25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedUp25ToRightBankedFlat + kStringIdEmpty, // TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 + kStringIdEmpty, // TrackElemType::DiagRightBankedFlatToRightBankedDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedDown25ToRightBankedFlat + kStringIdEmpty, // TrackElemType::DiagFlatToLeftBankedUp25 + kStringIdEmpty, // TrackElemType::DiagFlatToRightBankedUp25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedUp25ToFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedUp25ToFlat + kStringIdEmpty, // TrackElemType::DiagFlatToLeftBankedDown25 + kStringIdEmpty, // TrackElemType::DiagFlatToRightBankedDown25 + kStringIdEmpty, // TrackElemType::DiagLeftBankedDown25ToFlat + kStringIdEmpty, // TrackElemType::DiagRightBankedDown25ToFlat + kStringIdEmpty, // TrackElemType::Up25LeftBanked + kStringIdEmpty, // TrackElemType::Up25RightBanked + kStringIdEmpty, // TrackElemType::Down25LeftBanked + kStringIdEmpty, // TrackElemType::Down25RightBanked + kStringIdEmpty, // TrackElemType::LeftEighthBankToDiagUp25 + kStringIdEmpty, // TrackElemType::RightEighthBankToDiagUp25 + kStringIdEmpty, // TrackElemType::LeftEighthBankToDiagDown25 + kStringIdEmpty, // TrackElemType::RightEighthBankToDiagDown25 + kStringIdEmpty, // TrackElemType::LeftEighthBankToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::RightEighthBankToOrthogonalUp25 + kStringIdEmpty, // TrackElemType::LeftEighthBankToOrthogonalDown25 + kStringIdEmpty, // TrackElemType::RightEighthBankToOrthogonalDown25 STR_BRAKES, // TrackElemType::DiagBrakes STR_BLOCK_BRAKES, // TrackElemType::DiagBlockBrakes STR_BRAKES, // TrackElemType::Down25Brakes STR_BOOSTER, // TrackElemType::DiagBooster - STR_EMPTY, // TrackElemType::DiagFlatToUp60LongBase, - STR_EMPTY, // TrackElemType::DiagUp60ToFlatLongBase, - STR_EMPTY, // TrackElemType::DiagFlatToDown60LongBase, - STR_EMPTY, // TrackElemType::DiagDown60ToFlatLongBase, + kStringIdEmpty, // TrackElemType::DiagFlatToUp60LongBase, + kStringIdEmpty, // TrackElemType::DiagUp60ToFlatLongBase, + kStringIdEmpty, // TrackElemType::DiagFlatToDown60LongBase, + kStringIdEmpty, // TrackElemType::DiagDown60ToFlatLongBase, STR_DIVE_LOOP_LEFT, // TrackElemType::LeftEighthDiveLoopUpToOrthogonal STR_DIVE_LOOP_RIGHT, // TrackElemType::RightEighthDiveLoopUpToOrthogonal STR_DIVE_LOOP_LEFT, // TrackElemType::LeftEighthDiveLoopDownToDiag diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 42fbf78e24..3326069dd4 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -186,7 +186,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con return { false, STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY }; } - StringId warningMessage = STR_NONE; + StringId warningMessage = kStringIdNone; RideGetStartOfTrack(&trackElement); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 33dda7dc56..c46255ef83 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -652,7 +652,7 @@ bool TrackPaintUtilDrawStationCovers2( } auto baseImageIndex = stationObject->ShelterImageId; - if (baseImageIndex == ImageIndexUndefined) + if (baseImageIndex == kImageIndexUndefined) return false; static constexpr int16_t heights[][2] = { diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 1c0d7d8610..6420759ea9 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -612,7 +612,7 @@ private: std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::EnglishUK); highscore->name = name; highscore->company_value = scBasic.CompanyValue; - highscore->timestamp = DATETIME64_MIN; + highscore->timestamp = kDatetime64Min; break; } } @@ -624,7 +624,7 @@ private: std::string name = RCT2StringToUTF8(scBasic.CompletedBy, RCT2LanguageId::EnglishUK); highscore->name = name; highscore->company_value = scBasic.CompanyValue; - highscore->timestamp = DATETIME64_MIN; + highscore->timestamp = kDatetime64Min; } } } diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 302cb27680..6449515889 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -715,7 +715,7 @@ void ScriptEngine::LoadPlugin(std::shared_ptr& plugin) if (!plugin->IsLoaded()) { const auto& metadata = plugin->GetMetadata(); - if (metadata.MinApiVersion <= OPENRCT2_PLUGIN_API_VERSION) + if (metadata.MinApiVersion <= kPluginApiVersion) { ScriptExecutionInfo::PluginScope scope(_execInfo, plugin, false); plugin->Load(); @@ -1087,7 +1087,7 @@ GameActions::Result ScriptEngine::QueryOrExecuteCustomGameAction(const CustomAct } std::vector pluginCallArgs; - if (customActionInfo.Owner->GetTargetAPIVersion() <= API_VERSION_68_CUSTOM_ACTION_ARGS) + if (customActionInfo.Owner->GetTargetAPIVersion() <= kApiVersionCustomActionArgs) { pluginCallArgs = { *dukArgs }; } @@ -1847,7 +1847,7 @@ int32_t OpenRCT2::Scripting::GetTargetAPIVersion() if (plugin == nullptr) { // For in-game console, default to the current API version - return OPENRCT2_PLUGIN_API_VERSION; + return kPluginApiVersion; } return plugin->GetTargetAPIVersion(); diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index c549983024..e3b323cd78 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,13 +46,13 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 104; + static constexpr int32_t kPluginApiVersion = 104; // Versions marking breaking changes. - static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; - static constexpr int32_t API_VERSION_63_G2_REORDER = 63; - static constexpr int32_t API_VERSION_68_CUSTOM_ACTION_ARGS = 68; - static constexpr int32_t API_VERSION_77_NETWORK_IDS = 77; + static constexpr int32_t kApiVersionPeepDeprecation = 33; + static constexpr int32_t kApiVersionG2Reorder = 63; + static constexpr int32_t kApiVersionCustomActionArgs = 68; + static constexpr int32_t kApiVersionNetworkIDs = 77; #ifndef DISABLE_NETWORK class ScSocketBase; diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index a2f23424a1..df0e5eda03 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -58,11 +58,11 @@ namespace OpenRCT2::Scripting case EntityType::Vehicle: return "car"; case EntityType::Guest: - if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) + if (targetApiVersion <= kApiVersionPeepDeprecation) return "peep"; return "guest"; case EntityType::Staff: - if (targetApiVersion <= API_VERSION_33_PEEP_DEPRECATION) + if (targetApiVersion <= kApiVersionPeepDeprecation) return "peep"; return "staff"; case EntityType::SteamParticle: diff --git a/src/openrct2/scripting/bindings/game/ScContext.hpp b/src/openrct2/scripting/bindings/game/ScContext.hpp index 2cb18eabd9..c61d48c657 100644 --- a/src/openrct2/scripting/bindings/game/ScContext.hpp +++ b/src/openrct2/scripting/bindings/game/ScContext.hpp @@ -47,7 +47,7 @@ namespace OpenRCT2::Scripting private: int32_t apiVersion_get() { - return OPENRCT2_PLUGIN_API_VERSION; + return kPluginApiVersion; } std::shared_ptr configuration_get() @@ -472,7 +472,7 @@ namespace OpenRCT2::Scripting if (d.type() == DukValue::Type::NUMBER) { img = d.as_uint(); - if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) + if (GetTargetAPIVersion() <= kApiVersionG2Reorder) { img = NewIconIndex(d.as_uint()); } diff --git a/src/openrct2/scripting/bindings/network/ScNetwork.cpp b/src/openrct2/scripting/bindings/network/ScNetwork.cpp index 89454fd070..e96475d109 100644 --- a/src/openrct2/scripting/bindings/network/ScNetwork.cpp +++ b/src/openrct2/scripting/bindings/network/ScNetwork.cpp @@ -114,7 +114,7 @@ namespace OpenRCT2::Scripting std::shared_ptr ScNetwork::getPlayer(int32_t id) const { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numPlayers = NetworkGetNumPlayers(); @@ -173,7 +173,7 @@ namespace OpenRCT2::Scripting std::shared_ptr ScNetwork::getGroup(int32_t id) const { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numGroups = NetworkGetNumGroups(); @@ -206,7 +206,7 @@ namespace OpenRCT2::Scripting void ScNetwork::removeGroup(int32_t id) { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numGroups = NetworkGetNumGroups(); @@ -232,7 +232,7 @@ namespace OpenRCT2::Scripting void ScNetwork::kickPlayer(int32_t id) { #ifndef DISABLE_NETWORK - if (GetTargetAPIVersion() < API_VERSION_77_NETWORK_IDS) + if (GetTargetAPIVersion() < kApiVersionNetworkIDs) { auto index = id; auto numPlayers = NetworkGetNumPlayers(); diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index d877196d95..dceb9addaf 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -55,7 +55,7 @@ namespace OpenRCT2::Scripting int32_t ScMap::numEntities_get() const { - return MAX_ENTITIES; + return kMaxEntities; } std::vector> ScMap::rides_get() const @@ -88,7 +88,7 @@ namespace OpenRCT2::Scripting DukValue ScMap::getEntity(int32_t id) const { - if (id >= 0 && id < MAX_ENTITIES) + if (id >= 0 && id < kMaxEntities) { auto spriteId = EntityId::FromUnderlying(id); auto sprite = GetEntity(spriteId); diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 1703c4301d..cf2b2e6b37 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -21,7 +21,7 @@ enum : ImageIndex SPR_DEFAULT_PALETTE = 1532, SPR_SCROLLING_TEXT_LEGACY_START = 1542, - SPR_SCROLLING_TEXT_LEGACY_END = SPR_SCROLLING_TEXT_LEGACY_START + OpenRCT2::MaxScrollingTextLegacyEntries, + SPR_SCROLLING_TEXT_LEGACY_END = SPR_SCROLLING_TEXT_LEGACY_START + OpenRCT2::kMaxScrollingTextLegacyEntries, SPR_SCROLLING_TEXT_DEFAULT = 1574, SPR_EDGE_ROCK_BASE = 1579, @@ -1707,7 +1707,7 @@ enum : ImageIndex G2_SPRITE_COUNT = SPR_G2_END - SPR_G2_BEGIN, SPR_SCROLLING_TEXT_START = SPR_CSG_END, - SPR_SCROLLING_TEXT_END = SPR_SCROLLING_TEXT_START + OpenRCT2::MaxScrollingTextEntries, + SPR_SCROLLING_TEXT_END = SPR_SCROLLING_TEXT_START + OpenRCT2::kMaxScrollingTextEntries, SPR_IMAGE_LIST_LENGTH = 1000000, SPR_IMAGE_LIST_BEGIN = SPR_SCROLLING_TEXT_END, diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 8103ae5dd9..6d9a0a82d3 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -156,7 +156,7 @@ GameActions::Result MapCanConstructWithClearAt( if (tileElement == nullptr) { res.Error = GameActions::Status::Unknown; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = kStringIdNone; return res; } @@ -321,7 +321,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(kStringIdEmpty); ft.Add(stringId); break; } @@ -344,7 +344,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r auto* wallEntry = tileElement->AsWall()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - StringId stringId = wallEntry != nullptr ? wallEntry->name : static_cast(STR_EMPTY); + StringId stringId = wallEntry != nullptr ? wallEntry->name : static_cast(kStringIdEmpty); ft.Add(stringId); break; } @@ -353,7 +353,7 @@ void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& r auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); res.ErrorMessage = STR_X_IN_THE_WAY; auto ft = Formatter(res.ErrorMessageArgs.data()); - StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(STR_EMPTY); + StringId stringId = sceneryEntry != nullptr ? sceneryEntry->name : static_cast(kStringIdEmpty); ft.Add(stringId); break; } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 78411fece1..7d28416432 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -475,7 +475,7 @@ static bool FootpathDisconnectQueueFromPath(const CoordsXY& footpathPos, TileEle return true; } - for (Direction direction : ALL_DIRECTIONS) + for (Direction direction : kAllDirections) { if ((action < 0) && (direction == tileElement->AsPath()->GetSlopeDirection())) continue; @@ -748,7 +748,7 @@ void FootpathConnectEdges(const CoordsXY& footpathPos, TileElement* tileElement, FootpathNeighbourListInit(&neighbourList); FootpathUpdateQueueEntranceBanner(footpathPos, tileElement); - for (Direction direction : ALL_DIRECTIONS) + for (Direction direction : kAllDirections) { Loc6A6C85({ footpathPos, tileElement }, direction, flags, true, &neighbourList); } diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index e7c8c6a617..46a69cda6b 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -540,9 +540,9 @@ const Direction INVALID_DIRECTION = 0xFF; /** * Array of all valid cardinal directions, to make it easy to write range-based for loops like: - * for (Direction d : ALL_DIRECTIONS) + * for (Direction d : kAllDirections) */ -constexpr Direction ALL_DIRECTIONS[] = { +constexpr Direction kAllDirections[] = { 0, 1, 2, diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 0fea265f76..d6cb5b6837 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -324,7 +324,7 @@ namespace OpenRCT2::TileInspector if (newBanner == nullptr) { LOG_ERROR("No free banners available"); - return GameActions::Result(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME, STR_NONE); + return GameActions::Result(GameActions::Status::Unknown, STR_TOO_MANY_BANNERS_IN_GAME, kStringIdNone); } auto newId = newBanner->id; // Copy the banners style