mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2024-08-30 05:56:06 +02:00
Merge pull request #15282 from ZehMatt/refactor/entities
Rename SpriteBase to EntityBase
This commit is contained in:
commit
7e1ae9659f
37 changed files with 96 additions and 96 deletions
|
@ -222,13 +222,13 @@ struct GameStateSnapshots final : public IGameStateSnapshots
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompareSpriteDataCommon(
|
void CompareSpriteDataCommon(
|
||||||
const SpriteBase& spriteBase, const SpriteBase& spriteCmp, GameStateSpriteChange_t& changeData) const
|
const EntityBase& spriteBase, const EntityBase& spriteCmp, GameStateSpriteChange_t& changeData) const
|
||||||
{
|
{
|
||||||
COMPARE_FIELD(SpriteBase, Type);
|
COMPARE_FIELD(EntityBase, Type);
|
||||||
COMPARE_FIELD(SpriteBase, sprite_index);
|
COMPARE_FIELD(EntityBase, sprite_index);
|
||||||
COMPARE_FIELD(SpriteBase, x);
|
COMPARE_FIELD(EntityBase, x);
|
||||||
COMPARE_FIELD(SpriteBase, y);
|
COMPARE_FIELD(EntityBase, y);
|
||||||
COMPARE_FIELD(SpriteBase, z);
|
COMPARE_FIELD(EntityBase, z);
|
||||||
/* Only relevant for rendering, does not affect game state.
|
/* Only relevant for rendering, does not affect game state.
|
||||||
COMPARE_FIELD(SpriteBase, sprite_width);
|
COMPARE_FIELD(SpriteBase, sprite_width);
|
||||||
COMPARE_FIELD(SpriteBase, sprite_height_negative);
|
COMPARE_FIELD(SpriteBase, sprite_height_negative);
|
||||||
|
@ -238,7 +238,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots
|
||||||
COMPARE_FIELD(SpriteBase, sprite_right);
|
COMPARE_FIELD(SpriteBase, sprite_right);
|
||||||
COMPARE_FIELD(SpriteBase, sprite_bottom);
|
COMPARE_FIELD(SpriteBase, sprite_bottom);
|
||||||
*/
|
*/
|
||||||
COMPARE_FIELD(SpriteBase, sprite_direction);
|
COMPARE_FIELD(EntityBase, sprite_direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompareSpriteDataPeep(const Peep& spriteBase, const Peep& spriteCmp, GameStateSpriteChange_t& changeData) const
|
void CompareSpriteDataPeep(const Peep& spriteBase, const Peep& spriteCmp, GameStateSpriteChange_t& changeData) const
|
||||||
|
|
|
@ -684,7 +684,7 @@ static void LightfxAdd3DLight(const CoordsXYZ& loc, const LightType lightType)
|
||||||
LightfxAdd3DLight(((loc.x << 16) | loc.y), LightFXQualifier::Map, loc.z, loc, lightType);
|
LightfxAdd3DLight(((loc.x << 16) | loc.y), LightFXQualifier::Map, loc.z, loc, lightType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightfxAdd3DLight(const SpriteBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType)
|
void LightfxAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType)
|
||||||
{
|
{
|
||||||
LightfxAdd3DLight(entity.sprite_index, LightFXQualifier::Entity, id, loc, lightType);
|
LightfxAdd3DLight(entity.sprite_index, LightFXQualifier::Entity, id, loc, lightType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct Vehicle;
|
||||||
struct rct_drawpixelinfo;
|
struct rct_drawpixelinfo;
|
||||||
struct GamePalette;
|
struct GamePalette;
|
||||||
struct CoordsXYZ;
|
struct CoordsXYZ;
|
||||||
struct SpriteBase;
|
struct EntityBase;
|
||||||
|
|
||||||
enum class LightType : uint8_t
|
enum class LightType : uint8_t
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ void lightfx_update_viewport_settings();
|
||||||
void* lightfx_get_front_buffer();
|
void* lightfx_get_front_buffer();
|
||||||
const GamePalette& lightfx_get_palette();
|
const GamePalette& lightfx_get_palette();
|
||||||
|
|
||||||
void LightfxAdd3DLight(const SpriteBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType);
|
void LightfxAdd3DLight(const EntityBase& entity, const uint8_t id, const CoordsXYZ& loc, const LightType lightType);
|
||||||
|
|
||||||
void lightfx_add_3d_light_magic_from_drawing_tile(
|
void lightfx_add_3d_light_magic_from_drawing_tile(
|
||||||
const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, LightType lightType);
|
const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, LightType lightType);
|
||||||
|
|
|
@ -24,7 +24,7 @@ struct Peep;
|
||||||
struct TileElement;
|
struct TileElement;
|
||||||
struct rct_window;
|
struct rct_window;
|
||||||
union paint_entry;
|
union paint_entry;
|
||||||
struct SpriteBase;
|
struct EntityBase;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ struct InteractionInfo
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
TileElement* Element = nullptr;
|
TileElement* Element = nullptr;
|
||||||
SpriteBase* Entity;
|
EntityBase* Entity;
|
||||||
};
|
};
|
||||||
ViewportInteractionItem SpriteType = ViewportInteractionItem::None;
|
ViewportInteractionItem SpriteType = ViewportInteractionItem::None;
|
||||||
};
|
};
|
||||||
|
|
|
@ -474,7 +474,7 @@
|
||||||
<ClInclude Include="world\ScenerySelection.h" />
|
<ClInclude Include="world\ScenerySelection.h" />
|
||||||
<ClInclude Include="world\SmallScenery.h" />
|
<ClInclude Include="world\SmallScenery.h" />
|
||||||
<ClInclude Include="world\Sprite.h" />
|
<ClInclude Include="world\Sprite.h" />
|
||||||
<ClInclude Include="world\SpriteBase.h" />
|
<ClInclude Include="world\EntityBase.h" />
|
||||||
<ClInclude Include="world\Surface.h" />
|
<ClInclude Include="world\Surface.h" />
|
||||||
<ClInclude Include="world\TileElement.h" />
|
<ClInclude Include="world\TileElement.h" />
|
||||||
<ClInclude Include="world\TileElementsView.h" />
|
<ClInclude Include="world\TileElementsView.h" />
|
||||||
|
|
|
@ -429,7 +429,7 @@ static void peep_head_for_nearest_ride_type(Guest* peep, int32_t rideType);
|
||||||
static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeFlags);
|
static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeFlags);
|
||||||
bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement);
|
bool loc_690FD0(Peep* peep, ride_id_t* rideToView, uint8_t* rideSeatToView, TileElement* tileElement);
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Guest>() const
|
template<> bool EntityBase::Is<Guest>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Guest;
|
return Type == EntityType::Guest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ const bool gSpriteTypeToSlowWalkMap[] = {
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Peep>() const
|
template<> bool EntityBase::Is<Peep>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Guest || Type == EntityType::Staff;
|
return Type == EntityType::Guest || Type == EntityType::Staff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
#include "../ride/RideTypes.h"
|
#include "../ride/RideTypes.h"
|
||||||
#include "../ride/ShopItem.h"
|
#include "../ride/ShopItem.h"
|
||||||
#include "../util/Util.h"
|
#include "../util/Util.h"
|
||||||
|
#include "../world/EntityBase.h"
|
||||||
#include "../world/Location.hpp"
|
#include "../world/Location.hpp"
|
||||||
#include "../world/SpriteBase.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
@ -548,7 +548,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Peep : SpriteBase
|
struct Peep : EntityBase
|
||||||
{
|
{
|
||||||
char* Name;
|
char* Name;
|
||||||
CoordsXYZ NextLoc;
|
CoordsXYZ NextLoc;
|
||||||
|
|
|
@ -73,7 +73,7 @@ colour_t gStaffSecurityColour;
|
||||||
// Maximum manhattan distance that litter can be for a handyman to seek to it
|
// Maximum manhattan distance that litter can be for a handyman to seek to it
|
||||||
const uint16_t MAX_LITTER_DISTANCE = 3 * COORDS_XY_STEP;
|
const uint16_t MAX_LITTER_DISTANCE = 3 * COORDS_XY_STEP;
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Staff>() const
|
template<> bool EntityBase::Is<Staff>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Staff;
|
return Type == EntityType::Staff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1294,7 +1294,7 @@ namespace RCT1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src)
|
void ImportEntityCommonProperties(EntityBase* dst, const RCT12SpriteBase* src)
|
||||||
{
|
{
|
||||||
dst->sprite_direction = src->sprite_direction;
|
dst->sprite_direction = src->sprite_direction;
|
||||||
dst->sprite_width = src->sprite_width;
|
dst->sprite_width = src->sprite_width;
|
||||||
|
|
|
@ -1014,7 +1014,7 @@ void S6Exporter::RebuildEntityLinks()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const SpriteBase* src)
|
constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const EntityBase* src)
|
||||||
{
|
{
|
||||||
RCT12EntityLinkListOffset output = RCT12EntityLinkListOffset::Free;
|
RCT12EntityLinkListOffset output = RCT12EntityLinkListOffset::Free;
|
||||||
switch (src->Type)
|
switch (src->Type)
|
||||||
|
@ -1056,7 +1056,7 @@ constexpr RCT12EntityLinkListOffset GetRCT2LinkListOffset(const SpriteBase* src)
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr RCT12SpriteIdentifier GetRCT2SpriteIdentifier(const SpriteBase* src)
|
constexpr RCT12SpriteIdentifier GetRCT2SpriteIdentifier(const EntityBase* src)
|
||||||
{
|
{
|
||||||
RCT12SpriteIdentifier output = RCT12SpriteIdentifier::Null;
|
RCT12SpriteIdentifier output = RCT12SpriteIdentifier::Null;
|
||||||
switch (src->Type)
|
switch (src->Type)
|
||||||
|
@ -1088,7 +1088,7 @@ constexpr RCT12SpriteIdentifier GetRCT2SpriteIdentifier(const SpriteBase* src)
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const SpriteBase* src)
|
void S6Exporter::ExportEntityCommonProperties(RCT12SpriteBase* dst, const EntityBase* src)
|
||||||
{
|
{
|
||||||
dst->sprite_identifier = GetRCT2SpriteIdentifier(src);
|
dst->sprite_identifier = GetRCT2SpriteIdentifier(src);
|
||||||
dst->linked_list_type_offset = GetRCT2LinkListOffset(src);
|
dst->linked_list_type_offset = GetRCT2LinkListOffset(src);
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct Litter;
|
||||||
struct ObjectRepositoryItem;
|
struct ObjectRepositoryItem;
|
||||||
struct RCT12SpriteBase;
|
struct RCT12SpriteBase;
|
||||||
union rct_sprite;
|
union rct_sprite;
|
||||||
struct SpriteBase;
|
struct EntityBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6).
|
* Class to export RollerCoaster Tycoon 2 scenarios (*.SC6) and saved games (*.SV6).
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
void ExportRide(rct2_ride* dst, const Ride* src);
|
void ExportRide(rct2_ride* dst, const Ride* src);
|
||||||
void ExportEntities();
|
void ExportEntities();
|
||||||
template<typename RCT12_T, typename OpenRCT2_T> void ExportEntity(RCT12_T* dst, const OpenRCT2_T* src);
|
template<typename RCT12_T, typename OpenRCT2_T> void ExportEntity(RCT12_T* dst, const OpenRCT2_T* src);
|
||||||
void ExportEntityCommonProperties(RCT12SpriteBase* dst, const SpriteBase* src);
|
void ExportEntityCommonProperties(RCT12SpriteBase* dst, const EntityBase* src);
|
||||||
void ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src);
|
void ExportEntityPeep(RCT2SpritePeep* dst, const Peep* src);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -1395,7 +1395,7 @@ public:
|
||||||
return pos.x == 0xFF && pos.y == 0xFF && pos.z == 0xFF && pos.direction == INVALID_DIRECTION;
|
return pos.x == 0xFF && pos.y == 0xFF && pos.z == 0xFF && pos.direction == INVALID_DIRECTION;
|
||||||
};
|
};
|
||||||
|
|
||||||
ImportEntityCommonProperties(static_cast<SpriteBase*>(dst), src);
|
ImportEntityCommonProperties(static_cast<EntityBase*>(dst), src);
|
||||||
if (is_user_string_id(src->name_string_idx))
|
if (is_user_string_id(src->name_string_idx))
|
||||||
{
|
{
|
||||||
dst->SetName(GetUserString(src->name_string_idx));
|
dst->SetName(GetUserString(src->name_string_idx));
|
||||||
|
@ -1520,7 +1520,7 @@ public:
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportEntityCommonProperties(SpriteBase* dst, const RCT12SpriteBase* src)
|
void ImportEntityCommonProperties(EntityBase* dst, const RCT12SpriteBase* src)
|
||||||
{
|
{
|
||||||
dst->Type = GetEntityTypeFromRCT2Sprite(src);
|
dst->Type = GetEntityTypeFromRCT2Sprite(src);
|
||||||
dst->sprite_height_negative = src->sprite_height_negative;
|
dst->sprite_height_negative = src->sprite_height_negative;
|
||||||
|
|
|
@ -735,7 +735,7 @@ static const struct
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Vehicle>() const
|
template<> bool EntityBase::Is<Vehicle>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Vehicle;
|
return Type == EntityType::Vehicle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
#include "../audio/audio.h"
|
#include "../audio/audio.h"
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "../ride/RideTypes.h"
|
#include "../ride/RideTypes.h"
|
||||||
|
#include "../world/EntityBase.h"
|
||||||
#include "../world/Location.hpp"
|
#include "../world/Location.hpp"
|
||||||
#include "../world/SpriteBase.h"
|
|
||||||
#include "Station.h"
|
#include "Station.h"
|
||||||
#include "VehicleColour.h"
|
#include "VehicleColour.h"
|
||||||
#include "VehicleEntry.h"
|
#include "VehicleEntry.h"
|
||||||
|
@ -53,7 +53,7 @@ constexpr const uint16_t VehicleTrackTypeMask = 0b1111111111111100;
|
||||||
|
|
||||||
enum class MiniGolfAnimation : uint8_t;
|
enum class MiniGolfAnimation : uint8_t;
|
||||||
|
|
||||||
struct Vehicle : SpriteBase
|
struct Vehicle : EntityBase
|
||||||
{
|
{
|
||||||
static constexpr auto cEntityType = EntityType::Vehicle;
|
static constexpr auto cEntityType = EntityType::Vehicle;
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace OpenRCT2::Scripting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteBase* GetEntity() const
|
EntityBase* GetEntity() const
|
||||||
{
|
{
|
||||||
return ::GetEntity(_id);
|
return ::GetEntity(_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ namespace OpenRCT2::Scripting
|
||||||
dukglue_register_method(ctx, &ScMap::createEntity, "createEntity");
|
dukglue_register_method(ctx, &ScMap::createEntity, "createEntity");
|
||||||
}
|
}
|
||||||
|
|
||||||
DukValue ScMap::GetEntityAsDukValue(const SpriteBase* sprite) const
|
DukValue ScMap::GetEntityAsDukValue(const EntityBase* sprite) const
|
||||||
{
|
{
|
||||||
auto spriteId = sprite->sprite_index;
|
auto spriteId = sprite->sprite_index;
|
||||||
switch (sprite->Type)
|
switch (sprite->Type)
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenRCT2::Scripting
|
||||||
static void Register(duk_context* ctx);
|
static void Register(duk_context* ctx);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DukValue GetEntityAsDukValue(const SpriteBase* sprite) const;
|
DukValue GetEntityAsDukValue(const EntityBase* sprite) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace OpenRCT2::Scripting
|
} // namespace OpenRCT2::Scripting
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "../util/Util.h"
|
#include "../util/Util.h"
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Balloon>() const
|
template<> bool EntityBase::Is<Balloon>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Balloon;
|
return Type == EntityType::Balloon;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
class DataSerialiser;
|
class DataSerialiser;
|
||||||
struct CoordsXYZ;
|
struct CoordsXYZ;
|
||||||
|
|
|
@ -67,7 +67,7 @@ static constexpr const uint8_t * DuckAnimations[] =
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Duck>() const
|
template<> bool EntityBase::Is<Duck>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Duck;
|
return Type == EntityType::Duck;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
class DataSerialiser;
|
class DataSerialiser;
|
||||||
struct CoordsXY;
|
struct CoordsXY;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "MoneyEffect.h"
|
#include "MoneyEffect.h"
|
||||||
#include "Particle.h"
|
#include "Particle.h"
|
||||||
|
|
||||||
static void EntityBaseSerialise(SpriteBase& base, DataSerialiser& stream)
|
static void EntityBaseSerialise(EntityBase& base, DataSerialiser& stream)
|
||||||
{
|
{
|
||||||
stream << base.Type;
|
stream << base.Type;
|
||||||
stream << base.sprite_index;
|
stream << base.sprite_index;
|
||||||
|
|
|
@ -9,33 +9,33 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
constexpr uint16_t MAX_ENTITIES = 10000;
|
constexpr uint16_t MAX_ENTITIES = 10000;
|
||||||
|
|
||||||
SpriteBase* try_get_sprite(size_t spriteIndex);
|
EntityBase* try_get_sprite(size_t spriteIndex);
|
||||||
SpriteBase* get_sprite(size_t sprite_idx);
|
EntityBase* get_sprite(size_t sprite_idx);
|
||||||
|
|
||||||
template<typename T = SpriteBase> T* GetEntity(size_t sprite_idx)
|
template<typename T = EntityBase> T* GetEntity(size_t sprite_idx)
|
||||||
{
|
{
|
||||||
auto spr = get_sprite(sprite_idx);
|
auto spr = get_sprite(sprite_idx);
|
||||||
return spr != nullptr ? spr->As<T>() : nullptr;
|
return spr != nullptr ? spr->As<T>() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T = SpriteBase> T* TryGetEntity(size_t sprite_idx)
|
template<typename T = EntityBase> T* TryGetEntity(size_t sprite_idx)
|
||||||
{
|
{
|
||||||
auto spr = try_get_sprite(sprite_idx);
|
auto spr = try_get_sprite(sprite_idx);
|
||||||
return spr != nullptr ? spr->As<T>() : nullptr;
|
return spr != nullptr ? spr->As<T>() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteBase* CreateEntity(EntityType type);
|
EntityBase* CreateEntity(EntityType type);
|
||||||
template<typename T> T* CreateEntity()
|
template<typename T> T* CreateEntity()
|
||||||
{
|
{
|
||||||
return static_cast<T*>(CreateEntity(T::cEntityType));
|
return static_cast<T*>(CreateEntity(T::cEntityType));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use only with imports that must happen at a specified index
|
// Use only with imports that must happen at a specified index
|
||||||
SpriteBase* CreateEntityAt(const uint16_t index, const EntityType type);
|
EntityBase* CreateEntityAt(const uint16_t index, const EntityType type);
|
||||||
// Use only with imports that must happen at a specified index
|
// Use only with imports that must happen at a specified index
|
||||||
template<typename T> T* CreateEntityAt(const uint16_t index)
|
template<typename T> T* CreateEntityAt(const uint16_t index)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ enum class EntityType : uint8_t
|
||||||
Null = 255
|
Null = 255
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpriteBase
|
struct EntityBase
|
||||||
{
|
{
|
||||||
EntityType Type;
|
EntityType Type;
|
||||||
uint16_t sprite_index;
|
uint16_t sprite_index;
|
||||||
|
@ -74,7 +74,7 @@ struct SpriteBase
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MiscEntity : SpriteBase
|
struct MiscEntity : EntityBase
|
||||||
{
|
{
|
||||||
uint16_t frame;
|
uint16_t frame;
|
||||||
};
|
};
|
|
@ -12,8 +12,8 @@
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "../rct12/RCT12.h"
|
#include "../rct12/RCT12.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
|
#include "EntityBase.h"
|
||||||
#include "Location.hpp"
|
#include "Location.hpp"
|
||||||
#include "SpriteBase.h"
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -81,7 +81,7 @@ public:
|
||||||
using iterator_category = std::forward_iterator_tag;
|
using iterator_category = std::forward_iterator_tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T = SpriteBase> class EntityTileList
|
template<typename T = EntityBase> class EntityTileList
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const std::vector<uint16_t>& vec;
|
const std::vector<uint16_t>& vec;
|
||||||
|
@ -153,7 +153,7 @@ public:
|
||||||
using iterator_category = std::forward_iterator_tag;
|
using iterator_category = std::forward_iterator_tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T = SpriteBase> class EntityList
|
template<typename T = EntityBase> class EntityList
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
using EntityListIterator_t = EntityListIterator<T>;
|
using EntityListIterator_t = EntityListIterator<T>;
|
||||||
|
|
|
@ -57,7 +57,7 @@ void EntityTweener::PostTick()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTweener::RemoveEntity(SpriteBase* entity)
|
void EntityTweener::RemoveEntity(EntityBase* entity)
|
||||||
{
|
{
|
||||||
if (!entity->Is<Peep>() && !entity->Is<Vehicle>())
|
if (!entity->Is<Peep>() && !entity->Is<Vehicle>())
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class EntityTweener
|
class EntityTweener
|
||||||
{
|
{
|
||||||
std::vector<SpriteBase*> Entities;
|
std::vector<EntityBase*> Entities;
|
||||||
std::vector<CoordsXYZ> PrePos;
|
std::vector<CoordsXYZ> PrePos;
|
||||||
std::vector<CoordsXYZ> PostPos;
|
std::vector<CoordsXYZ> PostPos;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public:
|
||||||
|
|
||||||
void PreTick();
|
void PreTick();
|
||||||
void PostTick();
|
void PostTick();
|
||||||
void RemoveEntity(SpriteBase* entity);
|
void RemoveEntity(EntityBase* entity);
|
||||||
void Tween(float alpha);
|
void Tween(float alpha);
|
||||||
void Restore();
|
void Restore();
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
|
@ -70,7 +70,7 @@ const uint8_t _fountainPatternFlags[] = {
|
||||||
FOUNTAIN_FLAG::FAST // FAST_RANDOM_CHASERS
|
FOUNTAIN_FLAG::FAST // FAST_RANDOM_CHASERS
|
||||||
};
|
};
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<JumpingFountain>() const
|
template<> bool EntityBase::Is<JumpingFountain>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::JumpingFountain;
|
return Type == EntityType::JumpingFountain;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
#include "EntityBase.h"
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
#include "SpriteBase.h"
|
|
||||||
|
|
||||||
class DataSerialiser;
|
class DataSerialiser;
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
class DataSerialiser;
|
class DataSerialiser;
|
||||||
struct CoordsXYZ;
|
struct CoordsXYZ;
|
||||||
struct CoordsXYZD;
|
struct CoordsXYZD;
|
||||||
|
|
||||||
struct Litter : SpriteBase
|
struct Litter : EntityBase
|
||||||
{
|
{
|
||||||
enum class Type : uint8_t
|
enum class Type : uint8_t
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
static constexpr const CoordsXY _moneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, { -1, -1 } };
|
static constexpr const CoordsXY _moneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, { -1, -1 } };
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<MoneyEffect>() const
|
template<> bool EntityBase::Is<MoneyEffect>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::MoneyEffect;
|
return Type == EntityType::MoneyEffect;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
class DataSerialiser;
|
class DataSerialiser;
|
||||||
struct CoordsXYZ;
|
struct CoordsXYZ;
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<VehicleCrashParticle>() const
|
template<> bool EntityBase::Is<VehicleCrashParticle>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::CrashedVehicleParticle;
|
return Type == EntityType::CrashedVehicleParticle;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<CrashSplashParticle>() const
|
template<> bool EntityBase::Is<CrashSplashParticle>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::CrashSplash;
|
return Type == EntityType::CrashSplash;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../ride/VehicleColour.h"
|
#include "../ride/VehicleColour.h"
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
class DataSerialiser;
|
class DataSerialiser;
|
||||||
struct CoordsXYZ;
|
struct CoordsXYZ;
|
||||||
|
|
|
@ -44,7 +44,7 @@ constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1;
|
||||||
|
|
||||||
static std::array<std::vector<uint16_t>, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex;
|
static std::array<std::vector<uint16_t>, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex;
|
||||||
|
|
||||||
static void FreeEntity(SpriteBase* entity);
|
static void FreeEntity(EntityBase* entity);
|
||||||
|
|
||||||
constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y)
|
constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y)
|
||||||
{
|
{
|
||||||
|
@ -67,12 +67,12 @@ constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Required for GetEntity to return a default
|
// Required for GetEntity to return a default
|
||||||
template<> bool SpriteBase::Is<SpriteBase>() const
|
template<> bool EntityBase::Is<EntityBase>() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<Litter>() const
|
template<> bool EntityBase::Is<Litter>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::Litter;
|
return Type == EntityType::Litter;
|
||||||
}
|
}
|
||||||
|
@ -96,22 +96,22 @@ constexpr bool EntityTypeIsMiscEntity(const EntityType type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<MiscEntity>() const
|
template<> bool EntityBase::Is<MiscEntity>() const
|
||||||
{
|
{
|
||||||
return EntityTypeIsMiscEntity(Type);
|
return EntityTypeIsMiscEntity(Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<SteamParticle>() const
|
template<> bool EntityBase::Is<SteamParticle>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::SteamParticle;
|
return Type == EntityType::SteamParticle;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<ExplosionFlare>() const
|
template<> bool EntityBase::Is<ExplosionFlare>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::ExplosionFlare;
|
return Type == EntityType::ExplosionFlare;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> bool SpriteBase::Is<ExplosionCloud>() const
|
template<> bool EntityBase::Is<ExplosionCloud>() const
|
||||||
{
|
{
|
||||||
return Type == EntityType::ExplosionCloud;
|
return Type == EntityType::ExplosionCloud;
|
||||||
}
|
}
|
||||||
|
@ -141,12 +141,12 @@ std::string rct_sprite_checksum::ToString() const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteBase* try_get_sprite(size_t spriteIndex)
|
EntityBase* try_get_sprite(size_t spriteIndex)
|
||||||
{
|
{
|
||||||
return spriteIndex >= MAX_ENTITIES ? nullptr : &_spriteList[spriteIndex].base;
|
return spriteIndex >= MAX_ENTITIES ? nullptr : &_spriteList[spriteIndex].base;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteBase* get_sprite(size_t spriteIndex)
|
EntityBase* get_sprite(size_t spriteIndex)
|
||||||
{
|
{
|
||||||
if (spriteIndex == SPRITE_INDEX_NULL)
|
if (spriteIndex == SPRITE_INDEX_NULL)
|
||||||
{
|
{
|
||||||
|
@ -161,7 +161,7 @@ const std::vector<uint16_t>& GetEntityTileList(const CoordsXY& spritePos)
|
||||||
return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos.x, spritePos.y)];
|
return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos.x, spritePos.y)];
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteBase::Invalidate()
|
void EntityBase::Invalidate()
|
||||||
{
|
{
|
||||||
if (sprite_left == LOCATION_NULL)
|
if (sprite_left == LOCATION_NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -249,7 +249,7 @@ void reset_sprite_list()
|
||||||
reset_sprite_spatial_index();
|
reset_sprite_spatial_index();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteSpatialInsert(SpriteBase* sprite, const CoordsXY& newLoc);
|
static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -307,7 +307,7 @@ rct_sprite_checksum sprite_checksum()
|
||||||
|
|
||||||
#endif // DISABLE_NETWORK
|
#endif // DISABLE_NETWORK
|
||||||
|
|
||||||
static void sprite_reset(SpriteBase* sprite)
|
static void sprite_reset(EntityBase* sprite)
|
||||||
{
|
{
|
||||||
// Need to retain how the sprite is linked in lists
|
// Need to retain how the sprite is linked in lists
|
||||||
uint16_t sprite_index = sprite->sprite_index;
|
uint16_t sprite_index = sprite->sprite_index;
|
||||||
|
@ -320,7 +320,7 @@ static void sprite_reset(SpriteBase* sprite)
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr uint16_t MAX_MISC_SPRITES = 300;
|
static constexpr uint16_t MAX_MISC_SPRITES = 300;
|
||||||
static void AddToEntityList(SpriteBase* entity)
|
static void AddToEntityList(EntityBase* entity)
|
||||||
{
|
{
|
||||||
auto& list = gEntityLists[EnumValue(entity->Type)];
|
auto& list = gEntityLists[EnumValue(entity->Type)];
|
||||||
// Entity list must be in sprite_index order to prevent desync issues
|
// Entity list must be in sprite_index order to prevent desync issues
|
||||||
|
@ -333,7 +333,7 @@ static void AddToFreeList(uint16_t index)
|
||||||
_freeIdList.insert(std::upper_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index).base(), index);
|
_freeIdList.insert(std::upper_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index).base(), index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RemoveFromEntityList(SpriteBase* entity)
|
static void RemoveFromEntityList(EntityBase* entity)
|
||||||
{
|
{
|
||||||
auto& list = gEntityLists[EnumValue(entity->Type)];
|
auto& list = gEntityLists[EnumValue(entity->Type)];
|
||||||
auto ptr = std::lower_bound(std::begin(list), std::end(list), entity->sprite_index);
|
auto ptr = std::lower_bound(std::begin(list), std::end(list), entity->sprite_index);
|
||||||
|
@ -355,7 +355,7 @@ uint16_t GetMiscEntityCount()
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrepareNewEntity(SpriteBase* base, const EntityType type)
|
static void PrepareNewEntity(EntityBase* base, const EntityType type)
|
||||||
{
|
{
|
||||||
// Need to reset all sprite data, as the uninitialised values
|
// Need to reset all sprite data, as the uninitialised values
|
||||||
// may contain garbage and cause a desync later on.
|
// may contain garbage and cause a desync later on.
|
||||||
|
@ -375,7 +375,7 @@ static void PrepareNewEntity(SpriteBase* base, const EntityType type)
|
||||||
SpriteSpatialInsert(base, { LOCATION_NULL, 0 });
|
SpriteSpatialInsert(base, { LOCATION_NULL, 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteBase* CreateEntity(EntityType type)
|
EntityBase* CreateEntity(EntityType type)
|
||||||
{
|
{
|
||||||
if (_freeIdList.size() == 0)
|
if (_freeIdList.size() == 0)
|
||||||
{
|
{
|
||||||
|
@ -407,7 +407,7 @@ SpriteBase* CreateEntity(EntityType type)
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteBase* CreateEntityAt(const uint16_t index, const EntityType type)
|
EntityBase* CreateEntityAt(const uint16_t index, const EntityType type)
|
||||||
{
|
{
|
||||||
auto id = std::lower_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index);
|
auto id = std::lower_bound(std::rbegin(_freeIdList), std::rend(_freeIdList), index);
|
||||||
if (id == std::rend(_freeIdList) || *id != index)
|
if (id == std::rend(_freeIdList) || *id != index)
|
||||||
|
@ -452,7 +452,7 @@ void sprite_misc_update_all()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order
|
// Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order
|
||||||
static void SpriteSpatialInsert(SpriteBase* sprite, const CoordsXY& newLoc)
|
static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc)
|
||||||
{
|
{
|
||||||
size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y);
|
size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y);
|
||||||
auto& spatialVector = gSpriteSpatialIndex[newIndex];
|
auto& spatialVector = gSpriteSpatialIndex[newIndex];
|
||||||
|
@ -460,7 +460,7 @@ static void SpriteSpatialInsert(SpriteBase* sprite, const CoordsXY& newLoc)
|
||||||
spatialVector.insert(index, sprite->sprite_index);
|
spatialVector.insert(index, sprite->sprite_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteSpatialRemove(SpriteBase* sprite)
|
static void SpriteSpatialRemove(EntityBase* sprite)
|
||||||
{
|
{
|
||||||
size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y);
|
size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y);
|
||||||
auto& spatialVector = gSpriteSpatialIndex[currentIndex];
|
auto& spatialVector = gSpriteSpatialIndex[currentIndex];
|
||||||
|
@ -476,7 +476,7 @@ static void SpriteSpatialRemove(SpriteBase* sprite)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteSpatialMove(SpriteBase* sprite, const CoordsXY& newLoc)
|
static void SpriteSpatialMove(EntityBase* sprite, const CoordsXY& newLoc)
|
||||||
{
|
{
|
||||||
size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y);
|
size_t newIndex = GetSpatialIndexOffset(newLoc.x, newLoc.y);
|
||||||
size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y);
|
size_t currentIndex = GetSpatialIndexOffset(sprite->x, sprite->y);
|
||||||
|
@ -487,7 +487,7 @@ static void SpriteSpatialMove(SpriteBase* sprite, const CoordsXY& newLoc)
|
||||||
SpriteSpatialInsert(sprite, newLoc);
|
SpriteSpatialInsert(sprite, newLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteBase::MoveTo(const CoordsXYZ& newLocation)
|
void EntityBase::MoveTo(const CoordsXYZ& newLocation)
|
||||||
{
|
{
|
||||||
if (x != LOCATION_NULL)
|
if (x != LOCATION_NULL)
|
||||||
{
|
{
|
||||||
|
@ -517,19 +517,19 @@ void SpriteBase::MoveTo(const CoordsXYZ& newLocation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CoordsXYZ SpriteBase::GetLocation() const
|
CoordsXYZ EntityBase::GetLocation() const
|
||||||
{
|
{
|
||||||
return { x, y, z };
|
return { x, y, z };
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteBase::SetLocation(const CoordsXYZ& newLocation)
|
void EntityBase::SetLocation(const CoordsXYZ& newLocation)
|
||||||
{
|
{
|
||||||
x = static_cast<int16_t>(newLocation.x);
|
x = static_cast<int16_t>(newLocation.x);
|
||||||
y = static_cast<int16_t>(newLocation.y);
|
y = static_cast<int16_t>(newLocation.y);
|
||||||
z = static_cast<int16_t>(newLocation.z);
|
z = static_cast<int16_t>(newLocation.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite)
|
void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite)
|
||||||
{
|
{
|
||||||
auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), spritePos);
|
auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), spritePos);
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite)
|
||||||
/**
|
/**
|
||||||
* Frees any dynamically attached memory to the entity, such as peep name.
|
* Frees any dynamically attached memory to the entity, such as peep name.
|
||||||
*/
|
*/
|
||||||
static void FreeEntity(SpriteBase* entity)
|
static void FreeEntity(EntityBase* entity)
|
||||||
{
|
{
|
||||||
auto* guest = entity->As<Guest>();
|
auto* guest = entity->As<Guest>();
|
||||||
auto* staff = entity->As<Staff>();
|
auto* staff = entity->As<Staff>();
|
||||||
|
@ -565,7 +565,7 @@ static void FreeEntity(SpriteBase* entity)
|
||||||
*
|
*
|
||||||
* rct2: 0x0069EDB6
|
* rct2: 0x0069EDB6
|
||||||
*/
|
*/
|
||||||
void sprite_remove(SpriteBase* sprite)
|
void sprite_remove(EntityBase* sprite)
|
||||||
{
|
{
|
||||||
FreeEntity(sprite);
|
FreeEntity(sprite);
|
||||||
|
|
||||||
|
@ -605,13 +605,13 @@ uint16_t remove_floating_sprites()
|
||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sprite_set_flashing(SpriteBase* sprite, bool flashing)
|
void sprite_set_flashing(EntityBase* sprite, bool flashing)
|
||||||
{
|
{
|
||||||
assert(sprite->sprite_index < MAX_ENTITIES);
|
assert(sprite->sprite_index < MAX_ENTITIES);
|
||||||
_spriteFlashingList[sprite->sprite_index] = flashing;
|
_spriteFlashingList[sprite->sprite_index] = flashing;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sprite_get_flashing(SpriteBase* sprite)
|
bool sprite_get_flashing(EntityBase* sprite)
|
||||||
{
|
{
|
||||||
assert(sprite->sprite_index < MAX_ENTITIES);
|
assert(sprite->sprite_index < MAX_ENTITIES);
|
||||||
return _spriteFlashingList[sprite->sprite_index];
|
return _spriteFlashingList[sprite->sprite_index];
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "SpriteBase.h"
|
#include "EntityBase.h"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
union rct_sprite
|
union rct_sprite
|
||||||
{
|
{
|
||||||
uint8_t pad_00[0x200];
|
uint8_t pad_00[0x200];
|
||||||
SpriteBase base;
|
EntityBase base;
|
||||||
};
|
};
|
||||||
assert_struct_size(rct_sprite, 0x200);
|
assert_struct_size(rct_sprite, 0x200);
|
||||||
|
|
||||||
|
@ -38,11 +38,11 @@ struct rct_sprite_checksum
|
||||||
void reset_sprite_list();
|
void reset_sprite_list();
|
||||||
void reset_sprite_spatial_index();
|
void reset_sprite_spatial_index();
|
||||||
void sprite_misc_update_all();
|
void sprite_misc_update_all();
|
||||||
void sprite_set_coordinates(const CoordsXYZ& spritePos, SpriteBase* sprite);
|
void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite);
|
||||||
void sprite_remove(SpriteBase* sprite);
|
void sprite_remove(EntityBase* sprite);
|
||||||
uint16_t remove_floating_sprites();
|
uint16_t remove_floating_sprites();
|
||||||
|
|
||||||
rct_sprite_checksum sprite_checksum();
|
rct_sprite_checksum sprite_checksum();
|
||||||
|
|
||||||
void sprite_set_flashing(SpriteBase* sprite, bool flashing);
|
void sprite_set_flashing(EntityBase* sprite, bool flashing);
|
||||||
bool sprite_get_flashing(SpriteBase* sprite);
|
bool sprite_get_flashing(EntityBase* sprite);
|
||||||
|
|
Loading…
Reference in a new issue