diff --git a/src/openrct2/park/Legacy.cpp b/src/openrct2/park/Legacy.cpp index 7bd140f2e6..3f96764e36 100644 --- a/src/openrct2/park/Legacy.cpp +++ b/src/openrct2/park/Legacy.cpp @@ -2276,7 +2276,7 @@ void UpdateFootpathsFromMapping( pathToRailingsMap[entryIndex] = railingIndex; } -const std::vector peepAnimObjects = { +static constexpr auto kPeepAnimObjects = std::to_array({ "rct2.peep_animations.guest", "rct2.peep_animations.handyman", "rct2.peep_animations.mechanic", @@ -2292,11 +2292,11 @@ const std::vector peepAnimObjects = { "rct2.peep_animations.entertainer_roman", "rct2.peep_animations.entertainer_sheriff", "rct2.peep_animations.entertainer_snowman", -}; +}); -const std::vector& GetLegacyPeepAnimationObjects() +std::span GetLegacyPeepAnimationObjects() { - return peepAnimObjects; + return kPeepAnimObjects; } using AnimObjectConversionTable = std::map>; diff --git a/src/openrct2/park/Legacy.h b/src/openrct2/park/Legacy.h index f07180b96c..54d857e324 100644 --- a/src/openrct2/park/Legacy.h +++ b/src/openrct2/park/Legacy.h @@ -14,8 +14,8 @@ #include #include +#include #include -#include namespace OpenRCT2 { @@ -48,7 +48,7 @@ void UpdateFootpathsFromMapping( ObjectList& requiredObjects, ObjectEntryIndex& surfaceCount, ObjectEntryIndex& railingCount, ObjectEntryIndex entryIndex, const OpenRCT2::RCT2::FootpathMapping* footpathMapping); -const std::vector& GetLegacyPeepAnimationObjects(); +std::span GetLegacyPeepAnimationObjects(); void ConvertPeepAnimationTypeToObjects(OpenRCT2::GameState_t& gameState); std::string_view GetClimateObjectIdFromLegacyClimateType(OpenRCT2::RCT12::ClimateType); diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index ba9e66eb5f..fee68c0a12 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -818,7 +818,7 @@ void RCT12AddDefaultObjects(ObjectList& objectList) } } -void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, const std::vector& objectNames) +void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, std::span objectNames) { for (const auto& objectName : objectNames) { diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index c59b49bd0f..433ffe4af1 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -21,6 +21,7 @@ #include "../world/tile_element/TileElementType.h" #include "Limits.h" +#include #include #include #include @@ -1255,7 +1256,7 @@ std::string_view GetStationIdentifierFromStyle(uint8_t style); uint8_t GetStationStyleFromIdentifier(u8string_view identifier); std::optional GetStyleFromMusicIdentifier(std::string_view identifier); void RCT12AddDefaultObjects(ObjectList& objectList); -void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, const std::vector& objectNames); +void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, std::span objectNames); void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, const OpenRCT2::RCT12::EntryList& entryList); bool IsUserStringID(StringId stringId);