aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/entities/entity.cpp
diff options
context:
space:
mode:
authorJulien2012-07-23 14:28:41 -0400
committerJulien2012-07-27 00:15:00 -0400
commit8545991739848d878e61ff058e8fa1326261e634 (patch)
tree109b942affed199343d96240354f580054f245a0 /engines/lastexpress/entities/entity.cpp
parente985f7374fd20efc4574bc8320967deef7489d5a (diff)
downloadscummvm-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.cpp51
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 &parameter, uint timeType, uint delta) {
return true;
}
+bool Entity::timeCheck(TimeValue timeValue, uint &parameter, Common::Functor0<void> *function) {
+ if (getState()->time > timeValue && !parameter) {
+ parameter = 1;
+ (*function)();
+
+ return true;
+ }
+
+ return false;
+}
+
+bool Entity::timeCheckCallback(TimeValue timeValue, uint &parameter, 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 &parameter, 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 &parameter, 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 &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) {
if (getState()->time > timeValue && !parameter) {
parameter = 1;