Started work on build system
This commit is contained in:
@@ -8,16 +8,11 @@
|
||||
class CBaseEntity;
|
||||
class C_BaseEntity;
|
||||
|
||||
struct Triangle_t
|
||||
{
|
||||
float location[9];
|
||||
float uv[6];
|
||||
float normal[9];
|
||||
uint32_t texture;
|
||||
};
|
||||
|
||||
/* server entities */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Base server entity class.
|
||||
// It is updated every 1/tickrate (64) of a second. Does not require special
|
||||
// classes to exist.
|
||||
//-----------------------------------------------------------------------------
|
||||
class CBaseEntity
|
||||
{
|
||||
public:
|
||||
@@ -25,10 +20,18 @@ public:
|
||||
virtual void Precache() = 0;
|
||||
virtual void Spawn( void ) = 0;
|
||||
virtual void Destroy( void ) = 0;
|
||||
virtual void ReadParameter( const char *szName, const char *szValue );
|
||||
virtual void Think( float fDelta ) = 0;
|
||||
void SetPosition( vec3 position );
|
||||
void SetRotationEuler( vec3 euler );
|
||||
void SetRotationQuat( vec4 quaternion );
|
||||
void SetRotationMatrix( mat3 matrix );
|
||||
void SetScale( vec3 scale );
|
||||
|
||||
C_BaseEntity *pClientEntity;
|
||||
mat4 m_matrix;
|
||||
mat3 m_matrix;
|
||||
vec3 m_position;
|
||||
vec3 m_scale;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,9 +58,12 @@ CBaseEntity *__entity_alloc_##name() \
|
||||
}; \
|
||||
CEntityRegistry __entity_##name##_registry(#name, #class, __entity_alloc_##name); \
|
||||
|
||||
/* client entities */
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Base client entity class.
|
||||
// It recieves pure server data, which has to be interpolated by the client to
|
||||
// get smoother image.
|
||||
//-----------------------------------------------------------------------------
|
||||
class C_BaseEntity
|
||||
{
|
||||
public:
|
||||
@@ -66,7 +72,6 @@ public:
|
||||
virtual void Precache() = 0;
|
||||
virtual void Spawn( void ) = 0;
|
||||
virtual void Destroy( void ) = 0;
|
||||
/* happens every frame instead of tick */
|
||||
virtual void Think( float fDelta ) = 0;
|
||||
private:
|
||||
};
|
||||
@@ -77,6 +82,10 @@ public:
|
||||
C_EntityRegistry( const char *pName, ClientEntityRegistryFn pfn );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Server-Client sync for entities. When new server entity is created, client
|
||||
// entity gets created as well.
|
||||
//-----------------------------------------------------------------------------
|
||||
#define LINK_CLIENT_ENTITY(client, server) \
|
||||
C_BaseEntity *__c_entity_alloc_##server() \
|
||||
{ \
|
||||
|
||||
Reference in New Issue
Block a user