aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232015-11-19 14:56:16 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit601c6f408210344c73dcf4f3bab34b493132387a (patch)
tree10d3952aaf9f474bcac2c4bed96b9755c9056e38 /engines
parent8b48f2f63f5cc21d864c3e960ce307b50286b64b (diff)
downloadscummvm-rg350-601c6f408210344c73dcf4f3bab34b493132387a.tar.gz
scummvm-rg350-601c6f408210344c73dcf4f3bab34b493132387a.tar.bz2
scummvm-rg350-601c6f408210344c73dcf4f3bab34b493132387a.zip
ILLUSIONS: Terminate update functions on scene exit; fix bugs and use constants
Diffstat (limited to 'engines')
-rw-r--r--engines/illusions/bbdou/illusions_bbdou.cpp3
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp6
-rw-r--r--engines/illusions/duckman/propertytimers.cpp8
-rw-r--r--engines/illusions/illusions.cpp10
-rw-r--r--engines/illusions/updatefunctions.cpp3
-rw-r--r--engines/illusions/updatefunctions.h4
6 files changed, 16 insertions, 18 deletions
diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp
index b872a3c6e8..6ce367fb62 100644
--- a/engines/illusions/bbdou/illusions_bbdou.cpp
+++ b/engines/illusions/bbdou/illusions_bbdou.cpp
@@ -515,8 +515,7 @@ bool IllusionsEngine_BBDOU::enterScene(uint32 sceneId, uint32 threadId) {
void IllusionsEngine_BBDOU::exitScene(uint32 threadId) {
uint32 sceneId = _activeScenes.getCurrentScene();
- // TODO krnfileDump(sceneId);
- // TODO UpdateFunctions_disableBySceneId__TODO_maybe(sceneId);
+ _updateFunctions->terminateByScene(sceneId);
_threads->terminateThreadsBySceneId(sceneId, threadId);
_controls->destroyControlsBySceneId(sceneId);
_triggerFunctions->removeBySceneId(sceneId);
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index 86cd068f22..ed165f0c16 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -251,7 +251,7 @@ void IllusionsEngine_Duckman::initUpdateFunctions() {
int IllusionsEngine_Duckman::updateScript(uint flags) {
// TODO Some more stuff
_threads->updateThreads();
- return 1;
+ return kUFNext;
}
void IllusionsEngine_Duckman::startScreenShaker(uint pointsCount, uint32 duration, const ScreenShakerPoint *points, uint32 threadId) {
@@ -589,7 +589,7 @@ void IllusionsEngine_Duckman::startCursorHoldingObject(uint32 objectId, uint32 s
_cursor._sequenceId2 = sequenceId;
_cursor._actorIndex = 7;
_cursor._savedActorIndex = 7;
- _cursor._field14[_cursor._actorIndex - 1] = true;
+ _cursor._field14[6] = true;
_cursor._control->startSequenceActor(sequenceId, 2, 0);
setCursorActorIndex(_cursor._actorIndex, 1, 0);
_cursor._currOverlappedControl = 0;
@@ -776,7 +776,7 @@ void IllusionsEngine_Duckman::dumpActiveScenes(uint32 sceneId, uint32 threadId)
}
void IllusionsEngine_Duckman::dumpCurrSceneFiles(uint32 sceneId, uint32 threadId) {
- // TODO UpdateFunctions_disableBySceneId(sceneId);
+ _updateFunctions->terminateByScene(sceneId);
_threads->terminateActiveThreads(threadId);
_threads->terminateThreadsBySceneId(sceneId, threadId);
_controls->destroyActiveControls();
diff --git a/engines/illusions/duckman/propertytimers.cpp b/engines/illusions/duckman/propertytimers.cpp
index 60e58866b2..47d8cb47c4 100644
--- a/engines/illusions/duckman/propertytimers.cpp
+++ b/engines/illusions/duckman/propertytimers.cpp
@@ -81,7 +81,7 @@ bool PropertyTimers::findPropertyTimer(uint32 propertyId, PropertyTimer *&proper
}
int PropertyTimers::updatePropertyTimers(uint flags) {
- int result = 1;
+ int result = kUFNext;
uint32 currTime = getCurrentTime();
if (_vm->_pauseCtr <= 0) {
if (_propertyTimersPaused) {
@@ -95,7 +95,7 @@ int PropertyTimers::updatePropertyTimers(uint flags) {
if (flags & 1) {
_propertyTimersActive = false;
_propertyTimersPaused = false;
- result = 2;
+ result = kUFTerminate;
} else {
bool timersActive = false;
for (uint i = 0; i < kPropertyTimersCount; ++i) {
@@ -110,7 +110,7 @@ int PropertyTimers::updatePropertyTimers(uint flags) {
if (!timersActive) {
_propertyTimersActive = false;
_propertyTimersPaused = false;
- result = 2;
+ result = kUFTerminate;
}
}
} else {
@@ -121,7 +121,7 @@ int PropertyTimers::updatePropertyTimers(uint flags) {
}
_propertyTimersPaused = true;
}
- result = 1;
+ result = kUFNext;
}
return result;
}
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 4c8c7dc28f..d3eb50fe71 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -125,7 +125,7 @@ int IllusionsEngine::updateActors(uint flags) {
if (control->_pauseCtr == 0 && control->_actor && control->_actor->_controlRoutine)
control->_actor->runControlRoutine(control, deltaTime);
}
- return 1;
+ return kUFNext;
}
int IllusionsEngine::updateSequences(uint flags) {
@@ -136,7 +136,7 @@ int IllusionsEngine::updateSequences(uint flags) {
control->sequenceActor();
}
}
- return 1;
+ return kUFNext;
}
int IllusionsEngine::updateGraphics(uint flags) {
@@ -196,18 +196,18 @@ int IllusionsEngine::updateGraphics(uint flags) {
_screenText->_position, priority);
}
- return 1;
+ return kUFNext;
}
int IllusionsEngine::updateSprites(uint flags) {
_screen->updateSprites();
_screen->updatePalette();
- return 1;
+ return kUFNext;
}
int IllusionsEngine::updateSoundMan(uint flags) {
_soundMan->update();
- return 1;
+ return kUFNext;
}
int IllusionsEngine::getRandom(int max) {
diff --git a/engines/illusions/updatefunctions.cpp b/engines/illusions/updatefunctions.cpp
index cfd2c44b96..86aaf55048 100644
--- a/engines/illusions/updatefunctions.cpp
+++ b/engines/illusions/updatefunctions.cpp
@@ -71,8 +71,7 @@ void UpdateFunctions::update() {
}
void UpdateFunctions::terminateByScene(uint32 sceneId) {
- UpdateFunctionListIterator it = _updateFunctions.begin();
- while (it != _updateFunctions.end())
+ for (UpdateFunctionListIterator it = _updateFunctions.begin(); it != _updateFunctions.end(); ++it)
if ((*it)->_sceneId == sceneId)
(*it)->terminate();
}
diff --git a/engines/illusions/updatefunctions.h b/engines/illusions/updatefunctions.h
index b89b2a81d7..c09d95ba0e 100644
--- a/engines/illusions/updatefunctions.h
+++ b/engines/illusions/updatefunctions.h
@@ -29,8 +29,8 @@
namespace Illusions {
enum {
- kUFNext = 1, // Run next update funtion
- kUFTerminate = 2 // Terminate update function
+ kUFNext = 1, // Run next update funtion
+ kUFTerminate = 2 // Terminate update function
};
typedef Common::Functor1<uint, int> UpdateFunctionCallback;