18 #include "precompiled.h"
45 return "<a:component type='system'/><empty/>";
98 ENSURE(1 <= tiles && tiles <= 65535);
105 ENSURE(1 <= vertices && vertices <= 65535);
106 return (
u16)vertices;
122 if (cmpObstructionManager)
139 g_Renderer.GetWaterManager()->SetMapSize(vertices);
An entity initialisation parameter node.
A simple fixed-point number class.
virtual u16 GetTilesPerSide()
Returns number of tiles per side on the terrain.
#define REGISTER_COMPONENT_TYPE(cname)
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
virtual CTerrain * GetCTerrain()
const ssize_t TERRAIN_TILE_SIZE
metres [world space units] per tile in x and z
virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1)=0
Set the bounds of the world.
Serialization interface; see serialization overview.
Sent when terrain (texture or elevation) has been changed.
ssize_t GetVerticesPerSide() const
virtual void Serialize(ISerializer &serialize)
float GetExactGroundLevel(float x, float z) const
virtual void Deserialize(const CParamNode ¶mNode, IDeserializer &deserialize)
virtual u16 GetVerticesPerSide()
Returns number of vertices per side on the terrain.
entity_id_t GetEntityId() const
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
virtual float GetExactGroundLevel(float x, float z)
virtual void Init(const CParamNode ¶mNode)
ssize_t GetTilesPerSide() const
virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z)
virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z)
virtual void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1)
Indicate that terrain tiles within the given region (inclusive lower bound, exclusive upper bound) ha...
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
const CSimContext & GetSimContext() const
static bool IsInitialised()
A simplified syntax for accessing entity components.
fixed GetExactGroundLevelFixed(fixed x, fixed z) const
static CFixed FromInt(int n)
CEntityHandle GetSystemEntity() const
void CalcNormalFixed(ssize_t i, ssize_t j, CFixedVector3D &normal) const
void PostMessage(entity_id_t ent, const CMessage &msg) const
Send a message, targeted at a particular entity.
static void ClassInit(CComponentManager &componentManager)
virtual CVector3D CalcExactNormal(float x, float z)
virtual void ReloadTerrain()
Call when the underlying CTerrain has been modified behind our backs.
static std::string GetSchema()
virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, ssize_t vertices)=0
Set the bounds of the world.
CVector3D CalcExactNormal(float x, float z) const
CComponentManager & GetComponentManager() const
CTerrain & GetTerrain() const
Deserialization interface; see serialization overview.