diff options
author | Julien | 2012-07-23 14:28:41 -0400 |
---|---|---|
committer | Julien | 2012-07-27 00:15:00 -0400 |
commit | 8545991739848d878e61ff058e8fa1326261e634 (patch) | |
tree | 109b942affed199343d96240354f580054f245a0 /engines/lastexpress/entities/entity.cpp | |
parent | e985f7374fd20efc4574bc8320967deef7489d5a (diff) | |
download | scummvm-rg350-8545991739848d878e61ff058e8fa1326261e634.tar.gz scummvm-rg350-8545991739848d878e61ff058e8fa1326261e634.tar.bz2 scummvm-rg350-8545991739848d878e61ff058e8fa1326261e634.zip |
LASTEXPRESS: Remove several TIME_CHECK* macros
Diffstat (limited to 'engines/lastexpress/entities/entity.cpp')
-rw-r--r-- | engines/lastexpress/entities/entity.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp index 04ae6493c3..48856a7bc4 100644 --- a/engines/lastexpress/entities/entity.cpp +++ b/engines/lastexpress/entities/entity.cpp @@ -637,6 +637,57 @@ bool Entity::updateParameterCheck(uint ¶meter, uint timeType, uint delta) { return true; } +bool Entity::timeCheck(TimeValue timeValue, uint ¶meter, Common::Functor0<void> *function) { + if (getState()->time > timeValue && !parameter) { + parameter = 1; + (*function)(); + + return true; + } + + return false; +} + +bool Entity::timeCheckCallback(TimeValue timeValue, uint ¶meter, byte callback, Common::Functor0<void> *function) { + if (getState()->time > timeValue && !parameter) { + parameter = 1; + setCallback(callback); + (*function)(); + + return true; + } + + return false; +} + +bool Entity::timeCheckCallbackInventory(TimeValue timeValue, uint ¶meter, byte callback, Common::Functor0<void> *function) { + if (getState()->time > timeValue && !parameter) { + parameter = 1; + getData()->inventoryItem = kItemNone; + setCallback(callback); + (*function)(); + + return true; + } + + return false; +} + +bool Entity::timeCheckCar(TimeValue timeValue, uint ¶meter, byte callback, Common::Functor0<void> *function) { + if ((getState()->time <= timeValue && !getEntities()->isPlayerInCar(kCarGreenSleeping)) || !parameter) + parameter = (uint)getState()->time + 75; + + if (getState()->time > timeValue || parameter < getState()->time) { + parameter = kTimeInvalid; + setCallback(callback); + (*function)(); + + return true; + } + + return false; +} + void Entity::timeCheckSavepoint(TimeValue timeValue, uint ¶meter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) { if (getState()->time > timeValue && !parameter) { parameter = 1; |