1
0
forked from 0ad/0ad
0ad/source/graphics/ObjectBase.h
Ykkrosh 22dd4dd67b Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual
editing. Updated existing maps to newest format, so that they can still
work. Added undocumented _rewriteMaps() JS function. Also renamed _mem
to vmem, and reclassified its undocumentedness as unintentional, since
it's reasonably useful.
Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc
which don't care about progressiveness.
main.cpp: re-enabled vfs_display, since it doesn't crash now
Vector3D: stopped warning

This was SVN commit r2078.
2005-03-29 20:50:04 +00:00

76 lines
1.5 KiB
C++

#ifndef _OBJECTBASE_H
#define _OBJECTBASE_H
class CModel;
class CSkeletonAnim;
#include <vector>
#include "CStr.h"
class CObjectBase
{
public:
struct Anim {
// constructor
Anim() : m_Speed(1), m_AnimData(0) {}
// name of the animation - "Idle", "Run", etc
CStr m_AnimName;
// filename of the animation - manidle.psa, manrun.psa, etc
CStr m_FileName;
// animation speed, as specified in XML actor file
float m_Speed;
// the animation data, specific to the this model
CSkeletonAnim* m_AnimData;
};
struct Prop {
// name of the prop point to attach to - "Prop01", "Prop02", "Head", "LeftHand", etc ..
CStr m_PropPointName;
// name of the model file - art/actors/props/sword.xml or whatever
CStr m_ModelName;
};
struct Variant
{
Variant() : m_Frequency(0) {}
CStr m_VariantName;
int m_Frequency;
CStr m_ModelFilename;
CStr m_TextureFilename;
std::vector<Anim> m_Anims;
std::vector<Prop> m_Props;
};
CObjectBase();
std::vector< std::vector<Variant> > m_Variants;
typedef std::vector<u8> variation_key;
void CalculateVariation(std::set<CStr>& strings, variation_key& variation);
bool Load(const char* filename);
// object name
CStr m_Name;
// short human-readable name
CStr m_ShortName;
struct {
// automatically flatten terrain when applying object
bool m_AutoFlatten;
// cast shadows from this object
bool m_CastShadows;
} m_Properties;
// the material file
CStr m_Material;
};
#endif