diff options
author | Littleboy | 2012-07-15 17:21:36 -0400 |
---|---|---|
committer | Littleboy | 2012-07-16 23:51:25 -0400 |
commit | 96d0aedba93e4ba2691a5ee1eba24a1f07539c96 (patch) | |
tree | 2d69962e6d2f5a247d1eb385956390e7f4edb7ec /engines/lastexpress | |
parent | 876a8f9377b6c5533ca81c3c358e8b74014dc93f (diff) | |
download | scummvm-rg350-96d0aedba93e4ba2691a5ee1eba24a1f07539c96.tar.gz scummvm-rg350-96d0aedba93e4ba2691a5ee1eba24a1f07539c96.tar.bz2 scummvm-rg350-96d0aedba93e4ba2691a5ee1eba24a1f07539c96.zip |
LASTEXPRESS: Replace SAVEGAME_BLOOD_JACKET macro by function
Diffstat (limited to 'engines/lastexpress')
-rw-r--r-- | engines/lastexpress/entities/coudert.cpp | 39 | ||||
-rw-r--r-- | engines/lastexpress/entities/coudert.h | 1 |
2 files changed, 21 insertions, 19 deletions
diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp index dc7beb3167..66733acc16 100644 --- a/engines/lastexpress/entities/coudert.cpp +++ b/engines/lastexpress/entities/coudert.cpp @@ -37,15 +37,6 @@ namespace LastExpress { -#define SAVEGAME_BLOOD_JACKET() \ - if (getProgress().jacket == kJacketBlood \ - && getEntities()->isDistanceBetweenEntities(kEntityCoudert, kEntityPlayer, 1000) \ - && !getEntities()->isInsideCompartments(kEntityPlayer) \ - && !getEntities()->checkFields10(kEntityPlayer)) { \ - setCallback(1); \ - setup_savegame(kSavegameTypeEvent, kEventMertensBloodJacket); \ - } - Coudert::Coudert(LastExpressEngine *engine) : Entity(engine, kEntityCoudert) { ADD_CALLBACK_FUNCTION(Coudert, reset); ADD_CALLBACK_FUNCTION(Coudert, bloodJacket); @@ -124,7 +115,7 @@ IMPLEMENT_FUNCTION_S(2, Coudert, bloodJacket) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); break; case kActionExitCompartment: @@ -151,7 +142,7 @@ IMPLEMENT_FUNCTION_SI(3, Coudert, enterExitCompartment, ObjectIndex) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); return; case kActionCallback: @@ -177,7 +168,7 @@ IMPLEMENT_FUNCTION(4, Coudert, callbackActionOnDirection) break; } - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); break; case kActionExitCompartment: @@ -200,7 +191,7 @@ IMPLEMENT_FUNCTION_SIII(5, Coudert, enterExitCompartment2, ObjectIndex, EntityPo break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); return; case kActionCallback: @@ -221,7 +212,7 @@ IMPLEMENT_FUNCTION_S(6, Coudert, playSound) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); break; case kActionEndSound: @@ -250,7 +241,7 @@ IMPLEMENT_FUNCTION_NOSETUP(7, Coudert, playSound16) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); break; case kActionEndSound: @@ -363,7 +354,7 @@ IMPLEMENT_FUNCTION_I(10, Coudert, updateFromTime, uint32) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); UPDATE_PARAM(params->param2, getState()->time, params->param1); @@ -386,7 +377,7 @@ IMPLEMENT_FUNCTION_I(11, Coudert, updateFromTicks, uint32) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); UPDATE_PARAM(params->param2, getState()->timeTicks, params->param1); @@ -460,7 +451,7 @@ IMPLEMENT_FUNCTION_II(13, Coudert, function13, bool, EntityIndex) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); if (!params->param2 && !params->param3) { @@ -582,7 +573,7 @@ IMPLEMENT_FUNCTION_I(14, Coudert, function14, EntityIndex) break; case kActionNone: - SAVEGAME_BLOOD_JACKET(); + savegameBloodJacket(); break; case kActionDefault: @@ -4173,4 +4164,14 @@ void Coudert::visitCompartment(const SavePoint &savepoint, EntityPosition positi } } +void Coudert::savegameBloodJacket() { + if (getProgress().jacket == kJacketBlood + && getEntities()->isDistanceBetweenEntities(kEntityCoudert, kEntityPlayer, 1000) + && !getEntities()->isInsideCompartments(kEntityPlayer) + && !getEntities()->checkFields10(kEntityPlayer)) { + setCallback(1); + setup_savegame(kSavegameTypeEvent, kEventMertensBloodJacket); + } +} + } // End of namespace LastExpress diff --git a/engines/lastexpress/entities/coudert.h b/engines/lastexpress/entities/coudert.h index 45d13ce9bb..d06bb95ce9 100644 --- a/engines/lastexpress/entities/coudert.h +++ b/engines/lastexpress/entities/coudert.h @@ -219,6 +219,7 @@ public: private: void visitCompartment(const SavePoint &savepoint, EntityPosition position, const char *seq1, ObjectIndex compartment, const char *seq2, const char *seq3, EntityPosition sittingPosition, ObjectIndex object, const char *seq4); + void savegameBloodJacket(); }; } // End of namespace LastExpress |