Permalink
Browse files

LASTEXPRESS: fix gcc build

  • Loading branch information...
grechnik committed Aug 25, 2018
1 parent 28d83ee commit cdd7cc687f0b308c7e606e5b5e68c9aec0f5a121
Showing with 6 additions and 6 deletions.
  1. +2 −2 engines/lastexpress/entities/entity.cpp
  2. +4 −4 engines/lastexpress/entities/entity.h
@@ -167,7 +167,7 @@ void EntityData::saveLoadWithSerializer(Common::Serializer &s, const Common::Arr

for (uint i = 0; i < 8; i++) {
if (!paramsTypeSetters || _data.callbacks[i] >= paramsTypeSetters->size())
resetParametersType<EntityParametersIIII>(&_parameters[i]);
resetParametersType<EntityParametersIIII, EntityParametersIIII, EntityParametersIIII>(&_parameters[i]);
else
(*paramsTypeSetters)[_data.callbacks[i]](&_parameters[i]);
}
@@ -186,7 +186,7 @@ Entity::Entity(LastExpressEngine *engine, EntityIndex index) : _engine(engine),

// Add first empty entry to callbacks array
_callbacks.push_back(NULL);
_paramsTypeSetters.push_back(&EntityData::resetParametersType<EntityData::EntityParametersIIII>);
_paramsTypeSetters.push_back(&EntityData::resetParametersType<EntityData::EntityParametersIIII, EntityData::EntityParametersIIII, EntityData::EntityParametersIIII>);
}

Entity::~Entity() {
@@ -78,11 +78,11 @@ struct SavePoint;

#define ADD_CALLBACK_FUNCTION_TYPE(class, name, type) \
_callbacks.push_back(new ENTITY_CALLBACK(class, name, this)); \
_paramsTypeSetters.push_back(&EntityData::resetParametersType<EntityData::type>);
_paramsTypeSetters.push_back(&EntityData::resetParametersType<EntityData::type, EntityData::EntityParametersIIII, EntityData::EntityParametersIIII>);

#define ADD_CALLBACK_FUNCTION_TYPE2(class, name, type1, type2) \
_callbacks.push_back(new ENTITY_CALLBACK(class, name, this)); \
_paramsTypeSetters.push_back(&EntityData::resetParametersType<EntityData::type1, EntityData::type2>);
_paramsTypeSetters.push_back(&EntityData::resetParametersType<EntityData::type1, EntityData::type2, EntityData::EntityParametersIIII>);

#define ADD_CALLBACK_FUNCTION_TYPE3(class, name, type1, type2, type3) \
_callbacks.push_back(new ENTITY_CALLBACK(class, name, this)); \
@@ -106,7 +106,7 @@ struct SavePoint;

#define ADD_NULL_FUNCTION() \
_callbacks.push_back(new ENTITY_CALLBACK(Entity, nullfunction, this)); \
_paramsTypeSetters.push_back(&(EntityData::resetParametersType<EntityData::EntityParametersIIII>));
_paramsTypeSetters.push_back(&(EntityData::resetParametersType<EntityData::EntityParametersIIII, EntityData::EntityParametersIIII, EntityData::EntityParametersIIII>));

#define WRAP_SETUP_FUNCTION(className, method) \
new Common::Functor0Mem<void, className>(this, &className::method)
@@ -873,7 +873,7 @@ class EntityData {

EntityData() {}

template<class T1, class T2 = EntityParametersIIII, class T3 = EntityParametersIIII>
template<class T1, class T2, class T3>
static void resetParametersType(EntityCallParameters* params) {
params->clear();
params->parameters[0] = new T1();

0 comments on commit cdd7cc6

Please sign in to comment.