imported patch gamestate_to_model

This commit is contained in:
2010-06-02 13:39:39 +02:00
parent 710d3e2509
commit 54e14b41af
3 changed files with 15 additions and 12 deletions
+6 -3
View File
@@ -23,10 +23,13 @@
#define DECL_ENUM_ELEMENT( element ) element
#define BEGIN_ENUM( ENUM_NAME ) typedef enum tag##ENUM_NAME
#define END_ENUM( ENUM_NAME ) ENUM_NAME; \
const char* GetString##ENUM_NAME(enum tag##ENUM_NAME index);
const char* GetString##ENUM_NAME(enum tag##ENUM_NAME index); \
const char* GetString##ENUM_NAME(unsigned int index);
#else
#define DECL_ENUM_ELEMENT( element ) #element
#define BEGIN_ENUM( ENUM_NAME ) const char* gs_##ENUM_NAME [] =
#define END_ENUM( ENUM_NAME ) ; const char* GetString##ENUM_NAME(enum \
tag##ENUM_NAME index){ return gs_##ENUM_NAME [index]; }
#define END_ENUM( ENUM_NAME ) ; \
const char* GetString##ENUM_NAME(enum \
tag##ENUM_NAME index){ return gs_##ENUM_NAME [index]; } \
const char* GetString##ENUM_NAME(unsigned int index){ return gs_##ENUM_NAME [index]; }
#endif
+9
View File
@@ -72,6 +72,12 @@ class ModelBase : public Module {
void SendEntityCollisionEvent (const unsigned int reference_entity_id,
const unsigned int incidence_entity_id, float collision_time, vector3d normal);
void SetGameState (const unsigned int &state) {
mLastGameState = mGameState;
mGameState = state;
};
unsigned int GetGameState () { return mGameState; };
protected:
/** \brief Initializes the system */
virtual int OnInit (int argc, char* argv[]);
@@ -98,6 +104,9 @@ class ModelBase : public Module {
unsigned int mEntityIdCounter;
unsigned int mPlayerEntityId;
unsigned int mGameState;
unsigned int mLastGameState;
float mDeltaSec;
friend class ViewBase;