aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/entities/entity.cpp
diff options
context:
space:
mode:
authorJulien2012-07-26 16:26:35 -0400
committerJulien2012-07-27 00:15:05 -0400
commitb4b4a7d127194cf29fdfcf5ee7b41b875d26b37e (patch)
tree5082d4dd985a11ce366a75c283f2b0a238aa5727 /engines/lastexpress/entities/entity.cpp
parent2d6f7992351c9737f71964ad64c307fa6d1543cf (diff)
downloadscummvm-rg350-b4b4a7d127194cf29fdfcf5ee7b41b875d26b37e.tar.gz
scummvm-rg350-b4b4a7d127194cf29fdfcf5ee7b41b875d26b37e.tar.bz2
scummvm-rg350-b4b4a7d127194cf29fdfcf5ee7b41b875d26b37e.zip
LASTEXPRESS: Replace setup macros by functions
Diffstat (limited to 'engines/lastexpress/entities/entity.cpp')
-rw-r--r--engines/lastexpress/entities/entity.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp
index a9ceaa16a9..8595978390 100644
--- a/engines/lastexpress/entities/entity.cpp
+++ b/engines/lastexpress/entities/entity.cpp
@@ -596,6 +596,46 @@ void Entity::callbackAction() {
}
//////////////////////////////////////////////////////////////////////////
+// Setup functions
+//////////////////////////////////////////////////////////////////////////
+void Entity::setup(const char *name, uint index) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s()", name);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIIII>();
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+}
+
+void Entity::setupS(const char *name, uint index, const char *seq1) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s)", name, seq1);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSIIS>();
+
+ EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+}
+
+void Entity::setupSS(const char *name, uint index, const char *seq1, const char *seq2) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %s)", name, seq1, seq2);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSSII>();
+
+ EntityData::EntityParametersSSII *params = (EntityData::EntityParametersSSII*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+ strncpy((char *)&params->seq2, seq2, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+}
+
+//////////////////////////////////////////////////////////////////////////
// Helper functions
//////////////////////////////////////////////////////////////////////////