Skip to content

Commit

Permalink
LASTEXPRESS: Move some macros to entity.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Templier committed Jul 27, 2012
1 parent 831e1b2 commit 2c4518d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
23 changes: 23 additions & 0 deletions engines/lastexpress/entities/entity.h
Expand Up @@ -41,6 +41,29 @@ class Sequence;
class SequenceFrame;
struct SavePoint;


//////////////////////////////////////////////////////////////////////////
// Callbacks
#define ENTITY_CALLBACK(class, name, pointer) \
Common::Functor1Mem<const SavePoint&, void, class>(pointer, &class::name)

#define ADD_CALLBACK_FUNCTION(class, name) \
_callbacks.push_back(new ENTITY_CALLBACK(class, name, this));

#define ADD_NULL_FUNCTION() \
_callbacks.push_back(new ENTITY_CALLBACK(Entity, nullfunction, this));

//////////////////////////////////////////////////////////////////////////
// Parameters macros
//////////////////////////////////////////////////////////////////////////
#define CURRENT_PARAM(index, id) \
((EntityData::EntityParametersIIII*)_data->getCurrentParameters(index))->param##id

#define ENTITY_PARAM(index, id) \
((EntityData::EntityParametersIIII*)_data->getParameters(8, index))->param##id



class EntityData : Common::Serializable {
public:

Expand Down
20 changes: 0 additions & 20 deletions engines/lastexpress/entities/entity_intern.h
Expand Up @@ -25,17 +25,6 @@

namespace LastExpress {

//////////////////////////////////////////////////////////////////////////
// Callbacks
#define ENTITY_CALLBACK(class, name, pointer) \
Common::Functor1Mem<const SavePoint&, void, class>(pointer, &class::name)

#define ADD_CALLBACK_FUNCTION(class, name) \
_callbacks.push_back(new ENTITY_CALLBACK(class, name, this));

#define ADD_NULL_FUNCTION() \
_callbacks.push_back(new ENTITY_CALLBACK(Entity, nullfunction, this));

//////////////////////////////////////////////////////////////////////////
// Declaration
//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -307,15 +296,6 @@ void class::setup_##name() { \
getEntities()->resetState(entity); \
((class *)getEntities()->get(entity))->function();

//////////////////////////////////////////////////////////////////////////
// Parameters macros (for default IIII parameters)
//////////////////////////////////////////////////////////////////////////
#define CURRENT_PARAM(index, id) \
((EntityData::EntityParametersIIII*)_data->getCurrentParameters(index))->param##id

#define ENTITY_PARAM(index, id) \
((EntityData::EntityParametersIIII*)_data->getParameters(8, index))->param##id

//////////////////////////////////////////////////////////////////////////
// Time check macros
//////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 2c4518d

Please sign in to comment.