aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/scriptables
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-26 19:41:18 +0200
committerEinar Johan Trøan Sømåen2012-07-26 19:41:18 +0200
commit4eda234611bd77f053defe9e61d592b308270eaa (patch)
treecb0a437641b74b60b325ac9ccaa9b63dacab897d /engines/wintermute/base/scriptables
parenteb22e36d5e12b64442ce23c656227483dd9cf61e (diff)
downloadscummvm-rg350-4eda234611bd77f053defe9e61d592b308270eaa.tar.gz
scummvm-rg350-4eda234611bd77f053defe9e61d592b308270eaa.tar.bz2
scummvm-rg350-4eda234611bd77f053defe9e61d592b308270eaa.zip
WINTERMUTE: Replace BaseArray with a templated subclass of Common::Array.
This needs additional cleanup, but compiles and runs at this point.
Diffstat (limited to 'engines/wintermute/base/scriptables')
-rw-r--r--engines/wintermute/base/scriptables/script.h2
-rw-r--r--engines/wintermute/base/scriptables/script_engine.cpp16
-rw-r--r--engines/wintermute/base/scriptables/script_engine.h8
-rw-r--r--engines/wintermute/base/scriptables/script_stack.cpp8
-rw-r--r--engines/wintermute/base/scriptables/script_stack.h2
5 files changed, 18 insertions, 18 deletions
diff --git a/engines/wintermute/base/scriptables/script.h b/engines/wintermute/base/scriptables/script.h
index ba73e1015f..c343ad24ad 100644
--- a/engines/wintermute/base/scriptables/script.h
+++ b/engines/wintermute/base/scriptables/script.h
@@ -46,7 +46,7 @@ public:
bool dbgSendScript(IWmeDebugClient *client);
bool dbgSendVariables(IWmeDebugClient *client);
- BaseArray<int, int> _breakpoints;
+ BaseArray<int> _breakpoints;
bool _tracingMode;
ScScript *_parentScript;
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp
index 356617094d..e1aed7ed82 100644
--- a/engines/wintermute/base/scriptables/script_engine.cpp
+++ b/engines/wintermute/base/scriptables/script_engine.cpp
@@ -97,7 +97,7 @@ ScEngine::~ScEngine() {
delete _breakpoints[i];
_breakpoints[i] = NULL;
}
- _breakpoints.removeAll();
+ _breakpoints.clear();
}
@@ -108,11 +108,11 @@ bool ScEngine::cleanup() {
_scripts[i]->_owner->removeScript(_scripts[i]);
}
delete _scripts[i];
- _scripts.removeAt(i);
+ _scripts.remove_at(i);
i--;
}
- _scripts.removeAll();
+ _scripts.clear();
delete _globals;
_globals = NULL;
@@ -404,7 +404,7 @@ bool ScEngine::removeFinishedScripts() {
}
_gameRef->getDebugMgr()->onScriptShutdown(_scripts[i]);
delete _scripts[i];
- _scripts.removeAt(i);
+ _scripts.remove_at(i);
i--;
}
}
@@ -511,7 +511,7 @@ void ScEngine::editorCleanup() {
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_owner == NULL && (_scripts[i]->_state == SCRIPT_FINISHED || _scripts[i]->_state == SCRIPT_ERROR)) {
delete _scripts[i];
- _scripts.removeAt(i);
+ _scripts.remove_at(i);
i--;
}
}
@@ -620,10 +620,10 @@ bool ScEngine::removeBreakpoint(const char *scriptFilename, int line) {
if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), scriptFilename) == 0) {
for (int j = 0; j < _breakpoints[i]->_lines.getSize(); j++) {
if (_breakpoints[i]->_lines[j] == line) {
- _breakpoints[i]->_lines.removeAt(j);
+ _breakpoints[i]->_lines.remove_at(j);
if (_breakpoints[i]->_lines.getSize() == 0) {
delete _breakpoints[i];
- _breakpoints.removeAt(i);
+ _breakpoints.remove_at(i);
}
// refresh changes
refreshScriptBreakpoints();
@@ -666,7 +666,7 @@ bool ScEngine::refreshScriptBreakpoints(ScScript *script) {
}
}
if (script->_breakpoints.getSize() > 0) {
- script->_breakpoints.removeAll();
+ script->_breakpoints.clear();
}
return STATUS_OK;
diff --git a/engines/wintermute/base/scriptables/script_engine.h b/engines/wintermute/base/scriptables/script_engine.h
index fc441347df..fcfaa51971 100644
--- a/engines/wintermute/base/scriptables/script_engine.h
+++ b/engines/wintermute/base/scriptables/script_engine.h
@@ -74,11 +74,11 @@ public:
}
~CScBreakpoint() {
- _lines.removeAll();
+ _lines.clear();
}
Common::String _filename;
- BaseArray<int, int> _lines;
+ BaseArray<int> _lines;
};
@@ -87,7 +87,7 @@ public:
public:
bool dbgSendScripts(IWmeDebugClient *client);
- BaseArray<CScBreakpoint *, CScBreakpoint *> _breakpoints;
+ BaseArray<CScBreakpoint *> _breakpoints;
bool addBreakpoint(const char *scriptFilename, int line);
bool removeBreakpoint(const char *scriptFilename, int line);
bool refreshScriptBreakpoints();
@@ -122,7 +122,7 @@ public:
static void closeFile(void *data, byte *buffer);
static void parseElement(void *data, int line, int type, void *elementData);
- BaseArray<ScScript *, ScScript *> _scripts;
+ BaseArray<ScScript *> _scripts;
void enableProfiling();
void disableProfiling();
diff --git a/engines/wintermute/base/scriptables/script_stack.cpp b/engines/wintermute/base/scriptables/script_stack.cpp
index 0d4ea54b8c..8840a2c0f1 100644
--- a/engines/wintermute/base/scriptables/script_stack.cpp
+++ b/engines/wintermute/base/scriptables/script_stack.cpp
@@ -50,7 +50,7 @@ ScStack::~ScStack() {
for (int i = 0; i < _values.getSize(); i++) {
delete _values[i];
}
- _values.removeAll();
+ _values.clear();
}
@@ -123,7 +123,7 @@ void ScStack::correctParams(uint32 expectedParams) {
while (expectedParams < nuParams) {
//Pop();
delete _values[_sP - expectedParams];
- _values.removeAt(_sP - expectedParams);
+ _values.remove_at(_sP - expectedParams);
nuParams--;
_sP--;
}
@@ -132,13 +132,13 @@ void ScStack::correctParams(uint32 expectedParams) {
//Push(null_val);
ScValue *nullVal = new ScValue(_gameRef);
nullVal->setNULL();
- _values.insertAt(_sP - nuParams + 1, nullVal);
+ _values.insert_at(_sP - nuParams + 1, nullVal);
nuParams++;
_sP++;
if (_values.getSize() > _sP + 1) {
delete _values[_values.getSize() - 1];
- _values.removeAt(_values.getSize() - 1);
+ _values.remove_at(_values.getSize() - 1);
}
}
}
diff --git a/engines/wintermute/base/scriptables/script_stack.h b/engines/wintermute/base/scriptables/script_stack.h
index 3aacad0765..95839cc680 100644
--- a/engines/wintermute/base/scriptables/script_stack.h
+++ b/engines/wintermute/base/scriptables/script_stack.h
@@ -56,7 +56,7 @@ public:
ScValue *pop();
ScStack(BaseGame *inGame);
virtual ~ScStack();
- BaseArray<ScValue *, ScValue *> _values;
+ BaseArray<ScValue *> _values;
int _sP;
};