18#ifndef INCLUDED_OBJECTBASE
19#define INCLUDED_OBJECTBASE
31#include <boost/random/mersenne_twister.hpp>
35#include <unordered_set>
240 const std::shared_ptr<CObjectBase>&
GetBase(
u8 QualityLevel)
const;
Represents an actor file.
Definition: ObjectBase.h:215
std::vector< std::shared_ptr< CObjectBase > > m_ObjectBases
Definition: ObjectBase.h:267
void LoadErrorPlaceholder(const VfsPath &pathname)
Initialise this object with a default placeholder actor, pretending to be the actor at pathname.
Definition: ObjectBase.cpp:1010
VfsPath GetPathname() const
Definition: ObjectBase.h:228
bool UsesFile(const VfsPath &pathname) const
Returns whether this actor (including any possible props) uses the given file.
Definition: ObjectBase.cpp:1005
VfsPath m_Pathname
Definition: ObjectBase.h:261
std::set< CStr > PickSelectionsAtRandom(uint32_t seed) const
Return a list of selections specifying a particular variant in all groups, based on the seed.
Definition: ObjectBase.cpp:784
CActorDef(CObjectManager &objectManager)
Definition: ObjectBase.cpp:780
bool Load(const VfsPath &pathname)
Initialise this object by loading from the given file.
Definition: ObjectBase.cpp:815
std::vector< u8 > QualityLevels() const
Definition: ObjectBase.cpp:792
const std::shared_ptr< CObjectBase > & GetBase(u8 QualityLevel) const
Return the Object base matching the given quality level.
Definition: ObjectBase.cpp:801
CObjectManager & m_ObjectManager
Definition: ObjectBase.h:264
std::unordered_set< VfsPath > m_UsedFiles
Definition: ObjectBase.h:269
Maintains the tree of possible objects from a specific actor definition at a given quality level.
Definition: ObjectBase.h:47
CObjectBase(CObjectManager &objectManager, CActorDef &actorDef, u8 QualityLevel)
Definition: ObjectBase.cpp:59
std::set< CStr > CalculateRandomRemainingSelections(uint32_t seed, const std::vector< std::set< CStr > > &initialSelections) const
Definition: ObjectBase.cpp:510
u8 m_QualityLevel
Definition: ObjectBase.h:172
VfsPath m_Material
Definition: ObjectBase.h:169
bool UsesFile(const VfsPath &pathname) const
Returns whether this object (including any possible props) uses the given file.
Definition: ObjectBase.cpp:774
void GetQualitySplits(std::vector< u8 > &splits) const
Get all quality levels at which this object changes (includes props).
Definition: ObjectBase.cpp:725
boost::mt19937 rng_t
Definition: ObjectBase.h:186
std::unique_ptr< CObjectBase > CopyWithQuality(u8 newQualityLevel) const
Acts as an explicit copy constructor, for a new quality level.
Definition: ObjectBase.cpp:70
friend CActorDef
Definition: ObjectBase.h:48
struct CObjectBase::@7 m_Properties
std::vector< u8 > CalculateVariationKey(const std::vector< const std::set< CStr > * > &selections) const
Definition: ObjectBase.cpp:348
std::vector< std::vector< Variant > > m_VariantGroups
Definition: ObjectBase.h:206
CActorDef & m_ActorDef
Definition: ObjectBase.h:201
const Variation BuildVariation(const std::vector< u8 > &variationKey) const
Definition: ObjectBase.cpp:436
bool LoadVariant(const CXeromyces &XeroFile, const XMBElement &variant, Variant ¤tVariant)
Definition: ObjectBase.cpp:160
bool m_CastShadows
Definition: ObjectBase.h:163
const CStr & GetIdentifier() const
Definition: ObjectBase.cpp:769
CStr m_Identifier
Definition: ObjectBase.h:204
bool m_FloatOnWater
Definition: ObjectBase.h:165
std::vector< std::vector< CStr > > GetVariantGroups() const
Definition: ObjectBase.cpp:660
CObjectManager & m_ObjectManager
Definition: ObjectBase.h:207
bool Load(const CXeromyces &XeroFile, const XMBElement &base)
Definition: ObjectBase.cpp:80
Definition: ObjectEntry.h:38
Definition: ObjectManager.h:42
Interned 8-bit strings.
Definition: CStrIntern.h:38
Definition: Xeromyces.h:41
Definition: XMBData.h:136
Definition: ObjectBase.h:54
int m_Frequency
Definition: ObjectBase.h:61
float m_SoundPos
Definition: ObjectBase.h:70
float m_Speed
Definition: ObjectBase.h:65
float m_ActionPos2
Definition: ObjectBase.h:69
VfsPath m_FileName
Definition: ObjectBase.h:63
CStr m_ID
Definition: ObjectBase.h:60
float m_ActionPos
Definition: ObjectBase.h:68
CStr m_AnimName
Definition: ObjectBase.h:58
Anim()
Definition: ObjectBase.h:56
Definition: ObjectBase.h:96
float m_SizeX
Definition: ObjectBase.h:99
Decal()
Definition: ObjectBase.h:97
float m_Angle
Definition: ObjectBase.h:101
float m_SizeZ
Definition: ObjectBase.h:100
float m_OffsetZ
Definition: ObjectBase.h:103
float m_OffsetX
Definition: ObjectBase.h:102
Definition: ObjectBase.h:74
Prop()
Definition: ObjectBase.h:76
CStrW m_ModelName
Definition: ObjectBase.h:80
CStr m_PropPointName
Definition: ObjectBase.h:78
bool m_selectable
Definition: ObjectBase.h:84
float m_minHeight
Definition: ObjectBase.h:82
float m_maxHeight
Definition: ObjectBase.h:83
Definition: ObjectBase.h:88
CStrIntern m_SamplerName
Definition: ObjectBase.h:90
VfsPath m_SamplerFile
Definition: ObjectBase.h:92
Definition: ObjectBase.h:107
std::vector< Samp > m_Samplers
Definition: ObjectBase.h:119
CStr m_Color
Definition: ObjectBase.h:115
VfsPath m_Particles
Definition: ObjectBase.h:114
VfsPath m_ModelFilename
Definition: ObjectBase.h:112
int m_Frequency
Definition: ObjectBase.h:111
std::vector< Anim > m_Anims
Definition: ObjectBase.h:117
Variant()
Definition: ObjectBase.h:108
Decal m_Decal
Definition: ObjectBase.h:113
std::vector< Prop > m_Props
Definition: ObjectBase.h:118
CStr m_VariantName
Definition: ObjectBase.h:110
Definition: ObjectBase.h:123
std::multimap< CStr, Samp > samplers
Definition: ObjectBase.h:130
std::multimap< CStr, Prop > props
Definition: ObjectBase.h:128
CStr color
Definition: ObjectBase.h:127
std::multimap< CStr, Anim > anims
Definition: ObjectBase.h:129
Decal decal
Definition: ObjectBase.h:125
VfsPath particles
Definition: ObjectBase.h:126
VfsPath model
Definition: ObjectBase.h:124
uint8_t u8
Definition: types.h:37
unsigned int uint32_t
Definition: wposix_types.h:53