mirror of https://github.com/OpenRCT2/OpenRCT2.git
Spin off Object Type into standalone header (#19278)
* Split off object type into standalone header * Include missing header * Rename to ObjectTypes.h
This commit is contained in:
parent
ead13c44b8
commit
85b72c766e
|
@ -15,6 +15,7 @@
|
|||
#include "AudioMixer.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
class AudioObject;
|
||||
|
|
|
@ -314,6 +314,7 @@
|
|||
<ClInclude Include="object\ObjectList.h" />
|
||||
<ClInclude Include="object\ObjectManager.h" />
|
||||
<ClInclude Include="object\ObjectRepository.h" />
|
||||
<ClInclude Include="object\ObjectType.h" />
|
||||
<ClInclude Include="object\ResourceTable.h" />
|
||||
<ClInclude Include="object\RideObject.h" />
|
||||
<ClInclude Include="object\SceneryGroupObject.h" />
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "../common.h"
|
||||
#include "../object/Object.h"
|
||||
#include "../object/ObjectLimits.h"
|
||||
#include "../object/ObjectTypes.h"
|
||||
#include "../ride/RideTypes.h"
|
||||
#include "../util/Util.h"
|
||||
|
||||
#include <optional>
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "../common.h"
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
#include "ObjectTypes.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
#include "../interface/Cursors.h"
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
#include "ObjectTypes.h"
|
||||
|
||||
enum class PathBitDrawType : uint8_t
|
||||
{
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
#include "../common.h"
|
||||
#include "../interface/Cursors.h"
|
||||
#include "../world/Location.hpp"
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
#include "ObjectTypes.h"
|
||||
|
||||
struct LargeSceneryText;
|
||||
|
||||
|
|
|
@ -15,17 +15,14 @@
|
|||
#include "../util/Util.h"
|
||||
#include "ImageTable.h"
|
||||
#include "ObjectAsset.h"
|
||||
#include "ObjectTypes.h"
|
||||
#include "StringTable.h"
|
||||
|
||||
#include <array>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
constexpr const ObjectEntryIndex OBJECT_ENTRY_INDEX_NULL = std::numeric_limits<ObjectEntryIndex>::max();
|
||||
struct ObjectRepositoryItem;
|
||||
using ride_type_t = uint16_t;
|
||||
|
||||
|
@ -33,62 +30,6 @@ constexpr const size_t VersionNumFields = 3;
|
|||
using ObjectVersion = std::tuple<uint16_t, uint16_t, uint16_t>;
|
||||
static_assert(std::tuple_size<ObjectVersion>{} == VersionNumFields);
|
||||
|
||||
// First 0xF of RCTObjectEntry->flags
|
||||
enum class ObjectType : uint8_t
|
||||
{
|
||||
Ride,
|
||||
SmallScenery,
|
||||
LargeScenery,
|
||||
Walls,
|
||||
Banners,
|
||||
Paths,
|
||||
PathBits,
|
||||
SceneryGroup,
|
||||
ParkEntrance,
|
||||
Water,
|
||||
ScenarioText,
|
||||
TerrainSurface,
|
||||
TerrainEdge,
|
||||
Station,
|
||||
Music,
|
||||
FootpathSurface,
|
||||
FootpathRailings,
|
||||
Audio,
|
||||
|
||||
Count,
|
||||
None = 255
|
||||
};
|
||||
|
||||
constexpr std::array ObjectTypes = {
|
||||
ObjectType::Ride,
|
||||
ObjectType::SmallScenery,
|
||||
ObjectType::LargeScenery,
|
||||
ObjectType::Walls,
|
||||
ObjectType::Banners,
|
||||
ObjectType::Paths,
|
||||
ObjectType::PathBits,
|
||||
ObjectType::SceneryGroup,
|
||||
ObjectType::ParkEntrance,
|
||||
ObjectType::Water,
|
||||
ObjectType::ScenarioText,
|
||||
ObjectType::TerrainSurface,
|
||||
ObjectType::TerrainEdge,
|
||||
ObjectType::Station,
|
||||
ObjectType::Music,
|
||||
ObjectType::FootpathSurface,
|
||||
ObjectType::FootpathRailings,
|
||||
ObjectType::Audio,
|
||||
};
|
||||
static_assert(ObjectTypes.size() == EnumValue(ObjectType::Count));
|
||||
|
||||
// Object types that can be saved in a park file.
|
||||
constexpr std::array<ObjectType, 16> TransientObjectTypes = {
|
||||
ObjectType::Ride, ObjectType::SmallScenery, ObjectType::LargeScenery, ObjectType::Walls,
|
||||
ObjectType::Banners, ObjectType::Paths, ObjectType::PathBits, ObjectType::SceneryGroup,
|
||||
ObjectType::ParkEntrance, ObjectType::Water, ObjectType::TerrainSurface, ObjectType::TerrainEdge,
|
||||
ObjectType::Station, ObjectType::Music, ObjectType::FootpathSurface, ObjectType::FootpathRailings,
|
||||
};
|
||||
|
||||
namespace ObjectSelectionFlags
|
||||
{
|
||||
constexpr uint8_t Selected = (1 << 0);
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2023 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
constexpr const ObjectEntryIndex OBJECT_ENTRY_INDEX_NULL = std::numeric_limits<ObjectEntryIndex>::max();
|
||||
|
||||
// First 0xF of RCTObjectEntry->flags
|
||||
enum class ObjectType : uint8_t
|
||||
{
|
||||
Ride,
|
||||
SmallScenery,
|
||||
LargeScenery,
|
||||
Walls,
|
||||
Banners,
|
||||
Paths,
|
||||
PathBits,
|
||||
SceneryGroup,
|
||||
ParkEntrance,
|
||||
Water,
|
||||
ScenarioText,
|
||||
TerrainSurface,
|
||||
TerrainEdge,
|
||||
Station,
|
||||
Music,
|
||||
FootpathSurface,
|
||||
FootpathRailings,
|
||||
Audio,
|
||||
|
||||
Count,
|
||||
None = 255
|
||||
};
|
||||
|
||||
constexpr std::array ObjectTypes = {
|
||||
ObjectType::Ride,
|
||||
ObjectType::SmallScenery,
|
||||
ObjectType::LargeScenery,
|
||||
ObjectType::Walls,
|
||||
ObjectType::Banners,
|
||||
ObjectType::Paths,
|
||||
ObjectType::PathBits,
|
||||
ObjectType::SceneryGroup,
|
||||
ObjectType::ParkEntrance,
|
||||
ObjectType::Water,
|
||||
ObjectType::ScenarioText,
|
||||
ObjectType::TerrainSurface,
|
||||
ObjectType::TerrainEdge,
|
||||
ObjectType::Station,
|
||||
ObjectType::Music,
|
||||
ObjectType::FootpathSurface,
|
||||
ObjectType::FootpathRailings,
|
||||
ObjectType::Audio,
|
||||
};
|
||||
// Not using EnumValue to reduce header includes
|
||||
static_assert(ObjectTypes.size() == static_cast<uint8_t>(ObjectType::Count));
|
||||
|
||||
// Object types that can be saved in a park file.
|
||||
constexpr std::array<ObjectType, 16> TransientObjectTypes = {
|
||||
ObjectType::Ride, ObjectType::SmallScenery, ObjectType::LargeScenery, ObjectType::Walls,
|
||||
ObjectType::Banners, ObjectType::Paths, ObjectType::PathBits, ObjectType::SceneryGroup,
|
||||
ObjectType::ParkEntrance, ObjectType::Water, ObjectType::TerrainSurface, ObjectType::TerrainEdge,
|
||||
ObjectType::Station, ObjectType::Music, ObjectType::FootpathSurface, ObjectType::FootpathRailings,
|
||||
};
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
#include "../interface/Cursors.h"
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
#include "ObjectTypes.h"
|
||||
|
||||
enum SMALL_SCENERY_FLAGS : uint32_t
|
||||
{
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
#include "../interface/Cursors.h"
|
||||
|
||||
using ObjectEntryIndex = uint16_t;
|
||||
#include "ObjectTypes.h"
|
||||
|
||||
enum WALL_SCENERY_FLAGS
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "../Identifiers.h"
|
||||
#include "../object/Object.h"
|
||||
#include "../object/ObjectTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
|
|
Loading…
Reference in New Issue