aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/Base
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/Base')
-rw-r--r--engines/wintermute/Base/BFileManager.cpp54
-rw-r--r--engines/wintermute/Base/BFontBitmap.cpp8
-rw-r--r--engines/wintermute/Base/BFontStorage.cpp16
-rw-r--r--engines/wintermute/Base/BFontTT.cpp18
-rw-r--r--engines/wintermute/Base/BFrame.cpp60
-rw-r--r--engines/wintermute/Base/BGame.cpp70
-rw-r--r--engines/wintermute/Base/BRegion.cpp48
-rw-r--r--engines/wintermute/Base/BRenderSDL.cpp4
-rw-r--r--engines/wintermute/Base/BRenderer.cpp6
-rw-r--r--engines/wintermute/Base/BScriptHolder.cpp34
-rw-r--r--engines/wintermute/Base/BSoundMgr.cpp18
-rw-r--r--engines/wintermute/Base/BSprite.cpp60
-rw-r--r--engines/wintermute/Base/BSubFrame.cpp4
-rw-r--r--engines/wintermute/Base/BSurfaceStorage.cpp18
-rw-r--r--engines/wintermute/Base/PartEmitter.cpp66
-rw-r--r--engines/wintermute/Base/PartParticle.cpp2
-rw-r--r--engines/wintermute/Base/file/BDiskFile.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/SXStore.cpp40
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.cpp76
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.h2
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.cpp10
-rw-r--r--engines/wintermute/Base/scriptables/ScStack.cpp28
22 files changed, 322 insertions, 322 deletions
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp
index 621089d803..706da2a93b 100644
--- a/engines/wintermute/Base/BFileManager.cpp
+++ b/engines/wintermute/Base/BFileManager.cpp
@@ -75,13 +75,13 @@ CBFileManager::~CBFileManager() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBFileManager::cleanup() {
// delete registered paths
- for (int i = 0; i < _singlePaths.GetSize(); i++)
+ for (int i = 0; i < _singlePaths.getSize(); i++)
delete [] _singlePaths[i];
- _singlePaths.RemoveAll();
+ _singlePaths.removeAll();
- for (int i = 0; i < _packagePaths.GetSize(); i++)
+ for (int i = 0; i < _packagePaths.getSize(); i++)
delete [] _packagePaths[i];
- _packagePaths.RemoveAll();
+ _packagePaths.removeAll();
// delete file entries
@@ -93,16 +93,16 @@ ERRORCODE CBFileManager::cleanup() {
_files.clear();
// close open files
- for (int i = 0; i < _openFiles.GetSize(); i++) {
+ for (int i = 0; i < _openFiles.getSize(); i++) {
delete _openFiles[i];
}
- _openFiles.RemoveAll();
+ _openFiles.removeAll();
// delete packages
- for (int i = 0; i < _packages.GetSize(); i++)
+ for (int i = 0; i < _packages.getSize(); i++)
delete _packages[i];
- _packages.RemoveAll();
+ _packages.removeAll();
delete[] _basePath;
_basePath = NULL;
@@ -226,7 +226,7 @@ ERRORCODE CBFileManager::saveFile(const Common::String &filename, byte *Buffer,
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBFileManager::requestCD(int cd, char *packageFile, const char *filename) {
// unmount all non-local packages
- for (int i = 0; i < _packages.GetSize(); i++) {
+ for (int i = 0; i < _packages.getSize(); i++) {
if (_packages[i]->_cD > 0) _packages[i]->close();
}
@@ -250,10 +250,10 @@ ERRORCODE CBFileManager::addPath(TPathType type, const Common::String &path) {
switch (type) {
case PATH_SINGLE:
- _singlePaths.Add(buffer);
+ _singlePaths.add(buffer);
break;
case PATH_PACKAGE:
- _packagePaths.Add(buffer);
+ _packagePaths.add(buffer);
break;
}
@@ -263,13 +263,13 @@ ERRORCODE CBFileManager::addPath(TPathType type, const Common::String &path) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBFileManager::reloadPaths() {
// delete registered paths
- for (int i = 0; i < _singlePaths.GetSize(); i++)
+ for (int i = 0; i < _singlePaths.getSize(); i++)
delete [] _singlePaths[i];
- _singlePaths.RemoveAll();
+ _singlePaths.removeAll();
- for (int i = 0; i < _packagePaths.GetSize(); i++)
+ for (int i = 0; i < _packagePaths.getSize(); i++)
delete [] _packagePaths[i];
- _packagePaths.RemoveAll();
+ _packagePaths.removeAll();
return initPaths();
}
@@ -361,7 +361,7 @@ ERRORCODE CBFileManager::registerPackages() {
#if 0
AnsiString extension = AnsiString(PACKAGE_EXTENSION);
- for (int i = 0; i < _packagePaths.GetSize(); i++) {
+ for (int i = 0; i < _packagePaths.getSize(); i++) {
boost::filesystem::path absPath = boost::filesystem::syste_complete(_packagePaths[i]);
//Game->LOG(0, "Scanning: %s", absPath.string().c_str());
@@ -386,10 +386,10 @@ ERRORCODE CBFileManager::registerPackages() {
}
}
#endif
- warning(" Registered %d files in %d package(s)", _files.size(), _packages.GetSize());
- Game->LOG(0, " Registered %d files in %d package(s)", _files.size(), _packages.GetSize());
+ warning(" Registered %d files in %d package(s)", _files.size(), _packages.getSize());
+ Game->LOG(0, " Registered %d files in %d package(s)", _files.size(), _packages.getSize());
- warning(" Registered %d files in %d package(s)", _files.size(), _packages.GetSize());
+ warning(" Registered %d files in %d package(s)", _files.size(), _packages.getSize());
return STATUS_OK;
}
@@ -453,7 +453,7 @@ ERRORCODE CBFileManager::registerPackage(const Common::String &filename , bool s
pkg->_priority = hdr.Priority;
if (!hdr.MasterIndex) pkg->_cD = 0; // override CD to fixed disk
- _packages.Add(pkg);
+ _packages.add(pkg);
// read file entries
@@ -583,7 +583,7 @@ ERRORCODE CBFileManager::registerPackage(const char *Path, const char *name, boo
pkg->_priority = hdr.Priority;
if (!hdr.MasterIndex) pkg->_cD = 0; // override CD to fixed disk
- _packages.Add(pkg);
+ _packages.add(pkg);
// read file entries
@@ -672,7 +672,7 @@ Common::File *CBFileManager::openPackage(const Common::String &name) {
Common::File *ret = new Common::File();
char filename[MAX_PATH_LENGTH];
- for (int i = 0; i < _packagePaths.GetSize(); i++) {
+ for (int i = 0; i < _packagePaths.getSize(); i++) {
sprintf(filename, "%s%s.%s", _packagePaths[i], name.c_str(), PACKAGE_EXTENSION);
ret->open(filename);
if (ret->isOpen()) {
@@ -698,7 +698,7 @@ Common::File *CBFileManager::openSingleFile(const Common::String &name) {
Common::File *ret = NULL;
char filename[MAX_PATH_LENGTH];
- for (int i = 0; i < _singlePaths.GetSize(); i++) {
+ for (int i = 0; i < _singlePaths.getSize(); i++) {
sprintf(filename, "%s%s", _singlePaths[i], name.c_str());
ret->open(filename);
if (ret->isOpen())
@@ -723,7 +723,7 @@ bool CBFileManager::getFullPath(const Common::String &filename, char *fullname)
Common::File f;
bool found = false;
- for (int i = 0; i < _singlePaths.GetSize(); i++) {
+ for (int i = 0; i < _singlePaths.getSize(); i++) {
sprintf(fullname, "%s%s", _singlePaths[i], filename.c_str());
f.open(fullname);
if (f.isOpen()) {
@@ -786,17 +786,17 @@ Common::SeekableReadStream *CBFileManager::openFile(const Common::String &filena
#endif*/
Common::SeekableReadStream *File = openFileRaw(filename);
- if (File && keepTrackOf) _openFiles.Add(File);
+ if (File && keepTrackOf) _openFiles.add(File);
return File;
}
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBFileManager::closeFile(Common::SeekableReadStream *File) {
- for (int i = 0; i < _openFiles.GetSize(); i++) {
+ for (int i = 0; i < _openFiles.getSize(); i++) {
if (_openFiles[i] == File) {
delete _openFiles[i];
- _openFiles.RemoveAt(i);
+ _openFiles.removeAt(i);
return STATUS_OK;
}
}
diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp
index 56e969d7e7..0af81f7ed4 100644
--- a/engines/wintermute/Base/BFontBitmap.cpp
+++ b/engines/wintermute/Base/BFontBitmap.cpp
@@ -231,8 +231,8 @@ void CBFontBitmap::drawChar(byte c, int x, int y) {
bool handled = false;
if (_sprite) {
_sprite->GetCurrentFrame();
- if (_sprite->_currentFrame >= 0 && _sprite->_currentFrame < _sprite->_frames.GetSize() && _sprite->_frames[_sprite->_currentFrame]) {
- if (_sprite->_frames[_sprite->_currentFrame]->_subframes.GetSize() > 0) {
+ if (_sprite->_currentFrame >= 0 && _sprite->_currentFrame < _sprite->_frames.getSize() && _sprite->_frames[_sprite->_currentFrame]) {
+ if (_sprite->_frames[_sprite->_currentFrame]->_subframes.getSize() > 0) {
_sprite->_frames[_sprite->_currentFrame]->_subframes[0]->_surface->displayTrans(x, y, rect);
}
handled = true;
@@ -491,8 +491,8 @@ ERRORCODE CBFontBitmap::getWidths() {
CBSurface *surf = NULL;
if (_sprite) {
- if (_widthsFrame >= 0 && _widthsFrame < _sprite->_frames.GetSize()) {
- if (_sprite->_frames[_widthsFrame] && _sprite->_frames[_widthsFrame]->_subframes.GetSize() > 0) {
+ if (_widthsFrame >= 0 && _widthsFrame < _sprite->_frames.getSize()) {
+ if (_sprite->_frames[_widthsFrame] && _sprite->_frames[_widthsFrame]->_subframes.getSize() > 0) {
surf = _sprite->_frames[_widthsFrame]->_subframes[0]->_surface;
}
}
diff --git a/engines/wintermute/Base/BFontStorage.cpp b/engines/wintermute/Base/BFontStorage.cpp
index 7642a88bac..8b43510708 100644
--- a/engines/wintermute/Base/BFontStorage.cpp
+++ b/engines/wintermute/Base/BFontStorage.cpp
@@ -52,18 +52,18 @@ CBFontStorage::~CBFontStorage() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBFontStorage::cleanup(bool warn) {
- for (int i = 0; i < _fonts.GetSize(); i++) {
+ for (int i = 0; i < _fonts.getSize(); i++) {
if (warn) Game->LOG(0, "Removing orphan font '%s'", _fonts[i]->_filename);
delete _fonts[i];
}
- _fonts.RemoveAll();
+ _fonts.removeAll();
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBFontStorage::initLoop() {
- for (int i = 0; i < _fonts.GetSize(); i++) {
+ for (int i = 0; i < _fonts.getSize(); i++) {
_fonts[i]->initLoop();
}
return STATUS_OK;
@@ -73,7 +73,7 @@ ERRORCODE CBFontStorage::initLoop() {
CBFont *CBFontStorage::addFont(const char *filename) {
if (!filename) return NULL;
- for (int i = 0; i < _fonts.GetSize(); i++) {
+ for (int i = 0; i < _fonts.getSize(); i++) {
if (scumm_stricmp(_fonts[i]->_filename, filename) == 0) {
_fonts[i]->_refCount++;
return _fonts[i];
@@ -90,14 +90,14 @@ CBFont *CBFontStorage::addFont(const char *filename) {
}
else {
font->_refCount = 1;
- _fonts.Add(font);
+ _fonts.add(font);
return font;
}
*/
CBFont *font = CBFont::createFromFile(Game, filename);
if (font) {
font->_refCount = 1;
- _fonts.Add(font);
+ _fonts.add(font);
}
return font;
}
@@ -107,12 +107,12 @@ CBFont *CBFontStorage::addFont(const char *filename) {
ERRORCODE CBFontStorage::removeFont(CBFont *font) {
if (!font) return STATUS_FAILED;
- for (int i = 0; i < _fonts.GetSize(); i++) {
+ for (int i = 0; i < _fonts.getSize(); i++) {
if (_fonts[i] == font) {
_fonts[i]->_refCount--;
if (_fonts[i]->_refCount <= 0) {
delete _fonts[i];
- _fonts.RemoveAt(i);
+ _fonts.removeAt(i);
}
break;
}
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index 22f16a53f6..998aead064 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -73,10 +73,10 @@ CBFontTT::CBFontTT(CBGame *inGame): CBFont(inGame) {
CBFontTT::~CBFontTT(void) {
clearCache();
- for (int i = 0; i < _layers.GetSize(); i++) {
+ for (int i = 0; i < _layers.getSize(); i++) {
delete _layers[i];
}
- _layers.RemoveAll();
+ _layers.removeAll();
delete[] _fontFile;
_fontFile = NULL;
@@ -219,7 +219,7 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
if (surface) {
Common::Rect rc;
CBPlatform::setRect(&rc, 0, 0, surface->getWidth(), surface->getHeight());
- for (int i = 0; i < _layers.GetSize(); i++) {
+ for (int i = 0; i < _layers.getSize(); i++) {
uint32 color = _layers[i]->_color;
uint32 origForceAlpha = _renderer->_forceAlphaColor;
if (_renderer->_forceAlphaColor != 0) {
@@ -518,7 +518,7 @@ ERRORCODE CBFontTT::loadBuffer(byte *buffer) {
case TOKEN_LAYER: {
CBTTFontLayer *Layer = new CBTTFontLayer;
- if (Layer && DID_SUCCEED(parseLayer(Layer, (byte *)params))) _layers.Add(Layer);
+ if (Layer && DID_SUCCEED(parseLayer(Layer, (byte *)params))) _layers.add(Layer);
else {
delete Layer;
Layer = NULL;
@@ -535,10 +535,10 @@ ERRORCODE CBFontTT::loadBuffer(byte *buffer) {
}
// create at least one layer
- if (_layers.GetSize() == 0) {
+ if (_layers.getSize() == 0) {
CBTTFontLayer *Layer = new CBTTFontLayer;
Layer->_color = BaseColor;
- _layers.Add(Layer);
+ _layers.add(Layer);
}
if (!_fontFile) CBUtils::setString(&_fontFile, "arial.ttf");
@@ -605,16 +605,16 @@ ERRORCODE CBFontTT::persist(CBPersistMgr *persistMgr) {
// persist layers
int numLayers;
if (persistMgr->_saving) {
- numLayers = _layers.GetSize();
+ numLayers = _layers.getSize();
persistMgr->transfer(TMEMBER(numLayers));
for (int i = 0; i < numLayers; i++) _layers[i]->persist(persistMgr);
} else {
- numLayers = _layers.GetSize();
+ numLayers = _layers.getSize();
persistMgr->transfer(TMEMBER(numLayers));
for (int i = 0; i < numLayers; i++) {
CBTTFontLayer *layer = new CBTTFontLayer;
layer->persist(persistMgr);
- _layers.Add(layer);
+ _layers.add(layer);
}
}
diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp
index 5f516c3735..7680671434 100644
--- a/engines/wintermute/Base/BFrame.cpp
+++ b/engines/wintermute/Base/BFrame.cpp
@@ -62,15 +62,15 @@ CBFrame::~CBFrame() {
delete _sound;
_sound = NULL;
- for (int i = 0; i < _subframes.GetSize(); i++)
+ for (int i = 0; i < _subframes.getSize(); i++)
delete _subframes[i];
- _subframes.RemoveAll();
+ _subframes.removeAll();
- for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ for (int i = 0; i < _applyEvent.getSize(); i++) {
delete[] _applyEvent[i];
_applyEvent[i] = NULL;
}
- _applyEvent.RemoveAll();
+ _applyEvent.removeAll();
}
@@ -78,7 +78,7 @@ CBFrame::~CBFrame() {
ERRORCODE CBFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, float zoomY, bool precise, uint32 alpha, bool allFrames, float rotate, TSpriteBlendMode blendMode) {
ERRORCODE res;
- for (int i = 0; i < _subframes.GetSize(); i++) {
+ for (int i = 0; i < _subframes.getSize(); i++) {
res = _subframes[i]->draw(x, y, registerOwner, zoomX, zoomY, precise, alpha, rotate, blendMode);
if (DID_FAIL(res)) return res;
}
@@ -98,7 +98,7 @@ ERRORCODE CBFrame::oneTimeDisplay(CBObject *owner, bool muted) {
*/
}
if (owner) {
- for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ for (int i = 0; i < _applyEvent.getSize(); i++) {
owner->applyEvent(_applyEvent[i]);
}
}
@@ -241,7 +241,7 @@ ERRORCODE CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
if (!subframe || DID_FAIL(subframe->loadBuffer((byte *)params, lifeTime, keepLoaded))) {
delete subframe;
cmd = PARSERR_GENERIC;
- } else _subframes.Add(subframe);
+ } else _subframes.add(subframe);
}
break;
@@ -262,7 +262,7 @@ ERRORCODE CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
case TOKEN_APPLY_EVENT: {
char *Event = new char[strlen(params) + 1];
strcpy(Event, params);
- _applyEvent.Add(Event);
+ _applyEvent.add(Event);
}
break;
@@ -318,7 +318,7 @@ ERRORCODE CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
sub->_editorSelected = editorSelected;
- _subframes.InsertAt(0, sub);
+ _subframes.insertAt(0, sub);
return STATUS_OK;
}
@@ -331,7 +331,7 @@ bool CBFrame::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, fl
Common::Rect subRect;
- for (int i = 0; i < _subframes.GetSize(); i++) {
+ for (int i = 0; i < _subframes.getSize(); i++) {
_subframes[i]->getBoundingRect(&subRect, x, y, scaleX, scaleY);
CBPlatform::unionRect(rect, rect, &subRect);
}
@@ -359,13 +359,13 @@ ERRORCODE CBFrame::saveAsText(CBDynBuffer *buffer, int indent) {
if (_editorExpanded)
buffer->putTextIndent(indent + 2, "EDITOR_EXPANDED=%s\n", _editorExpanded ? "TRUE" : "FALSE");
- if (_subframes.GetSize() > 0) _subframes[0]->saveAsText(buffer, indent, false);
+ if (_subframes.getSize() > 0) _subframes[0]->saveAsText(buffer, indent, false);
- for (int i = 1; i < _subframes.GetSize(); i++) {
+ for (int i = 1; i < _subframes.getSize(); i++) {
_subframes[i]->saveAsText(buffer, indent + 2);
}
- for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ for (int i = 0; i < _applyEvent.getSize(); i++) {
buffer->putTextIndent(indent + 2, "APPLY_EVENT=\"%s\"\n", _applyEvent[i]);
}
@@ -438,7 +438,7 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
if (strcmp(name, "GetSubframe") == 0) {
stack->correctParams(1);
int index = stack->pop()->getInt(-1);
- if (index < 0 || index >= _subframes.GetSize()) {
+ if (index < 0 || index >= _subframes.getSize()) {
script->runtimeError("Frame.GetSubframe: Subframe index %d is out of range.", index);
stack->pushNULL();
} else stack->pushNative(_subframes[index], true);
@@ -454,15 +454,15 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
CScValue *val = stack->pop();
if (val->isInt()) {
int index = val->getInt(-1);
- if (index < 0 || index >= _subframes.GetSize()) {
+ if (index < 0 || index >= _subframes.getSize()) {
script->runtimeError("Frame.DeleteSubframe: Subframe index %d is out of range.", index);
}
} else {
CBSubFrame *sub = (CBSubFrame *)val->getNative();
- for (int i = 0; i < _subframes.GetSize(); i++) {
+ for (int i = 0; i < _subframes.getSize(); i++) {
if (_subframes[i] == sub) {
delete _subframes[i];
- _subframes.RemoveAt(i);
+ _subframes.removeAt(i);
break;
}
}
@@ -485,7 +485,7 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
sub->setSurface(filename);
sub->setDefaultRect();
}
- _subframes.Add(sub);
+ _subframes.add(sub);
stack->pushNative(sub, true);
return STATUS_OK;
@@ -508,8 +508,8 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
sub->setSurface(filename);
}
- if (index >= _subframes.GetSize()) _subframes.Add(sub);
- else _subframes.InsertAt(index, sub);
+ if (index >= _subframes.getSize()) _subframes.add(sub);
+ else _subframes.insertAt(index, sub);
stack->pushNative(sub, true);
return STATUS_OK;
@@ -521,7 +521,7 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
else if (strcmp(name, "GetSubframe") == 0) {
stack->correctParams(1);
int index = stack->pop()->getInt(-1);
- if (index < 0 || index >= _applyEvent.GetSize()) {
+ if (index < 0 || index >= _applyEvent.getSize()) {
script->runtimeError("Frame.GetEvent: Event index %d is out of range.", index);
stack->pushNULL();
} else stack->pushString(_applyEvent[index]);
@@ -534,13 +534,13 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
else if (strcmp(name, "AddEvent") == 0) {
stack->correctParams(1);
const char *event = stack->pop()->getString();
- for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ for (int i = 0; i < _applyEvent.getSize(); i++) {
if (scumm_stricmp(_applyEvent[i], event) == 0) {
stack->pushNULL();
return STATUS_OK;
}
}
- _applyEvent.Add(event);
+ _applyEvent.add(event);
stack->pushNULL();
return STATUS_OK;
}
@@ -551,10 +551,10 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
else if (strcmp(name, "DeleteEvent") == 0) {
stack->correctParams(1);
const char *event = stack->pop()->getString();
- for (int i = 0; i < _applyEvent.GetSize(); i++) {
+ for (int i = 0; i < _applyEvent.getSize(); i++) {
if (scumm_stricmp(_applyEvent[i], event) == 0) {
delete [] _applyEvent[i];
- _applyEvent.RemoveAt(i);
+ _applyEvent.removeAt(i);
break;
}
}
@@ -564,7 +564,7 @@ ERRORCODE CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
//////////////////////////////////////////////////////////////////////////
else {
- if (_subframes.GetSize() == 1) return _subframes[0]->scCallMethod(script, stack, thisStack, name);
+ if (_subframes.getSize() == 1) return _subframes[0]->scCallMethod(script, stack, thisStack, name);
else return CBScriptable::scCallMethod(script, stack, thisStack, name);
}
}
@@ -627,7 +627,7 @@ CScValue *CBFrame::scGetProperty(const char *name) {
// NumSubframes (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumSubframes") == 0) {
- _scValue->setInt(_subframes.GetSize());
+ _scValue->setInt(_subframes.getSize());
return _scValue;
}
@@ -635,13 +635,13 @@ CScValue *CBFrame::scGetProperty(const char *name) {
// NumEvents (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumEvents") == 0) {
- _scValue->setInt(_applyEvent.GetSize());
+ _scValue->setInt(_applyEvent.getSize());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
else {
- if (_subframes.GetSize() == 1) return _subframes[0]->scGetProperty(name);
+ if (_subframes.getSize() == 1) return _subframes[0]->scGetProperty(name);
else return CBScriptable::scGetProperty(name);
}
}
@@ -691,7 +691,7 @@ ERRORCODE CBFrame::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
else {
- if (_subframes.GetSize() == 1) return _subframes[0]->scSetProperty(name, value);
+ if (_subframes.getSize() == 1) return _subframes[0]->scSetProperty(name, value);
else return CBScriptable::scSetProperty(name, value);
}
}
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index 26afb8a7d9..d1ade0e3fd 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -360,13 +360,13 @@ ERRORCODE CBGame::cleanup() {
unregisterObject(_fader);
_fader = NULL;
- for (int i = 0; i < _regObjects.GetSize(); i++) {
+ for (int i = 0; i < _regObjects.getSize(); i++) {
delete _regObjects[i];
_regObjects[i] = NULL;
}
- _regObjects.RemoveAll();
+ _regObjects.removeAll();
- _windows.RemoveAll(); // refs only
+ _windows.removeAll(); // refs only
_focusedWindow = NULL; // ref only
delete[] _saveImageName;
@@ -386,11 +386,11 @@ ERRORCODE CBGame::cleanup() {
_scValue = NULL;
_sFX = NULL;
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
_scripts[i]->_owner = NULL;
_scripts[i]->finish();
}
- _scripts.RemoveAll();
+ _scripts.removeAll();
_fontStorage->removeFont(_systemFont);
_systemFont = NULL;
@@ -398,10 +398,10 @@ ERRORCODE CBGame::cleanup() {
_fontStorage->removeFont(_videoFont);
_videoFont = NULL;
- for (int i = 0; i < _quickMessages.GetSize(); i++) delete _quickMessages[i];
- _quickMessages.RemoveAll();
+ for (int i = 0; i < _quickMessages.getSize(); i++) delete _quickMessages[i];
+ _quickMessages.removeAll();
- _viewportStack.RemoveAll();
+ _viewportStack.removeAll();
_viewportSP = -1;
delete[] _name;
@@ -657,7 +657,7 @@ ERRORCODE CBGame::initLoop() {
getMousePos(&_mousePos);
_focusedWindow = NULL;
- for (int i = _windows.GetSize() - 1; i >= 0; i--) {
+ for (int i = _windows.getSize() - 1; i >= 0; i--) {
if (_windows[i]->_visible) {
_focusedWindow = _windows[i];
break;
@@ -1097,7 +1097,7 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
stack->correctParams(1);
CUIWindow *win = new CUIWindow(Game);
if (win && DID_SUCCEED(win->loadFile(stack->pop()->getString()))) {
- _windows.Add(win);
+ _windows.add(win);
registerObject(win);
stack->pushNative(win, true);
} else {
@@ -1856,7 +1856,7 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
CScValue *val = stack->pop();
CUIWindow *win = new CUIWindow(Game);
- _windows.Add(win);
+ _windows.add(win);
registerObject(win);
if (!val->isNULL()) win->setName(val->getString());
stack->pushNative(win, true);
@@ -1869,7 +1869,7 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "DeleteWindow") == 0) {
stack->correctParams(1);
CBObject *obj = (CBObject *)stack->pop()->getNative();
- for (int i = 0; i < _windows.GetSize(); i++) {
+ for (int i = 0; i < _windows.getSize(); i++) {
if (_windows[i] == obj) {
unregisterObject(_windows[i]);
stack->pushBool(true);
@@ -2771,13 +2771,13 @@ const char *CBGame::scToString() {
#define QUICK_MSG_DURATION 3000
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::displayQuickMsg() {
- if (_quickMessages.GetSize() == 0 || !_systemFont) return STATUS_OK;
+ if (_quickMessages.getSize() == 0 || !_systemFont) return STATUS_OK;
// update
- for (int i = 0; i < _quickMessages.GetSize(); i++) {
+ for (int i = 0; i < _quickMessages.getSize(); i++) {
if (_currentTime - _quickMessages[i]->_startTime >= QUICK_MSG_DURATION) {
delete _quickMessages[i];
- _quickMessages.RemoveAt(i);
+ _quickMessages.removeAt(i);
i--;
}
}
@@ -2785,7 +2785,7 @@ ERRORCODE CBGame::displayQuickMsg() {
int posY = 20;
// display
- for (int i = 0; i < _quickMessages.GetSize(); i++) {
+ for (int i = 0; i < _quickMessages.getSize(); i++) {
_systemFont->drawText((byte *)_quickMessages[i]->getText(), 0, posY, _renderer->_width);
posY += _systemFont->getTextHeight((byte *)_quickMessages[i]->getText(), _renderer->_width);
}
@@ -2796,11 +2796,11 @@ ERRORCODE CBGame::displayQuickMsg() {
#define MAX_QUICK_MSG 5
//////////////////////////////////////////////////////////////////////////
void CBGame::quickMessage(const char *text) {
- if (_quickMessages.GetSize() >= MAX_QUICK_MSG) {
+ if (_quickMessages.getSize() >= MAX_QUICK_MSG) {
delete _quickMessages[0];
- _quickMessages.RemoveAt(0);
+ _quickMessages.removeAt(0);
}
- _quickMessages.Add(new CBQuickMsg(Game, text));
+ _quickMessages.add(new CBQuickMsg(Game, text));
}
@@ -2819,7 +2819,7 @@ void CBGame::quickMessageForm(char *fmt, ...) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::registerObject(CBObject *object) {
- _regObjects.Add(object);
+ _regObjects.add(object);
return STATUS_OK;
}
@@ -2829,9 +2829,9 @@ ERRORCODE CBGame::unregisterObject(CBObject *object) {
if (!object) return STATUS_OK;
// is it a window?
- for (int i = 0; i < _windows.GetSize(); i++) {
+ for (int i = 0; i < _windows.getSize(); i++) {
if ((CBObject *)_windows[i] == object) {
- _windows.RemoveAt(i);
+ _windows.removeAt(i);
// get new focused window
if (_focusedWindow == object) _focusedWindow = NULL;
@@ -2849,9 +2849,9 @@ ERRORCODE CBGame::unregisterObject(CBObject *object) {
if (_store) _store->OnObjectDestroyed(object);
// destroy object
- for (int i = 0; i < _regObjects.GetSize(); i++) {
+ for (int i = 0; i < _regObjects.getSize(); i++) {
if (_regObjects[i] == object) {
- _regObjects.RemoveAt(i);
+ _regObjects.removeAt(i);
if (!_loadInProgress) CSysClassRegistry::getInstance()->enumInstances(invalidateValues, "CScValue", (void *)object);
delete object;
return STATUS_OK;
@@ -2881,7 +2881,7 @@ bool CBGame::validObject(CBObject *object) {
if (!object) return false;
if (object == this) return true;
- for (int i = 0; i < _regObjects.GetSize(); i++) {
+ for (int i = 0; i < _regObjects.getSize(); i++) {
if (_regObjects[i] == object) return true;
}
return false;
@@ -3354,7 +3354,7 @@ ERRORCODE CBGame::displayWindows(bool inGame) {
// did we lose focus? focus topmost window
if (_focusedWindow == NULL || !_focusedWindow->_visible || _focusedWindow->_disable) {
_focusedWindow = NULL;
- for (int i = _windows.GetSize() - 1; i >= 0; i--) {
+ for (int i = _windows.getSize() - 1; i >= 0; i--) {
if (_windows[i]->_visible && !_windows[i]->_disable) {
_focusedWindow = _windows[i];
break;
@@ -3363,7 +3363,7 @@ ERRORCODE CBGame::displayWindows(bool inGame) {
}
// display all windows
- for (int i = 0; i < _windows.GetSize(); i++) {
+ for (int i = 0; i < _windows.getSize(); i++) {
if (_windows[i]->_visible && _windows[i]->_inGame == inGame) {
res = _windows[i]->display();
@@ -3679,11 +3679,11 @@ ERRORCODE CBGame::persist(CBPersistMgr *persistMgr) {
ERRORCODE CBGame::focusWindow(CUIWindow *Window) {
CUIWindow *Prev = _focusedWindow;
- for (int i = 0; i < _windows.GetSize(); i++) {
+ for (int i = 0; i < _windows.getSize(); i++) {
if (_windows[i] == Window) {
- if (i < _windows.GetSize() - 1) {
- _windows.RemoveAt(i);
- _windows.Add(Window);
+ if (i < _windows.getSize() - 1) {
+ _windows.removeAt(i);
+ _windows.add(Window);
Game->_focusedWindow = Window;
}
@@ -3938,7 +3938,7 @@ ERRORCODE CBGame::setActiveObject(CBObject *obj) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::pushViewport(CBViewport *viewport) {
_viewportSP++;
- if (_viewportSP >= _viewportStack.GetSize()) _viewportStack.Add(viewport);
+ if (_viewportSP >= _viewportStack.getSize()) _viewportStack.add(viewport);
else _viewportStack[_viewportSP] = viewport;
_renderer->setViewport(viewport->getRect());
@@ -3952,7 +3952,7 @@ ERRORCODE CBGame::popViewport() {
_viewportSP--;
if (_viewportSP < -1) Game->LOG(0, "Fatal: Viewport stack underflow!");
- if (_viewportSP >= 0 && _viewportSP < _viewportStack.GetSize()) _renderer->setViewport(_viewportStack[_viewportSP]->getRect());
+ if (_viewportSP >= 0 && _viewportSP < _viewportStack.getSize()) _renderer->setViewport(_viewportStack[_viewportSP]->getRect());
else _renderer->setViewport(_renderer->_drawOffsetX,
_renderer->_drawOffsetY,
_renderer->_width + _renderer->_drawOffsetX,
@@ -4139,7 +4139,7 @@ void CBGame::DEBUG_DumpClassRegistry() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::invalidateDeviceObjects() {
- for (int i = 0; i < _regObjects.GetSize(); i++) {
+ for (int i = 0; i < _regObjects.getSize(); i++) {
_regObjects[i]->invalidateDeviceObjects();
}
return STATUS_OK;
@@ -4148,7 +4148,7 @@ ERRORCODE CBGame::invalidateDeviceObjects() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::restoreDeviceObjects() {
- for (int i = 0; i < _regObjects.GetSize(); i++) {
+ for (int i = 0; i < _regObjects.getSize(); i++) {
_regObjects[i]->restoreDeviceObjects();
}
return STATUS_OK;
diff --git a/engines/wintermute/Base/BRegion.cpp b/engines/wintermute/Base/BRegion.cpp
index 45b202e35f..63e862a569 100644
--- a/engines/wintermute/Base/BRegion.cpp
+++ b/engines/wintermute/Base/BRegion.cpp
@@ -61,8 +61,8 @@ CBRegion::~CBRegion() {
//////////////////////////////////////////////////////////////////////////
void CBRegion::cleanup() {
- for (int i = 0; i < _points.GetSize(); i++) delete _points[i];
- _points.RemoveAll();
+ for (int i = 0; i < _points.getSize(); i++) delete _points[i];
+ _points.removeAll();
CBPlatform::setRectEmpty(&_rect);
_editorSelectedPoint = -1;
@@ -77,7 +77,7 @@ bool CBRegion::createRegion() {
//////////////////////////////////////////////////////////////////////////
bool CBRegion::pointInRegion(int x, int y) {
- if (_points.GetSize() < 3) return false;
+ if (_points.getSize() < 3) return false;
Common::Point pt;
pt.x = x;
@@ -155,8 +155,8 @@ ERRORCODE CBRegion::loadBuffer(byte *buffer, bool complete) {
int i;
- for (i = 0; i < _points.GetSize(); i++) delete _points[i];
- _points.RemoveAll();
+ for (i = 0; i < _points.getSize(); i++) delete _points[i];
+ _points.removeAll();
while ((cmd = parser.getCommand((char **)&buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
@@ -179,7 +179,7 @@ ERRORCODE CBRegion::loadBuffer(byte *buffer, bool complete) {
case TOKEN_POINT: {
int x, y;
parser.scanStr((char *)params, "%d,%d", &x, &y);
- _points.Add(new CBPoint(x, y));
+ _points.add(new CBPoint(x, y));
}
break;
@@ -220,7 +220,7 @@ ERRORCODE CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
int x = stack->pop()->getInt();
int y = stack->pop()->getInt();
- _points.Add(new CBPoint(x, y));
+ _points.add(new CBPoint(x, y));
createRegion();
stack->pushBool(true);
@@ -237,8 +237,8 @@ ERRORCODE CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
int x = stack->pop()->getInt();
int y = stack->pop()->getInt();
- if (Index >= 0 && Index < _points.GetSize()) {
- _points.InsertAt(Index, new CBPoint(x, y));
+ if (Index >= 0 && Index < _points.getSize()) {
+ _points.insertAt(Index, new CBPoint(x, y));
createRegion();
stack->pushBool(true);
@@ -256,7 +256,7 @@ ERRORCODE CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
int x = stack->pop()->getInt();
int y = stack->pop()->getInt();
- if (Index >= 0 && Index < _points.GetSize()) {
+ if (Index >= 0 && Index < _points.getSize()) {
_points[Index]->x = x;
_points[Index]->y = y;
createRegion();
@@ -274,11 +274,11 @@ ERRORCODE CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
stack->correctParams(1);
int index = stack->pop()->getInt();
- if (index >= 0 && index < _points.GetSize()) {
+ if (index >= 0 && index < _points.getSize()) {
delete _points[index];
_points[index] = NULL;
- _points.RemoveAt(index);
+ _points.removeAt(index);
createRegion();
stack->pushBool(true);
@@ -294,7 +294,7 @@ ERRORCODE CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
stack->correctParams(1);
int index = stack->pop()->getInt();
- if (index >= 0 && index < _points.GetSize()) {
+ if (index >= 0 && index < _points.getSize()) {
CScValue *val = stack->getPushValue();
if (val) {
val->setProperty("X", _points[index]->x);
@@ -341,7 +341,7 @@ CScValue *CBRegion::scGetProperty(const char *name) {
// NumPoints
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumPoints") == 0) {
- _scValue->setInt(_points.GetSize());
+ _scValue->setInt(_points.getSize());
return _scValue;
}
@@ -389,11 +389,11 @@ ERRORCODE CBRegion::saveAsText(CBDynBuffer *buffer, int indent, const char *name
int i;
- for (i = 0; i < _scripts.GetSize(); i++) {
+ for (i = 0; i < _scripts.getSize(); i++) {
buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- for (i = 0; i < _points.GetSize(); i++) {
+ for (i = 0; i < _points.getSize(); i++) {
buffer->putTextIndent(indent + 2, "POINT {%d,%d}\n", _points[i]->x, _points[i]->y);
}
@@ -427,7 +427,7 @@ typedef struct {
//////////////////////////////////////////////////////////////////////////
bool CBRegion::ptInPolygon(int x, int y) {
- if (_points.GetSize() < 3) return false;
+ if (_points.getSize() < 3) return false;
int counter = 0;
double xinters;
@@ -439,9 +439,9 @@ bool CBRegion::ptInPolygon(int x, int y) {
p1.x = (double)_points[0]->x;
p1.y = (double)_points[0]->y;
- for (int i = 1; i <= _points.GetSize(); i++) {
- p2.x = (double)_points[i % _points.GetSize()]->x;
- p2.y = (double)_points[i % _points.GetSize()]->y;
+ for (int i = 1; i <= _points.getSize(); i++) {
+ p2.x = (double)_points[i % _points.getSize()]->x;
+ p2.y = (double)_points[i % _points.getSize()]->y;
if (p.y > MIN(p1.y, p2.y)) {
if (p.y <= MAX(p1.y, p2.y)) {
@@ -466,11 +466,11 @@ bool CBRegion::ptInPolygon(int x, int y) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBRegion::getBoundingRect(Common::Rect *rect) {
- if (_points.GetSize() == 0) CBPlatform::setRectEmpty(rect);
+ if (_points.getSize() == 0) CBPlatform::setRectEmpty(rect);
else {
int MinX = INT_MAX, MinY = INT_MAX, MaxX = INT_MIN, MaxY = INT_MIN;
- for (int i = 0; i < _points.GetSize(); i++) {
+ for (int i = 0; i < _points.getSize(); i++) {
MinX = MIN(MinX, _points[i]->x);
MinY = MIN(MinY, _points[i]->y);
@@ -489,13 +489,13 @@ ERRORCODE CBRegion::mimic(CBRegion *region, float scale, int x, int y) {
cleanup();
- for (int i = 0; i < region->_points.GetSize(); i++) {
+ for (int i = 0; i < region->_points.getSize(); i++) {
int xVal, yVal;
xVal = (int)((float)region->_points[i]->x * scale / 100.0f);
yVal = (int)((float)region->_points[i]->y * scale / 100.0f);
- _points.Add(new CBPoint(xVal + x, yVal + y));
+ _points.add(new CBPoint(xVal + x, yVal + y));
}
_lastMimicScale = scale;
diff --git a/engines/wintermute/Base/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp
index 323c6cc7be..51202d26ef 100644
--- a/engines/wintermute/Base/BRenderSDL.cpp
+++ b/engines/wintermute/Base/BRenderSDL.cpp
@@ -639,7 +639,7 @@ void CBRenderSDL::dumpData(const char *filename) {
int TotalKB = 0;
int TotalLoss = 0;
fprintf(f, "Filename;Usage;Size;KBytes\n");
- for (int i = 0; i < Mgr->_surfaces.GetSize(); i++) {
+ for (int i = 0; i < Mgr->_surfaces.getSize(); i++) {
CBSurfaceSDL *Surf = (CBSurfaceSDL *)Mgr->_surfaces[i];
if (!Surf->_filename) continue;
if (!Surf->_valid) continue;
@@ -653,7 +653,7 @@ void CBRenderSDL::dumpData(const char *filename) {
fprintf(f, "%d;", kb);
fprintf(f, "\n");
}
- fprintf(f, "Total %d;;;%d\n", Mgr->_surfaces.GetSize(), TotalKB);
+ fprintf(f, "Total %d;;;%d\n", Mgr->_surfaces.getSize(), TotalKB);
fclose(f);
diff --git a/engines/wintermute/Base/BRenderer.cpp b/engines/wintermute/Base/BRenderer.cpp
index a3774e3770..b593161c41 100644
--- a/engines/wintermute/Base/BRenderer.cpp
+++ b/engines/wintermute/Base/BRenderer.cpp
@@ -72,7 +72,7 @@ CBObject *CBRenderer::getObjectAt(int x, int y) {
point.x = x;
point.y = y;
- for (int i = _rectList.GetSize() - 1; i >= 0; i--) {
+ for (int i = _rectList.getSize() - 1; i >= 0; i--) {
if (CBPlatform::ptInRect(&_rectList[i]->_rect, point)) {
if (_rectList[i]->_precise) {
// frame
@@ -106,10 +106,10 @@ CBObject *CBRenderer::getObjectAt(int x, int y) {
//////////////////////////////////////////////////////////////////////////
void CBRenderer::deleteRectList() {
- for (int i = 0; i < _rectList.GetSize(); i++) {
+ for (int i = 0; i < _rectList.getSize(); i++) {
delete _rectList[i];
}
- _rectList.RemoveAll();
+ _rectList.removeAll();
}
diff --git a/engines/wintermute/Base/BScriptHolder.cpp b/engines/wintermute/Base/BScriptHolder.cpp
index 160ba7e2cd..40e7d5d392 100644
--- a/engines/wintermute/Base/BScriptHolder.cpp
+++ b/engines/wintermute/Base/BScriptHolder.cpp
@@ -61,11 +61,11 @@ ERRORCODE CBScriptHolder::cleanup() {
int i;
- for (i = 0; i < _scripts.GetSize(); i++) {
+ for (i = 0; i < _scripts.getSize(); i++) {
_scripts[i]->finish(true);
_scripts[i]->_owner = NULL;
}
- _scripts.RemoveAll();
+ _scripts.removeAll();
return STATUS_OK;
}
@@ -84,11 +84,11 @@ ERRORCODE CBScriptHolder::applyEvent(const char *eventName, bool unbreakable) {
int numHandlers = 0;
ERRORCODE ret = STATUS_FAILED;
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread) {
CScScript *handler = _scripts[i]->invokeEventHandler(eventName, unbreakable);
if (handler) {
- //_scripts.Add(handler);
+ //_scripts.add(handler);
numHandlers++;
ret = STATUS_OK;
}
@@ -175,7 +175,7 @@ ERRORCODE CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScSt
const char *filename = stack->pop()->getString();
bool killThreads = stack->pop()->getBool(false);
bool ret = false;
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (scumm_stricmp(_scripts[i]->_filename, filename) == 0) {
_scripts[i]->finish(killThreads);
ret = true;
@@ -194,7 +194,7 @@ ERRORCODE CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScSt
stack->correctParams(1);
const char *filename = stack->pop()->getString();
bool ret = false;
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (scumm_stricmp(_scripts[i]->_filename, filename) == 0 && _scripts[i]->_state != SCRIPT_FINISHED && _scripts[i]->_state != SCRIPT_ERROR) {
ret = true;
break;
@@ -277,7 +277,7 @@ ERRORCODE CBScriptHolder::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBScriptHolder::addScript(const char *filename) {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (scumm_stricmp(_scripts[i]->_filename, filename) == 0) {
if (_scripts[i]->_state != SCRIPT_FINISHED) {
Game->LOG(0, "CBScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", filename, _name);
@@ -295,8 +295,8 @@ ERRORCODE CBScriptHolder::addScript(const char *filename) {
strcpy(scr->_filename, filename);
scr->_state = SCRIPT_ERROR;
scr->_owner = this;
- _scripts.Add(scr);
- Game->_scEngine->_scripts.Add(scr);
+ _scripts.add(scr);
+ Game->_scEngine->_scripts.add(scr);
Game->getDebugMgr()->onScriptInit(scr);
return STATUS_OK;
@@ -304,7 +304,7 @@ ERRORCODE CBScriptHolder::addScript(const char *filename) {
return STATUS_FAILED;
} else {
scr->_freezable = _freezable;
- _scripts.Add(scr);
+ _scripts.add(scr);
return STATUS_OK;
}
}
@@ -312,9 +312,9 @@ ERRORCODE CBScriptHolder::addScript(const char *filename) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBScriptHolder::removeScript(CScScript *script) {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i] == script) {
- _scripts.RemoveAt(i);
+ _scripts.removeAt(i);
break;
}
}
@@ -323,7 +323,7 @@ ERRORCODE CBScriptHolder::removeScript(CScScript *script) {
//////////////////////////////////////////////////////////////////////////
bool CBScriptHolder::canHandleEvent(const char *EventName) {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread && _scripts[i]->canHandleEvent(EventName)) return true;
}
return false;
@@ -332,7 +332,7 @@ bool CBScriptHolder::canHandleEvent(const char *EventName) {
//////////////////////////////////////////////////////////////////////////
bool CBScriptHolder::canHandleMethod(const char *MethodName) {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread && _scripts[i]->canHandleMethod(MethodName)) return true;
}
return false;
@@ -420,7 +420,7 @@ ERRORCODE CBScriptHolder::parseProperty(byte *buffer, bool complete) {
//////////////////////////////////////////////////////////////////////////
void CBScriptHolder::makeFreezable(bool freezable) {
_freezable = freezable;
- for (int i = 0; i < _scripts.GetSize(); i++)
+ for (int i = 0; i < _scripts.getSize(); i++)
_scripts[i]->_freezable = freezable;
}
@@ -428,14 +428,14 @@ void CBScriptHolder::makeFreezable(bool freezable) {
//////////////////////////////////////////////////////////////////////////
CScScript *CBScriptHolder::invokeMethodThread(const char *methodName) {
- for (int i = _scripts.GetSize() - 1; i >= 0; i--) {
+ for (int i = _scripts.getSize() - 1; i >= 0; i--) {
if (_scripts[i]->canHandleMethod(methodName)) {
CScScript *thread = new CScScript(Game, _scripts[i]->_engine);
if (thread) {
ERRORCODE ret = thread->createMethodThread(_scripts[i], methodName);
if (DID_SUCCEED(ret)) {
- _scripts[i]->_engine->_scripts.Add(thread);
+ _scripts[i]->_engine->_scripts.add(thread);
Game->getDebugMgr()->onScriptMethodThreadInit(thread, _scripts[i], methodName);
return thread;
diff --git a/engines/wintermute/Base/BSoundMgr.cpp b/engines/wintermute/Base/BSoundMgr.cpp
index 9e038fd5fc..b8393bc0f2 100644
--- a/engines/wintermute/Base/BSoundMgr.cpp
+++ b/engines/wintermute/Base/BSoundMgr.cpp
@@ -60,9 +60,9 @@ CBSoundMgr::~CBSoundMgr() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSoundMgr::cleanup() {
- for (int i = 0; i < _sounds.GetSize(); i++)
+ for (int i = 0; i < _sounds.getSize(); i++)
delete _sounds[i];
- _sounds.RemoveAll();
+ _sounds.removeAll();
#if 0
BASS_Free();
#endif
@@ -174,7 +174,7 @@ CBSoundBuffer *CBSoundMgr::addSound(const char *filename, TSoundType type, bool
}
// register sound
- _sounds.Add(sound);
+ _sounds.add(sound);
return sound;
@@ -200,17 +200,17 @@ ERRORCODE CBSoundMgr::addSound(CBSoundBuffer *sound, TSoundType type) {
}
// register sound
- _sounds.Add(sound);
+ _sounds.add(sound);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSoundMgr::removeSound(CBSoundBuffer *sound) {
- for (int i = 0; i < _sounds.GetSize(); i++) {
+ for (int i = 0; i < _sounds.getSize(); i++) {
if (_sounds[i] == sound) {
delete _sounds[i];
- _sounds.RemoveAt(i);
+ _sounds.removeAt(i);
return STATUS_OK;
}
}
@@ -236,7 +236,7 @@ ERRORCODE CBSoundMgr::setVolume(TSoundType type, int volume) {
break;
}
- for (int i = 0; i < _sounds.GetSize(); i++) {
+ for (int i = 0; i < _sounds.getSize(); i++) {
if (_sounds[i]->_type == type) _sounds[i]->setVolume(volume);
}
@@ -295,7 +295,7 @@ byte CBSoundMgr::getMasterVolumePercent() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSoundMgr::pauseAll(bool includingMusic) {
- for (int i = 0; i < _sounds.GetSize(); i++) {
+ for (int i = 0; i < _sounds.getSize(); i++) {
if (_sounds[i]->isPlaying() && (_sounds[i]->_type != SOUND_MUSIC || includingMusic)) {
_sounds[i]->pause();
_sounds[i]->_freezePaused = true;
@@ -309,7 +309,7 @@ ERRORCODE CBSoundMgr::pauseAll(bool includingMusic) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSoundMgr::resumeAll() {
- for (int i = 0; i < _sounds.GetSize(); i++) {
+ for (int i = 0; i < _sounds.getSize(); i++) {
if (_sounds[i]->_freezePaused) {
_sounds[i]->resume();
_sounds[i]->_freezePaused = false;
diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp
index 349cb1e2f5..6fd5152d70 100644
--- a/engines/wintermute/Base/BSprite.cpp
+++ b/engines/wintermute/Base/BSprite.cpp
@@ -90,9 +90,9 @@ void CBSprite::setDefaults() {
void CBSprite::cleanup() {
CBScriptHolder::cleanup();
- for (int i = 0; i < _frames.GetSize(); i++)
+ for (int i = 0; i < _frames.getSize(); i++)
delete _frames[i];
- _frames.RemoveAll();
+ _frames.removeAll();
delete[] _editorBgFile;
_editorBgFile = NULL;
@@ -104,7 +104,7 @@ void CBSprite::cleanup() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSprite::draw(int x, int y, CBObject *registerOwner, float zoomX, float zoomY, uint32 alpha) {
GetCurrentFrame(zoomX, zoomY);
- if (_currentFrame < 0 || _currentFrame >= _frames.GetSize()) return STATUS_OK;
+ if (_currentFrame < 0 || _currentFrame >= _frames.getSize()) return STATUS_OK;
// move owner if allowed to
if (_changed && _owner && _owner->_movable) {
@@ -147,8 +147,8 @@ ERRORCODE CBSprite::loadFile(const char *filename, int lifeTime, TSpriteCacheTyp
delete subframe;
} else {
CBPlatform::setRect(&subframe->_rect, 0, 0, subframe->_surface->getWidth(), subframe->_surface->getHeight());
- frame->_subframes.Add(subframe);
- _frames.Add(frame);
+ frame->_subframes.add(subframe);
+ _frames.add(frame);
_currentFrame = 0;
ret = STATUS_OK;
}
@@ -295,7 +295,7 @@ ERRORCODE CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSprit
return STATUS_FAILED;
}
- _frames.Add(frame);
+ _frames.add(frame);
frameCount++;
if (_currentFrame == -1) _currentFrame = 0;
}
@@ -319,7 +319,7 @@ ERRORCODE CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSprit
//////////////////////////////////////////////////////////////////////
void CBSprite::reset() {
- if (_frames.GetSize() > 0) _currentFrame = 0;
+ if (_frames.getSize() > 0) _currentFrame = 0;
else _currentFrame = -1;
killAllSounds();
@@ -344,9 +344,9 @@ bool CBSprite::GetCurrentFrame(float zoomX, float zoomY) {
// get current frame
if (!_paused && !_finished && timer >= _lastFrameTime + _frames[_currentFrame]->_delay && _lastFrameTime != 0) {
- if (_currentFrame < _frames.GetSize() - 1) {
+ if (_currentFrame < _frames.getSize() - 1) {
_currentFrame++;
- if (_continuous) _canBreak = (_currentFrame == _frames.GetSize() - 1);
+ if (_continuous) _canBreak = (_currentFrame == _frames.getSize() - 1);
} else {
if (_looping) {
_currentFrame = 0;
@@ -360,12 +360,12 @@ bool CBSprite::GetCurrentFrame(float zoomX, float zoomY) {
_lastFrameTime = timer;
}
- _changed = (lastFrame != _currentFrame || (_looping && _frames.GetSize() == 1));
+ _changed = (lastFrame != _currentFrame || (_looping && _frames.getSize() == 1));
if (_lastFrameTime == 0) {
_lastFrameTime = timer;
_changed = true;
- if (_continuous) _canBreak = (_currentFrame == _frames.GetSize() - 1);
+ if (_continuous) _canBreak = (_currentFrame == _frames.getSize() - 1);
}
if (_changed) {
@@ -384,7 +384,7 @@ bool CBSprite::GetCurrentFrame(float zoomX, float zoomY) {
//////////////////////////////////////////////////////////////////////
ERRORCODE CBSprite::display(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
- if (_currentFrame < 0 || _currentFrame >= _frames.GetSize()) return STATUS_OK;
+ if (_currentFrame < 0 || _currentFrame >= _frames.getSize()) return STATUS_OK;
// on change...
if (_changed) {
@@ -403,9 +403,9 @@ ERRORCODE CBSprite::display(int X, int Y, CBObject *Register, float ZoomX, float
//////////////////////////////////////////////////////////////////////////
CBSurface *CBSprite::getSurface() {
// only used for animated textures for 3D models
- if (_currentFrame < 0 || _currentFrame >= _frames.GetSize()) return NULL;
+ if (_currentFrame < 0 || _currentFrame >= _frames.getSize()) return NULL;
CBFrame *Frame = _frames[_currentFrame];
- if (Frame && Frame->_subframes.GetSize() > 0) {
+ if (Frame && Frame->_subframes.getSize() > 0) {
CBSubFrame *Subframe = Frame->_subframes[0];
if (Subframe) return Subframe->_surface;
else return NULL;
@@ -417,7 +417,7 @@ bool CBSprite::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, f
if (!rect) return false;
CBPlatform::setRectEmpty(rect);
- for (int i = 0; i < _frames.GetSize(); i++) {
+ for (int i = 0; i < _frames.getSize(); i++) {
Common::Rect frame;
Common::Rect temp;
CBPlatform::copyRect(&temp, rect);
@@ -456,12 +456,12 @@ ERRORCODE CBSprite::saveAsText(CBDynBuffer *buffer, int indent) {
int i;
// scripts
- for (i = 0; i < _scripts.GetSize(); i++) {
+ for (i = 0; i < _scripts.getSize(); i++) {
buffer->putTextIndent(indent + 2, "SCRIPT=\"%s\"\n", _scripts[i]->_filename);
}
- for (i = 0; i < _frames.GetSize(); i++) {
+ for (i = 0; i < _frames.getSize(); i++) {
_frames[i]->saveAsText(buffer, indent + 2);
}
@@ -514,7 +514,7 @@ ERRORCODE CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
if (strcmp(name, "GetFrame") == 0) {
stack->correctParams(1);
int Index = stack->pop()->getInt(-1);
- if (Index < 0 || Index >= _frames.GetSize()) {
+ if (Index < 0 || Index >= _frames.getSize()) {
script->runtimeError("Sprite.GetFrame: Frame index %d is out of range.", Index);
stack->pushNULL();
} else stack->pushNative(_frames[Index], true);
@@ -529,16 +529,16 @@ ERRORCODE CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
CScValue *Val = stack->pop();
if (Val->isInt()) {
int Index = Val->getInt(-1);
- if (Index < 0 || Index >= _frames.GetSize()) {
+ if (Index < 0 || Index >= _frames.getSize()) {
script->runtimeError("Sprite.DeleteFrame: Frame index %d is out of range.", Index);
}
} else {
CBFrame *Frame = (CBFrame *)Val->getNative();
- for (int i = 0; i < _frames.GetSize(); i++) {
+ for (int i = 0; i < _frames.getSize(); i++) {
if (_frames[i] == Frame) {
if (i == _currentFrame) _lastFrameTime = 0;
delete _frames[i];
- _frames.RemoveAt(i);
+ _frames.removeAt(i);
break;
}
}
@@ -571,10 +571,10 @@ ERRORCODE CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
CBSubFrame *sub = new CBSubFrame(Game);
if (DID_SUCCEED(sub->setSurface(filename))) {
sub->setDefaultRect();
- frame->_subframes.Add(sub);
+ frame->_subframes.add(sub);
} else delete sub;
}
- _frames.Add(frame);
+ _frames.add(frame);
stack->pushNative(frame, true);
return STATUS_OK;
@@ -597,13 +597,13 @@ ERRORCODE CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
CBFrame *frame = new CBFrame(Game);
if (filename != NULL) {
CBSubFrame *sub = new CBSubFrame(Game);
- if (DID_SUCCEED(sub->setSurface(filename))) frame->_subframes.Add(sub);
+ if (DID_SUCCEED(sub->setSurface(filename))) frame->_subframes.add(sub);
else delete sub;
}
- if (index >= _frames.GetSize())
- _frames.Add(frame);
- else _frames.InsertAt(index, frame);
+ if (index >= _frames.getSize())
+ _frames.add(frame);
+ else _frames.insertAt(index, frame);
stack->pushNative(frame, true);
return STATUS_OK;
@@ -649,7 +649,7 @@ CScValue *CBSprite::scGetProperty(const char *name) {
// NumFrames (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumFrames") == 0) {
- _scValue->setInt(_frames.GetSize());
+ _scValue->setInt(_frames.getSize());
return _scValue;
}
@@ -713,7 +713,7 @@ ERRORCODE CBSprite::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "CurrentFrame") == 0) {
_currentFrame = value->getInt(0);
- if (_currentFrame >= _frames.GetSize() || _currentFrame < 0) {
+ if (_currentFrame >= _frames.getSize() || _currentFrame < 0) {
_currentFrame = -1;
}
_lastFrameTime = 0;
@@ -748,7 +748,7 @@ const char *CBSprite::scToString() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSprite::killAllSounds() {
- for (int i = 0; i < _frames.GetSize(); i++) {
+ for (int i = 0; i < _frames.getSize(); i++) {
if (_frames[i]->_sound)
_frames[i]->_sound->stop();
}
diff --git a/engines/wintermute/Base/BSubFrame.cpp b/engines/wintermute/Base/BSubFrame.cpp
index 4a1a5ec1f0..11450a1349 100644
--- a/engines/wintermute/Base/BSubFrame.cpp
+++ b/engines/wintermute/Base/BSubFrame.cpp
@@ -209,9 +209,9 @@ ERRORCODE CBSubFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, f
if (registerOwner != NULL && !_decoration) {
if (zoomX == 100 && zoomY == 100) {
- Game->_renderer->_rectList.Add(new CBActiveRect(Game, registerOwner, this, x - _hotspotX + _rect.left, y - _hotspotY + _rect.top, _rect.right - _rect.left, _rect.bottom - _rect.top, zoomX, zoomY, precise));
+ Game->_renderer->_rectList.add(new CBActiveRect(Game, registerOwner, this, x - _hotspotX + _rect.left, y - _hotspotY + _rect.top, _rect.right - _rect.left, _rect.bottom - _rect.top, zoomX, zoomY, precise));
} else {
- Game->_renderer->_rectList.Add(new CBActiveRect(Game, registerOwner, this, (int)(x - (_hotspotX + _rect.left) * (zoomX / 100)), (int)(y - (_hotspotY + _rect.top) * (zoomY / 100)), (int)((_rect.right - _rect.left) * (zoomX / 100)), (int)((_rect.bottom - _rect.top) * (zoomY / 100)), zoomX, zoomY, precise));
+ Game->_renderer->_rectList.add(new CBActiveRect(Game, registerOwner, this, (int)(x - (_hotspotX + _rect.left) * (zoomX / 100)), (int)(y - (_hotspotY + _rect.top) * (zoomY / 100)), (int)((_rect.right - _rect.left) * (zoomX / 100)), (int)((_rect.bottom - _rect.top) * (zoomY / 100)), zoomX, zoomY, precise));
}
}
if (Game->_suspendedRendering) return STATUS_OK;
diff --git a/engines/wintermute/Base/BSurfaceStorage.cpp b/engines/wintermute/Base/BSurfaceStorage.cpp
index eedfbca178..1c6bb33af3 100644
--- a/engines/wintermute/Base/BSurfaceStorage.cpp
+++ b/engines/wintermute/Base/BSurfaceStorage.cpp
@@ -52,11 +52,11 @@ CBSurfaceStorage::~CBSurfaceStorage() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSurfaceStorage::cleanup(bool warn) {
- for (int i = 0; i < _surfaces.GetSize(); i++) {
+ for (int i = 0; i < _surfaces.getSize(); i++) {
if (warn) Game->LOG(0, "CBSurfaceStorage warning: purging surface '%s', usage:%d", _surfaces[i]->_filename, _surfaces[i]->_referenceCount);
delete _surfaces[i];
}
- _surfaces.RemoveAll();
+ _surfaces.removeAll();
return STATUS_OK;
}
@@ -67,7 +67,7 @@ ERRORCODE CBSurfaceStorage::initLoop() {
if (Game->_smartCache && Game->_liveTimer - _lastCleanupTime >= Game->_surfaceGCCycleTime) {
_lastCleanupTime = Game->_liveTimer;
sortSurfaces();
- for (int i = 0; i < _surfaces.GetSize(); i++) {
+ for (int i = 0; i < _surfaces.getSize(); i++) {
if (_surfaces[i]->_lifeTime <= 0) break;
if (_surfaces[i]->_lifeTime > 0 && _surfaces[i]->_valid && Game->_liveTimer - _surfaces[i]->_lastUsedTime >= _surfaces[i]->_lifeTime) {
@@ -82,12 +82,12 @@ ERRORCODE CBSurfaceStorage::initLoop() {
//////////////////////////////////////////////////////////////////////
ERRORCODE CBSurfaceStorage::removeSurface(CBSurface *surface) {
- for (int i = 0; i < _surfaces.GetSize(); i++) {
+ for (int i = 0; i < _surfaces.getSize(); i++) {
if (_surfaces[i] == surface) {
_surfaces[i]->_referenceCount--;
if (_surfaces[i]->_referenceCount <= 0) {
delete _surfaces[i];
- _surfaces.RemoveAt(i);
+ _surfaces.removeAt(i);
}
break;
}
@@ -98,7 +98,7 @@ ERRORCODE CBSurfaceStorage::removeSurface(CBSurface *surface) {
//////////////////////////////////////////////////////////////////////
CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
- for (int i = 0; i < _surfaces.GetSize(); i++) {
+ for (int i = 0; i < _surfaces.getSize(); i++) {
if (scumm_stricmp(_surfaces[i]->_filename, filename) == 0) {
_surfaces[i]->_referenceCount++;
return _surfaces[i];
@@ -123,7 +123,7 @@ CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool defaultCK, by
return NULL;
} else {
surface->_referenceCount = 1;
- _surfaces.Add(surface);
+ _surfaces.add(surface);
return surface;
}
}
@@ -132,7 +132,7 @@ CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool defaultCK, by
//////////////////////////////////////////////////////////////////////
ERRORCODE CBSurfaceStorage::restoreAll() {
ERRORCODE ret;
- for (int i = 0; i < _surfaces.GetSize(); i++) {
+ for (int i = 0; i < _surfaces.getSize(); i++) {
ret = _surfaces[i]->restore();
if (ret != STATUS_OK) {
Game->LOG(0, "CBSurfaceStorage::RestoreAll failed");
@@ -161,7 +161,7 @@ ERRORCODE CBSurfaceStorage::persist(CBPersistMgr *persistMgr)
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBSurfaceStorage::sortSurfaces() {
- qsort(_surfaces.GetData(), _surfaces.GetSize(), sizeof(CBSurface *), surfaceSortCB);
+ qsort(_surfaces.getData(), _surfaces.getSize(), sizeof(CBSurface *), surfaceSortCB);
return STATUS_OK;
}
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp
index a07b5a90c7..c3efc74eec 100644
--- a/engines/wintermute/Base/PartEmitter.cpp
+++ b/engines/wintermute/Base/PartEmitter.cpp
@@ -95,21 +95,21 @@ CPartEmitter::CPartEmitter(CBGame *inGame, CBScriptHolder *Owner) : CBObject(inG
//////////////////////////////////////////////////////////////////////////
CPartEmitter::~CPartEmitter(void) {
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
delete _particles[i];
}
- _particles.RemoveAll();
+ _particles.removeAll();
- for (int i = 0; i < _forces.GetSize(); i++) {
+ for (int i = 0; i < _forces.getSize(); i++) {
delete _forces[i];
}
- _forces.RemoveAll();
+ _forces.removeAll();
- for (int i = 0; i < _sprites.GetSize(); i++) {
+ for (int i = 0; i < _sprites.getSize(); i++) {
delete [] _sprites[i];
}
- _sprites.RemoveAll();
+ _sprites.removeAll();
delete[] _emitEvent;
_emitEvent = NULL;
@@ -120,7 +120,7 @@ ERRORCODE CPartEmitter::addSprite(const char *filename) {
if (!filename) return STATUS_FAILED;
// do we already have the file?
- for (int i = 0; i < _sprites.GetSize(); i++) {
+ for (int i = 0; i < _sprites.getSize(); i++) {
if (scumm_stricmp(filename, _sprites[i]) == 0) return STATUS_OK;
}
@@ -133,17 +133,17 @@ ERRORCODE CPartEmitter::addSprite(const char *filename) {
char *Str = new char[strlen(filename) + 1];
strcpy(Str, filename);
- _sprites.Add(Str);
+ _sprites.add(Str);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
ERRORCODE CPartEmitter::removeSprite(const char *filename) {
- for (int i = 0; i < _sprites.GetSize(); i++) {
+ for (int i = 0; i < _sprites.getSize(); i++) {
if (scumm_stricmp(filename, _sprites[i]) == 0) {
delete [] _sprites[i];
- _sprites.RemoveAt(i);
+ _sprites.removeAt(i);
return STATUS_OK;
}
}
@@ -153,7 +153,7 @@ ERRORCODE CPartEmitter::removeSprite(const char *filename) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CPartEmitter::initParticle(CPartParticle *particle, uint32 currentTime, uint32 timerDelta) {
if (!particle) return STATUS_FAILED;
- if (_sprites.GetSize() == 0) return STATUS_FAILED;
+ if (_sprites.getSize() == 0) return STATUS_FAILED;
int posX = CBUtils::randomInt(_posX, _posX + _width);
int posY = CBUtils::randomInt(_posY, _posY + _height);
@@ -172,7 +172,7 @@ ERRORCODE CPartEmitter::initParticle(CPartParticle *particle, uint32 currentTime
else lifeTime = CBUtils::randomInt(_lifeTime1, _lifeTime2);
float angle = CBUtils::randomAngle(_angle1, _angle2);
- int spriteIndex = CBUtils::randomInt(0, _sprites.GetSize() - 1);
+ int spriteIndex = CBUtils::randomInt(0, _sprites.getSize() - 1);
float rotation = CBUtils::randomAngle(_rotation1, _rotation2);
float angVelocity = CBUtils::randomFloat(_angVelocity1, _angVelocity2);
@@ -235,7 +235,7 @@ ERRORCODE CPartEmitter::update() {
ERRORCODE CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
int numLive = 0;
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
_particles[i]->update(this, currentTime, timerDelta);
if (!_particles[i]->_isDead) numLive++;
@@ -256,7 +256,7 @@ ERRORCODE CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
int toGen = MIN(_genAmount, _maxParticles - numLive);
while (toGen > 0) {
int firstDeadIndex = -1;
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
if (_particles[i]->_isDead) {
firstDeadIndex = i;
break;
@@ -267,7 +267,7 @@ ERRORCODE CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
if (firstDeadIndex >= 0) particle = _particles[firstDeadIndex];
else {
particle = new CPartParticle(Game);
- _particles.Add(particle);
+ _particles.add(particle);
}
initParticle(particle, currentTime, timerDelta);
needsSort = true;
@@ -289,9 +289,9 @@ ERRORCODE CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CPartEmitter::display(CBRegion *region) {
- if (_sprites.GetSize() <= 1) Game->_renderer->startSpriteBatch();
+ if (_sprites.getSize() <= 1) Game->_renderer->startSpriteBatch();
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
if (region != NULL && _useRegion) {
if (!region->pointInRegion((int)_particles[i]->_pos.x, (int)_particles[i]->_pos.y)) continue;
}
@@ -299,14 +299,14 @@ ERRORCODE CPartEmitter::display(CBRegion *region) {
_particles[i]->display(this);
}
- if (_sprites.GetSize() <= 1) Game->_renderer->endSpriteBatch();
+ if (_sprites.getSize() <= 1) Game->_renderer->endSpriteBatch();
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
ERRORCODE CPartEmitter::start() {
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
_particles[i]->_isDead = true;
}
_running = true;
@@ -331,7 +331,7 @@ ERRORCODE CPartEmitter::start() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CPartEmitter::sortParticlesByZ() {
// sort particles by _posY
- qsort(_particles.GetData(), _particles.GetSize(), sizeof(CPartParticle *), CPartEmitter::compareZ);
+ qsort(_particles.getData(), _particles.getSize(), sizeof(CPartParticle *), CPartEmitter::compareZ);
return STATUS_OK;
}
@@ -366,7 +366,7 @@ ERRORCODE CPartEmitter::setBorderThickness(int thicknessLeft, int thicknessRight
CPartForce *CPartEmitter::addForceByName(const char *name) {
CPartForce *force = NULL;
- for (int i = 0; i < _forces.GetSize(); i++) {
+ for (int i = 0; i < _forces.getSize(); i++) {
if (scumm_stricmp(name, _forces[i]->_name) == 0) {
force = _forces[i];
break;
@@ -376,7 +376,7 @@ CPartForce *CPartEmitter::addForceByName(const char *name) {
force = new CPartForce(Game);
if (force) {
force->setName(name);
- _forces.Add(force);
+ _forces.add(force);
}
}
return force;
@@ -401,10 +401,10 @@ ERRORCODE CPartEmitter::addForce(const char *name, CPartForce::TForceType type,
//////////////////////////////////////////////////////////////////////////
ERRORCODE CPartEmitter::removeForce(const char *name) {
- for (int i = 0; i < _forces.GetSize(); i++) {
+ for (int i = 0; i < _forces.getSize(); i++) {
if (scumm_stricmp(name, _forces[i]->_name) == 0) {
delete _forces[i];
- _forces.RemoveAt(i);
+ _forces.removeAt(i);
return STATUS_OK;
}
}
@@ -482,10 +482,10 @@ ERRORCODE CPartEmitter::scCallMethod(CScScript *script, CScStack *stack, CScStac
else if (strcmp(name, "Stop") == 0) {
stack->correctParams(0);
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
delete _particles[i];
}
- _particles.RemoveAll();
+ _particles.removeAll();
_running = false;
stack->pushBool(true);
@@ -745,7 +745,7 @@ CScValue *CPartEmitter::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumLiveParticles") == 0) {
int numAlive = 0;
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
if (_particles[i] && !_particles[i]->_isDead) numAlive++;
}
_scValue->setInt(numAlive);
@@ -1163,9 +1163,9 @@ ERRORCODE CPartEmitter::persist(CBPersistMgr *persistMgr) {
int numForces;
if (persistMgr->_saving) {
- numForces = _forces.GetSize();
+ numForces = _forces.getSize();
persistMgr->transfer(TMEMBER(numForces));
- for (int i = 0; i < _forces.GetSize(); i++) {
+ for (int i = 0; i < _forces.getSize(); i++) {
_forces[i]->persist(persistMgr);
}
} else {
@@ -1173,15 +1173,15 @@ ERRORCODE CPartEmitter::persist(CBPersistMgr *persistMgr) {
for (int i = 0; i < numForces; i++) {
CPartForce *force = new CPartForce(Game);
force->persist(persistMgr);
- _forces.Add(force);
+ _forces.add(force);
}
}
int numParticles;
if (persistMgr->_saving) {
- numParticles = _particles.GetSize();
+ numParticles = _particles.getSize();
persistMgr->transfer(TMEMBER(numParticles));
- for (int i = 0; i < _particles.GetSize(); i++) {
+ for (int i = 0; i < _particles.getSize(); i++) {
_particles[i]->persist(persistMgr);
}
} else {
@@ -1189,7 +1189,7 @@ ERRORCODE CPartEmitter::persist(CBPersistMgr *persistMgr) {
for (int i = 0; i < numParticles; i++) {
CPartParticle *particle = new CPartParticle(Game);
particle->persist(persistMgr);
- _particles.Add(particle);
+ _particles.add(particle);
}
}
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp
index 9d667bdca8..3eaa546d29 100644
--- a/engines/wintermute/Base/PartParticle.cpp
+++ b/engines/wintermute/Base/PartParticle.cpp
@@ -143,7 +143,7 @@ ERRORCODE CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint3
// update position
float elapsedTime = (float)timerDelta / 1000.f;
- for (int i = 0; i < emitter->_forces.GetSize(); i++) {
+ for (int i = 0; i < emitter->_forces.getSize(); i++) {
CPartForce *force = emitter->_forces[i];
switch (force->_type) {
case CPartForce::FORCE_GLOBAL:
diff --git a/engines/wintermute/Base/file/BDiskFile.cpp b/engines/wintermute/Base/file/BDiskFile.cpp
index 1e9ec96e66..4287458b8e 100644
--- a/engines/wintermute/Base/file/BDiskFile.cpp
+++ b/engines/wintermute/Base/file/BDiskFile.cpp
@@ -50,7 +50,7 @@ Common::SeekableReadStream *openDiskFile(const Common::String &filename, CBFileM
uint32 prefixSize = 0;
Common::SeekableReadStream *file = NULL;
- for (int i = 0; i < fileManager->_singlePaths.GetSize(); i++) {
+ for (int i = 0; i < fileManager->_singlePaths.getSize(); i++) {
sprintf(fullPath, "%s%s", fileManager->_singlePaths[i], filename.c_str());
correctSlashes(fullPath);
Common::File *tempFile = new Common::File();
diff --git a/engines/wintermute/Base/scriptables/SXStore.cpp b/engines/wintermute/Base/scriptables/SXStore.cpp
index 4658f48216..065fac5255 100644
--- a/engines/wintermute/Base/scriptables/SXStore.cpp
+++ b/engines/wintermute/Base/scriptables/SXStore.cpp
@@ -68,16 +68,16 @@ CSXStore::~CSXStore() {
void CSXStore::cleanup() {
setEventsEnabled(NULL, false);
- for (int i = 0; i < _validProducts.GetSize(); i++) {
+ for (int i = 0; i < _validProducts.getSize(); i++) {
delete _validProducts[i];
}
- _validProducts.RemoveAll();
+ _validProducts.removeAll();
- for (int i = 0; i < _transactions.GetSize(); i++) {
+ for (int i = 0; i < _transactions.getSize(); i++) {
delete _transactions[i];
}
- _transactions.RemoveAll();
+ _transactions.removeAll();
_lastProductRequestOwner = _lastPurchaseOwner = _lastRestoreOwner = NULL;
@@ -120,7 +120,7 @@ ERRORCODE CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
else if (strcmp(name, "GetValidProduct") == 0) {
stack->correctParams(1);
int index = stack->pop()->getInt();
- if (index >= 0 && index < _validProducts.GetSize()) {
+ if (index >= 0 && index < _validProducts.getSize()) {
CScValue *prod = stack->getPushValue();
if (prod) {
prod->setProperty("Id", _validProducts[index]->getId());
@@ -152,7 +152,7 @@ ERRORCODE CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *t
else if (strcmp(name, "GetTransaction") == 0) {
stack->correctParams(1);
int index = stack->pop()->getInt();
- if (index >= 0 && index < _transactions.GetSize()) {
+ if (index >= 0 && index < _transactions.getSize()) {
CScValue *trans = stack->getPushValue();
if (trans) {
trans->setProperty("Id", _transactions[index]->getId());
@@ -255,7 +255,7 @@ CScValue *CSXStore::scGetProperty(const char *name) {
// NumValidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumValidProducts") == 0) {
- _scValue->setInt(_validProducts.GetSize());
+ _scValue->setInt(_validProducts.getSize());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -269,7 +269,7 @@ CScValue *CSXStore::scGetProperty(const char *name) {
// NumTransactions (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumTransactions") == 0) {
- _scValue->setInt(_transactions.GetSize());
+ _scValue->setInt(_transactions.getSize());
return _scValue;
}
@@ -293,16 +293,16 @@ ERRORCODE CSXStore::persist(CBPersistMgr *persistMgr) {
// persist valid products
int numProducts;
if (persistMgr->_saving) {
- numProducts = _validProducts.GetSize();
+ numProducts = _validProducts.getSize();
persistMgr->transfer(TMEMBER(numProducts));
for (int i = 0; i < numProducts; i++) _validProducts[i]->persist(persistMgr);
} else {
- numProducts = _validProducts.GetSize();
+ numProducts = _validProducts.getSize();
persistMgr->transfer(TMEMBER(numProducts));
for (int i = 0; i < numProducts; i++) {
CBStoreProduct *prod = new CBStoreProduct;
prod->persist(persistMgr);
- _validProducts.Add(prod);
+ _validProducts.add(prod);
}
}
@@ -362,10 +362,10 @@ bool CSXStore::isAvailable() {
//////////////////////////////////////////////////////////////////////////
void CSXStore::receiveProductsStart() {
- for (int i = 0; i < _validProducts.GetSize(); i++) {
+ for (int i = 0; i < _validProducts.getSize(); i++) {
delete _validProducts[i];
}
- _validProducts.RemoveAll();
+ _validProducts.removeAll();
_invalidProducts.clear();
}
@@ -378,7 +378,7 @@ void CSXStore::receiveProductsEnd() {
//////////////////////////////////////////////////////////////////////////
void CSXStore::addValidProduct(const char *id, const char *name, const char *desc, const char *price) {
CBStoreProduct *prod = new CBStoreProduct(id, name, desc, price);
- _validProducts.Add(prod);
+ _validProducts.add(prod);
}
//////////////////////////////////////////////////////////////////////////
@@ -388,10 +388,10 @@ void CSXStore::addInvalidProduct(const char *id) {
//////////////////////////////////////////////////////////////////////////
void CSXStore::receiveTransactionsStart() {
- for (int i = 0; i < _transactions.GetSize(); i++) {
+ for (int i = 0; i < _transactions.getSize(); i++) {
delete _transactions[i];
}
- _transactions.RemoveAll();
+ _transactions.removeAll();
}
//////////////////////////////////////////////////////////////////////////
@@ -405,7 +405,7 @@ void CSXStore::receiveTransactionsEnd() {
//////////////////////////////////////////////////////////////////////////
void CSXStore::addTransaction(const char *id, const char *productId, const char *state) {
CBStoreTransaction *trans = new CBStoreTransaction(id, productId, state);
- _transactions.Add(trans);
+ _transactions.add(trans);
}
//////////////////////////////////////////////////////////////////////////
@@ -413,7 +413,7 @@ bool CSXStore::purchase(CScScript *script, const char *productId) {
if (!productId) return false;
#ifdef __IPHONEOS__
- for (int i = 0; i < _validProducts.GetSize(); i++) {
+ for (int i = 0; i < _validProducts.getSize(); i++) {
if (strcmp(productId, _validProducts[i]->GetId()) == 0) {
_lastPurchaseOwner = script->_owner;
@@ -430,11 +430,11 @@ bool CSXStore::purchase(CScScript *script, const char *productId) {
bool CSXStore::finishTransaction(CScScript *script, const char *transId) {
if (!transId) return false;
#ifdef __IPHONEOS__
- for (int i = 0; i < _transactions.GetSize(); i++) {
+ for (int i = 0; i < _transactions.getSize(); i++) {
if (strcmp(transId, _transactions[i]->GetId()) == 0) {
if (StoreKit_FinishTransaction(transId) > 0) {
SAFE_DELETE(_transactions[i]);
- _transactions.RemoveAt(i);
+ _transactions.removeAt(i);
return true;
} else return false;
}
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp
index 089978ece3..ea651e69bf 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.cpp
+++ b/engines/wintermute/Base/scriptables/ScEngine.cpp
@@ -89,24 +89,24 @@ CScEngine::~CScEngine() {
cleanup();
- for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ for (int i = 0; i < _breakpoints.getSize(); i++) {
delete _breakpoints[i];
_breakpoints[i] = NULL;
}
- _breakpoints.RemoveAll();
+ _breakpoints.removeAll();
}
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::cleanup() {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread && _scripts[i]->_owner) _scripts[i]->_owner->removeScript(_scripts[i]);
delete _scripts[i];
- _scripts.RemoveAt(i);
+ _scripts.removeAt(i);
i--;
}
- _scripts.RemoveAll();
+ _scripts.removeAll();
delete _globals;
_globals = NULL;
@@ -162,7 +162,7 @@ CScScript *CScEngine::runScript(const char *filename, CBScriptHolder *owner) {
script->_globals->setProp("self", &val);
script->_globals->setProp("this", &val);
- _scripts.Add(script);
+ _scripts.add(script);
Game->getDebugMgr()->onScriptInit(script);
return script;
@@ -245,18 +245,18 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::tick() {
- if (_scripts.GetSize() == 0)
+ if (_scripts.getSize() == 0)
return STATUS_OK;
// resolve waiting scripts
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
switch (_scripts[i]->_state) {
case SCRIPT_WAITING: {
/*
bool obj_found=false;
- for(int j=0; j<Game->_regObjects.GetSize(); j++)
+ for(int j=0; j<Game->_regObjects.getSize(); j++)
{
if(Game->_regObjects[j] == _scripts[i]->_waitObject)
{
@@ -307,7 +307,7 @@ ERRORCODE CScEngine::tick() {
// execute scripts
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
// skip paused scripts
if (_scripts[i]->_state == SCRIPT_PAUSED) continue;
@@ -346,7 +346,7 @@ ERRORCODE CScEngine::tick() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::tickUnbreakable() {
// execute unbreakable scripts
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_unbreakable) continue;
while (_scripts[i]->_state == SCRIPT_RUNNING) {
@@ -365,12 +365,12 @@ ERRORCODE CScEngine::tickUnbreakable() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::removeFinishedScripts() {
// remove finished scripts
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_FINISHED || _scripts[i]->_state == SCRIPT_ERROR) {
if (!_scripts[i]->_thread && _scripts[i]->_owner) _scripts[i]->_owner->removeScript(_scripts[i]);
Game->getDebugMgr()->onScriptShutdown(_scripts[i]);
delete _scripts[i];
- _scripts.RemoveAt(i);
+ _scripts.removeAt(i);
i--;
}
}
@@ -382,7 +382,7 @@ ERRORCODE CScEngine::removeFinishedScripts() {
int CScEngine::getNumScripts(int *running, int *waiting, int *persistent) {
int numRunning = 0, numWaiting = 0, numPersistent = 0, numTotal = 0;
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_FINISHED) continue;
switch (_scripts[i]->_state) {
case SCRIPT_RUNNING:
@@ -425,7 +425,7 @@ ERRORCODE CScEngine::emptyScriptCache() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::resetObject(CBObject *Object) {
// terminate all scripts waiting for this object
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_WAITING && _scripts[i]->_waitObject == Object) {
if (!Game->_compatKillMethodThreads) resetScript(_scripts[i]);
@@ -439,7 +439,7 @@ ERRORCODE CScEngine::resetObject(CBObject *Object) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::resetScript(CScScript *script) {
// terminate all scripts waiting for this script
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_WAITING_SCRIPT && _scripts[i]->_waitScript == script) {
_scripts[i]->finish();
}
@@ -462,10 +462,10 @@ ERRORCODE CScEngine::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
void CScEngine::editorCleanup() {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ 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.removeAt(i);
i--;
}
}
@@ -474,7 +474,7 @@ void CScEngine::editorCleanup() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::pauseAll() {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i] != _currentScript) _scripts[i]->pause();
}
@@ -484,7 +484,7 @@ ERRORCODE CScEngine::pauseAll() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScEngine::resumeAll() {
- for (int i = 0; i < _scripts.GetSize(); i++)
+ for (int i = 0; i < _scripts.getSize(); i++)
_scripts[i]->resume();
return STATUS_OK;
@@ -493,7 +493,7 @@ ERRORCODE CScEngine::resumeAll() {
//////////////////////////////////////////////////////////////////////////
bool CScEngine::isValidScript(CScScript *script) {
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i] == script) return true;
}
return false;
@@ -511,13 +511,13 @@ ERRORCODE CScEngine::dbgSendScripts(IWmeDebugClient *client) {
_globals->dbgSendVariables(client, WME_DBGVAR_GLOBAL, NULL, 0);
// process normal scripts first
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_thread || _scripts[i]->_methodThread) continue;
_scripts[i]->dbgSendScript(client);
}
// and threads later
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_thread || _scripts[i]->_methodThread)
_scripts[i]->dbgSendScript(client);
}
@@ -530,7 +530,7 @@ ERRORCODE CScEngine::addBreakpoint(const char *scriptFilename, int line) {
if (!Game->getDebugMgr()->_enabled) return STATUS_OK;
CScBreakpoint *bp = NULL;
- for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ for (int i = 0; i < _breakpoints.getSize(); i++) {
if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), scriptFilename) == 0) {
bp = _breakpoints[i];
break;
@@ -538,13 +538,13 @@ ERRORCODE CScEngine::addBreakpoint(const char *scriptFilename, int line) {
}
if (bp == NULL) {
bp = new CScBreakpoint(scriptFilename);
- _breakpoints.Add(bp);
+ _breakpoints.add(bp);
}
- for (int i = 0; i < bp->_lines.GetSize(); i++) {
+ for (int i = 0; i < bp->_lines.getSize(); i++) {
if (bp->_lines[i] == line) return STATUS_OK;
}
- bp->_lines.Add(line);
+ bp->_lines.add(line);
// refresh changes
refreshScriptBreakpoints();
@@ -556,14 +556,14 @@ ERRORCODE CScEngine::addBreakpoint(const char *scriptFilename, int line) {
ERRORCODE CScEngine::removeBreakpoint(const char *scriptFilename, int line) {
if (!Game->getDebugMgr()->_enabled) return STATUS_OK;
- for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ for (int i = 0; i < _breakpoints.getSize(); i++) {
if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), scriptFilename) == 0) {
- for (int j = 0; j < _breakpoints[i]->_lines.GetSize(); j++) {
+ for (int j = 0; j < _breakpoints[i]->_lines.getSize(); j++) {
if (_breakpoints[i]->_lines[j] == line) {
- _breakpoints[i]->_lines.RemoveAt(j);
- if (_breakpoints[i]->_lines.GetSize() == 0) {
+ _breakpoints[i]->_lines.removeAt(j);
+ if (_breakpoints[i]->_lines.getSize() == 0) {
delete _breakpoints[i];
- _breakpoints.RemoveAt(i);
+ _breakpoints.removeAt(i);
}
// refresh changes
refreshScriptBreakpoints();
@@ -581,7 +581,7 @@ ERRORCODE CScEngine::removeBreakpoint(const char *scriptFilename, int line) {
ERRORCODE CScEngine::refreshScriptBreakpoints() {
if (!Game->getDebugMgr()->_enabled) return STATUS_OK;
- for (int i = 0; i < _scripts.GetSize(); i++) {
+ for (int i = 0; i < _scripts.getSize(); i++) {
refreshScriptBreakpoints(_scripts[i]);
}
return STATUS_OK;
@@ -593,13 +593,13 @@ ERRORCODE CScEngine::refreshScriptBreakpoints(CScScript *script) {
if (!script || !script->_filename) return STATUS_FAILED;
- for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ for (int i = 0; i < _breakpoints.getSize(); i++) {
if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), script->_filename) == 0) {
- script->_breakpoints.Copy(_breakpoints[i]->_lines);
+ script->_breakpoints.copy(_breakpoints[i]->_lines);
return STATUS_OK;
}
}
- if (script->_breakpoints.GetSize() > 0) script->_breakpoints.RemoveAll();
+ if (script->_breakpoints.getSize() > 0) script->_breakpoints.removeAll();
return STATUS_OK;
}
@@ -613,8 +613,8 @@ ERRORCODE CScEngine::saveBreakpoints() {
char key[100];
int count = 0;
- for (int i = 0; i < _breakpoints.GetSize(); i++) {
- for (int j = 0; j < _breakpoints[i]->_lines.GetSize(); j++) {
+ for (int i = 0; i < _breakpoints.getSize(); i++) {
+ for (int j = 0; j < _breakpoints[i]->_lines.getSize(); j++) {
count++;
sprintf(key, "Breakpoint%d", count);
sprintf(text, "%s:%d", _breakpoints[i]->_filename.c_str(), _breakpoints[i]->_lines[j]);
diff --git a/engines/wintermute/Base/scriptables/ScEngine.h b/engines/wintermute/Base/scriptables/ScEngine.h
index d4112be47b..d439ab8eab 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.h
+++ b/engines/wintermute/Base/scriptables/ScEngine.h
@@ -72,7 +72,7 @@ public:
}
~CScBreakpoint() {
- _lines.RemoveAll();
+ _lines.removeAll();
}
Common::String _filename;
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp
index ebb68654fd..40803cded6 100644
--- a/engines/wintermute/Base/scriptables/ScScript.cpp
+++ b/engines/wintermute/Base/scriptables/ScScript.cpp
@@ -1029,7 +1029,7 @@ ERRORCODE CScScript::executeInstruction() {
_currentLine = newLine;
if (Game->getDebugMgr()->_enabled) {
Game->getDebugMgr()->onScriptChangeLine(this, _currentLine);
- for (int i = 0; i < _breakpoints.GetSize(); i++) {
+ for (int i = 0; i < _breakpoints.getSize(); i++) {
if (_breakpoints[i] == _currentLine) {
Game->getDebugMgr()->onScriptHitBreakpoint(this);
sleep(0);
@@ -1268,7 +1268,7 @@ CScScript *CScScript::invokeEventHandler(const char *eventName, bool unbreakable
ERRORCODE ret = thread->createThread(this, pos, eventName);
if (DID_SUCCEED(ret)) {
thread->_unbreakable = unbreakable;
- _engine->_scripts.Add(thread);
+ _engine->_scripts.add(thread);
Game->getDebugMgr()->onScriptEventThreadInit(thread, this, eventName);
return thread;
} else {
@@ -1363,7 +1363,7 @@ ERRORCODE CScScript::copyParameters(CScStack *stack) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CScScript::finishThreads() {
- for (int i = 0; i < _engine->_scripts.GetSize(); i++) {
+ for (int i = 0; i < _engine->_scripts.getSize(); i++) {
CScScript *scr = _engine->_scripts[i];
if (scr->_thread && scr->_state != SCRIPT_FINISHED && scr->_owner == _owner && scumm_stricmp(scr->_filename, _filename) == 0)
scr->finish(true);
@@ -1417,12 +1417,12 @@ TScriptState CScScript::dbgGetState() {
//////////////////////////////////////////////////////////////////////////
int CScScript::dbgGetNumBreakpoints() {
- return _breakpoints.GetSize();
+ return _breakpoints.getSize();
}
//////////////////////////////////////////////////////////////////////////
int CScScript::dbgGetBreakpoint(int index) {
- if (index >= 0 && index < _breakpoints.GetSize()) return _breakpoints[index];
+ if (index >= 0 && index < _breakpoints.getSize()) return _breakpoints[index];
else return -1;
}
diff --git a/engines/wintermute/Base/scriptables/ScStack.cpp b/engines/wintermute/Base/scriptables/ScStack.cpp
index 7bc44838f3..33fe9f44e8 100644
--- a/engines/wintermute/Base/scriptables/ScStack.cpp
+++ b/engines/wintermute/Base/scriptables/ScStack.cpp
@@ -44,13 +44,13 @@ CScStack::CScStack(CBGame *inGame): CBBase(inGame) {
CScStack::~CScStack() {
#if _DEBUG
- //Game->LOG(0, "STAT: Stack size: %d, SP=%d", _values.GetSize(), _sP);
+ //Game->LOG(0, "STAT: Stack size: %d, SP=%d", _values.getSize(), _sP);
#endif
- for (int i = 0; i < _values.GetSize(); i++) {
+ for (int i = 0; i < _values.getSize(); i++) {
delete _values[i];
}
- _values.RemoveAll();
+ _values.removeAll();
}
@@ -69,13 +69,13 @@ CScValue *CScStack::pop() {
void CScStack::push(CScValue *val) {
_sP++;
- if (_sP < _values.GetSize()) {
+ if (_sP < _values.getSize()) {
_values[_sP]->cleanup();
_values[_sP]->copy(val);
} else {
CScValue *copyVal = new CScValue(Game);
copyVal->copy(val);
- _values.Add(copyVal);
+ _values.add(copyVal);
}
}
@@ -84,9 +84,9 @@ void CScStack::push(CScValue *val) {
CScValue *CScStack::getPushValue() {
_sP++;
- if (_sP >= _values.GetSize()) {
+ if (_sP >= _values.getSize()) {
CScValue *val = new CScValue(Game);
- _values.Add(val);
+ _values.add(val);
}
_values[_sP]->cleanup();
return _values[_sP];
@@ -96,7 +96,7 @@ CScValue *CScStack::getPushValue() {
//////////////////////////////////////////////////////////////////////////
CScValue *CScStack::getTop() {
- if (_sP < 0 || _sP >= _values.GetSize()) return NULL;
+ if (_sP < 0 || _sP >= _values.getSize()) return NULL;
else return _values[_sP];
}
@@ -104,7 +104,7 @@ CScValue *CScStack::getTop() {
//////////////////////////////////////////////////////////////////////////
CScValue *CScStack::getAt(int index) {
index = _sP - index;
- if (index < 0 || index >= _values.GetSize()) return NULL;
+ if (index < 0 || index >= _values.getSize()) return NULL;
else return _values[index];
}
@@ -117,7 +117,7 @@ void CScStack::correctParams(uint32 expectedParams) {
while (expectedParams < nuParams) {
//Pop();
delete _values[_sP - expectedParams];
- _values.RemoveAt(_sP - expectedParams);
+ _values.removeAt(_sP - expectedParams);
nuParams--;
_sP--;
}
@@ -126,13 +126,13 @@ void CScStack::correctParams(uint32 expectedParams) {
//Push(null_val);
CScValue *nullVal = new CScValue(Game);
nullVal->setNULL();
- _values.InsertAt(_sP - nuParams + 1, nullVal);
+ _values.insertAt(_sP - nuParams + 1, nullVal);
nuParams++;
_sP++;
- if (_values.GetSize() > _sP + 1) {
- delete _values[_values.GetSize() - 1];
- _values.RemoveAt(_values.GetSize() - 1);
+ if (_values.getSize() > _sP + 1) {
+ delete _values[_values.getSize() - 1];
+ _values.removeAt(_values.getSize() - 1);
}
}
}