diff options
author | Julien | 2012-07-22 21:14:48 -0400 |
---|---|---|
committer | Julien | 2012-07-27 00:14:55 -0400 |
commit | c589e69ec9f29e59fc4358e5045fcc613f9ab6a8 (patch) | |
tree | 842b0864648e2fb1e0552e3f640e402b6a86e18c /engines/lastexpress/entities | |
parent | 5d4a8f1e15c9b90209cbd4572ef17552cc06d65c (diff) | |
download | scummvm-rg350-c589e69ec9f29e59fc4358e5045fcc613f9ab6a8.tar.gz scummvm-rg350-c589e69ec9f29e59fc4358e5045fcc613f9ab6a8.tar.bz2 scummvm-rg350-c589e69ec9f29e59fc4358e5045fcc613f9ab6a8.zip |
LASTEXPRESS: Replace TIME_CHECK_CALLBACK_ACTION macro
Diffstat (limited to 'engines/lastexpress/entities')
-rw-r--r-- | engines/lastexpress/entities/boutarel.cpp | 3 | ||||
-rw-r--r-- | engines/lastexpress/entities/entity.cpp | 10 | ||||
-rw-r--r-- | engines/lastexpress/entities/entity.h | 1 | ||||
-rw-r--r-- | engines/lastexpress/entities/entity_intern.h | 7 | ||||
-rw-r--r-- | engines/lastexpress/entities/gendarmes.cpp | 3 |
5 files changed, 15 insertions, 9 deletions
diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp index 95ec37bf50..ab5f019c49 100644 --- a/engines/lastexpress/entities/boutarel.cpp +++ b/engines/lastexpress/entities/boutarel.cpp @@ -476,7 +476,8 @@ IMPLEMENT_FUNCTION_IS(17, Boutarel, function17, TimeValue) break; case kActionNone: - TIME_CHECK_CALLBACK_ACTION(params->param1, params->param6); + if (Entity::timeCheckCallbackAction((TimeValue)params->param1, params->param6)) + break; if (params->param5) { UPDATE_PARAM(params->param7, getState()->timeTicks, 90) diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 4c661a4915..9cb6825f79 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -611,4 +611,14 @@ void Entity::timeCheckObject(TimeValue timeValue, uint ¶meter, ObjectIndex o } } +bool Entity::timeCheckCallbackAction(TimeValue timeValue, uint ¶meter) { + if (getState()->time > timeValue && !parameter) { + parameter = 1; + callbackAction(); + return true; + } + + return false; +} + } // End of namespace LastExpress diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 77c3793890..fb5c958464 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -871,6 +871,7 @@ protected: void timeCheckSavepoint(TimeValue timeValue, uint ¶meter, EntityIndex entity1, EntityIndex entity2, ActionIndex action); void timeCheckObject(TimeValue timeValue, uint ¶meter, ObjectIndex index, ObjectLocation location); + bool timeCheckCallbackAction(TimeValue timeValue, uint ¶meter); }; diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index 576765620f..cb4f7b941b 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -347,13 +347,6 @@ void class::setup_##name() { \ break; \ } -#define TIME_CHECK_CALLBACK_ACTION(timeValue, parameter) \ - if (getState()->time > timeValue && !parameter) { \ - parameter = 1; \ - callbackAction(); \ - break; \ - } - #define TIME_CHECK_PLAYSOUND_UPDATEPOSITION(timeValue, parameter, callback, sound, position) \ if (getState()->time > timeValue && !parameter) { \ parameter = 1; \ diff --git a/engines/lastexpress/entities/gendarmes.cpp b/engines/lastexpress/entities/gendarmes.cpp index 877c0c29b3..fe9f6f0aa5 100644 --- a/engines/lastexpress/entities/gendarmes.cpp +++ b/engines/lastexpress/entities/gendarmes.cpp @@ -551,7 +551,8 @@ void Gendarmes::arrest(const SavePoint &savepoint, bool shouldPlaySound, SoundFl case kActionNone: if (checkCallback) { EXPOSE_PARAMS(EntityData::EntityParametersIIII); - TIME_CHECK_CALLBACK_ACTION(params->param1, params->param2); + if (Entity::timeCheckCallbackAction((TimeValue)params->param1, params->param2)) + break; } if (shouldUpdateEntity) { |