Skip to content

Commit

Permalink
ZVISION: Added clean function for script scope and body for queue
Browse files Browse the repository at this point in the history
routine.
  • Loading branch information
Marisa-Chan committed Oct 24, 2013
1 parent 803ff02 commit d8ad0e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions engines/zvision/script_manager.cpp
Expand Up @@ -216,13 +216,34 @@ void ScriptManager::cleanStateTable() {
}
}

void ScriptManager::cleanScriptScope(script_scope &scope) {
scope._priv_queue_one.clear();
scope._priv_queue_two.clear();
scope.scope_queue = &scope._priv_queue_one;
scope.exec_queue = &scope._priv_queue_two;
for (PuzzleList::iterator iter = scope._puzzles.begin(); iter != scope._puzzles.end(); ++iter)
delete(*iter);

scope._puzzles.clear();

for (ControlList::iterator iter = scope._controls.begin(); iter != scope._controls.end(); ++iter)
delete(*iter);

scope._controls.clear();

scope.proc_count = 0;
}

uint ScriptManager::getStateValue(uint32 key) {
if (_globalState.contains(key))
return _globalState[key];
else
return 0;
}

void ScriptManager::queuePuzzles(uint32 key) {
}

void ScriptManager::setStateValue(uint32 key, uint value) {
_globalState[key] = value;

Expand Down
2 changes: 2 additions & 0 deletions engines/zvision/script_manager.h
Expand Up @@ -163,6 +163,7 @@ class ScriptManager {
public:
void initialize();
void update(uint deltaTimeMillis);
void queuePuzzles(uint32 key);

uint getStateValue(uint32 key);
void setStateValue(uint32 key, uint value);
Expand Down Expand Up @@ -228,6 +229,7 @@ class ScriptManager {
void updateNodes(uint deltaTimeMillis);
void checkPuzzleCriteria();
void cleanStateTable();
void cleanScriptScope(script_scope &scope);

// TODO: Make this private. It was only made public so Console::cmdParseAllScrFiles() could use it
public:
Expand Down

0 comments on commit d8ad0e5

Please sign in to comment.