From 4eda234611bd77f053defe9e61d592b308270eaa Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Thu, 26 Jul 2012 19:41:18 +0200 Subject: WINTERMUTE: Replace BaseArray with a templated subclass of Common::Array. This needs additional cleanup, but compiles and runs at this point. --- engines/wintermute/base/scriptables/script.h | 2 +- engines/wintermute/base/scriptables/script_engine.cpp | 16 ++++++++-------- engines/wintermute/base/scriptables/script_engine.h | 8 ++++---- engines/wintermute/base/scriptables/script_stack.cpp | 8 ++++---- engines/wintermute/base/scriptables/script_stack.h | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'engines/wintermute/base/scriptables') 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 _breakpoints; + BaseArray _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 _lines; + BaseArray _lines; }; @@ -87,7 +87,7 @@ public: public: bool dbgSendScripts(IWmeDebugClient *client); - BaseArray _breakpoints; + BaseArray _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 _scripts; + BaseArray _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 _values; + BaseArray _values; int _sP; }; -- cgit v1.2.3