diff options
author | Einar Johan Trøan Sømåen | 2012-07-04 13:15:47 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-04 13:15:47 +0200 |
commit | 0f249f55db2f2d4b6f94b9eea195d42e49a74248 (patch) | |
tree | 8d0bf8532220f81f68fff1d8428b196accf64062 | |
parent | 46d2428dabb1637218b924753e9a3942d4d73b69 (diff) | |
download | scummvm-rg350-0f249f55db2f2d4b6f94b9eea195d42e49a74248.tar.gz scummvm-rg350-0f249f55db2f2d4b6f94b9eea195d42e49a74248.tar.bz2 scummvm-rg350-0f249f55db2f2d4b6f94b9eea195d42e49a74248.zip |
WINTERMUTE: Rename FuncName->funcName and VarName->varName mainly in AdGame. (But also all const char* Filename->filename)
100 files changed, 1069 insertions, 1073 deletions
diff --git a/engines/wintermute/Ad/AdActor.cpp b/engines/wintermute/Ad/AdActor.cpp index f553128d79..1af137e96f 100644 --- a/engines/wintermute/Ad/AdActor.cpp +++ b/engines/wintermute/Ad/AdActor.cpp @@ -696,12 +696,12 @@ HRESULT CAdActor::update() { if (_tempSprite2) {
_tempSprite2->Reset();
_currentSprite = _tempSprite2;
- ((CAdGame *)Game)->AddSentence(_sentence);
+ ((CAdGame *)Game)->addSentence(_sentence);
}
}
} else {
_currentSprite = _tempSprite2;
- ((CAdGame *)Game)->AddSentence(_sentence);
+ ((CAdGame *)Game)->addSentence(_sentence);
}
}
break;
@@ -898,7 +898,7 @@ HRESULT CAdActor::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi CScValue *val = stack->pop();
// turn to object?
- if (val->isNative() && Game->ValidObject((CBObject *)val->getNative())) {
+ if (val->isNative() && Game->validObject((CBObject *)val->getNative())) {
CBObject *obj = (CBObject *)val->getNative();
int angle = (int)(atan2((double)(obj->_posY - _posY), (double)(obj->_posX - _posX)) * (180 / 3.14));
dir = (int)angleToDirection(angle);
diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp index 0623327e0a..27509a529c 100644 --- a/engines/wintermute/Ad/AdEntity.cpp +++ b/engines/wintermute/Ad/AdEntity.cpp @@ -73,7 +73,7 @@ CAdEntity::CAdEntity(CBGame *inGame): CAdTalkHolder(inGame) { //////////////////////////////////////////////////////////////////////////
CAdEntity::~CAdEntity() {
- Game->UnregisterObject(_region);
+ Game->unregisterObject(_region);
delete _theora;
_theora = NULL;
@@ -318,13 +318,13 @@ HRESULT CAdEntity::loadBuffer(byte *buffer, bool complete) { break;
case TOKEN_REGION: {
- if (_region) Game->UnregisterObject(_region);
+ if (_region) Game->unregisterObject(_region);
_region = NULL;
CBRegion *rgn = new CBRegion(Game);
if (!rgn || FAILED(rgn->loadBuffer(params, false))) cmd = PARSERR_GENERIC;
else {
_region = rgn;
- Game->RegisterObject(_region);
+ Game->registerObject(_region);
}
}
break;
@@ -474,7 +474,7 @@ HRESULT CAdEntity::loadBuffer(byte *buffer, bool complete) { _alphaColor = DRGBA(ar, ag, ab, alpha);
_state = STATE_READY;
- if (_item && ((CAdGame *)Game)->IsItemTaken(_item)) _active = false;
+ if (_item && ((CAdGame *)Game)->isItemTaken(_item)) _active = false;
return S_OK;
}
@@ -577,11 +577,11 @@ HRESULT CAdEntity::update() { _tempSprite2->Reset();
_currentSprite = _tempSprite2;
}
- ((CAdGame *)Game)->AddSentence(_sentence);
+ ((CAdGame *)Game)->addSentence(_sentence);
}
} else {
_currentSprite = _tempSprite2;
- ((CAdGame *)Game)->AddSentence(_sentence);
+ ((CAdGame *)Game)->addSentence(_sentence);
}
}
break;
@@ -733,7 +733,7 @@ HRESULT CAdEntity::scCallMethod(CScScript *script, CScStack *stack, CScStack *th stack->correctParams(0);
if (!_region) {
_region = new CBRegion(Game);
- Game->RegisterObject(_region);
+ Game->registerObject(_region);
}
if (_region) stack->pushNative(_region, true);
else stack->pushNULL();
@@ -747,7 +747,7 @@ HRESULT CAdEntity::scCallMethod(CScScript *script, CScStack *stack, CScStack *th else if (strcmp(name, "DeleteRegion") == 0) {
stack->correctParams(0);
if (_region) {
- Game->UnregisterObject(_region);
+ Game->unregisterObject(_region);
_region = NULL;
stack->pushBool(true);
} else stack->pushBool(false);
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp index 901a60ba35..969a03456d 100644 --- a/engines/wintermute/Ad/AdGame.cpp +++ b/engines/wintermute/Ad/AdGame.cpp @@ -72,7 +72,7 @@ CAdGame::CAdGame(): CBGame() { _scene = new CAdScene(Game);
_scene->setName("");
- RegisterObject(_scene);
+ registerObject(_scene);
_prevSceneName = NULL;
_prevSceneFilename = NULL;
@@ -106,7 +106,7 @@ CAdGame::CAdGame(): CBGame() { _smartItemCursor = false;
- AddSpeechDir("speech");
+ addSpeechDir("speech");
}
@@ -121,7 +121,7 @@ HRESULT CAdGame::cleanup() { int i;
for (i = 0; i < _objects.GetSize(); i++) {
- UnregisterObject(_objects[i]);
+ unregisterObject(_objects[i]);
_objects[i] = NULL;
}
_objects.RemoveAll();
@@ -138,11 +138,11 @@ HRESULT CAdGame::cleanup() { _speechDirs.RemoveAll();
- UnregisterObject(_scene);
+ unregisterObject(_scene);
_scene = NULL;
// remove items
- for (i = 0; i < _items.GetSize(); i++) Game->UnregisterObject(_items[i]);
+ for (i = 0; i < _items.GetSize(); i++) Game->unregisterObject(_items[i]);
_items.RemoveAll();
@@ -157,12 +157,12 @@ HRESULT CAdGame::cleanup() { if (_responseBox) {
- Game->UnregisterObject(_responseBox);
+ Game->unregisterObject(_responseBox);
_responseBox = NULL;
}
if (_inventoryBox) {
- Game->UnregisterObject(_inventoryBox);
+ Game->unregisterObject(_inventoryBox);
_inventoryBox = NULL;
}
@@ -195,9 +195,9 @@ HRESULT CAdGame::cleanup() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::InitLoop() {
+HRESULT CAdGame::initLoop() {
if (_scheduledScene && _transMgr->isReady()) {
- ChangeScene(_scheduledScene, _scheduledFadeIn);
+ changeScene(_scheduledScene, _scheduledFadeIn);
delete[] _scheduledScene;
_scheduledScene = NULL;
@@ -218,40 +218,40 @@ HRESULT CAdGame::InitLoop() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::AddObject(CAdObject *Object) {
- _objects.Add(Object);
- return RegisterObject(Object);
+HRESULT CAdGame::addObject(CAdObject *object) {
+ _objects.Add(object);
+ return registerObject(object);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::RemoveObject(CAdObject *Object) {
+HRESULT CAdGame::removeObject(CAdObject *object) {
// in case the user called Scene.CreateXXX() and Game.DeleteXXX()
if (_scene) {
- HRESULT Res = _scene->removeObject(Object);
+ HRESULT Res = _scene->removeObject(object);
if (SUCCEEDED(Res)) return Res;
}
for (int i = 0; i < _objects.GetSize(); i++) {
- if (_objects[i] == Object) {
+ if (_objects[i] == object) {
_objects.RemoveAt(i);
break;
}
}
- return UnregisterObject(Object);
+ return unregisterObject(object);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ChangeScene(const char *Filename, bool FadeIn) {
+HRESULT CAdGame::changeScene(const char *filename, bool fadeIn) {
if (_scene == NULL) {
_scene = new CAdScene(Game);
- RegisterObject(_scene);
+ registerObject(_scene);
} else {
_scene->applyEvent("SceneShutdown", true);
- SetPrevSceneName(_scene->_name);
- SetPrevSceneFilename(_scene->_filename);
+ setPrevSceneName(_scene->_name);
+ setPrevSceneFilename(_scene->_filename);
if (!_tempDisableSaveState) _scene->saveState();
_tempDisableSaveState = false;
@@ -269,7 +269,7 @@ HRESULT CAdGame::ChangeScene(const char *Filename, bool FadeIn) { if (_initialScene && _dEBUG_DebugMode && _debugStartupScene) {
_initialScene = false;
ret = _scene->loadFile(_debugStartupScene);
- } else ret = _scene->loadFile(Filename);
+ } else ret = _scene->loadFile(filename);
if (SUCCEEDED(ret)) {
// invalidate references to the original scene
@@ -280,22 +280,22 @@ HRESULT CAdGame::ChangeScene(const char *Filename, bool FadeIn) { _scene->loadState();
}
- if (FadeIn) Game->_transMgr->start(TRANSITION_FADE_IN);
+ if (fadeIn) Game->_transMgr->start(TRANSITION_FADE_IN);
return ret;
} else return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
-void CAdGame::AddSentence(CAdSentence *Sentence) {
- _sentences.Add(Sentence);
+void CAdGame::addSentence(CAdSentence *sentence) {
+ _sentences.Add(sentence);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::DisplaySentences(bool Frozen) {
+HRESULT CAdGame::displaySentences(bool frozen) {
for (int i = 0; i < _sentences.GetSize(); i++) {
- if (Frozen && _sentences[i]->_freezable) continue;
+ if (frozen && _sentences[i]->_freezable) continue;
else _sentences[i]->display();
}
return S_OK;
@@ -303,7 +303,7 @@ HRESULT CAdGame::DisplaySentences(bool Frozen) { //////////////////////////////////////////////////////////////////////////
-void CAdGame::FinishSentences() {
+void CAdGame::finishSentences() {
for (int i = 0; i < _sentences.GetSize(); i++) {
if (_sentences[i]->CanSkip()) {
_sentences[i]->_duration = 0;
@@ -322,15 +322,15 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
if (strcmp(name, "ChangeScene") == 0) {
stack->correctParams(3);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
CScValue *valFadeOut = stack->pop();
CScValue *valFadeIn = stack->pop();
- bool TransOut = valFadeOut->isNULL() ? true : valFadeOut->getBool();
- bool TransIn = valFadeIn->isNULL() ? true : valFadeIn->getBool();
+ bool transOut = valFadeOut->isNULL() ? true : valFadeOut->getBool();
+ bool transIn = valFadeIn->isNULL() ? true : valFadeIn->getBool();
- ScheduleChangeScene(Filename, TransIn);
- if (TransOut) _transMgr->start(TRANSITION_FADE_OUT, true);
+ scheduleChangeScene(filename, transIn);
+ if (transOut) _transMgr->start(TRANSITION_FADE_OUT, true);
stack->pushNULL();
@@ -348,7 +348,7 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this stack->correctParams(1);
CAdActor *act = new CAdActor(Game);
if (act && SUCCEEDED(act->loadFile(stack->pop()->getString()))) {
- AddObject(act);
+ addObject(act);
stack->pushNative(act, true);
} else {
delete act;
@@ -365,7 +365,7 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this stack->correctParams(1);
CAdEntity *ent = new CAdEntity(Game);
if (ent && SUCCEEDED(ent->loadFile(stack->pop()->getString()))) {
- AddObject(ent);
+ addObject(ent);
stack->pushNative(ent, true);
} else {
delete ent;
@@ -382,7 +382,7 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this stack->correctParams(1);
CScValue *val = stack->pop();
CAdObject *obj = (CAdObject *)val->getNative();
- RemoveObject(obj);
+ removeObject(obj);
if (val->getType() == VAL_VARIABLE_REF) val->setNULL();
stack->pushNULL();
@@ -394,12 +394,12 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "CreateEntity") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ CScValue *val = stack->pop();
- CAdEntity *Ent = new CAdEntity(Game);
- AddObject(Ent);
- if (!Val->isNULL()) Ent->setName(Val->getString());
- stack->pushNative(Ent, true);
+ CAdEntity *ent = new CAdEntity(Game);
+ addObject(ent);
+ if (!val->isNULL()) ent->setName(val->getString());
+ stack->pushNative(ent, true);
return S_OK;
}
@@ -408,12 +408,12 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "CreateItem") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ CScValue *val = stack->pop();
- CAdItem *Item = new CAdItem(Game);
- AddItem(Item);
- if (!Val->isNULL()) Item->setName(Val->getString());
- stack->pushNative(Item, true);
+ CAdItem *item = new CAdItem(Game);
+ addItem(item);
+ if (!val->isNULL()) item->setName(val->getString());
+ stack->pushNative(item, true);
return S_OK;
}
@@ -422,14 +422,14 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "DeleteItem") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ CScValue *val = stack->pop();
- CAdItem *Item = NULL;
- if (Val->isNative()) Item = (CAdItem *)Val->getNative();
- else Item = GetItemByName(Val->getString());
+ CAdItem *item = NULL;
+ if (val->isNative()) item = (CAdItem *)val->getNative();
+ else item = getItemByName(val->getString());
- if (Item) {
- DeleteItem(Item);
+ if (item) {
+ deleteItem(item);
}
stack->pushNULL();
@@ -441,17 +441,17 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "QueryItem") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ CScValue *val = stack->pop();
- CAdItem *Item = NULL;
- if (Val->isInt()) {
- int Index = Val->getInt();
- if (Index >= 0 && Index < _items.GetSize()) Item = _items[Index];
+ CAdItem *item = NULL;
+ if (val->isInt()) {
+ int index = val->getInt();
+ if (index >= 0 && index < _items.GetSize()) item = _items[index];
} else {
- Item = GetItemByName(Val->getString());
+ item = getItemByName(val->getString());
}
- if (Item) stack->pushNative(Item, true);
+ if (item) stack->pushNative(item, true);
else stack->pushNULL();
return S_OK;
@@ -500,7 +500,7 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this else if (strcmp(name, "ResetResponse") == 0) {
stack->correctParams(1);
int ID = stack->pop()->getInt(-1);
- ResetResponse(ID);
+ resetResponse(ID);
stack->pushNULL();
return S_OK;
}
@@ -521,7 +521,7 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetResponse") == 0) {
stack->correctParams(1);
- bool AutoSelectLast = stack->pop()->getBool();
+ bool autoSelectLast = stack->pop()->getBool();
if (_responseBox) {
_responseBox->weedResponses();
@@ -532,7 +532,7 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this }
- if (_responseBox->_responses.GetSize() == 1 && AutoSelectLast) {
+ if (_responseBox->_responses.GetSize() == 1 && autoSelectLast) {
stack->pushInt(_responseBox->_responses[0]->_iD);
_responseBox->handleResponse(_responseBox->_responses[0]);
_responseBox->clearResponses();
@@ -573,13 +573,13 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "StartDlgBranch") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
- Common::String BranchName;
- if (Val->isNULL()) {
- BranchName.format("line%d", script->_currentLine);
- } else BranchName = Val->getString();
+ CScValue *val = stack->pop();
+ Common::String branchName;
+ if (val->isNULL()) {
+ branchName.format("line%d", script->_currentLine);
+ } else branchName = val->getString();
- StartDlgBranch(BranchName.c_str(), script->_filename == NULL ? "" : script->_filename, script->_threadEvent == NULL ? "" : script->_threadEvent);
+ startDlgBranch(branchName.c_str(), script->_filename == NULL ? "" : script->_filename, script->_threadEvent == NULL ? "" : script->_threadEvent);
stack->pushNULL();
return S_OK;
@@ -591,10 +591,10 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this else if (strcmp(name, "EndDlgBranch") == 0) {
stack->correctParams(1);
- const char *BranchName = NULL;
- CScValue *Val = stack->pop();
- if (!Val->isNULL()) BranchName = Val->getString();
- EndDlgBranch(BranchName, script->_filename == NULL ? "" : script->_filename, script->_threadEvent == NULL ? "" : script->_threadEvent);
+ const char *branchName = NULL;
+ CScValue *val = stack->pop();
+ if (!val->isNULL()) branchName = val->getString();
+ endDlgBranch(branchName, script->_filename == NULL ? "" : script->_filename, script->_threadEvent == NULL ? "" : script->_threadEvent);
stack->pushNULL();
@@ -700,12 +700,12 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "LoadResponseBox") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
- Game->UnregisterObject(_responseBox);
+ Game->unregisterObject(_responseBox);
_responseBox = new CAdResponseBox(Game);
- if (_responseBox && !FAILED(_responseBox->loadFile(Filename))) {
- RegisterObject(_responseBox);
+ if (_responseBox && !FAILED(_responseBox->loadFile(filename))) {
+ registerObject(_responseBox);
stack->pushBool(true);
} else {
delete _responseBox;
@@ -720,12 +720,12 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "LoadInventoryBox") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
- Game->UnregisterObject(_inventoryBox);
+ Game->unregisterObject(_inventoryBox);
_inventoryBox = new CAdInventoryBox(Game);
- if (_inventoryBox && !FAILED(_inventoryBox->loadFile(Filename))) {
- RegisterObject(_inventoryBox);
+ if (_inventoryBox && !FAILED(_inventoryBox->loadFile(filename))) {
+ registerObject(_inventoryBox);
stack->pushBool(true);
} else {
delete _inventoryBox;
@@ -740,11 +740,11 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "LoadItems") == 0) {
stack->correctParams(2);
- const char *Filename = stack->pop()->getString();
- bool Merge = stack->pop()->getBool(false);
+ const char *filename = stack->pop()->getString();
+ bool merge = stack->pop()->getBool(false);
- HRESULT Ret = LoadItemsFile(Filename, Merge);
- stack->pushBool(SUCCEEDED(Ret));
+ HRESULT ret = loadItemsFile(filename, merge);
+ stack->pushBool(SUCCEEDED(ret));
return S_OK;
}
@@ -754,8 +754,8 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "AddSpeechDir") == 0) {
stack->correctParams(1);
- const char *Dir = stack->pop()->getString();
- stack->pushBool(SUCCEEDED(AddSpeechDir(Dir)));
+ const char *dir = stack->pop()->getString();
+ stack->pushBool(SUCCEEDED(addSpeechDir(dir)));
return S_OK;
}
@@ -765,8 +765,8 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "RemoveSpeechDir") == 0) {
stack->correctParams(1);
- const char *Dir = stack->pop()->getString();
- stack->pushBool(SUCCEEDED(RemoveSpeechDir(Dir)));
+ const char *dir = stack->pop()->getString();
+ stack->pushBool(SUCCEEDED(removeSpeechDir(dir)));
return S_OK;
}
@@ -776,16 +776,16 @@ HRESULT CAdGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetSceneViewport") == 0) {
stack->correctParams(4);
- int X = stack->pop()->getInt();
- int Y = stack->pop()->getInt();
- int Width = stack->pop()->getInt();
- int Height = stack->pop()->getInt();
+ int x = stack->pop()->getInt();
+ int y = stack->pop()->getInt();
+ int width = stack->pop()->getInt();
+ int height = stack->pop()->getInt();
- if (Width <= 0) Width = _renderer->_width;
- if (Height <= 0) Height = _renderer->_height;
+ if (width <= 0) width = _renderer->_width;
+ if (height <= 0) height = _renderer->_height;
if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
- if (_sceneViewport) _sceneViewport->setRect(X, Y, X + Width, Y + Height);
+ if (_sceneViewport) _sceneViewport->setRect(x, y, x + width, y + height);
stack->pushBool(true);
@@ -970,7 +970,7 @@ HRESULT CAdGame::scSetProperty(const char *name, CScValue *value) { }
} else {
// try to get by name
- _selectedItem = GetItemByName(value->getString());
+ _selectedItem = getItemByName(value->getString());
}
}
@@ -1003,7 +1003,7 @@ HRESULT CAdGame::scSetProperty(const char *name, CScValue *value) { else {
CBObject *Obj = (CBObject *)value->getNative();
if (Obj == this) _inventoryOwner = _invObject;
- else if (Game->ValidObject(Obj)) _inventoryOwner = (CAdObject *)Obj;
+ else if (Game->validObject(Obj)) _inventoryOwner = (CAdObject *)Obj;
}
if (_inventoryOwner && _inventoryBox) _inventoryBox->_scrollOffset = _inventoryOwner->getInventory()->_scrollOffset;
@@ -1099,9 +1099,9 @@ HRESULT CAdGame::showCursor() { if (_selectedItem && Game->_state == GAME_RUNNING && _stateEx == GAME_NORMAL && _interactive) {
if (_selectedItem->_cursorCombined) {
- CBSprite *OrigLastCursor = _lastCursor;
+ CBSprite *origLastCursor = _lastCursor;
CBGame::showCursor();
- _lastCursor = OrigLastCursor;
+ _lastCursor = origLastCursor;
}
if (_activeObject && _selectedItem->_cursorHover && _activeObject->getExtendedFlag("usable")) {
if (!_smartItemCursor || _activeObject->canHandleEvent(_selectedItem->_name))
@@ -1114,22 +1114,22 @@ HRESULT CAdGame::showCursor() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::loadFile(const char *Filename) {
- byte *Buffer = _fileManager->readWholeFile(Filename);
- if (Buffer == NULL) {
- Game->LOG(0, "CAdGame::LoadFile failed for file '%s'", Filename);
+HRESULT CAdGame::loadFile(const char *filename) {
+ byte *buffer = _fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
+ Game->LOG(0, "CAdGame::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing GAME file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(buffer, true))) Game->LOG(0, "Error parsing GAME file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
@@ -1150,7 +1150,7 @@ TOKEN_DEF(STARTUP_SCENE) TOKEN_DEF(DEBUG_STARTUP_SCENE)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) {
+HRESULT CAdGame::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(GAME)
TOKEN_TABLE(AD_GAME)
@@ -1169,9 +1169,9 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) { int cmd = 1;
CBParser parser(Game);
- bool ItemFound = false, ItemsFound = false;
+ bool itemFound = false, itemsFound = false;
- while (cmd > 0 && (cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while (cmd > 0 && (cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_GAME:
if (FAILED(CBGame::loadBuffer(params, false))) cmd = PARSERR_GENERIC;
@@ -1184,7 +1184,7 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) { delete _responseBox;
_responseBox = new CAdResponseBox(Game);
if (_responseBox && !FAILED(_responseBox->loadFile((char *)params2)))
- RegisterObject(_responseBox);
+ registerObject(_responseBox);
else {
delete _responseBox;
_responseBox = NULL;
@@ -1196,7 +1196,7 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) { delete _inventoryBox;
_inventoryBox = new CAdInventoryBox(Game);
if (_inventoryBox && !FAILED(_inventoryBox->loadFile((char *)params2)))
- RegisterObject(_inventoryBox);
+ registerObject(_inventoryBox);
else {
delete _inventoryBox;
_inventoryBox = NULL;
@@ -1205,9 +1205,9 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_ITEMS:
- ItemsFound = true;
+ itemsFound = true;
CBUtils::setString(&_itemsFile, (char *)params2);
- if (FAILED(LoadItemsFile(_itemsFile))) {
+ if (FAILED(loadItemsFile(_itemsFile))) {
delete[] _itemsFile;
_itemsFile = NULL;
cmd = PARSERR_GENERIC;
@@ -1254,7 +1254,7 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) { return E_FAIL;
}
- if (ItemFound && !ItemsFound) {
+ if (itemFound && !itemsFound) {
Game->LOG(0, "**Warning** Please put the items definition to a separate file.");
}
@@ -1314,27 +1314,27 @@ HRESULT CAdGame::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::LoadGame(const char *Filename) {
- HRESULT ret = CBGame::LoadGame(Filename);
+HRESULT CAdGame::loadGame(const char *filename) {
+ HRESULT ret = CBGame::loadGame(filename);
if (SUCCEEDED(ret)) CSysClassRegistry::getInstance()->enumInstances(afterLoadRegion, "CAdRegion", NULL);
return ret;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::InitAfterLoad() {
- CBGame::InitAfterLoad();
- CSysClassRegistry::getInstance()->enumInstances(AfterLoadScene, "CAdScene", NULL);
+HRESULT CAdGame::initAfterLoad() {
+ CBGame::initAfterLoad();
+ CSysClassRegistry::getInstance()->enumInstances(afterLoadScene, "CAdScene", NULL);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-void CAdGame::AfterLoadScene(void *Scene, void *Data) {
- ((CAdScene *)Scene)->afterLoad();
+void CAdGame::afterLoadScene(void *scene, void *data) {
+ ((CAdScene *)scene)->afterLoad();
}
//////////////////////////////////////////////////////////////////////////
-void CAdGame::SetPrevSceneName(const char *name) {
+void CAdGame::setPrevSceneName(const char *name) {
delete[] _prevSceneName;
_prevSceneName = NULL;
if (name) {
@@ -1345,7 +1345,7 @@ void CAdGame::SetPrevSceneName(const char *name) { //////////////////////////////////////////////////////////////////////////
-void CAdGame::SetPrevSceneFilename(const char *name) {
+void CAdGame::setPrevSceneFilename(const char *name) {
delete[] _prevSceneFilename;
_prevSceneFilename = NULL;
if (name) {
@@ -1356,16 +1356,16 @@ void CAdGame::SetPrevSceneFilename(const char *name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ScheduleChangeScene(const char *Filename, bool FadeIn) {
+HRESULT CAdGame::scheduleChangeScene(const char *filename, bool fadeIn) {
delete[] _scheduledScene;
_scheduledScene = NULL;
- if (_scene && !_scene->_initialized) return ChangeScene(Filename, FadeIn);
+ if (_scene && !_scene->_initialized) return changeScene(filename, fadeIn);
else {
- _scheduledScene = new char [strlen(Filename) + 1];
- strcpy(_scheduledScene, Filename);
+ _scheduledScene = new char [strlen(filename) + 1];
+ strcpy(_scheduledScene, filename);
- _scheduledFadeIn = FadeIn;
+ _scheduledFadeIn = fadeIn;
return S_OK;
}
@@ -1373,40 +1373,40 @@ HRESULT CAdGame::ScheduleChangeScene(const char *Filename, bool FadeIn) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor) {
- CBGame::GetVersion(VerMajor, VerMinor, NULL, NULL);
+HRESULT CAdGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) {
+ CBGame::getVersion(verMajor, verMinor, NULL, NULL);
- if (ExtMajor) *ExtMajor = 0;
- if (ExtMinor) *ExtMinor = 0;
+ if (extMajor) *extMajor = 0;
+ if (extMinor) *extMinor = 0;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::LoadItemsFile(const char *Filename, bool Merge) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
- if (Buffer == NULL) {
- Game->LOG(0, "CAdGame::LoadItemsFile failed for file '%s'", Filename);
+HRESULT CAdGame::loadItemsFile(const char *filename, bool merge) {
+ byte *buffer = Game->_fileManager->readWholeFile(filename);
+ if (buffer == NULL) {
+ Game->LOG(0, "CAdGame::LoadItemsFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- //_filename = new char [strlen(Filename)+1];
- //strcpy(_filename, Filename);
+ //_filename = new char [strlen(filename)+1];
+ //strcpy(_filename, filename);
- if (FAILED(ret = LoadItemsBuffer(Buffer, Merge))) Game->LOG(0, "Error parsing ITEMS file '%s'", Filename);
+ if (FAILED(ret = loadItemsBuffer(buffer, merge))) Game->LOG(0, "Error parsing ITEMS file '%s'", filename);
- delete [] Buffer;
+ delete [] buffer;
return ret;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::LoadItemsBuffer(byte *Buffer, bool Merge) {
+HRESULT CAdGame::loadItemsBuffer(byte *buffer, bool merge) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(ITEM)
TOKEN_TABLE_END
@@ -1415,21 +1415,21 @@ HRESULT CAdGame::LoadItemsBuffer(byte *Buffer, bool Merge) { int cmd;
CBParser parser(Game);
- if (!Merge) {
- while (_items.GetSize() > 0) DeleteItem(_items[0]);
+ if (!merge) {
+ while (_items.GetSize() > 0) deleteItem(_items[0]);
}
- while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
+ while ((cmd = parser.GetCommand((char **)&buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_ITEM: {
CAdItem *item = new CAdItem(Game);
if (item && !FAILED(item->loadBuffer(params, false))) {
// delete item with the same name, if exists
- if (Merge) {
- CAdItem *PrevItem = GetItemByName(item->_name);
- if (PrevItem) DeleteItem(PrevItem);
+ if (merge) {
+ CAdItem *PrevItem = getItemByName(item->_name);
+ if (PrevItem) deleteItem(PrevItem);
}
- AddItem(item);
+ addItem(item);
} else {
delete item;
item = NULL;
@@ -1454,37 +1454,37 @@ HRESULT CAdGame::LoadItemsBuffer(byte *Buffer, bool Merge) { //////////////////////////////////////////////////////////////////////////
-CAdSceneState *CAdGame::GetSceneState(const char *Filename, bool Saving) {
- char *FilenameCor = new char[strlen(Filename) + 1];
- strcpy(FilenameCor, Filename);
- for (uint32 i = 0; i < strlen(FilenameCor); i++) {
- if (FilenameCor[i] == '/') FilenameCor[i] = '\\';
+CAdSceneState *CAdGame::getSceneState(const char *filename, bool saving) {
+ char *filenameCor = new char[strlen(filename) + 1];
+ strcpy(filenameCor, filename);
+ for (uint32 i = 0; i < strlen(filenameCor); i++) {
+ if (filenameCor[i] == '/') filenameCor[i] = '\\';
}
for (int i = 0; i < _sceneStates.GetSize(); i++) {
- if (scumm_stricmp(_sceneStates[i]->_filename, FilenameCor) == 0) {
- delete [] FilenameCor;
+ if (scumm_stricmp(_sceneStates[i]->_filename, filenameCor) == 0) {
+ delete [] filenameCor;
return _sceneStates[i];
}
}
- if (Saving) {
+ if (saving) {
CAdSceneState *ret = new CAdSceneState(Game);
- ret->setFilename(FilenameCor);
+ ret->setFilename(filenameCor);
_sceneStates.Add(ret);
- delete [] FilenameCor;
+ delete [] filenameCor;
return ret;
} else {
- delete [] FilenameCor;
+ delete [] filenameCor;
return NULL;
}
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) {
+HRESULT CAdGame::windowLoadHook(CUIWindow *win, char **buffer, char **params) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(ENTITY_CONTAINER)
TOKEN_TABLE_END
@@ -1492,7 +1492,7 @@ HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) { int cmd = PARSERR_GENERIC;
CBParser parser(Game);
- cmd = parser.GetCommand(Buffer, commands, params);
+ cmd = parser.GetCommand(buffer, commands, params);
switch (cmd) {
case TOKEN_ENTITY_CONTAINER: {
CUIEntity *ent = new CUIEntity(Game);
@@ -1501,8 +1501,8 @@ HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) { ent = NULL;
cmd = PARSERR_GENERIC;
} else {
- ent->_parent = Win;
- Win->_widgets.Add(ent);
+ ent->_parent = win;
+ win->_widgets.Add(ent);
}
}
break;
@@ -1518,17 +1518,17 @@ HRESULT CAdGame::WindowLoadHook(CUIWindow *Win, char **Buffer, char **params) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name) {
+HRESULT CAdGame::windowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name) {
if (strcmp(name, "CreateEntityContainer") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ CScValue *val = stack->pop();
- CUIEntity *Ent = new CUIEntity(Game);
- if (!Val->isNULL()) Ent->setName(Val->getString());
- stack->pushNative(Ent, true);
+ CUIEntity *ent = new CUIEntity(Game);
+ if (!val->isNULL()) ent->setName(val->getString());
+ stack->pushNative(ent, true);
- Ent->_parent = Win;
- Win->_widgets.Add(Ent);
+ ent->_parent = win;
+ win->_widgets.Add(ent);
return S_OK;
} else return E_FAIL;
@@ -1536,10 +1536,10 @@ HRESULT CAdGame::WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScSt //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::StartDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName) {
- char *name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
+HRESULT CAdGame::startDlgBranch(const char *branchName, const char *scriptName, const char *eventName) {
+ char *name = new char[strlen(branchName) + 1 + strlen(scriptName) + 1 + strlen(eventName) + 1];
if (name) {
- sprintf(name, "%s.%s.%s", BranchName, ScriptName, EventName);
+ sprintf(name, "%s.%s.%s", branchName, scriptName, eventName);
_dlgPendingBranches.Add(name);
}
return S_OK;
@@ -1547,17 +1547,17 @@ HRESULT CAdGame::StartDlgBranch(const char *BranchName, const char *ScriptName, //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName) {
+HRESULT CAdGame::endDlgBranch(const char *branchName, const char *scriptName, const char *eventName) {
char *name = NULL;
- bool DeleteName = false;
- if (BranchName == NULL && _dlgPendingBranches.GetSize() > 0) {
+ bool deleteName = false;
+ if (branchName == NULL && _dlgPendingBranches.GetSize() > 0) {
name = _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1];
} else {
- if (BranchName != NULL) {
- name = new char[strlen(BranchName) + 1 + strlen(ScriptName) + 1 + strlen(EventName) + 1];
+ if (branchName != NULL) {
+ name = new char[strlen(branchName) + 1 + strlen(scriptName) + 1 + strlen(eventName) + 1];
if (name) {
- sprintf(name, "%s.%s.%s", BranchName, ScriptName, EventName);
- DeleteName = true;
+ sprintf(name, "%s.%s.%s", branchName, scriptName, eventName);
+ deleteName = true;
}
}
}
@@ -1565,20 +1565,20 @@ HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, co if (name == NULL) return S_OK;
- int StartIndex = -1;
+ int startIndex = -1;
for (int i = _dlgPendingBranches.GetSize() - 1; i >= 0; i--) {
if (scumm_stricmp(name, _dlgPendingBranches[i]) == 0) {
- StartIndex = i;
+ startIndex = i;
break;
}
}
- if (StartIndex >= 0) {
- for (int i = StartIndex; i < _dlgPendingBranches.GetSize(); i++) {
+ if (startIndex >= 0) {
+ for (int i = startIndex; i < _dlgPendingBranches.GetSize(); i++) {
//ClearBranchResponses(_dlgPendingBranches[i]);
delete [] _dlgPendingBranches[i];
_dlgPendingBranches[i] = NULL;
}
- _dlgPendingBranches.RemoveAt(StartIndex, _dlgPendingBranches.GetSize() - StartIndex);
+ _dlgPendingBranches.RemoveAt(startIndex, _dlgPendingBranches.GetSize() - startIndex);
}
// dialogue is over, forget selected responses
@@ -1587,14 +1587,14 @@ HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, co _responsesBranch.RemoveAll();
}
- if (DeleteName) delete [] name;
+ if (deleteName) delete [] name;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ClearBranchResponses(char *name) {
+HRESULT CAdGame::clearBranchResponses(char *name) {
for (int i = 0; i < _responsesBranch.GetSize(); i++) {
if (scumm_stricmp(name, _responsesBranch[i]->_context) == 0) {
delete _responsesBranch[i];
@@ -1607,8 +1607,8 @@ HRESULT CAdGame::ClearBranchResponses(char *name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::AddBranchResponse(int ID) {
- if (BranchResponseUsed(ID)) return S_OK;
+HRESULT CAdGame::addBranchResponse(int ID) {
+ if (branchResponseUsed(ID)) return S_OK;
CAdResponseContext *r = new CAdResponseContext(Game);
r->_iD = ID;
r->setContext(_dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL);
@@ -1618,7 +1618,7 @@ HRESULT CAdGame::AddBranchResponse(int ID) { //////////////////////////////////////////////////////////////////////////
-bool CAdGame::BranchResponseUsed(int ID) {
+bool CAdGame::branchResponseUsed(int ID) {
char *Context = _dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL;
for (int i = 0; i < _responsesBranch.GetSize(); i++) {
if (_responsesBranch[i]->_iD == ID) {
@@ -1630,8 +1630,8 @@ bool CAdGame::BranchResponseUsed(int ID) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::AddGameResponse(int ID) {
- if (GameResponseUsed(ID)) return S_OK;
+HRESULT CAdGame::addGameResponse(int ID) {
+ if (gameResponseUsed(ID)) return S_OK;
CAdResponseContext *r = new CAdResponseContext(Game);
r->_iD = ID;
r->setContext(_dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL);
@@ -1641,7 +1641,7 @@ HRESULT CAdGame::AddGameResponse(int ID) { //////////////////////////////////////////////////////////////////////////
-bool CAdGame::GameResponseUsed(int ID) {
+bool CAdGame::gameResponseUsed(int ID) {
char *Context = _dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL;
for (int i = 0; i < _responsesGame.GetSize(); i++) {
CAdResponseContext *RespContext = _responsesGame[i];
@@ -1654,7 +1654,7 @@ bool CAdGame::GameResponseUsed(int ID) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ResetResponse(int ID) {
+HRESULT CAdGame::resetResponse(int ID) {
char *Context = _dlgPendingBranches.GetSize() > 0 ? _dlgPendingBranches[_dlgPendingBranches.GetSize() - 1] : NULL;
int i;
@@ -1683,9 +1683,9 @@ HRESULT CAdGame::ResetResponse(int ID) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) {
+HRESULT CAdGame::displayContent(bool update, bool displayAll) {
// init
- if (Update) InitLoop();
+ if (update) initLoop();
// fill black
_renderer->fill(0, 0, 0);
@@ -1693,11 +1693,11 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) { // playing exclusive video?
if (_videoPlayer->isPlaying()) {
- if (Update) _videoPlayer->update();
+ if (update) _videoPlayer->update();
_videoPlayer->display();
} else if (_theoraPlayer) {
if (_theoraPlayer->isPlaying()) {
- if (Update) _theoraPlayer->update();
+ if (update) _theoraPlayer->update();
_theoraPlayer->display();
}
if (_theoraPlayer->isFinished()) {
@@ -1707,7 +1707,7 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) { } else {
// process scripts
- if (Update) _scEngine->Tick();
+ if (update) _scEngine->Tick();
POINT p;
getMousePos(&p);
@@ -1717,20 +1717,20 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) { // display in-game windows
- DisplayWindows(true);
+ displayWindows(true);
if (_inventoryBox) _inventoryBox->display();
if (_stateEx == GAME_WAITING_RESPONSE) _responseBox->display();
if (_indicatorDisplay) displayIndicator();
- if (Update || DisplayAll) {
+ if (update || displayAll) {
// display normal windows
- DisplayWindows(false);
+ displayWindows(false);
setActiveObject(Game->_renderer->getObjectAt(p.x, p.y));
// textual info
- DisplaySentences(_state == GAME_FROZEN);
+ displaySentences(_state == GAME_FROZEN);
showCursor();
@@ -1751,21 +1751,21 @@ HRESULT CAdGame::DisplayContent(bool Update, bool DisplayAll) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::RegisterInventory(CAdInventory *Inv) {
+HRESULT CAdGame::registerInventory(CAdInventory *inv) {
for (int i = 0; i < _inventories.GetSize(); i++) {
- if (_inventories[i] == Inv) return S_OK;
+ if (_inventories[i] == inv) return S_OK;
}
- RegisterObject(Inv);
- _inventories.Add(Inv);
+ registerObject(inv);
+ _inventories.Add(inv);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::UnregisterInventory(CAdInventory *Inv) {
+HRESULT CAdGame::unregisterInventory(CAdInventory *inv) {
for (int i = 0; i < _inventories.GetSize(); i++) {
- if (_inventories[i] == Inv) {
- UnregisterObject(_inventories[i]);
+ if (_inventories[i] == inv) {
+ unregisterObject(_inventories[i]);
_inventories.RemoveAt(i);
return S_OK;
}
@@ -1774,14 +1774,12 @@ HRESULT CAdGame::UnregisterInventory(CAdInventory *Inv) { }
//////////////////////////////////////////////////////////////////////////
-bool CAdGame::IsItemTaken(char *ItemName) {
- int i;
-
- for (i = 0; i < _inventories.GetSize(); i++) {
+bool CAdGame::isItemTaken(char *itemName) {
+ for (int i = 0; i < _inventories.GetSize(); i++) {
CAdInventory *Inv = _inventories[i];
for (int j = 0; j < Inv->_takenItems.GetSize(); j++) {
- if (scumm_stricmp(ItemName, Inv->_takenItems[j]->_name) == 0) {
+ if (scumm_stricmp(itemName, Inv->_takenItems[j]->_name) == 0) {
return true;
}
}
@@ -1790,7 +1788,7 @@ bool CAdGame::IsItemTaken(char *ItemName) { }
//////////////////////////////////////////////////////////////////////////
-CAdItem *CAdGame::GetItemByName(const char *name) {
+CAdItem *CAdGame::getItemByName(const char *name) {
for (int i = 0; i < _items.GetSize(); i++) {
if (scumm_stricmp(_items[i]->_name, name) == 0) return _items[i];
}
@@ -1799,65 +1797,63 @@ CAdItem *CAdGame::GetItemByName(const char *name) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::AddItem(CAdItem *Item) {
- _items.Add(Item);
- return Game->RegisterObject(Item);
+HRESULT CAdGame::addItem(CAdItem *item) {
+ _items.Add(item);
+ return Game->registerObject(item);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::ResetContent() {
- int i;
-
+HRESULT CAdGame::resetContent() {
// clear pending dialogs
- for (i = 0; i < _dlgPendingBranches.GetSize(); i++) {
+ for (int i = 0; i < _dlgPendingBranches.GetSize(); i++) {
delete [] _dlgPendingBranches[i];
}
_dlgPendingBranches.RemoveAll();
// clear inventories
- for (i = 0; i < _inventories.GetSize(); i++) {
+ for (int i = 0; i < _inventories.GetSize(); i++) {
_inventories[i]->_takenItems.RemoveAll();
}
// clear scene states
- for (i = 0; i < _sceneStates.GetSize(); i++) delete _sceneStates[i];
+ for (int i = 0; i < _sceneStates.GetSize(); i++) delete _sceneStates[i];
_sceneStates.RemoveAll();
// clear once responses
- for (i = 0; i < _responsesBranch.GetSize(); i++) delete _responsesBranch[i];
+ for (int i = 0; i < _responsesBranch.GetSize(); i++) delete _responsesBranch[i];
_responsesBranch.RemoveAll();
// clear once game responses
- for (i = 0; i < _responsesGame.GetSize(); i++) delete _responsesGame[i];
+ for (int i = 0; i < _responsesGame.GetSize(); i++) delete _responsesGame[i];
_responsesGame.RemoveAll();
// reload inventory items
- if (_itemsFile) LoadItemsFile(_itemsFile);
+ if (_itemsFile) loadItemsFile(_itemsFile);
_tempDisableSaveState = true;
- return CBGame::ResetContent();
+ return CBGame::resetContent();
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::DeleteItem(CAdItem *Item) {
- if (!Item) return E_FAIL;
+HRESULT CAdGame::deleteItem(CAdItem *item) {
+ if (!item) return E_FAIL;
- if (_selectedItem == Item) _selectedItem = NULL;
- _scene->handleItemAssociations(Item->_name, false);
+ if (_selectedItem == item) _selectedItem = NULL;
+ _scene->handleItemAssociations(item->_name, false);
// remove from all inventories
for (int i = 0; i < _inventories.GetSize(); i++) {
- _inventories[i]->RemoveItem(Item);
+ _inventories[i]->RemoveItem(item);
}
// remove object
for (int i = 0; i < _items.GetSize(); i++) {
- if (_items[i] == Item) {
- UnregisterObject(_items[i]);
+ if (_items[i] == item) {
+ unregisterObject(_items[i]);
_items.RemoveAt(i);
break;
}
@@ -1868,45 +1864,45 @@ HRESULT CAdGame::DeleteItem(CAdItem *Item) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::AddSpeechDir(const char *Dir) {
- if (!Dir || Dir[0] == '\0') return E_FAIL;
+HRESULT CAdGame::addSpeechDir(const char *dir) {
+ if (!dir || dir[0] == '\0') return E_FAIL;
- char *Temp = new char[strlen(Dir) + 2];
- strcpy(Temp, Dir);
- if (Temp[strlen(Temp) - 1] != '\\' && Temp[strlen(Temp) - 1] != '/')
- strcat(Temp, "\\");
+ char *temp = new char[strlen(dir) + 2];
+ strcpy(temp, dir);
+ if (temp[strlen(temp) - 1] != '\\' && temp[strlen(temp) - 1] != '/')
+ strcat(temp, "\\");
for (int i = 0; i < _speechDirs.GetSize(); i++) {
- if (scumm_stricmp(_speechDirs[i], Temp) == 0) {
- delete [] Temp;
+ if (scumm_stricmp(_speechDirs[i], temp) == 0) {
+ delete [] temp;
return S_OK;
}
}
- _speechDirs.Add(Temp);
+ _speechDirs.Add(temp);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::RemoveSpeechDir(const char *Dir) {
- if (!Dir || Dir[0] == '\0') return E_FAIL;
+HRESULT CAdGame::removeSpeechDir(const char *dir) {
+ if (!dir || dir[0] == '\0') return E_FAIL;
- char *Temp = new char[strlen(Dir) + 2];
- strcpy(Temp, Dir);
- if (Temp[strlen(Temp) - 1] != '\\' && Temp[strlen(Temp) - 1] != '/')
- strcat(Temp, "\\");
+ char *temp = new char[strlen(dir) + 2];
+ strcpy(temp, dir);
+ if (temp[strlen(temp) - 1] != '\\' && temp[strlen(temp) - 1] != '/')
+ strcat(temp, "\\");
bool Found = false;
for (int i = 0; i < _speechDirs.GetSize(); i++) {
- if (scumm_stricmp(_speechDirs[i], Temp) == 0) {
+ if (scumm_stricmp(_speechDirs[i], temp) == 0) {
delete [] _speechDirs[i];
_speechDirs.RemoveAt(i);
Found = true;
break;
}
}
- delete [] Temp;
+ delete [] temp;
if (Found) return S_OK;
else return E_FAIL;
@@ -1914,51 +1910,51 @@ HRESULT CAdGame::RemoveSpeechDir(const char *Dir) { //////////////////////////////////////////////////////////////////////////
-char *CAdGame::FindSpeechFile(char *StringID) {
- char *Ret = new char[MAX_PATH];
+char *CAdGame::findSpeechFile(char *stringID) {
+ char *ret = new char[MAX_PATH];
for (int i = 0; i < _speechDirs.GetSize(); i++) {
- sprintf(Ret, "%s%s.ogg", _speechDirs[i], StringID);
- Common::SeekableReadStream *File = _fileManager->openFile(Ret);
- if (File) {
- _fileManager->closeFile(File);
- return Ret;
+ sprintf(ret, "%s%s.ogg", _speechDirs[i], stringID);
+ Common::SeekableReadStream *file = _fileManager->openFile(ret); // TODO: Replace with hasFile
+ if (file) {
+ _fileManager->closeFile(file);
+ return ret;
}
- sprintf(Ret, "%s%s.wav", _speechDirs[i], StringID);
- File = _fileManager->openFile(Ret);
- if (File) {
- _fileManager->closeFile(File);
- return Ret;
+ sprintf(ret, "%s%s.wav", _speechDirs[i], stringID);
+ file = _fileManager->openFile(ret);
+ if (file) {
+ _fileManager->closeFile(file);
+ return ret;
}
}
- delete [] Ret;
+ delete [] ret;
return NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CAdGame::ValidMouse() {
- POINT Pos;
- CBPlatform::GetCursorPos(&Pos);
+bool CAdGame::validMouse() {
+ POINT pos;
+ CBPlatform::GetCursorPos(&pos);
- return _renderer->pointInViewport(&Pos);
+ return _renderer->pointInViewport(&pos);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnMouseLeftDown() {
- if (!ValidMouse()) return S_OK;
+HRESULT CAdGame::onMouseLeftDown() {
+ if (!validMouse()) return S_OK;
if (_state == GAME_RUNNING && !_interactive) {
if (_talkSkipButton == TALK_SKIP_LEFT || _talkSkipButton == TALK_SKIP_BOTH) {
- FinishSentences();
+ finishSentences();
}
return S_OK;
}
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
- bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("LeftClick"));
- if (!Handled) {
+ bool handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("LeftClick"));
+ if (!handled) {
if (_activeObject != NULL) {
_activeObject->applyEvent("LeftClick");
} else if (_state == GAME_RUNNING && _scene && _scene->pointInViewport(_mousePos.x, _mousePos.y)) {
@@ -1974,15 +1970,15 @@ HRESULT CAdGame::OnMouseLeftDown() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnMouseLeftUp() {
+HRESULT CAdGame::onMouseLeftUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
CBPlatform::ReleaseCapture();
_capturedObject = NULL;
_mouseLeftDown = false;
- bool Handled = /*_state==GAME_RUNNING &&*/ SUCCEEDED(applyEvent("LeftRelease"));
- if (!Handled) {
+ bool handled = /*_state==GAME_RUNNING &&*/ SUCCEEDED(applyEvent("LeftRelease"));
+ if (!handled) {
if (_activeObject != NULL) {
_activeObject->applyEvent("LeftRelease");
} else if (_state == GAME_RUNNING && _scene && _scene->pointInViewport(_mousePos.x, _mousePos.y)) {
@@ -1993,15 +1989,15 @@ HRESULT CAdGame::OnMouseLeftUp() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnMouseLeftDblClick() {
- if (!ValidMouse()) return S_OK;
+HRESULT CAdGame::onMouseLeftDblClick() {
+ if (!validMouse()) return S_OK;
if (_state == GAME_RUNNING && !_interactive) return S_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
- bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("LeftDoubleClick"));
- if (!Handled) {
+ bool handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("LeftDoubleClick"));
+ if (!handled) {
if (_activeObject != NULL) {
_activeObject->applyEvent("LeftDoubleClick");
} else if (_state == GAME_RUNNING && _scene && _scene->pointInViewport(_mousePos.x, _mousePos.y)) {
@@ -2012,11 +2008,11 @@ HRESULT CAdGame::OnMouseLeftDblClick() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnMouseRightDown() {
- if (!ValidMouse()) return S_OK;
+HRESULT CAdGame::onMouseRightDown() {
+ if (!validMouse()) return S_OK;
if (_state == GAME_RUNNING && !_interactive) {
if (_talkSkipButton == TALK_SKIP_RIGHT || _talkSkipButton == TALK_SKIP_BOTH) {
- FinishSentences();
+ finishSentences();
}
return S_OK;
}
@@ -2025,8 +2021,8 @@ HRESULT CAdGame::OnMouseRightDown() { if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
- bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("RightClick"));
- if (!Handled) {
+ bool handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("RightClick"));
+ if (!handled) {
if (_activeObject != NULL) {
_activeObject->applyEvent("RightClick");
} else if (_state == GAME_RUNNING && _scene && _scene->pointInViewport(_mousePos.x, _mousePos.y)) {
@@ -2037,11 +2033,11 @@ HRESULT CAdGame::OnMouseRightDown() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnMouseRightUp() {
+HRESULT CAdGame::onMouseRightUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
- bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("RightRelease"));
- if (!Handled) {
+ bool handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("RightRelease"));
+ if (!handled) {
if (_activeObject != NULL) {
_activeObject->applyEvent("RightRelease");
} else if (_state == GAME_RUNNING && _scene && _scene->pointInViewport(_mousePos.x, _mousePos.y)) {
@@ -2052,7 +2048,7 @@ HRESULT CAdGame::OnMouseRightUp() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::DisplayDebugInfo() {
+HRESULT CAdGame::displayDebugInfo() {
char str[100];
if (Game->_dEBUG_DebugMode) {
sprintf(str, "Mouse: %d, %d (scene: %d, %d)", _mousePos.x, _mousePos.y, _mousePos.x + _scene->getOffsetLeft(), _mousePos.y + _scene->getOffsetTop());
@@ -2061,12 +2057,12 @@ HRESULT CAdGame::DisplayDebugInfo() { sprintf(str, "Scene: %s (prev: %s)", (_scene && _scene->_name) ? _scene->_name : "???", _prevSceneName ? _prevSceneName : "???");
_systemFont->drawText((byte *)str, 0, 110, _renderer->_width, TAL_RIGHT);
}
- return CBGame::DisplayDebugInfo();
+ return CBGame::displayDebugInfo();
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::OnScriptShutdown(CScScript *script) {
+HRESULT CAdGame::onScriptShutdown(CScScript *script) {
if (_responseBox && _responseBox->_waitingScript == script)
_responseBox->_waitingScript = NULL;
diff --git a/engines/wintermute/Ad/AdGame.h b/engines/wintermute/Ad/AdGame.h index ad6785a8ff..df4d26eaf5 100644 --- a/engines/wintermute/Ad/AdGame.h +++ b/engines/wintermute/Ad/AdGame.h @@ -44,58 +44,58 @@ class CAdResponseContext; class CAdResponseBox;
class CAdGame : public CBGame {
public:
- virtual HRESULT OnScriptShutdown(CScScript *script);
+ virtual HRESULT onScriptShutdown(CScScript *script);
- virtual HRESULT OnMouseLeftDown();
- virtual HRESULT OnMouseLeftUp();
- virtual HRESULT OnMouseLeftDblClick();
- virtual HRESULT OnMouseRightDown();
- virtual HRESULT OnMouseRightUp();
+ virtual HRESULT onMouseLeftDown();
+ virtual HRESULT onMouseLeftUp();
+ virtual HRESULT onMouseLeftDblClick();
+ virtual HRESULT onMouseRightDown();
+ virtual HRESULT onMouseRightUp();
- virtual HRESULT DisplayDebugInfo();
+ virtual HRESULT displayDebugInfo();
- virtual HRESULT InitAfterLoad();
- static void AfterLoadScene(void *Scene, void *Data);
+ virtual HRESULT initAfterLoad();
+ static void afterLoadScene(void *scene, void *data);
bool _smartItemCursor;
CBArray<char *, char *> _speechDirs;
- HRESULT AddSpeechDir(const char *Dir);
- HRESULT RemoveSpeechDir(const char *Dir);
- char *FindSpeechFile(char *StringID);
+ HRESULT addSpeechDir(const char *dir);
+ HRESULT removeSpeechDir(const char *dir);
+ char *findSpeechFile(char *StringID);
- HRESULT DeleteItem(CAdItem *Item);
+ HRESULT deleteItem(CAdItem *Item);
char *_itemsFile;
bool _tempDisableSaveState;
- virtual HRESULT ResetContent();
- HRESULT AddItem(CAdItem *Item);
- CAdItem *GetItemByName(const char *name);
+ virtual HRESULT resetContent();
+ HRESULT addItem(CAdItem *item);
+ CAdItem *getItemByName(const char *name);
CBArray<CAdItem *, CAdItem *> _items;
CAdObject *_inventoryOwner;
- bool IsItemTaken(char *ItemName);
- HRESULT RegisterInventory(CAdInventory *Inv);
- HRESULT UnregisterInventory(CAdInventory *Inv);
+ bool isItemTaken(char *itemName);
+ HRESULT registerInventory(CAdInventory *inv);
+ HRESULT unregisterInventory(CAdInventory *inv);
CAdObject *_invObject;
CBArray<CAdInventory *, CAdInventory *> _inventories;
- virtual HRESULT DisplayContent(bool Update = true, bool DisplayAll = false);
+ virtual HRESULT displayContent(bool update = true, bool displayAll = false);
char *_debugStartupScene;
char *_startupScene;
bool _initialScene;
- bool GameResponseUsed(int ID);
- HRESULT AddGameResponse(int ID);
- HRESULT ResetResponse(int ID);
-
- bool BranchResponseUsed(int ID);
- HRESULT AddBranchResponse(int ID);
- HRESULT ClearBranchResponses(char *name);
- HRESULT StartDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName);
- HRESULT EndDlgBranch(const char *BranchName, const char *ScriptName, const char *EventName);
- virtual HRESULT WindowLoadHook(CUIWindow *Win, char **Buf, char **Params);
- virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name);
-
- CAdSceneState *GetSceneState(const char *Filename, bool Saving);
+ bool gameResponseUsed(int ID);
+ HRESULT addGameResponse(int ID);
+ HRESULT resetResponse(int ID);
+
+ bool branchResponseUsed(int ID);
+ HRESULT addBranchResponse(int ID);
+ HRESULT clearBranchResponses(char *name);
+ HRESULT startDlgBranch(const char *branchName, const char *scriptName, const char *eventName);
+ HRESULT endDlgBranch(const char *branchName, const char *scriptName, const char *eventName);
+ virtual HRESULT windowLoadHook(CUIWindow *win, char **buf, char **params);
+ virtual HRESULT windowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name);
+
+ CAdSceneState *getSceneState(const char *filename, bool saving);
CBViewport *_sceneViewport;
int _texItemLifeTime;
int _texWalkLifeTime;
@@ -104,31 +104,31 @@ public: TTalkSkipButton _talkSkipButton;
- virtual HRESULT GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor);
- HRESULT ScheduleChangeScene(const char *Filename, bool FadeIn);
+ virtual HRESULT getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor);
+ HRESULT scheduleChangeScene(const char *filename, bool fadeIn);
char *_scheduledScene;
bool _scheduledFadeIn;
- void SetPrevSceneName(const char *name);
- void SetPrevSceneFilename(const char *name);
+ void setPrevSceneName(const char *name);
+ void setPrevSceneFilename(const char *name);
char *_prevSceneName;
char *_prevSceneFilename;
- virtual HRESULT LoadGame(const char *Filename);
+ virtual HRESULT loadGame(const char *filename);
CAdItem *_selectedItem;
HRESULT cleanup();
DECLARE_PERSISTENT(CAdGame, CBGame)
- void FinishSentences();
+ void finishSentences();
HRESULT showCursor();
TGameStateEx _stateEx;
CAdResponseBox *_responseBox;
CAdInventoryBox *_inventoryBox;
- HRESULT DisplaySentences(bool Frozen);
- void AddSentence(CAdSentence *Sentence);
- HRESULT ChangeScene(const char *Filename, bool FadeIn);
- HRESULT RemoveObject(CAdObject *Object);
- HRESULT AddObject(CAdObject *Object);
+ HRESULT displaySentences(bool frozen);
+ void addSentence(CAdSentence *sentence);
+ HRESULT changeScene(const char *filename, bool fadeIn);
+ HRESULT removeObject(CAdObject *object);
+ HRESULT addObject(CAdObject *object);
CAdScene *_scene;
- HRESULT InitLoop();
+ HRESULT initLoop();
CAdGame();
virtual ~CAdGame();
CBArray<CAdObject *, CAdObject *> _objects;
@@ -140,11 +140,11 @@ public: CBArray<CAdResponseContext *, CAdResponseContext *> _responsesBranch;
CBArray<CAdResponseContext *, CAdResponseContext *> _responsesGame;
- virtual HRESULT loadFile(const char *Filename);
- virtual HRESULT loadBuffer(byte *Buffer, bool Complete = true);
+ virtual HRESULT loadFile(const char *filename);
+ virtual HRESULT loadBuffer(byte *buffer, bool complete = true);
- HRESULT LoadItemsFile(const char *Filename, bool Merge = false);
- HRESULT LoadItemsBuffer(byte *Buffer, bool Merge = false);
+ HRESULT loadItemsFile(const char *filename, bool merge = false);
+ HRESULT loadItemsBuffer(byte *buffer, bool merge = false);
virtual void PublishNatives();
@@ -154,7 +154,7 @@ public: virtual CScValue *scGetProperty(const char *name);
virtual HRESULT scSetProperty(const char *name, CScValue *value);
virtual HRESULT scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
- bool ValidMouse();
+ bool validMouse();
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/Ad/AdInventory.cpp b/engines/wintermute/Ad/AdInventory.cpp index edc1fa65b9..a453343a56 100644 --- a/engines/wintermute/Ad/AdInventory.cpp +++ b/engines/wintermute/Ad/AdInventory.cpp @@ -52,7 +52,7 @@ CAdInventory::~CAdInventory() { HRESULT CAdInventory::InsertItem(const char *name, const char *InsertAfter) {
if (name == NULL) return E_FAIL;
- CAdItem *item = ((CAdGame *)Game)->GetItemByName(name);
+ CAdItem *item = ((CAdGame *)Game)->getItemByName(name);
if (item == NULL) return E_FAIL;
int InsertIndex = -1;
diff --git a/engines/wintermute/Ad/AdInventoryBox.cpp b/engines/wintermute/Ad/AdInventoryBox.cpp index 60b0a77692..7af618e548 100644 --- a/engines/wintermute/Ad/AdInventoryBox.cpp +++ b/engines/wintermute/Ad/AdInventoryBox.cpp @@ -64,7 +64,7 @@ CAdInventoryBox::CAdInventoryBox(CBGame *inGame): CBObject(inGame) { //////////////////////////////////////////////////////////////////////////
CAdInventoryBox::~CAdInventoryBox() {
- Game->UnregisterObject(_window);
+ Game->unregisterObject(_window);
_window = NULL;
delete _closeButton;
@@ -154,19 +154,19 @@ HRESULT CAdInventoryBox::display() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdInventoryBox::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdInventoryBox::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdInventoryBox::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdInventoryBox::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing INVENTORY_BOX file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing INVENTORY_BOX file '%s'", filename);
delete [] Buffer;
@@ -245,7 +245,7 @@ HRESULT CAdInventoryBox::loadBuffer(byte *Buffer, bool Complete) { delete _window;
_window = NULL;
cmd = PARSERR_GENERIC;
- } else Game->RegisterObject(_window);
+ } else Game->registerObject(_window);
break;
case TOKEN_AREA:
diff --git a/engines/wintermute/Ad/AdInventoryBox.h b/engines/wintermute/Ad/AdInventoryBox.h index 3e8714ae8f..903a3ff8e9 100644 --- a/engines/wintermute/Ad/AdInventoryBox.h +++ b/engines/wintermute/Ad/AdInventoryBox.h @@ -53,7 +53,7 @@ public: CUIWindow *_window;
CAdInventoryBox(CBGame *inGame);
virtual ~CAdInventoryBox();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
};
diff --git a/engines/wintermute/Ad/AdItem.cpp b/engines/wintermute/Ad/AdItem.cpp index c105478045..77e6aa5a4a 100644 --- a/engines/wintermute/Ad/AdItem.cpp +++ b/engines/wintermute/Ad/AdItem.cpp @@ -84,19 +84,19 @@ CAdItem::~CAdItem() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdItem::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdItem::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdItem::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdItem::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ITEM file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ITEM file '%s'", filename);
delete [] Buffer;
@@ -369,11 +369,11 @@ HRESULT CAdItem::update() { _tempSprite2->Reset();
_currentSprite = _tempSprite2;
}
- ((CAdGame *)Game)->AddSentence(_sentence);
+ ((CAdGame *)Game)->addSentence(_sentence);
}
} else {
_currentSprite = _tempSprite2;
- ((CAdGame *)Game)->AddSentence(_sentence);
+ ((CAdGame *)Game)->addSentence(_sentence);
}
}
default:
@@ -439,14 +439,14 @@ HRESULT CAdItem::scCallMethod(CScScript *script, CScStack *stack, CScStack *this bool SetCurrent = false;
if (_currentSprite && _currentSprite == _spriteHover) SetCurrent = true;
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
delete _spriteHover;
_spriteHover = NULL;
CBSprite *spr = new CBSprite(Game, this);
- if (!spr || FAILED(spr->loadFile(Filename))) {
+ if (!spr || FAILED(spr->loadFile(filename))) {
stack->pushBool(false);
- script->RuntimeError("Item.SetHoverSprite failed for file '%s'", Filename);
+ script->RuntimeError("Item.SetHoverSprite failed for file '%s'", filename);
} else {
_spriteHover = spr;
if (SetCurrent) _currentSprite = _spriteHover;
@@ -482,14 +482,14 @@ HRESULT CAdItem::scCallMethod(CScScript *script, CScStack *stack, CScStack *this if (strcmp(name, "SetNormalCursor") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
delete _cursorNormal;
_cursorNormal = NULL;
CBSprite *spr = new CBSprite(Game);
- if (!spr || FAILED(spr->loadFile(Filename))) {
+ if (!spr || FAILED(spr->loadFile(filename))) {
stack->pushBool(false);
- script->RuntimeError("Item.SetNormalCursor failed for file '%s'", Filename);
+ script->RuntimeError("Item.SetNormalCursor failed for file '%s'", filename);
} else {
_cursorNormal = spr;
stack->pushBool(true);
@@ -525,14 +525,14 @@ HRESULT CAdItem::scCallMethod(CScScript *script, CScStack *stack, CScStack *this if (strcmp(name, "SetHoverCursor") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
delete _cursorHover;
_cursorHover = NULL;
CBSprite *spr = new CBSprite(Game);
- if (!spr || FAILED(spr->loadFile(Filename))) {
+ if (!spr || FAILED(spr->loadFile(filename))) {
stack->pushBool(false);
- script->RuntimeError("Item.SetHoverCursor failed for file '%s'", Filename);
+ script->RuntimeError("Item.SetHoverCursor failed for file '%s'", filename);
} else {
_cursorHover = spr;
stack->pushBool(true);
diff --git a/engines/wintermute/Ad/AdItem.h b/engines/wintermute/Ad/AdItem.h index ad59048e53..31460319e7 100644 --- a/engines/wintermute/Ad/AdItem.h +++ b/engines/wintermute/Ad/AdItem.h @@ -55,7 +55,7 @@ public: CBSprite *_cursorHover;
CAdItem(CBGame *inGame);
virtual ~CAdItem();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
// scripting interface
diff --git a/engines/wintermute/Ad/AdLayer.cpp b/engines/wintermute/Ad/AdLayer.cpp index b462d23963..4329c7b36a 100644 --- a/engines/wintermute/Ad/AdLayer.cpp +++ b/engines/wintermute/Ad/AdLayer.cpp @@ -61,19 +61,19 @@ CAdLayer::~CAdLayer() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdLayer::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdLayer::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdLayer::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdLayer::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing LAYER file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing LAYER file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Ad/AdLayer.h b/engines/wintermute/Ad/AdLayer.h index 7c2c595fa2..0b8aa3958d 100644 --- a/engines/wintermute/Ad/AdLayer.h +++ b/engines/wintermute/Ad/AdLayer.h @@ -42,7 +42,7 @@ public: CAdLayer(CBGame *inGame);
virtual ~CAdLayer();
CBArray<CAdSceneNode *, CAdSceneNode *> _nodes;
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/Ad/AdNodeState.cpp b/engines/wintermute/Ad/AdNodeState.cpp index f732067471..87f4e7d72f 100644 --- a/engines/wintermute/Ad/AdNodeState.cpp +++ b/engines/wintermute/Ad/AdNodeState.cpp @@ -76,18 +76,18 @@ void CAdNodeState::setName(const char *name) { //////////////////////////////////////////////////////////////////////////
-void CAdNodeState::setFilename(const char *Filename) {
+void CAdNodeState::setFilename(const char *filename) {
delete[] _filename;
_filename = NULL;
- CBUtils::setString(&_filename, Filename);
+ CBUtils::setString(&_filename, filename);
}
//////////////////////////////////////////////////////////////////////////
-void CAdNodeState::SetCursor(const char *Filename) {
+void CAdNodeState::SetCursor(const char *filename) {
delete[] _cursor;
_cursor = NULL;
- CBUtils::setString(&_cursor, Filename);
+ CBUtils::setString(&_cursor, filename);
}
diff --git a/engines/wintermute/Ad/AdNodeState.h b/engines/wintermute/Ad/AdNodeState.h index 9c75cf8092..7d9b1c6d90 100644 --- a/engines/wintermute/Ad/AdNodeState.h +++ b/engines/wintermute/Ad/AdNodeState.h @@ -37,8 +37,8 @@ class CAdNodeState : public CBBase { public:
HRESULT TransferEntity(CAdEntity *Entity, bool IncludingSprites, bool Saving);
void setName(const char *name);
- void setFilename(const char *Filename);
- void SetCursor(const char *Filename);
+ void setFilename(const char *filename);
+ void SetCursor(const char *filename);
DECLARE_PERSISTENT(CAdNodeState, CBBase)
CAdNodeState(CBGame *inGame);
virtual ~CAdNodeState();
diff --git a/engines/wintermute/Ad/AdObject.cpp b/engines/wintermute/Ad/AdObject.cpp index 2f72a2dcbe..d59e575d8e 100644 --- a/engines/wintermute/Ad/AdObject.cpp +++ b/engines/wintermute/Ad/AdObject.cpp @@ -130,38 +130,38 @@ CAdObject::~CAdObject() { if (_font) Game->_fontStorage->RemoveFont(_font);
if (_inventory) {
- ((CAdGame *)Game)->UnregisterInventory(_inventory);
+ ((CAdGame *)Game)->unregisterInventory(_inventory);
_inventory = NULL;
}
if (_partEmitter)
- Game->UnregisterObject(_partEmitter);
+ Game->unregisterObject(_partEmitter);
for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
- Game->UnregisterObject(_attachmentsPre[i]);
+ Game->unregisterObject(_attachmentsPre[i]);
}
_attachmentsPre.RemoveAll();
for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
- Game->UnregisterObject(_attachmentsPost[i]);
+ Game->unregisterObject(_attachmentsPost[i]);
}
_attachmentsPost.RemoveAll();
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdObject::playAnim(const char *Filename) {
+HRESULT CAdObject::playAnim(const char *filename) {
delete _animSprite;
_animSprite = NULL;
_animSprite = new CBSprite(Game, this);
if (!_animSprite) {
- Game->LOG(0, "CAdObject::PlayAnim: error creating temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
+ Game->LOG(0, "CAdObject::PlayAnim: error creating temp sprite (object:\"%s\" sprite:\"%s\")", _name, filename);
return E_FAIL;
}
- HRESULT res = _animSprite->loadFile(Filename);
+ HRESULT res = _animSprite->loadFile(filename);
if (FAILED(res)) {
- Game->LOG(res, "CAdObject::PlayAnim: error loading temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
+ Game->LOG(res, "CAdObject::PlayAnim: error loading temp sprite (object:\"%s\" sprite:\"%s\")", _name, filename);
delete _animSprite;
_animSprite = NULL;
return res;
@@ -352,7 +352,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th if (!_inventory) {
_inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(_inventory);
+ ((CAdGame *)Game)->registerInventory(_inventory);
}
CScValue *val = stack->pop();
@@ -380,7 +380,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th if (!_inventory) {
_inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(_inventory);
+ ((CAdGame *)Game)->registerInventory(_inventory);
}
CScValue *val = stack->pop();
@@ -404,12 +404,12 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th if (!_inventory) {
_inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(_inventory);
+ ((CAdGame *)Game)->registerInventory(_inventory);
}
CScValue *val = stack->pop();
if (val->_type == VAL_STRING) {
- CAdItem *item = ((CAdGame *)Game)->GetItemByName(val->getString());
+ CAdItem *item = ((CAdGame *)Game)->getItemByName(val->getString());
if (item) stack->pushNative(item, true);
else stack->pushNULL();
} else if (val->isNULL() || val->getInt() < 0 || val->getInt() >= _inventory->_takenItems.GetSize())
@@ -428,7 +428,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th if (!_inventory) {
_inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(_inventory);
+ ((CAdGame *)Game)->registerInventory(_inventory);
}
CScValue *val = stack->pop();
@@ -470,7 +470,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th else if (strcmp(name, "DeleteParticleEmitter") == 0) {
stack->correctParams(0);
if (_partEmitter) {
- Game->UnregisterObject(_partEmitter);
+ Game->unregisterObject(_partEmitter);
_partEmitter = NULL;
}
stack->pushNULL();
@@ -483,20 +483,20 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "AddAttachment") == 0) {
stack->correctParams(4);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
bool PreDisplay = stack->pop()->getBool(true);
int OffsetX = stack->pop()->getInt();
int OffsetY = stack->pop()->getInt();
HRESULT res;
CAdEntity *Ent = new CAdEntity(Game);
- if (FAILED(res = Ent->loadFile(Filename))) {
+ if (FAILED(res = Ent->loadFile(filename))) {
delete Ent;
Ent = NULL;
- script->RuntimeError("AddAttachment() failed loading entity '%s'", Filename);
+ script->RuntimeError("AddAttachment() failed loading entity '%s'", filename);
stack->pushBool(false);
} else {
- Game->RegisterObject(Ent);
+ Game->registerObject(Ent);
Ent->_posX = OffsetX;
Ent->_posY = OffsetY;
@@ -523,7 +523,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
if (_attachmentsPre[i] == Obj) {
Found = true;
- Game->UnregisterObject(_attachmentsPre[i]);
+ Game->unregisterObject(_attachmentsPre[i]);
_attachmentsPre.RemoveAt(i);
i--;
}
@@ -531,7 +531,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
if (_attachmentsPost[i] == Obj) {
Found = true;
- Game->UnregisterObject(_attachmentsPost[i]);
+ Game->unregisterObject(_attachmentsPost[i]);
_attachmentsPost.RemoveAt(i);
i--;
}
@@ -541,7 +541,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th for (int i = 0; i < _attachmentsPre.GetSize(); i++) {
if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, attachmentName) == 0) {
Found = true;
- Game->UnregisterObject(_attachmentsPre[i]);
+ Game->unregisterObject(_attachmentsPre[i]);
_attachmentsPre.RemoveAt(i);
i--;
}
@@ -549,7 +549,7 @@ HRESULT CAdObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th for (int i = 0; i < _attachmentsPost.GetSize(); i++) {
if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, attachmentName) == 0) {
Found = true;
- Game->UnregisterObject(_attachmentsPost[i]);
+ Game->unregisterObject(_attachmentsPost[i]);
_attachmentsPost.RemoveAt(i);
i--;
}
@@ -792,10 +792,10 @@ const char *CAdObject::scToString() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdObject::SetFont(const char *Filename) {
+HRESULT CAdObject::SetFont(const char *filename) {
if (_font) Game->_fontStorage->RemoveFont(_font);
- if (Filename) {
- _font = Game->_fontStorage->AddFont(Filename);
+ if (filename) {
+ _font = Game->_fontStorage->AddFont(filename);
return _font == NULL ? E_FAIL : S_OK;
} else {
_font = NULL;
@@ -852,7 +852,7 @@ void CAdObject::talk(const char *Text, const char *Sound, uint32 Duration, const if (!Sound) {
char *Key = Game->_stringTable->GetKey(Text);
if (Key) {
- Sound = ((CAdGame *)Game)->FindSpeechFile(Key);
+ Sound = ((CAdGame *)Game)->findSpeechFile(Key);
delete [] Key;
if (Sound) DeleteSound = true;
@@ -1052,7 +1052,7 @@ HRESULT CAdObject::updateBlockRegion() { CAdInventory *CAdObject::getInventory() {
if (!_inventory) {
_inventory = new CAdInventory(Game);
- ((CAdGame *)Game)->RegisterInventory(_inventory);
+ ((CAdGame *)Game)->registerInventory(_inventory);
}
return _inventory;
}
@@ -1077,7 +1077,7 @@ HRESULT CAdObject::afterMove() { }
for (int i = 0; i < MAX_NUM_REGIONS; i++) {
- if (_currentRegions[i] && Game->ValidObject(_currentRegions[i])) {
+ if (_currentRegions[i] && Game->validObject(_currentRegions[i])) {
_currentRegions[i]->applyEvent("ActorLeave");
}
_currentRegions[i] = NewRegions[i];
@@ -1179,7 +1179,7 @@ CPartEmitter *CAdObject::createParticleEmitter(bool FollowParent, int OffsetX, i if (!_partEmitter) {
_partEmitter = new CPartEmitter(Game, this);
if (_partEmitter) {
- Game->RegisterObject(_partEmitter);
+ Game->registerObject(_partEmitter);
}
}
updatePartEmitter();
diff --git a/engines/wintermute/Ad/AdRegion.cpp b/engines/wintermute/Ad/AdRegion.cpp index 9522ebbb61..5f57a0d967 100644 --- a/engines/wintermute/Ad/AdRegion.cpp +++ b/engines/wintermute/Ad/AdRegion.cpp @@ -54,19 +54,19 @@ CAdRegion::~CAdRegion() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdRegion::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdRegion::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdRegion::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdRegion::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Ad/AdRegion.h b/engines/wintermute/Ad/AdRegion.h index 15b794641b..9a9d0e1055 100644 --- a/engines/wintermute/Ad/AdRegion.h +++ b/engines/wintermute/Ad/AdRegion.h @@ -42,7 +42,7 @@ public: bool _decoration;
CAdRegion(CBGame *inGame);
virtual ~CAdRegion();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/Ad/AdResponse.cpp b/engines/wintermute/Ad/AdResponse.cpp index 36b6ce454a..e8923f2179 100644 --- a/engines/wintermute/Ad/AdResponse.cpp +++ b/engines/wintermute/Ad/AdResponse.cpp @@ -72,11 +72,11 @@ void CAdResponse::SetText(const char *Text) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdResponse::SetIcon(const char *Filename) {
+HRESULT CAdResponse::SetIcon(const char *filename) {
delete _icon;
_icon = new CBSprite(Game);
- if (!_icon || FAILED(_icon->loadFile(Filename))) {
- Game->LOG(0, "CAdResponse::SetIcon failed for file '%s'", Filename);
+ if (!_icon || FAILED(_icon->loadFile(filename))) {
+ Game->LOG(0, "CAdResponse::SetIcon failed for file '%s'", filename);
delete _icon;
_icon = NULL;
return E_FAIL;
@@ -85,22 +85,22 @@ HRESULT CAdResponse::SetIcon(const char *Filename) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdResponse::SetFont(const char *Filename) {
+HRESULT CAdResponse::SetFont(const char *filename) {
if (_font) Game->_fontStorage->RemoveFont(_font);
- _font = Game->_fontStorage->AddFont(Filename);
+ _font = Game->_fontStorage->AddFont(filename);
if (!_font) {
- Game->LOG(0, "CAdResponse::SetFont failed for file '%s'", Filename);
+ Game->LOG(0, "CAdResponse::SetFont failed for file '%s'", filename);
return E_FAIL;
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdResponse::SetIconHover(const char *Filename) {
+HRESULT CAdResponse::SetIconHover(const char *filename) {
delete _iconHover;
_iconHover = new CBSprite(Game);
- if (!_iconHover || FAILED(_iconHover->loadFile(Filename))) {
- Game->LOG(0, "CAdResponse::SetIconHover failed for file '%s'", Filename);
+ if (!_iconHover || FAILED(_iconHover->loadFile(filename))) {
+ Game->LOG(0, "CAdResponse::SetIconHover failed for file '%s'", filename);
delete _iconHover;
_iconHover = NULL;
return E_FAIL;
@@ -110,11 +110,11 @@ HRESULT CAdResponse::SetIconHover(const char *Filename) { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdResponse::SetIconPressed(const char *Filename) {
+HRESULT CAdResponse::SetIconPressed(const char *filename) {
delete _iconPressed;
_iconPressed = new CBSprite(Game);
- if (!_iconPressed || FAILED(_iconPressed->loadFile(Filename))) {
- Game->LOG(0, "CAdResponse::SetIconPressed failed for file '%s'", Filename);
+ if (!_iconPressed || FAILED(_iconPressed->loadFile(filename))) {
+ Game->LOG(0, "CAdResponse::SetIconPressed failed for file '%s'", filename);
delete _iconPressed;
_iconPressed = NULL;
return E_FAIL;
diff --git a/engines/wintermute/Ad/AdResponse.h b/engines/wintermute/Ad/AdResponse.h index 42f2f90b14..84ec6a086a 100644 --- a/engines/wintermute/Ad/AdResponse.h +++ b/engines/wintermute/Ad/AdResponse.h @@ -38,10 +38,10 @@ class CBFont; class CAdResponse : public CBObject {
public:
DECLARE_PERSISTENT(CAdResponse, CBObject)
- HRESULT SetIcon(const char *Filename);
- HRESULT SetFont(const char *Filename);
- HRESULT SetIconHover(const char *Filename);
- HRESULT SetIconPressed(const char *Filename);
+ HRESULT SetIcon(const char *filename);
+ HRESULT SetFont(const char *filename);
+ HRESULT SetIconHover(const char *filename);
+ HRESULT SetIconPressed(const char *filename);
void SetText(const char *Text);
int _iD;
CBSprite *_icon;
diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp index b73465590e..80ab26392c 100644 --- a/engines/wintermute/Ad/AdResponseBox.cpp +++ b/engines/wintermute/Ad/AdResponseBox.cpp @@ -187,19 +187,19 @@ HRESULT CAdResponseBox::createButtons() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdResponseBox::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdResponseBox::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdResponseBox::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdResponseBox::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing RESPONSE_BOX file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing RESPONSE_BOX file '%s'", filename);
delete [] Buffer;
@@ -542,7 +542,7 @@ HRESULT CAdResponseBox::weedResponses() { for (int i = 0; i < _responses.GetSize(); i++) {
switch (_responses[i]->_responseType) {
case RESPONSE_ONCE:
- if (AdGame->BranchResponseUsed(_responses[i]->_iD)) {
+ if (AdGame->branchResponseUsed(_responses[i]->_iD)) {
delete _responses[i];
_responses.RemoveAt(i);
i--;
@@ -550,7 +550,7 @@ HRESULT CAdResponseBox::weedResponses() { break;
case RESPONSE_ONCE_GAME:
- if (AdGame->GameResponseUsed(_responses[i]->_iD)) {
+ if (AdGame->gameResponseUsed(_responses[i]->_iD)) {
delete _responses[i];
_responses.RemoveAt(i);
i--;
@@ -580,11 +580,11 @@ HRESULT CAdResponseBox::handleResponse(CAdResponse *Response) { switch (Response->_responseType) {
case RESPONSE_ONCE:
- AdGame->AddBranchResponse(Response->_iD);
+ AdGame->addBranchResponse(Response->_iD);
break;
case RESPONSE_ONCE_GAME:
- AdGame->AddGameResponse(Response->_iD);
+ AdGame->addGameResponse(Response->_iD);
break;
default:
warning("CAdResponseBox::HandleResponse - Unhandled enum");
diff --git a/engines/wintermute/Ad/AdResponseBox.h b/engines/wintermute/Ad/AdResponseBox.h index 17778beaba..2fcf7ab7a6 100644 --- a/engines/wintermute/Ad/AdResponseBox.h +++ b/engines/wintermute/Ad/AdResponseBox.h @@ -75,7 +75,7 @@ public: RECT _responseArea;
int _verticalAlign;
TTextAlign _align;
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
};
diff --git a/engines/wintermute/Ad/AdRotLevel.cpp b/engines/wintermute/Ad/AdRotLevel.cpp index f1c866c91e..84a13260ae 100644 --- a/engines/wintermute/Ad/AdRotLevel.cpp +++ b/engines/wintermute/Ad/AdRotLevel.cpp @@ -53,19 +53,19 @@ CAdRotLevel::~CAdRotLevel() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdRotLevel::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdRotLevel::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdRotLevel::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdRotLevel::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ROTATION_LEVEL file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ROTATION_LEVEL file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Ad/AdRotLevel.h b/engines/wintermute/Ad/AdRotLevel.h index cfa6f88f1c..dffca612c8 100644 --- a/engines/wintermute/Ad/AdRotLevel.h +++ b/engines/wintermute/Ad/AdRotLevel.h @@ -40,7 +40,7 @@ public: virtual ~CAdRotLevel();
float _rotation;
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
};
diff --git a/engines/wintermute/Ad/AdScaleLevel.cpp b/engines/wintermute/Ad/AdScaleLevel.cpp index e7a54eb927..1e686545ff 100644 --- a/engines/wintermute/Ad/AdScaleLevel.cpp +++ b/engines/wintermute/Ad/AdScaleLevel.cpp @@ -51,19 +51,19 @@ CAdScaleLevel::~CAdScaleLevel() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdScaleLevel::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdScaleLevel::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdScaleLevel::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdScaleLevel::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCALE_LEVEL file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCALE_LEVEL file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Ad/AdScaleLevel.h b/engines/wintermute/Ad/AdScaleLevel.h index a00197620c..6cb336aae5 100644 --- a/engines/wintermute/Ad/AdScaleLevel.h +++ b/engines/wintermute/Ad/AdScaleLevel.h @@ -41,7 +41,7 @@ public: CAdScaleLevel(CBGame *inGame);
virtual ~CAdScaleLevel();
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
};
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp index 2b5aed2777..02888c07e6 100644 --- a/engines/wintermute/Ad/AdScene.cpp +++ b/engines/wintermute/Ad/AdScene.cpp @@ -74,7 +74,7 @@ CAdScene::CAdScene(CBGame *inGame): CBObject(inGame) { //////////////////////////////////////////////////////////////////////////
CAdScene::~CAdScene() {
cleanup();
- Game->UnregisterObject(_fader);
+ Game->unregisterObject(_fader);
delete _pfTarget;
_pfTarget = NULL;
}
@@ -129,7 +129,7 @@ void CAdScene::setDefaults() { _shieldWindow = NULL;
_fader = new CBFader(Game);
- Game->RegisterObject(_fader);
+ Game->registerObject(_fader);
_viewport = NULL;
}
@@ -146,24 +146,24 @@ void CAdScene::cleanup() { delete _shieldWindow;
_shieldWindow = NULL;
- Game->UnregisterObject(_fader);
+ Game->unregisterObject(_fader);
_fader = NULL;
for (i = 0; i < _layers.GetSize(); i++)
- Game->UnregisterObject(_layers[i]);
+ Game->unregisterObject(_layers[i]);
_layers.RemoveAll();
for (i = 0; i < _waypointGroups.GetSize(); i++)
- Game->UnregisterObject(_waypointGroups[i]);
+ Game->unregisterObject(_waypointGroups[i]);
_waypointGroups.RemoveAll();
for (i = 0; i < _scaleLevels.GetSize(); i++)
- Game->UnregisterObject(_scaleLevels[i]);
+ Game->unregisterObject(_scaleLevels[i]);
_scaleLevels.RemoveAll();
for (i = 0; i < _rotLevels.GetSize(); i++)
- Game->UnregisterObject(_rotLevels[i]);
+ Game->unregisterObject(_rotLevels[i]);
_rotLevels.RemoveAll();
@@ -173,7 +173,7 @@ void CAdScene::cleanup() { _pfPointsNum = 0;
for (i = 0; i < _objects.GetSize(); i++)
- Game->UnregisterObject(_objects[i]);
+ Game->unregisterObject(_objects[i]);
_objects.RemoveAll();
delete _viewport;
@@ -503,23 +503,23 @@ HRESULT CAdScene::initLoop() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdScene::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdScene::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdScene::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdScene::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
delete[] _filename;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCENE file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing SCENE file '%s'", filename);
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
delete [] Buffer;
@@ -648,7 +648,7 @@ HRESULT CAdScene::loadBuffer(byte *Buffer, bool Complete) { delete layer;
layer = NULL;
} else {
- Game->RegisterObject(layer);
+ Game->registerObject(layer);
_layers.Add(layer);
if (layer->_main) {
_mainLayer = layer;
@@ -666,7 +666,7 @@ HRESULT CAdScene::loadBuffer(byte *Buffer, bool Complete) { delete wpt;
wpt = NULL;
} else {
- Game->RegisterObject(wpt);
+ Game->registerObject(wpt);
_waypointGroups.Add(wpt);
}
}
@@ -679,7 +679,7 @@ HRESULT CAdScene::loadBuffer(byte *Buffer, bool Complete) { delete sl;
sl = NULL;
} else {
- Game->RegisterObject(sl);
+ Game->registerObject(sl);
_scaleLevels.Add(sl);
}
}
@@ -692,7 +692,7 @@ HRESULT CAdScene::loadBuffer(byte *Buffer, bool Complete) { delete rl;
rl = NULL;
} else {
- Game->RegisterObject(rl);
+ Game->registerObject(rl);
_rotLevels.Add(rl);
}
}
@@ -1600,7 +1600,7 @@ HRESULT CAdScene::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi Layer->_height = _mainLayer->_height;
}
_layers.Add(Layer);
- Game->RegisterObject(Layer);
+ Game->registerObject(Layer);
stack->pushNative(Layer, true);
return S_OK;
@@ -1624,7 +1624,7 @@ HRESULT CAdScene::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi if (Index <= _layers.GetSize() - 1) _layers.InsertAt(Index, Layer);
else _layers.Add(Layer);
- Game->RegisterObject(Layer);
+ Game->registerObject(Layer);
stack->pushNative(Layer, true);
return S_OK;
@@ -1666,7 +1666,7 @@ HRESULT CAdScene::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi for (int i = 0; i < _layers.GetSize(); i++) {
if (_layers[i] == ToDelete) {
_layers.RemoveAt(i);
- Game->UnregisterObject(ToDelete);
+ Game->unregisterObject(ToDelete);
break;
}
}
@@ -1952,7 +1952,7 @@ const char *CAdScene::scToString() { //////////////////////////////////////////////////////////////////////////
HRESULT CAdScene::addObject(CAdObject *Object) {
_objects.Add(Object);
- return Game->RegisterObject(Object);
+ return Game->registerObject(Object);
}
@@ -1961,7 +1961,7 @@ HRESULT CAdScene::removeObject(CAdObject *Object) { for (int i = 0; i < _objects.GetSize(); i++) {
if (_objects[i] == Object) {
_objects.RemoveAt(i);
- return Game->UnregisterObject(Object);
+ return Game->unregisterObject(Object);
}
}
return E_FAIL;
@@ -2489,7 +2489,7 @@ HRESULT CAdScene::persistState(bool Saving) { if (!_persistentState) return S_OK;
CAdGame *AdGame = (CAdGame *)Game;
- CAdSceneState *State = AdGame->GetSceneState(_filename, Saving);
+ CAdSceneState *State = AdGame->getSceneState(_filename, Saving);
if (!State) return S_OK;
diff --git a/engines/wintermute/Ad/AdScene.h b/engines/wintermute/Ad/AdScene.h index 037e5abeca..ae4750b612 100644 --- a/engines/wintermute/Ad/AdScene.h +++ b/engines/wintermute/Ad/AdScene.h @@ -123,7 +123,7 @@ public: CBArray<CAdLayer *, CAdLayer *> _layers;
CBArray<CAdObject *, CAdObject *> _objects;
CBArray<CAdWaypointGroup *, CAdWaypointGroup *> _waypointGroups;
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
int _width;
int _height;
diff --git a/engines/wintermute/Ad/AdSceneNode.cpp b/engines/wintermute/Ad/AdSceneNode.cpp index dbb4a0054f..2c734bf87b 100644 --- a/engines/wintermute/Ad/AdSceneNode.cpp +++ b/engines/wintermute/Ad/AdSceneNode.cpp @@ -44,10 +44,10 @@ CAdSceneNode::CAdSceneNode(CBGame *inGame): CBObject(inGame) { //////////////////////////////////////////////////////////////////////////
CAdSceneNode::~CAdSceneNode() {
- Game->UnregisterObject(_region);
+ Game->unregisterObject(_region);
_region = NULL;
- Game->UnregisterObject(_entity);
+ Game->unregisterObject(_entity);
_entity = NULL;
}
@@ -56,7 +56,7 @@ CAdSceneNode::~CAdSceneNode() { HRESULT CAdSceneNode::setEntity(CAdEntity *Entity) {
_type = OBJECT_ENTITY;
_entity = Entity;
- return Game->RegisterObject(Entity);
+ return Game->registerObject(Entity);
}
@@ -64,7 +64,7 @@ HRESULT CAdSceneNode::setEntity(CAdEntity *Entity) { HRESULT CAdSceneNode::setRegion(CAdRegion *Region) {
_type = OBJECT_REGION;
_region = Region;
- return Game->RegisterObject(Region);
+ return Game->registerObject(Region);
}
diff --git a/engines/wintermute/Ad/AdTalkDef.cpp b/engines/wintermute/Ad/AdTalkDef.cpp index 6a1e0a1d15..11e2b1e2af 100644 --- a/engines/wintermute/Ad/AdTalkDef.cpp +++ b/engines/wintermute/Ad/AdTalkDef.cpp @@ -69,18 +69,18 @@ CAdTalkDef::~CAdTalkDef() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdTalkDef::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdTalkDef::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdTalkDef::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdTalkDef::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- CBUtils::setString(&_filename, Filename);
+ CBUtils::setString(&_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Ad/AdTalkHolder.cpp b/engines/wintermute/Ad/AdTalkHolder.cpp index 4f5ad76880..d5746a4530 100644 --- a/engines/wintermute/Ad/AdTalkHolder.cpp +++ b/engines/wintermute/Ad/AdTalkHolder.cpp @@ -138,10 +138,10 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack if (SetCurrent) _currentSprite = NULL;
stack->pushBool(true);
} else {
- const char *Filename = Val->getString();
+ const char *filename = Val->getString();
CBSprite *spr = new CBSprite(Game, this);
- if (!spr || FAILED(spr->loadFile(Filename))) {
- script->RuntimeError("SetSprite method failed for file '%s'", Filename);
+ if (!spr || FAILED(spr->loadFile(filename))) {
+ script->RuntimeError("SetSprite method failed for file '%s'", filename);
stack->pushBool(false);
} else {
_sprite = spr;
@@ -180,13 +180,13 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack else if (strcmp(name, "AddTalkSprite") == 0) {
stack->correctParams(2);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
bool Ex = stack->pop()->getBool();
CBSprite *spr = new CBSprite(Game, this);
- if (!spr || FAILED(spr->loadFile(Filename))) {
+ if (!spr || FAILED(spr->loadFile(filename))) {
stack->pushBool(false);
- script->RuntimeError("AddTalkSprite method failed for file '%s'", Filename);
+ script->RuntimeError("AddTalkSprite method failed for file '%s'", filename);
} else {
if (Ex) _talkSpritesEx.Add(spr);
else _talkSprites.Add(spr);
@@ -201,7 +201,7 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack else if (strcmp(name, "RemoveTalkSprite") == 0) {
stack->correctParams(2);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
bool Ex = stack->pop()->getBool();
int i;
@@ -210,7 +210,7 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack if (Ex) {
for (i = 0; i < _talkSpritesEx.GetSize(); i++) {
- if (scumm_stricmp(_talkSpritesEx[i]->_filename, Filename) == 0) {
+ if (scumm_stricmp(_talkSpritesEx[i]->_filename, filename) == 0) {
if (_currentSprite == _talkSpritesEx[i]) SetCurrent = true;
if (_tempSprite2 == _talkSpritesEx[i]) SetTemp2 = true;
delete _talkSpritesEx[i];
@@ -220,7 +220,7 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack }
} else {
for (i = 0; i < _talkSprites.GetSize(); i++) {
- if (scumm_stricmp(_talkSprites[i]->_filename, Filename) == 0) {
+ if (scumm_stricmp(_talkSprites[i]->_filename, filename) == 0) {
if (_currentSprite == _talkSprites[i]) SetCurrent = true;
if (_tempSprite2 == _talkSprites[i]) SetTemp2 = true;
delete _talkSprites[i];
@@ -244,15 +244,15 @@ HRESULT CAdTalkHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack else if (strcmp(name, "SetTalkSprite") == 0) {
stack->correctParams(2);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
bool Ex = stack->pop()->getBool();
bool SetCurrent = false;
bool SetTemp2 = false;
CBSprite *spr = new CBSprite(Game, this);
- if (!spr || FAILED(spr->loadFile(Filename))) {
+ if (!spr || FAILED(spr->loadFile(filename))) {
stack->pushBool(false);
- script->RuntimeError("SetTalkSprite method failed for file '%s'", Filename);
+ script->RuntimeError("SetTalkSprite method failed for file '%s'", filename);
} else {
// delete current
diff --git a/engines/wintermute/Ad/AdWaypointGroup.cpp b/engines/wintermute/Ad/AdWaypointGroup.cpp index da21cf0ba6..a0004e978b 100644 --- a/engines/wintermute/Ad/AdWaypointGroup.cpp +++ b/engines/wintermute/Ad/AdWaypointGroup.cpp @@ -64,19 +64,19 @@ void CAdWaypointGroup::cleanup() { //////////////////////////////////////////////////////////////////////////
-HRESULT CAdWaypointGroup::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CAdWaypointGroup::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CAdWaypointGroup::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CAdWaypointGroup::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WAYPOINTS file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WAYPOINTS file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Ad/AdWaypointGroup.h b/engines/wintermute/Ad/AdWaypointGroup.h index bc4b9420f1..dc4a5650e9 100644 --- a/engines/wintermute/Ad/AdWaypointGroup.h +++ b/engines/wintermute/Ad/AdWaypointGroup.h @@ -44,7 +44,7 @@ public: virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
bool _active;
CAdWaypointGroup(CBGame *inGame);
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual ~CAdWaypointGroup();
CBArray<CBPoint *, CBPoint *> _points;
diff --git a/engines/wintermute/Base/BDebugger.cpp b/engines/wintermute/Base/BDebugger.cpp index 1a3b3fdb35..aa4ac7cf3e 100644 --- a/engines/wintermute/Base/BDebugger.cpp +++ b/engines/wintermute/Base/BDebugger.cpp @@ -51,74 +51,74 @@ HRESULT CBDebugger::Shutdown() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnGameInit() {
+HRESULT CBDebugger::onGameInit() {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnGameShutdown() {
+HRESULT CBDebugger::onGameShutdown() {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnGameTick() {
+HRESULT CBDebugger::onGameTick() {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnLog(unsigned int ErrorCode, const char *Text) {
+HRESULT CBDebugger::onLog(unsigned int errorCode, const char *text) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptInit(CScScript *script) {
+HRESULT CBDebugger::onScriptInit(CScScript *script) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *name) {
+HRESULT CBDebugger::onScriptEventThreadInit(CScScript *script, CScScript *parentScript, const char *name) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *name) {
+HRESULT CBDebugger::onScriptMethodThreadInit(CScScript *script, CScScript *parentScript, const char *name) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptShutdown(CScScript *script) {
+HRESULT CBDebugger::onScriptShutdown(CScScript *script) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptChangeLine(CScScript *Script, int Line) {
+HRESULT CBDebugger::onScriptChangeLine(CScScript *Script, int Line) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptChangeScope(CScScript *Script, CScValue *Scope) {
+HRESULT CBDebugger::onScriptChangeScope(CScScript *Script, CScValue *Scope) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptShutdownScope(CScScript *Script, CScValue *Scope) {
+HRESULT CBDebugger::onScriptShutdownScope(CScScript *Script, CScValue *Scope) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnVariableInit(EWmeDebuggerVariableType Type, CScScript *script, CScValue *Scope, CScValue *Var, const char *VariableName) {
+HRESULT CBDebugger::onVariableInit(EWmeDebuggerVariableType type, CScScript *script, CScValue *scope, CScValue *var, const char *variableName) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnVariableChangeValue(CScValue *Var, CScValue *value) {
+HRESULT CBDebugger::onVariableChangeValue(CScValue *Var, CScValue *value) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBDebugger::OnScriptHitBreakpoint(CScScript *script) {
+HRESULT CBDebugger::onScriptHitBreakpoint(CScScript *script) {
return S_OK;
}
diff --git a/engines/wintermute/Base/BDebugger.h b/engines/wintermute/Base/BDebugger.h index db1b6784f7..e448a72651 100644 --- a/engines/wintermute/Base/BDebugger.h +++ b/engines/wintermute/Base/BDebugger.h @@ -47,22 +47,22 @@ public: HRESULT Shutdown();
// internal interface
- HRESULT OnGameInit();
- HRESULT OnGameShutdown();
- HRESULT OnGameTick();
- HRESULT OnLog(unsigned int ErrorCode, const char *Text);
- HRESULT OnScriptInit(CScScript *script);
- HRESULT OnScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *name);
- HRESULT OnScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *name);
-
- HRESULT OnScriptShutdown(CScScript *script);
- HRESULT OnScriptChangeLine(CScScript *Script, int Line);
- HRESULT OnScriptChangeScope(CScScript *Script, CScValue *Scope);
- HRESULT OnScriptShutdownScope(CScScript *Script, CScValue *Scope);
- HRESULT OnVariableInit(EWmeDebuggerVariableType Type, CScScript *script, CScValue *Scope, CScValue *Var, const char *VariableName);
- HRESULT OnVariableChangeValue(CScValue *Var, CScValue *value);
-
- HRESULT OnScriptHitBreakpoint(CScScript *script);
+ HRESULT onGameInit();
+ HRESULT onGameShutdown();
+ HRESULT onGameTick();
+ HRESULT onLog(unsigned int ErrorCode, const char *Text);
+ HRESULT onScriptInit(CScScript *script);
+ HRESULT onScriptEventThreadInit(CScScript *Script, CScScript *ParentScript, const char *name);
+ HRESULT onScriptMethodThreadInit(CScScript *Script, CScScript *ParentScript, const char *name);
+
+ HRESULT onScriptShutdown(CScScript *script);
+ HRESULT onScriptChangeLine(CScScript *Script, int Line);
+ HRESULT onScriptChangeScope(CScScript *Script, CScValue *Scope);
+ HRESULT onScriptShutdownScope(CScScript *Script, CScValue *Scope);
+ HRESULT onVariableInit(EWmeDebuggerVariableType Type, CScScript *script, CScValue *Scope, CScValue *Var, const char *VariableName);
+ HRESULT onVariableChangeValue(CScValue *Var, CScValue *value);
+
+ HRESULT onScriptHitBreakpoint(CScScript *script);
// IWmeDebugServer interface
virtual bool AttachClient(IWmeDebugClient *Client);
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp index 1fe1c7546a..7fcdb2e26b 100644 --- a/engines/wintermute/Base/BFileManager.cpp +++ b/engines/wintermute/Base/BFileManager.cpp @@ -116,13 +116,13 @@ HRESULT CBFileManager::cleanup() { #define MAX_FILE_SIZE 10000000
//////////////////////////////////////////////////////////////////////
-byte *CBFileManager::readWholeFile(const Common::String &Filename, uint32 *Size, bool MustExist) {
+byte *CBFileManager::readWholeFile(const Common::String &filename, uint32 *Size, bool MustExist) {
byte *buffer = NULL;
- Common::SeekableReadStream *File = openFile(Filename);
+ Common::SeekableReadStream *File = openFile(filename);
if (!File) {
- if (MustExist) Game->LOG(0, "Error opening file '%s'", Filename.c_str());
+ if (MustExist) Game->LOG(0, "Error opening file '%s'", filename.c_str());
return NULL;
}
@@ -137,13 +137,13 @@ byte *CBFileManager::readWholeFile(const Common::String &Filename, uint32 *Size, buffer = new byte[File->size() + 1];
if (buffer == NULL) {
- Game->LOG(0, "Error allocating buffer for file '%s' (%d bytes)", Filename.c_str(), File->size() + 1);
+ Game->LOG(0, "Error allocating buffer for file '%s' (%d bytes)", filename.c_str(), File->size() + 1);
closeFile(File);
return NULL;
}
if (File->read(buffer, File->size()) != File->size()) {
- Game->LOG(0, "Error reading file '%s'", Filename.c_str());
+ Game->LOG(0, "Error reading file '%s'", filename.c_str());
closeFile(File);
delete [] buffer;
return NULL;
@@ -163,12 +163,12 @@ Common::SeekableReadStream *CBFileManager::loadSaveGame(const Common::String &fi }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBFileManager::saveFile(const Common::String &Filename, byte *Buffer, uint32 BufferSize, bool Compressed, byte *PrefixBuffer, uint32 PrefixSize) {
+HRESULT CBFileManager::saveFile(const Common::String &filename, byte *Buffer, uint32 BufferSize, bool Compressed, byte *PrefixBuffer, uint32 PrefixSize) {
// TODO
warning("Implement SaveFile");
Common::SaveFileManager *saveMan = g_wintermute->getSaveFileMan();
- Common::OutSaveFile *file = saveMan->openForSaving(Filename);
+ Common::OutSaveFile *file = saveMan->openForSaving(filename);
file->write(PrefixBuffer, PrefixSize);
file->write(Buffer, BufferSize);
file->finalize();
@@ -176,11 +176,11 @@ HRESULT CBFileManager::saveFile(const Common::String &Filename, byte *Buffer, ui #if 0
RestoreCurrentDir();
- CBUtils::CreatePath(Filename, false);
+ CBUtils::CreatePath(filename, false);
- FILE *f = fopen(Filename, "wb");
+ FILE *f = fopen(filename, "wb");
if (!f) {
- Game->LOG(0, "Error opening file '%s' for writing.", Filename);
+ Game->LOG(0, "Error opening file '%s' for writing.", filename);
return E_FAIL;
}
@@ -192,7 +192,7 @@ HRESULT CBFileManager::saveFile(const Common::String &Filename, byte *Buffer, ui uint32 CompSize = BufferSize + (BufferSize / 100) + 12; // 1% extra space
byte *CompBuffer = new byte[CompSize];
if (!CompBuffer) {
- Game->LOG(0, "Error allocating compression buffer while saving '%s'", Filename);
+ Game->LOG(0, "Error allocating compression buffer while saving '%s'", filename);
Compressed = false;
} else {
if (compress(CompBuffer, (uLongf *)&CompSize, Buffer, BufferSize) == Z_OK) {
@@ -209,7 +209,7 @@ HRESULT CBFileManager::saveFile(const Common::String &Filename, byte *Buffer, ui fwrite(CompBuffer, CompSize, 1, f);
} else {
- Game->LOG(0, "Error compressing data while saving '%s'", Filename);
+ Game->LOG(0, "Error compressing data while saving '%s'", filename);
Compressed = false;
}
@@ -396,19 +396,19 @@ HRESULT CBFileManager::registerPackages() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool SearchSignature) {
-// FILE *f = fopen(Filename, "rb");
+HRESULT CBFileManager::registerPackage(const Common::String &filename , bool searchSignature) {
+// FILE *f = fopen(filename, "rb");
Common::File *package = new Common::File();
- package->open(Filename);
+ package->open(filename);
if (!package->isOpen()) {
- Game->LOG(0, " Error opening package file '%s'. Ignoring.", Filename.c_str());
+ Game->LOG(0, " Error opening package file '%s'. Ignoring.", filename.c_str());
return S_OK;
}
uint32 AbsoluteOffset = 0;
bool BoundToExe = false;
- if (SearchSignature) {
+ if (searchSignature) {
uint32 Offset;
if (!findPackageSignature(package, &Offset)) {
delete package;
@@ -424,13 +424,13 @@ HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool Sea hdr.readFromStream(package);
// package->read(&hdr, sizeof(TPackageHeader), 1, f);
if (hdr.Magic1 != PACKAGE_MAGIC_1 || hdr.Magic2 != PACKAGE_MAGIC_2 || hdr.PackageVersion > PACKAGE_VERSION) {
- Game->LOG(0, " Invalid header in package file '%s'. Ignoring.", Filename.c_str());
+ Game->LOG(0, " Invalid header in package file '%s'. Ignoring.", filename.c_str());
delete package;
return S_OK;
}
if (hdr.PackageVersion != PACKAGE_VERSION) {
- Game->LOG(0, " Warning: package file '%s' is outdated.", Filename.c_str());
+ Game->LOG(0, " Warning: package file '%s' is outdated.", filename.c_str());
}
// new in v2
@@ -527,11 +527,11 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *name, bool error("Implement RegisterPackage, this is the old one");
#if 0
char Filename[MAX_PATH];
- sprintf(Filename, "%s%s", Path, name);
+ sprintf(filename, "%s%s", Path, name);
- FILE *f = fopen(Filename, "rb");
+ FILE *f = fopen(filename, "rb");
if (!f) {
- Game->LOG(0, " Error opening package file '%s'. Ignoring.", Filename);
+ Game->LOG(0, " Error opening package file '%s'. Ignoring.", filename);
return S_OK;
}
@@ -553,13 +553,13 @@ HRESULT CBFileManager::registerPackage(const char *Path, const char *name, bool TPackageHeader hdr;
fread(&hdr, sizeof(TPackageHeader), 1, f);
if (hdr.Magic1 != PACKAGE_MAGIC_1 || hdr.Magic2 != PACKAGE_MAGIC_2 || hdr.PackageVersion > PACKAGE_VERSION) {
- Game->LOG(0, " Invalid header in package file '%s'. Ignoring.", Filename);
+ Game->LOG(0, " Invalid header in package file '%s'. Ignoring.", filename);
fclose(f);
return S_OK;
}
if (hdr.PackageVersion != PACKAGE_VERSION) {
- Game->LOG(0, " Warning: package file '%s' is outdated.", Filename);
+ Game->LOG(0, " Warning: package file '%s' is outdated.", filename);
}
// new in v2
@@ -672,18 +672,18 @@ Common::File *CBFileManager::openPackage(const Common::String &name) { //RestoreCurrentDir();
Common::File *ret = new Common::File();
- char Filename[MAX_PATH];
+ char filename[MAX_PATH];
for (int i = 0; i < _packagePaths.GetSize(); i++) {
- sprintf(Filename, "%s%s.%s", _packagePaths[i], name.c_str(), PACKAGE_EXTENSION);
- ret->open(Filename);
+ sprintf(filename, "%s%s.%s", _packagePaths[i], name.c_str(), PACKAGE_EXTENSION);
+ ret->open(filename);
if (ret->isOpen()) {
return ret;
}
}
- sprintf(Filename, "%s.%s", name.c_str(), PACKAGE_EXTENSION);
- ret->open(Filename);
+ sprintf(filename, "%s.%s", name.c_str(), PACKAGE_EXTENSION);
+ ret->open(filename);
if (ret->isOpen()) {
return ret;
}
@@ -698,11 +698,11 @@ Common::File *CBFileManager::openSingleFile(const Common::String &name) { restoreCurrentDir();
Common::File *ret = NULL;
- char Filename[MAX_PATH];
+ char filename[MAX_PATH];
for (int i = 0; i < _singlePaths.GetSize(); i++) {
- sprintf(Filename, "%s%s", _singlePaths[i], name.c_str());
- ret->open(Filename);
+ sprintf(filename, "%s%s", _singlePaths[i], name.c_str());
+ ret->open(filename);
if (ret->isOpen())
return ret;
}
@@ -776,13 +776,13 @@ bool CBFileManager::hasFile(const Common::String &filename) { //////////////////////////////////////////////////////////////////////////
Common::SeekableReadStream *CBFileManager::openFile(const Common::String &filename, bool AbsPathWarning, bool keepTrackOf) {
if (strcmp(filename.c_str(), "") == 0) return NULL;
- //Game->LOG(0, "open file: %s", Filename);
+ //Game->LOG(0, "open file: %s", filename);
/*#ifdef __WIN32__
if (Game->_dEBUG_DebugMode && Game->_dEBUG_AbsolutePathWarning && AbsPathWarning) {
char Drive[_MAX_DRIVE];
- _splitpath(Filename, Drive, NULL, NULL, NULL);
+ _splitpath(filename, Drive, NULL, NULL, NULL);
if (Drive[0] != '\0') {
- Game->LOG(0, "WARNING: Referencing absolute path '%s'. The game will NOT work on another computer.", Filename);
+ Game->LOG(0, "WARNING: Referencing absolute path '%s'. The game will NOT work on another computer.", filename);
}
}
#endif*/
@@ -807,14 +807,14 @@ HRESULT CBFileManager::closeFile(Common::SeekableReadStream *File) { //////////////////////////////////////////////////////////////////////////
-Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &Filename) {
+Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &filename) {
restoreCurrentDir();
Common::SeekableReadStream *ret = NULL;
- if (scumm_strnicmp(Filename.c_str(), "savegame:", 9) == 0) {
+ if (scumm_strnicmp(filename.c_str(), "savegame:", 9) == 0) {
CBSaveThumbFile *SaveThumbFile = new CBSaveThumbFile(Game);
- if (SUCCEEDED(SaveThumbFile->open(Filename))) {
+ if (SUCCEEDED(SaveThumbFile->open(filename))) {
ret = SaveThumbFile->getMemStream();
}
delete SaveThumbFile;
@@ -823,16 +823,16 @@ Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &Fil - ret = openDiskFile(Filename, this);
+ ret = openDiskFile(filename, this);
if (ret) return ret;
- ret = openPkgFile(Filename, this);
+ ret = openPkgFile(filename, this);
if (ret) return ret;
- ret = CBResources::getFile(Filename);
+ ret = CBResources::getFile(filename);
if (ret) return ret;
- warning("BFileManager::OpenFileRaw - Failed to open %s", Filename.c_str());
+ warning("BFileManager::OpenFileRaw - Failed to open %s", filename.c_str());
return NULL;
}
diff --git a/engines/wintermute/Base/BFont.cpp b/engines/wintermute/Base/BFont.cpp index 7c832becf2..7286c9179d 100644 --- a/engines/wintermute/Base/BFont.cpp +++ b/engines/wintermute/Base/BFont.cpp @@ -73,18 +73,18 @@ int CBFont::getTextWidth(byte *text, int MaxLenght) { //////////////////////////////////////////////////////////////////////
HRESULT CBFont::loadFile(const char * Filename)
{
- BYTE* Buffer = Game->_fileManager->readWholeFile(Filename);
+ BYTE* Buffer = Game->_fileManager->readWholeFile(filename);
if(Buffer==NULL){
- Game->LOG(0, "CBFont::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CBFont::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename)+1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename)+1];
+ strcpy(_filename, filename);
- if(FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
+ if(FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", filename);
delete [] Buffer;
@@ -152,11 +152,11 @@ HRESULT CBFont::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
-CBFont *CBFont::createFromFile(CBGame *Game, const char *Filename) {
- if (isTrueType(Game, Filename)) {
+CBFont *CBFont::createFromFile(CBGame *Game, const char *filename) {
+ if (isTrueType(Game, filename)) {
CBFontTT *Font = new CBFontTT(Game);
if (Font) {
- if (FAILED(Font->loadFile(Filename))) {
+ if (FAILED(Font->loadFile(filename))) {
delete Font;
return NULL;
}
@@ -165,7 +165,7 @@ CBFont *CBFont::createFromFile(CBGame *Game, const char *Filename) { } else {
CBFontBitmap *Font = new CBFontBitmap(Game);
if (Font) {
- if (FAILED(Font->loadFile(Filename))) {
+ if (FAILED(Font->loadFile(filename))) {
delete Font;
return NULL;
}
@@ -180,14 +180,14 @@ TOKEN_DEF(FONT) TOKEN_DEF(TTFONT)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool CBFont::isTrueType(CBGame *Game, const char *Filename) {
+bool CBFont::isTrueType(CBGame *Game, const char *filename) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(FONT)
TOKEN_TABLE(TTFONT)
TOKEN_TABLE_END
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) return false;
byte *WorkBuffer = Buffer;
diff --git a/engines/wintermute/Base/BFont.h b/engines/wintermute/Base/BFont.h index a8d613b92e..93bc426ed9 100644 --- a/engines/wintermute/Base/BFont.h +++ b/engines/wintermute/Base/BFont.h @@ -48,12 +48,12 @@ public: CBFont(CBGame *inGame);
virtual ~CBFont();
- static CBFont *createFromFile(CBGame *Game, const char *Filename);
+ static CBFont *createFromFile(CBGame *Game, const char *filename);
private:
//HRESULT loadBuffer(byte * Buffer);
//HRESULT loadFile(const char* Filename);
- static bool isTrueType(CBGame *Game, const char *Filename);
+ static bool isTrueType(CBGame *Game, const char *filename);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp index ccbeb6dd80..16a1274e18 100644 --- a/engines/wintermute/Base/BFontBitmap.cpp +++ b/engines/wintermute/Base/BFontBitmap.cpp @@ -245,19 +245,19 @@ void CBFontBitmap::drawChar(byte c, int x, int y) { //////////////////////////////////////////////////////////////////////
-HRESULT CBFontBitmap::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CBFontBitmap::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing FONT file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Base/BFontBitmap.h b/engines/wintermute/Base/BFontBitmap.h index f64ef05a64..c1ccddd3bf 100644 --- a/engines/wintermute/Base/BFontBitmap.h +++ b/engines/wintermute/Base/BFontBitmap.h @@ -38,7 +38,7 @@ class CBFontBitmap : public CBFont { public:
DECLARE_PERSISTENT(CBFontBitmap, CBFont)
HRESULT loadBuffer(byte *Buffer);
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
virtual int getTextWidth(byte *text, int MaxLength = -1);
virtual int getTextHeight(byte *text, int width);
virtual void drawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int MaxLenght = -1);
diff --git a/engines/wintermute/Base/BFontStorage.cpp b/engines/wintermute/Base/BFontStorage.cpp index fa08bb44fc..00aa67cb20 100644 --- a/engines/wintermute/Base/BFontStorage.cpp +++ b/engines/wintermute/Base/BFontStorage.cpp @@ -90,11 +90,11 @@ HRESULT CBFontStorage::InitLoop() { }
//////////////////////////////////////////////////////////////////////////
-CBFont *CBFontStorage::AddFont(const char *Filename) {
- if (!Filename) return NULL;
+CBFont *CBFontStorage::AddFont(const char *filename) {
+ if (!filename) return NULL;
for (int i = 0; i < _fonts.GetSize(); i++) {
- if (scumm_stricmp(_fonts[i]->_filename, Filename) == 0) {
+ if (scumm_stricmp(_fonts[i]->_filename, filename) == 0) {
_fonts[i]->_refCount++;
return _fonts[i];
}
@@ -104,7 +104,7 @@ CBFont *CBFontStorage::AddFont(const char *Filename) { CBFont* font = new CBFont(Game);
if (!font) return NULL;
- if (FAILED(font->loadFile(Filename))) {
+ if (FAILED(font->loadFile(filename))) {
delete font;
return NULL;
}
@@ -114,7 +114,7 @@ CBFont *CBFontStorage::AddFont(const char *Filename) { return font;
}
*/
- CBFont *font = CBFont::createFromFile(Game, Filename);
+ CBFont *font = CBFont::createFromFile(Game, filename);
if (font) {
font->_refCount = 1;
_fonts.Add(font);
diff --git a/engines/wintermute/Base/BFontStorage.h b/engines/wintermute/Base/BFontStorage.h index 110f4634c8..b337d2d6d5 100644 --- a/engines/wintermute/Base/BFontStorage.h +++ b/engines/wintermute/Base/BFontStorage.h @@ -43,7 +43,7 @@ public: DECLARE_PERSISTENT(CBFontStorage, CBBase)
HRESULT cleanup(bool Warn = false);
HRESULT RemoveFont(CBFont *Font);
- CBFont *AddFont(const char *Filename);
+ CBFont *AddFont(const char *filename);
CBFontStorage(CBGame *inGame);
virtual ~CBFontStorage();
CBArray<CBFont *, CBFont *> _fonts;
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp index cc373961e2..a5081f91f9 100644 --- a/engines/wintermute/Base/BFontTT.cpp +++ b/engines/wintermute/Base/BFontTT.cpp @@ -404,19 +404,19 @@ int CBFontTT::getLetterHeight() { //////////////////////////////////////////////////////////////////////
-HRESULT CBFontTT::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CBFontTT::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CBFontTT::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CBFontTT::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer))) Game->LOG(0, "Error parsing TTFONT file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp index 3e034cc499..8a20b87299 100644 --- a/engines/wintermute/Base/BFrame.cpp +++ b/engines/wintermute/Base/BFrame.cpp @@ -479,12 +479,12 @@ HRESULT CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this else if (strcmp(name, "AddSubframe") == 0) {
stack->correctParams(1);
CScValue *Val = stack->pop();
- const char *Filename = NULL;
- if (!Val->isNULL()) Filename = Val->getString();
+ const char *filename = NULL;
+ if (!Val->isNULL()) filename = Val->getString();
CBSubFrame *Sub = new CBSubFrame(Game);
- if (Filename != NULL) {
- Sub->setSurface(Filename);
+ if (filename != NULL) {
+ Sub->setSurface(filename);
Sub->setDefaultRect();
}
_subframes.Add(Sub);
@@ -502,12 +502,12 @@ HRESULT CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this if (Index < 0) Index = 0;
CScValue *Val = stack->pop();
- const char *Filename = NULL;
- if (!Val->isNULL()) Filename = Val->getString();
+ const char *filename = NULL;
+ if (!Val->isNULL()) filename = Val->getString();
CBSubFrame *Sub = new CBSubFrame(Game);
- if (Filename != NULL) {
- Sub->setSurface(Filename);
+ if (filename != NULL) {
+ Sub->setSurface(filename);
}
if (Index >= _subframes.GetSize()) _subframes.Add(Sub);
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index b3c4c87ecd..7037e19c31 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -284,7 +284,7 @@ CBGame::~CBGame() { LOG(0, "");
LOG(0, "Shutting down...");
- getDebugMgr()->OnGameShutdown();
+ getDebugMgr()->onGameShutdown();
_registry->WriteBool("System", "LastRun", true);
@@ -356,10 +356,10 @@ HRESULT CBGame::cleanup() { _musicStartTime[i] = 0;
}
- UnregisterObject(_store);
+ unregisterObject(_store);
_store = NULL;
- UnregisterObject(_fader);
+ unregisterObject(_fader);
_fader = NULL;
for (int i = 0; i < _regObjects.GetSize(); i++) {
@@ -458,11 +458,11 @@ HRESULT CBGame::initialize1() { _fader = new CBFader(this);
if (_fader == NULL) goto init_fail;
- RegisterObject(_fader);
+ registerObject(_fader);
_store = new CSXStore(this);
if (_store == NULL) goto init_fail;
- RegisterObject(_store);
+ registerObject(_store);
return S_OK;
@@ -585,7 +585,7 @@ void CBGame::LOG(HRESULT res, LPCSTR fmt, ...) { if (_engineLogCallback) {
_engineLogCallback(buff, res, _engineLogCallbackData);
}
- if (_debugMgr) _debugMgr->OnLog(res, buff);
+ if (_debugMgr) _debugMgr->onLog(res, buff);
debugCN(kWinterMuteDebugLog, "%02d:%02d:%02d: %s\n", hours, mins, secs, buff);
@@ -609,10 +609,10 @@ HRESULT CBGame::initLoop() { _currentTime = CBPlatform::GetTime();
- getDebugMgr()->OnGameTick();
+ getDebugMgr()->onGameTick();
_renderer->initLoop();
_soundMgr->initLoop();
- UpdateMusicCrossfade();
+ updateMusicCrossfade();
_surfaceStorage->initLoop();
_fontStorage->InitLoop();
@@ -993,7 +993,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Caption") == 0) {
HRESULT res = CBObject::scCallMethod(script, stack, thisStack, name);
- SetWindowTitle();
+ setWindowTitle();
return res;
}
@@ -1047,7 +1047,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS else if (strcmp(name, "ValidObject") == 0) {
stack->correctParams(1);
CBScriptable *obj = stack->pop()->getNative();
- if (ValidObject((CBObject *) obj)) stack->pushBool(true);
+ if (validObject((CBObject *) obj)) stack->pushBool(true);
else stack->pushBool(false);
return S_OK;
@@ -1058,7 +1058,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Reset") == 0) {
stack->correctParams(0);
- ResetContent();
+ resetContent();
stack->pushNULL();
return S_OK;
@@ -1072,7 +1072,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS stack->correctParams(1);
CScValue *val = stack->pop();
CBObject *obj = (CBObject *)val->getNative();
- UnregisterObject(obj);
+ unregisterObject(obj);
if (val->getType() == VAL_VARIABLE_REF) val->setNULL();
stack->pushNULL();
@@ -1087,7 +1087,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS CUIWindow *win = new CUIWindow(Game);
if (win && SUCCEEDED(win->loadFile(stack->pop()->getString()))) {
_windows.Add(win);
- RegisterObject(win);
+ registerObject(win);
stack->pushNative(win, true);
} else {
delete win;
@@ -1559,7 +1559,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS else if (strcmp(name, "IsSaveSlotUsed") == 0) {
stack->correctParams(1);
int Slot = stack->pop()->getInt();
- stack->pushBool(IsSaveSlotUsed(Slot));
+ stack->pushBool(isSaveSlotUsed(Slot));
return S_OK;
}
@@ -1571,7 +1571,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS int Slot = stack->pop()->getInt();
char Desc[512];
Desc[0] = '\0';
- GetSaveSlotDescription(Slot, Desc);
+ getSaveSlotDescription(Slot, Desc);
stack->pushString(Desc);
return S_OK;
}
@@ -1582,7 +1582,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS else if (strcmp(name, "EmptySaveSlot") == 0) {
stack->correctParams(1);
int Slot = stack->pop()->getInt();
- EmptySaveSlot(Slot);
+ emptySaveSlot(Slot);
stack->pushNULL();
return S_OK;
}
@@ -1845,7 +1845,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS CUIWindow *Win = new CUIWindow(Game);
_windows.Add(Win);
- RegisterObject(Win);
+ registerObject(Win);
if (!Val->isNULL()) Win->setName(Val->getString());
stack->pushNative(Win, true);
return S_OK;
@@ -1859,7 +1859,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS CBObject *Obj = (CBObject *)stack->pop()->getNative();
for (int i = 0; i < _windows.GetSize(); i++) {
if (_windows[i] == Obj) {
- UnregisterObject(_windows[i]);
+ unregisterObject(_windows[i]);
stack->pushBool(true);
return S_OK;
}
@@ -1997,7 +1997,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS delete _loadingIcon;
_loadingIcon = NULL;
} else {
- DisplayContent(false, true);
+ displayContent(false, true);
Game->_renderer->flip();
Game->_renderer->initLoop();
}
@@ -2487,7 +2487,7 @@ CScValue *CBGame::scGetProperty(const char *name) { // SaveDirectory (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SaveDirectory") == 0) {
- AnsiString dataDir = GetDataDir();
+ AnsiString dataDir = getDataDir();
_scValue->setString(dataDir.c_str());
return _scValue;
}
@@ -2588,7 +2588,7 @@ HRESULT CBGame::scSetProperty(const char *name, CScValue *value) { //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Name") == 0) {
HRESULT res = CBObject::scSetProperty(name, value);
- SetWindowTitle();
+ setWindowTitle();
return res;
}
@@ -2597,7 +2597,7 @@ HRESULT CBGame::scSetProperty(const char *name, CScValue *value) { //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "MainObject") == 0) {
CBScriptable *obj = value->getNative();
- if (obj == NULL || ValidObject((CBObject *)obj)) _mainObject = (CBObject *)obj;
+ if (obj == NULL || validObject((CBObject *)obj)) _mainObject = (CBObject *)obj;
return S_OK;
}
@@ -2758,7 +2758,7 @@ const char *CBGame::scToString() { #define QUICK_MSG_DURATION 3000
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::DisplayQuickMsg() {
+HRESULT CBGame::displayQuickMsg() {
if (_quickMessages.GetSize() == 0 || !_systemFont) return S_OK;
int i;
@@ -2808,14 +2808,14 @@ void CBGame::quickMessageForm(LPSTR fmt, ...) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::RegisterObject(CBObject *object) {
+HRESULT CBGame::registerObject(CBObject *object) {
_regObjects.Add(object);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::UnregisterObject(CBObject *object) {
+HRESULT CBGame::unregisterObject(CBObject *object) {
if (!object) return S_OK;
int i;
@@ -2869,7 +2869,7 @@ void CBGame::invalidateValues(void *value, void *data) { //////////////////////////////////////////////////////////////////////////
-bool CBGame::ValidObject(CBObject *object) {
+bool CBGame::validObject(CBObject *object) {
if (!object) return false;
if (object == this) return true;
@@ -3013,7 +3013,7 @@ HRESULT CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisS stack->correctParams(1);
CBScriptable *obj = stack->pop()->getNative();
- if (ValidObject((CBObject *)obj)) script->WaitForExclusive((CBObject *)obj);
+ if (validObject((CBObject *)obj)) script->WaitForExclusive((CBObject *)obj);
stack->pushNULL();
}
@@ -3150,7 +3150,7 @@ HRESULT CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisS stack->correctParams(0);
if (Game->getDebugMgr()->_enabled) {
- Game->getDebugMgr()->OnScriptHitBreakpoint(script);
+ Game->getDebugMgr()->onScriptHitBreakpoint(script);
script->Sleep(0);
}
stack->pushNULL();
@@ -3227,7 +3227,7 @@ HRESULT CBGame::showCursor() { //////////////////////////////////////////////////////////////////////////
HRESULT CBGame::SaveGame(int slot, const char *desc, bool quickSave) {
char filename[MAX_PATH + 1];
- GetSaveSlotFilename(slot, filename);
+ getSaveSlotFilename(slot, filename);
LOG(0, "Saving game '%s'...", filename);
@@ -3271,23 +3271,23 @@ save_finish: //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::LoadGame(int slot) {
+HRESULT CBGame::loadGame(int slot) {
//Game->LOG(0, "Load start %d", CBUtils::GetUsedMemMB());
_loading = false;
_scheduledLoadSlot = -1;
char filename[MAX_PATH + 1];
- GetSaveSlotFilename(slot, filename);
+ getSaveSlotFilename(slot, filename);
- return LoadGame(filename);
+ return loadGame(filename);
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::LoadGame(const char *filename) {
+HRESULT CBGame::loadGame(const char *filename) {
LOG(0, "Loading game '%s'...", filename);
- getDebugMgr()->OnGameShutdown();
+ getDebugMgr()->onGameShutdown();
HRESULT ret;
@@ -3315,14 +3315,14 @@ HRESULT CBGame::LoadGame(const char *filename) { if (FAILED(ret = CSysClassRegistry::getInstance()->loadInstances(Game, pm))) goto load_finish;
// data initialization after load
- InitAfterLoad();
+ initAfterLoad();
Game->applyEvent("AfterLoad", true);
- DisplayContent(true, false);
+ displayContent(true, false);
//_renderer->flip();
- getDebugMgr()->OnGameInit();
+ getDebugMgr()->onGameInit();
load_finish:
_dEBUG_AbsolutePathWarning = true;
@@ -3341,7 +3341,7 @@ load_finish: //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::InitAfterLoad() {
+HRESULT CBGame::initAfterLoad() {
CSysClassRegistry::getInstance()->enumInstances(afterLoadRegion, "CBRegion", NULL);
CSysClassRegistry::getInstance()->enumInstances(afterLoadSubFrame, "CBSubFrame", NULL);
CSysClassRegistry::getInstance()->enumInstances(afterLoadSound, "CBSound", NULL);
@@ -3383,7 +3383,7 @@ void CBGame::afterLoadScript(void *script, void *data) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::DisplayWindows(bool inGame) {
+HRESULT CBGame::displayWindows(bool inGame) {
HRESULT res;
int i;
@@ -3725,7 +3725,7 @@ HRESULT CBGame::focusWindow(CUIWindow *Window) { Game->_focusedWindow = Window;
}
- if (Window->_mode == WINDOW_NORMAL && Prev != Window && Game->ValidObject(Prev) && (Prev->_mode == WINDOW_EXCLUSIVE || Prev->_mode == WINDOW_SYSTEM_EXCLUSIVE))
+ if (Window->_mode == WINDOW_NORMAL && Prev != Window && Game->validObject(Prev) && (Prev->_mode == WINDOW_EXCLUSIVE || Prev->_mode == WINDOW_SYSTEM_EXCLUSIVE))
return focusWindow(Prev);
else return S_OK;
}
@@ -3768,16 +3768,16 @@ HRESULT CBGame::unfreeze() { //////////////////////////////////////////////////////////////////////////
bool CBGame::handleKeypress(Common::Event *event, bool printable) {
- if (IsVideoPlaying()) {
+ if (isVideoPlaying()) {
if (event->kbd.keycode == Common::KEYCODE_ESCAPE)
- StopVideo();
+ stopVideo();
return true;
}
#ifdef __WIN32__
// TODO: Do we really need to handle this in-engine?
// handle Alt+F4 on windows
if (event->type == Common::EVENT_KEYDOWN && event->kbd.keycode == Common::KEYCODE_F4 && (event->kbd.flags == Common::KBD_ALT)) {
- OnWindowClose();
+ onWindowClose();
return true;
//TODO
}
@@ -3848,19 +3848,19 @@ bool CBGame::handleMouseWheel(int Delta) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor) {
- if (VerMajor) *VerMajor = DCGF_VER_MAJOR;
- if (VerMinor) *VerMinor = DCGF_VER_MINOR;
+HRESULT CBGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) {
+ if (verMajor) *verMajor = DCGF_VER_MAJOR;
+ if (verMinor) *verMinor = DCGF_VER_MINOR;
- if (ExtMajor) *ExtMajor = 0;
- if (ExtMinor) *ExtMinor = 0;
+ if (extMajor) *extMajor = 0;
+ if (extMinor) *extMinor = 0;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::SetWindowTitle() {
+void CBGame::setWindowTitle() {
if (_renderer) {
char Title[512];
strcpy(Title, _caption[0]);
@@ -3888,8 +3888,8 @@ void CBGame::SetWindowTitle() { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::GetSaveSlotFilename(int Slot, char *Buffer) {
- AnsiString dataDir = GetDataDir();
+HRESULT CBGame::getSaveSlotFilename(int Slot, char *Buffer) {
+ AnsiString dataDir = getDataDir();
//sprintf(Buffer, "%s/save%03d.%s", dataDir.c_str(), Slot, _savedGameExt);
sprintf(Buffer, "save%03d.%s", Slot, _savedGameExt);
warning("Saving %s - we really should prefix these things to avoid collisions.", Buffer);
@@ -3897,7 +3897,7 @@ HRESULT CBGame::GetSaveSlotFilename(int Slot, char *Buffer) { }
//////////////////////////////////////////////////////////////////////////
-AnsiString CBGame::GetDataDir() {
+AnsiString CBGame::getDataDir() {
AnsiString userDir = PathUtil::getUserDirectory();
#ifdef __IPHONEOS__
return userDir;
@@ -3909,11 +3909,11 @@ AnsiString CBGame::GetDataDir() { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::GetSaveSlotDescription(int Slot, char *Buffer) {
- Buffer[0] = '\0';
+HRESULT CBGame::getSaveSlotDescription(int slot, char *buffer) {
+ buffer[0] = '\0';
char filename[MAX_PATH + 1];
- GetSaveSlotFilename(Slot, filename);
+ getSaveSlotFilename(slot, filename);
CBPersistMgr *pm = new CBPersistMgr(Game);
if (!pm) return E_FAIL;
@@ -3925,7 +3925,7 @@ HRESULT CBGame::GetSaveSlotDescription(int Slot, char *Buffer) { }
_dEBUG_AbsolutePathWarning = true;
- strcpy(Buffer, pm->_savedDescription);
+ strcpy(buffer, pm->_savedDescription);
delete pm;
return S_OK;
@@ -3933,9 +3933,9 @@ HRESULT CBGame::GetSaveSlotDescription(int Slot, char *Buffer) { //////////////////////////////////////////////////////////////////////////
-bool CBGame::IsSaveSlotUsed(int slot) {
+bool CBGame::isSaveSlotUsed(int slot) {
char filename[MAX_PATH + 1];
- GetSaveSlotFilename(slot, filename);
+ getSaveSlotFilename(slot, filename);
warning("CBGame::IsSaveSlotUsed(%d) - FIXME, ugly solution", slot);
Common::SeekableReadStream *File = g_wintermute->getSaveFileMan()->openForLoading(filename);
@@ -3946,9 +3946,9 @@ bool CBGame::IsSaveSlotUsed(int slot) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::EmptySaveSlot(int Slot) {
+HRESULT CBGame::emptySaveSlot(int Slot) {
char filename[MAX_PATH + 1];
- GetSaveSlotFilename(Slot, filename);
+ getSaveSlotFilename(Slot, filename);
CBPlatform::DeleteFile(filename);
@@ -4038,13 +4038,13 @@ HRESULT CBGame::getCurrentViewportOffset(int *offsetX, int *offsetY) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::WindowLoadHook(CUIWindow *win, char **Buf, char **Params) {
+HRESULT CBGame::windowLoadHook(CUIWindow *win, char **Buf, char **Params) {
return E_FAIL;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::WindowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name) {
+HRESULT CBGame::windowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name) {
return E_FAIL;
}
@@ -4073,13 +4073,13 @@ void CBGame::setResourceModule(HMODULE resModule) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::DisplayContent(bool update, bool displayAll) {
+HRESULT CBGame::displayContent(bool update, bool displayAll) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::DisplayContentSimple() {
+HRESULT CBGame::displayContentSimple() {
// fill black
_renderer->fill(0, 0, 0);
if (_indicatorDisplay) displayIndicator();
@@ -4107,7 +4107,7 @@ HRESULT CBGame::displayIndicator() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::UpdateMusicCrossfade() {
+HRESULT CBGame::updateMusicCrossfade() {
/* byte GlobMusicVol = _soundMgr->getVolumePercent(SOUND_MUSIC); */
if (!_musicCrossfadeRunning) return S_OK;
@@ -4162,7 +4162,7 @@ HRESULT CBGame::UpdateMusicCrossfade() { //////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::ResetContent() {
+HRESULT CBGame::resetContent() {
_scEngine->ClearGlobals();
//_timer = 0;
//_liveTimer = 0;
@@ -4215,14 +4215,14 @@ HRESULT CBGame::setWaitCursor(const char *filename) { }
//////////////////////////////////////////////////////////////////////////
-bool CBGame::IsVideoPlaying() {
+bool CBGame::isVideoPlaying() {
if (_videoPlayer->isPlaying()) return true;
if (_theoraPlayer && _theoraPlayer->isPlaying()) return true;
return false;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::StopVideo() {
+HRESULT CBGame::stopVideo() {
if (_videoPlayer->isPlaying()) _videoPlayer->stop();
if (_theoraPlayer && _theoraPlayer->isPlaying()) {
_theoraPlayer->stop();
@@ -4246,7 +4246,7 @@ HRESULT CBGame::drawCursor(CBSprite *Cursor) { //////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnActivate(bool Activate, bool RefreshMouse) {
+HRESULT CBGame::onActivate(bool Activate, bool RefreshMouse) {
if (_shuttingDown || !_renderer) return S_OK;
_renderer->_active = Activate;
@@ -4264,7 +4264,7 @@ HRESULT CBGame::OnActivate(bool Activate, bool RefreshMouse) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseLeftDown() {
+HRESULT CBGame::onMouseLeftDown() {
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("LeftClick"));
@@ -4282,7 +4282,7 @@ HRESULT CBGame::OnMouseLeftDown() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseLeftUp() {
+HRESULT CBGame::onMouseLeftUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
CBPlatform::ReleaseCapture();
@@ -4299,7 +4299,7 @@ HRESULT CBGame::OnMouseLeftUp() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseLeftDblClick() {
+HRESULT CBGame::onMouseLeftDblClick() {
if (_state == GAME_RUNNING && !_interactive) return S_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
@@ -4314,7 +4314,7 @@ HRESULT CBGame::OnMouseLeftDblClick() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseRightDblClick() {
+HRESULT CBGame::onMouseRightDblClick() {
if (_state == GAME_RUNNING && !_interactive) return S_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_RIGHT);
@@ -4329,7 +4329,7 @@ HRESULT CBGame::OnMouseRightDblClick() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseRightDown() {
+HRESULT CBGame::onMouseRightDown() {
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("RightClick"));
@@ -4342,7 +4342,7 @@ HRESULT CBGame::OnMouseRightDown() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseRightUp() {
+HRESULT CBGame::onMouseRightUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("RightRelease"));
@@ -4355,7 +4355,7 @@ HRESULT CBGame::OnMouseRightUp() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseMiddleDown() {
+HRESULT CBGame::onMouseMiddleDown() {
if (_state == GAME_RUNNING && !_interactive) return S_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_MIDDLE);
@@ -4370,7 +4370,7 @@ HRESULT CBGame::OnMouseMiddleDown() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnMouseMiddleUp() {
+HRESULT CBGame::onMouseMiddleUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_MIDDLE);
bool Handled = _state == GAME_RUNNING && SUCCEEDED(applyEvent("MiddleRelease"));
@@ -4383,18 +4383,18 @@ HRESULT CBGame::OnMouseMiddleUp() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnPaint() {
+HRESULT CBGame::onPaint() {
if (_renderer && _renderer->_windowed && _renderer->_ready) {
_renderer->initLoop();
- DisplayContent(false, true);
- DisplayDebugInfo();
+ displayContent(false, true);
+ displayDebugInfo();
_renderer->windowedBlt();
}
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnWindowClose() {
+HRESULT CBGame::onWindowClose() {
if (canHandleEvent("QuitGame")) {
if (_state != GAME_FROZEN) Game->applyEvent("QuitGame");
return S_OK;
@@ -4402,7 +4402,7 @@ HRESULT CBGame::OnWindowClose() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::DisplayDebugInfo() {
+HRESULT CBGame::displayDebugInfo() {
char str[100];
if (_dEBUG_ShowFPS) {
@@ -4499,22 +4499,22 @@ HRESULT CBGame::MiniUpdate() { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::OnScriptShutdown(CScScript *script) {
+HRESULT CBGame::onScriptShutdown(CScScript *script) {
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
bool CBGame::isLeftDoubleClick() {
- return IsDoubleClick(0);
+ return isDoubleClick(0);
}
//////////////////////////////////////////////////////////////////////////
bool CBGame::isRightDoubleClick() {
- return IsDoubleClick(1);
+ return isDoubleClick(1);
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::IsDoubleClick(int buttonIndex) {
+bool CBGame::isDoubleClick(int buttonIndex) {
uint32 maxDoubleCLickTime = 500;
int maxMoveX = 4;
int maxMoveY = 4;
diff --git a/engines/wintermute/Base/BGame.h b/engines/wintermute/Base/BGame.h index 799abc7b5c..055e2d1410 100644 --- a/engines/wintermute/Base/BGame.h +++ b/engines/wintermute/Base/BGame.h @@ -67,19 +67,19 @@ class CBGame: public CBObject { public:
DECLARE_PERSISTENT(CBGame, CBObject)
- virtual HRESULT OnScriptShutdown(CScScript *script);
-
- virtual HRESULT OnActivate(bool Activate, bool RefreshMouse);
- virtual HRESULT OnMouseLeftDown();
- virtual HRESULT OnMouseLeftUp();
- virtual HRESULT OnMouseLeftDblClick();
- virtual HRESULT OnMouseRightDblClick();
- virtual HRESULT OnMouseRightDown();
- virtual HRESULT OnMouseRightUp();
- virtual HRESULT OnMouseMiddleDown();
- virtual HRESULT OnMouseMiddleUp();
- virtual HRESULT OnPaint();
- virtual HRESULT OnWindowClose();
+ virtual HRESULT onScriptShutdown(CScScript *script);
+
+ virtual HRESULT onActivate(bool activate, bool refreshMouse);
+ virtual HRESULT onMouseLeftDown();
+ virtual HRESULT onMouseLeftUp();
+ virtual HRESULT onMouseLeftDblClick();
+ virtual HRESULT onMouseRightDblClick();
+ virtual HRESULT onMouseRightDown();
+ virtual HRESULT onMouseRightUp();
+ virtual HRESULT onMouseMiddleDown();
+ virtual HRESULT onMouseMiddleUp();
+ virtual HRESULT onPaint();
+ virtual HRESULT onWindowClose();
bool isLeftDoubleClick();
bool isRightDoubleClick();
@@ -96,7 +96,7 @@ public: bool _shuttingDown;
- virtual HRESULT DisplayDebugInfo();
+ virtual HRESULT displayDebugInfo();
bool _dEBUG_ShowFPS;
bool _suspendedRendering;
@@ -110,10 +110,10 @@ public: int _loadingIconY;
int _loadingIconPersistent;
- virtual HRESULT ResetContent();
+ virtual HRESULT resetContent();
void DEBUG_DumpClassRegistry();
- HRESULT setWaitCursor(const char *Filename);
+ HRESULT setWaitCursor(const char *filename);
char *_localSaveDir;
bool _saveDirChecked;
@@ -248,39 +248,39 @@ public: int _scheduledLoadSlot;
bool _loading;
bool _personalizedSave;
- HRESULT EmptySaveSlot(int Slot);
- bool IsSaveSlotUsed(int Slot);
- HRESULT GetSaveSlotDescription(int Slot, char *Buffer);
- HRESULT GetSaveSlotFilename(int Slot, char *Buffer);
- void SetWindowTitle();
+ HRESULT emptySaveSlot(int slot);
+ bool isSaveSlotUsed(int slot);
+ HRESULT getSaveSlotDescription(int slot, char *buffer);
+ HRESULT getSaveSlotFilename(int slot, char *buffer);
+ void setWindowTitle();
virtual bool handleMouseWheel(int Delta);
bool _quitting;
- virtual HRESULT GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor);
+ virtual HRESULT getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor);
virtual bool handleKeypress(Common::Event *event, bool printable = false);
virtual void handleKeyRelease(Common::Event *event);
int _freezeLevel;
HRESULT unfreeze();
- HRESULT freeze(bool IncludingMusic = true);
- HRESULT focusWindow(CUIWindow *Window);
+ HRESULT freeze(bool includingMusic = true);
+ HRESULT focusWindow(CUIWindow *window);
CVidPlayer *_videoPlayer;
CVidTheoraPlayer *_theoraPlayer;
bool _loadInProgress;
CUIWindow *_focusedWindow;
bool _editorForceScripts;
- static void afterLoadRegion(void *Region, void *Data);
- static void afterLoadSubFrame(void *Subframe, void *Data);
- static void afterLoadSound(void *Sound, void *Data);
- static void afterLoadFont(void *Font, void *Data);
+ static void afterLoadRegion(void *region, void *data);
+ static void afterLoadSubFrame(void *subframe, void *data);
+ static void afterLoadSound(void *sound, void *data);
+ static void afterLoadFont(void *font, void *data);
static void afterLoadScript(void *script, void *data);
- static void invalidateValues(void *Value, void *Data);
-
- HRESULT loadSettings(const char *Filename);
- HRESULT resumeMusic(int Channel);
- HRESULT setMusicStartTime(int Channel, uint32 Time);
- HRESULT pauseMusic(int Channel);
- HRESULT stopMusic(int Channel);
- HRESULT playMusic(int Channel, const char *Filename, bool Looping = true, uint32 LoopStart = 0);
+ static void invalidateValues(void *value, void *data);
+
+ HRESULT loadSettings(const char *filename);
+ HRESULT resumeMusic(int channel);
+ HRESULT setMusicStartTime(int channel, uint32 time);
+ HRESULT pauseMusic(int channel);
+ HRESULT stopMusic(int channel);
+ HRESULT playMusic(int channel, const char *filename, bool looping = true, uint32 loopStart = 0);
CBSound *_music[NUM_MUSIC_CHANNELS];
bool _musicCrossfadeRunning;
bool _musicCrossfadeSwap;
@@ -288,12 +288,12 @@ public: uint32 _musicCrossfadeLength;
int _musicCrossfadeChannel1;
int _musicCrossfadeChannel2;
- HRESULT DisplayWindows(bool InGame = false);
+ HRESULT displayWindows(bool inGame = false);
CBRegistry *_registry;
bool _useD3D;
virtual HRESULT cleanup();
- virtual HRESULT LoadGame(int Slot);
- virtual HRESULT LoadGame(const char *Filename);
+ virtual HRESULT loadGame(int slot);
+ virtual HRESULT loadGame(const char *filename);
virtual HRESULT SaveGame(int slot, const char *desc, bool quickSave = false);
virtual HRESULT showCursor();
@@ -314,39 +314,39 @@ public: CBObject *_capturedObject;
POINT _mousePos;
- bool ValidObject(CBObject *object);
- HRESULT UnregisterObject(CBObject *object);
- HRESULT RegisterObject(CBObject *object);
+ bool validObject(CBObject *object);
+ HRESULT unregisterObject(CBObject *object);
+ HRESULT registerObject(CBObject *object);
void quickMessage(const char *text);
void quickMessageForm(LPSTR fmt, ...);
- HRESULT DisplayQuickMsg();
+ HRESULT displayQuickMsg();
uint32 _fps;
- HRESULT UpdateMusicCrossfade();
+ HRESULT updateMusicCrossfade();
- bool IsVideoPlaying();
- HRESULT StopVideo();
+ bool isVideoPlaying();
+ HRESULT stopVideo();
CBArray<CBObject *, CBObject *> _regObjects;
public:
- virtual HRESULT DisplayContent(bool Update = true, bool DisplayAll = false);
- virtual HRESULT DisplayContentSimple();
+ virtual HRESULT displayContent(bool update = true, bool displayAll = false);
+ virtual HRESULT displayContentSimple();
bool _forceNonStreamedSounds;
void resetMousePos();
int _subtitlesSpeed;
void SetInteractive(bool State);
- virtual HRESULT WindowLoadHook(CUIWindow *Win, char **Buf, char **Params);
- virtual HRESULT WindowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name);
- HRESULT getCurrentViewportOffset(int *OffsetX = NULL, int *OffsetY = NULL);
- HRESULT getCurrentViewportRect(RECT *Rect, bool *Custom = NULL);
+ virtual HRESULT windowLoadHook(CUIWindow *win, char **buf, char **params);
+ virtual HRESULT windowScriptMethodHook(CUIWindow *Win, CScScript *script, CScStack *stack, const char *name);
+ HRESULT getCurrentViewportOffset(int *offsetX = NULL, int *offsetY = NULL);
+ HRESULT getCurrentViewportRect(RECT *rect, bool *custom = NULL);
HRESULT popViewport();
HRESULT pushViewport(CBViewport *Viewport);
HRESULT setActiveObject(CBObject *Obj);
CBSprite *_lastCursor;
HRESULT drawCursor(CBSprite *Cursor);
- virtual HRESULT InitAfterLoad();
+ virtual HRESULT initAfterLoad();
CBSaveThumbHelper *_cachedThumbnail;
- AnsiString GetDataDir();
+ AnsiString getDataDir();
void addMem(int bytes);
bool _touchInterface;
@@ -368,7 +368,7 @@ private: };
LastClickInfo _lastClick[2];
- bool IsDoubleClick(int buttonIndex);
+ bool isDoubleClick(int buttonIndex);
uint32 _usedMem;
diff --git a/engines/wintermute/Base/BImage.cpp b/engines/wintermute/Base/BImage.cpp index 31a3772964..11be19683f 100644 --- a/engines/wintermute/Base/BImage.cpp +++ b/engines/wintermute/Base/BImage.cpp @@ -112,11 +112,11 @@ void CBImage::copyFrom(Graphics::Surface *surface) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBImage::SaveBMPFile(const char *Filename) {
+HRESULT CBImage::SaveBMPFile(const char *filename) {
#if 0
if (!_bitmap) return E_FAIL;
- if (FreeImage_Save(FIF_BMP, _bitmap, Filename)) return S_OK;
+ if (FreeImage_Save(FIF_BMP, _bitmap, filename)) return S_OK;
else return E_FAIL;
#endif
return E_FAIL;
diff --git a/engines/wintermute/Base/BImage.h b/engines/wintermute/Base/BImage.h index 8b2cf70cc1..2472af718c 100644 --- a/engines/wintermute/Base/BImage.h +++ b/engines/wintermute/Base/BImage.h @@ -57,7 +57,7 @@ public: byte getAlphaAt(int x, int y);
bool writeBMPToStream(Common::WriteStream *stream);
HRESULT Resize(int NewWidth, int NewHeight);
- HRESULT SaveBMPFile(const char *Filename);
+ HRESULT SaveBMPFile(const char *filename);
HRESULT CopyFrom(CBImage *OrigImage, int NewWidth = 0, int NewHeight = 0);
void copyFrom(Graphics::Surface *surface);
private:
diff --git a/engines/wintermute/Base/BObject.cpp b/engines/wintermute/Base/BObject.cpp index a352b11bf0..8b92721a4e 100644 --- a/engines/wintermute/Base/BObject.cpp +++ b/engines/wintermute/Base/BObject.cpp @@ -268,8 +268,8 @@ HRESULT CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "LoadSound") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
- if (SUCCEEDED(playSFX(Filename, false, false)))
+ const char *filename = stack->pop()->getString();
+ if (SUCCEEDED(playSFX(filename, false, false)))
stack->pushBool(true);
else
stack->pushBool(false);
@@ -283,7 +283,7 @@ HRESULT CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi else if (strcmp(name, "PlaySound") == 0) {
stack->correctParams(3);
- const char *Filename;
+ const char *filename;
bool Looping;
uint32 LoopStart;
@@ -292,17 +292,17 @@ HRESULT CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi CScValue *val3 = stack->pop();
if (val1->_type == VAL_BOOL) {
- Filename = NULL;
+ filename = NULL;
Looping = val1->getBool();
LoopStart = val2->getInt();
} else {
- if (val1->isNULL()) Filename = NULL;
- else Filename = val1->getString();
+ if (val1->isNULL()) filename = NULL;
+ else filename = val1->getString();
Looping = val2->isNULL() ? false : val2->getBool();
LoopStart = val3->getInt();
}
- if (FAILED(playSFX(Filename, Looping, true, NULL, LoopStart))) stack->pushBool(false);
+ if (FAILED(playSFX(filename, Looping, true, NULL, LoopStart))) stack->pushBool(false);
else stack->pushBool(true);
return S_OK;
}
@@ -313,21 +313,21 @@ HRESULT CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi else if (strcmp(name, "PlaySoundEvent") == 0) {
stack->correctParams(2);
- const char *Filename;
+ const char *filename;
const char *EventName;
CScValue *val1 = stack->pop();
CScValue *val2 = stack->pop();
if (val2->isNULL()) {
- Filename = NULL;
+ filename = NULL;
EventName = val1->getString();
} else {
- Filename = val1->getString();
+ filename = val1->getString();
EventName = val2->getString();
}
- if (FAILED(playSFX(Filename, false, true, EventName))) stack->pushBool(false);
+ if (FAILED(playSFX(filename, false, true, EventName))) stack->pushBool(false);
else stack->pushBool(true);
return S_OK;
}
diff --git a/engines/wintermute/Base/BObject.h b/engines/wintermute/Base/BObject.h index b217994ada..ef4d8f3909 100644 --- a/engines/wintermute/Base/BObject.h +++ b/engines/wintermute/Base/BObject.h @@ -70,7 +70,7 @@ public: HRESULT resumeSFX();
HRESULT pauseSFX();
HRESULT stopSFX(bool DeleteSound = true);
- HRESULT playSFX(const char *Filename, bool Looping = false, bool PlayNow = true, const char *EventName = NULL, uint32 LoopStart = 0);
+ HRESULT playSFX(const char *filename, bool Looping = false, bool PlayNow = true, const char *EventName = NULL, uint32 LoopStart = 0);
CBSound *_sFX;
TSFXType _sFXType;
@@ -83,8 +83,8 @@ public: virtual HRESULT handleMouse(TMouseEvent Event, TMouseButton Button);
virtual bool handleKeypress(Common::Event *event, bool printable = false);
virtual int getHeight();
- HRESULT setCursor(const char *Filename);
- HRESULT setActiveCursor(const char *Filename);
+ HRESULT setCursor(const char *filename);
+ HRESULT setActiveCursor(const char *filename);
HRESULT cleanup();
char *getCaption(int Case = 1);
void setCaption(const char *Caption, int Case = 1);
diff --git a/engines/wintermute/Base/BPersistMgr.cpp b/engines/wintermute/Base/BPersistMgr.cpp index 74c9fbd422..dc04d1624e 100644 --- a/engines/wintermute/Base/BPersistMgr.cpp +++ b/engines/wintermute/Base/BPersistMgr.cpp @@ -195,7 +195,7 @@ HRESULT CBPersistMgr::initSave(const char *desc) { putDWORD(magic);
byte VerMajor, VerMinor, ExtMajor, ExtMinor;
- Game->GetVersion(&VerMajor, &VerMinor, &ExtMajor, &ExtMinor);
+ Game->getVersion(&VerMajor, &VerMinor, &ExtMajor, &ExtMinor);
//uint32 Version = MAKELONG(MAKEWORD(VerMajor, VerMinor), MAKEWORD(ExtMajor, ExtMinor));
_saveStream->writeByte(VerMajor);
_saveStream->writeByte(VerMinor);
@@ -250,7 +250,7 @@ HRESULT CBPersistMgr::readHeader(const Common::String &filename) { _saving = false;
_loadStream = g_system->getSavefileManager()->openForLoading(filename);
- //_buffer = Game->_fileManager->readWholeFile(Filename, &_bufferSize);
+ //_buffer = Game->_fileManager->readWholeFile(filename, &_bufferSize);
if (_loadStream) {
uint32 Magic;
Magic = getDWORD();
diff --git a/engines/wintermute/Base/BRegion.cpp b/engines/wintermute/Base/BRegion.cpp index c100a2c765..3efd913da8 100644 --- a/engines/wintermute/Base/BRegion.cpp +++ b/engines/wintermute/Base/BRegion.cpp @@ -95,19 +95,19 @@ bool CBRegion::PointInRegion(int X, int Y) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBRegion::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CBRegion::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CBRegion::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CBRegion::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing REGION file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/Base/BRegion.h b/engines/wintermute/Base/BRegion.h index e63ae3a170..fb725e814b 100644 --- a/engines/wintermute/Base/BRegion.h +++ b/engines/wintermute/Base/BRegion.h @@ -50,7 +50,7 @@ public: virtual ~CBRegion();
bool PointInRegion(int X, int Y);
bool CreateRegion();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
RECT _rect;
CBArray<CBPoint *, CBPoint *> _points;
diff --git a/engines/wintermute/Base/BRegistry.cpp b/engines/wintermute/Base/BRegistry.cpp index 7a77e17fc7..64f2a0093c 100644 --- a/engines/wintermute/Base/BRegistry.cpp +++ b/engines/wintermute/Base/BRegistry.cpp @@ -139,12 +139,12 @@ char *CBRegistry::GetIniName() { //////////////////////////////////////////////////////////////////////////
void CBRegistry::LoadValues(bool local) {
if (local) LoadXml("settings.xml", _localValues);
- else LoadXml(PathUtil::combine(Game->GetDataDir(), "settings.xml"), _values);
+ else LoadXml(PathUtil::combine(Game->getDataDir(), "settings.xml"), _values);
}
//////////////////////////////////////////////////////////////////////////
void CBRegistry::SaveValues() {
- SaveXml(PathUtil::combine(Game->GetDataDir(), "settings.xml"), _values);
+ SaveXml(PathUtil::combine(Game->getDataDir(), "settings.xml"), _values);
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/Base/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp index 1427b31aae..acbd8a645e 100644 --- a/engines/wintermute/Base/BRenderSDL.cpp +++ b/engines/wintermute/Base/BRenderSDL.cpp @@ -621,10 +621,10 @@ void CBRenderSDL::pointToScreen(POINT *point) { }
//////////////////////////////////////////////////////////////////////////
-void CBRenderSDL::dumpData(const char *Filename) {
- warning("CBRenderSDL::DumpData(%s) - not reimplemented yet", Filename); // TODO
+void CBRenderSDL::dumpData(const char *filename) {
+ warning("CBRenderSDL::DumpData(%s) - not reimplemented yet", filename); // TODO
#if 0
- FILE *f = fopen(Filename, "wt");
+ FILE *f = fopen(filename, "wt");
if (!f) return;
CBSurfaceStorage *Mgr = Game->_surfaceStorage;
diff --git a/engines/wintermute/Base/BRenderSDL.h b/engines/wintermute/Base/BRenderSDL.h index a9abb18e9d..0f3cf82a31 100644 --- a/engines/wintermute/Base/BRenderSDL.h +++ b/engines/wintermute/Base/BRenderSDL.h @@ -89,7 +89,7 @@ public: void pointFromScreen(POINT *point);
void pointToScreen(POINT *point);
- void dumpData(const char *Filename);
+ void dumpData(const char *filename);
float getScaleRatioX() const {
return _ratioX;
diff --git a/engines/wintermute/Base/BRenderer.h b/engines/wintermute/Base/BRenderer.h index 38925fc57a..5caa707e54 100644 --- a/engines/wintermute/Base/BRenderer.h +++ b/engines/wintermute/Base/BRenderer.h @@ -47,7 +47,7 @@ public: int _drawOffsetX;
int _drawOffsetY;
- virtual void dumpData(const char *Filename) {};
+ virtual void dumpData(const char *filename) {};
virtual CBImage *takeScreenshot();
virtual HRESULT setViewport(int left, int top, int right, int bottom);
virtual HRESULT setViewport(RECT *Rect);
diff --git a/engines/wintermute/Base/BSaveThumbHelper.cpp b/engines/wintermute/Base/BSaveThumbHelper.cpp index 1e54470924..9e5466b323 100644 --- a/engines/wintermute/Base/BSaveThumbHelper.cpp +++ b/engines/wintermute/Base/BSaveThumbHelper.cpp @@ -53,10 +53,10 @@ HRESULT CBSaveThumbHelper::StoreThumbnail(bool DoFlip) { if (DoFlip) {
// when using opengl on windows it seems to be necessary to do this twice
// works normally for direct3d
- Game->DisplayContent(false);
+ Game->displayContent(false);
Game->_renderer->flip();
- Game->DisplayContent(false);
+ Game->displayContent(false);
Game->_renderer->flip();
}
diff --git a/engines/wintermute/Base/BScriptHolder.cpp b/engines/wintermute/Base/BScriptHolder.cpp index b6495931aa..6353352b8d 100644 --- a/engines/wintermute/Base/BScriptHolder.cpp +++ b/engines/wintermute/Base/BScriptHolder.cpp @@ -71,11 +71,11 @@ HRESULT CBScriptHolder::cleanup() { }
//////////////////////////////////////////////////////////////////////
-void CBScriptHolder::setFilename(const char *Filename) {
+void CBScriptHolder::setFilename(const char *filename) {
if (_filename != NULL) delete [] _filename;
- _filename = new char [strlen(Filename) + 1];
- if (_filename != NULL) strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ if (_filename != NULL) strcpy(_filename, filename);
}
@@ -172,11 +172,11 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScStac //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "DetachScript") == 0) {
stack->correctParams(2);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
bool KillThreads = stack->pop()->getBool(false);
bool ret = false;
for (int i = 0; i < _scripts.GetSize(); i++) {
- if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0) {
+ if (scumm_stricmp(_scripts[i]->_filename, filename) == 0) {
_scripts[i]->finish(KillThreads);
ret = true;
break;
@@ -192,10 +192,10 @@ HRESULT CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScStac //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "IsScriptRunning") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
bool ret = false;
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) {
+ if (scumm_stricmp(_scripts[i]->_filename, filename) == 0 && _scripts[i]->_state != SCRIPT_FINISHED && _scripts[i]->_state != SCRIPT_ERROR) {
ret = true;
break;
}
@@ -276,28 +276,28 @@ HRESULT CBScriptHolder::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBScriptHolder::addScript(const char *Filename) {
+HRESULT CBScriptHolder::addScript(const char *filename) {
for (int i = 0; i < _scripts.GetSize(); i++) {
- if (scumm_stricmp(_scripts[i]->_filename, Filename) == 0) {
+ 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);
+ Game->LOG(0, "CBScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", filename, _name);
return S_OK;
}
}
}
- CScScript *scr = Game->_scEngine->RunScript(Filename, this);
+ CScScript *scr = Game->_scEngine->RunScript(filename, this);
if (!scr) {
if (Game->_editorForceScripts) {
// editor hack
scr = new CScScript(Game, Game->_scEngine);
- scr->_filename = new char[strlen(Filename) + 1];
- strcpy(scr->_filename, Filename);
+ scr->_filename = new char[strlen(filename) + 1];
+ strcpy(scr->_filename, filename);
scr->_state = SCRIPT_ERROR;
scr->_owner = this;
_scripts.Add(scr);
Game->_scEngine->_scripts.Add(scr);
- Game->getDebugMgr()->OnScriptInit(scr);
+ Game->getDebugMgr()->onScriptInit(scr);
return S_OK;
}
@@ -436,7 +436,7 @@ CScScript *CBScriptHolder::invokeMethodThread(const char *methodName) { HRESULT ret = thread->CreateMethodThread(_scripts[i], methodName);
if (SUCCEEDED(ret)) {
_scripts[i]->_engine->_scripts.Add(thread);
- Game->getDebugMgr()->OnScriptMethodThreadInit(thread, _scripts[i], methodName);
+ Game->getDebugMgr()->onScriptMethodThreadInit(thread, _scripts[i], methodName);
return thread;
} else {
diff --git a/engines/wintermute/Base/BSoundBuffer.cpp b/engines/wintermute/Base/BSoundBuffer.cpp index 55db2a0f89..44d51cd360 100644 --- a/engines/wintermute/Base/BSoundBuffer.cpp +++ b/engines/wintermute/Base/BSoundBuffer.cpp @@ -93,8 +93,8 @@ void CBSoundBuffer::setStreaming(bool Streamed, uint32 NumBlocks, uint32 BlockSi //////////////////////////////////////////////////////////////////////////
-HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) {
- warning("BSoundBuffer::LoadFromFile(%s,%d)", Filename, ForceReload);
+HRESULT CBSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
+ warning("BSoundBuffer::LoadFromFile(%s,%d)", filename, forceReload);
#if 0
if (_stream) {
BASS_StreamFree(_stream);
@@ -105,24 +105,24 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) { delete _file;
// Load a file, but avoid having the File-manager handle the disposal of it.
- _file = Game->_fileManager->openFile(Filename, true, false);
+ _file = Game->_fileManager->openFile(filename, true, false);
if (!_file) {
- Game->LOG(0, "Error opening sound file '%s'", Filename);
+ Game->LOG(0, "Error opening sound file '%s'", filename);
return E_FAIL;
}
- Common::String strFilename(Filename);
+ Common::String strFilename(filename);
if (strFilename.hasSuffix(".ogg")) {
_stream = Audio::makeVorbisStream(_file, DisposeAfterUse::YES);
} else if (strFilename.hasSuffix(".wav")) {
- warning("BSoundBuffer::LoadFromFile - WAVE not supported yet for %s", Filename);
+ warning("BSoundBuffer::LoadFromFile - WAVE not supported yet for %s", filename);
//_stream = Audio::makeWAVStream(_file, DisposeAfterUse::NO);
} else {
- warning("BSoundBuffer::LoadFromFile - Unknown filetype for %s", Filename);
+ warning("BSoundBuffer::LoadFromFile - Unknown filetype for %s", filename);
}
if (!_stream) {
return E_FAIL;
}
- CBUtils::setString(&_filename, Filename);
+ CBUtils::setString(&_filename, filename);
return S_OK;
#if 0
@@ -134,20 +134,20 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) { _stream = BASS_StreamCreateFileUser(STREAMFILE_NOBUFFER, 0, &fileProc, (void *)_file);
if (!_stream) {
- Game->LOG(0, "BASS error: %d while loading '%s'", BASS_ErrorGetCode(), Filename);
+ Game->LOG(0, "BASS error: %d while loading '%s'", BASS_ErrorGetCode(), filename);
return E_FAIL;
}
- CBUtils::setString(&_filename, Filename);
+ CBUtils::setString(&_filename, filename);
/*
HRESULT res;
bool NewlyCreated = false;
if(!_soundBuffer || ForceReload || _streamed){
- if(!_file) _file = Game->_fileManager->openFile(Filename);
+ if(!_file) _file = Game->_fileManager->openFile(filename);
if(!_file){
- Game->LOG(0, "Error opening sound file '%s'", Filename);
+ Game->LOG(0, "Error opening sound file '%s'", filename);
return E_FAIL;
}
// switch to streamed for big files
@@ -160,7 +160,7 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) { res = InitializeBuffer(_file);
if(FAILED(res)){
- Game->LOG(res, "Error creating sound buffer for file '%s'", Filename);
+ Game->LOG(res, "Error creating sound buffer for file '%s'", filename);
return res;
}
}
@@ -169,8 +169,8 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) { // store filename
if(!_filename){
- _filename = new char[strlen(Filename)+1];
- strcpy(_filename, Filename);
+ _filename = new char[strlen(filename)+1];
+ strcpy(_filename, filename);
}
// close file (if not streaming)
diff --git a/engines/wintermute/Base/BSoundBuffer.h b/engines/wintermute/Base/BSoundBuffer.h index 1e59ef0971..264c5856b2 100644 --- a/engines/wintermute/Base/BSoundBuffer.h +++ b/engines/wintermute/Base/BSoundBuffer.h @@ -71,7 +71,7 @@ public: void setType(TSoundType Type);
- HRESULT loadFromFile(const char *Filename, bool ForceReload = false);
+ HRESULT loadFromFile(const char *filename, bool ForceReload = false);
void setStreaming(bool Streamed, uint32 NumBlocks = 0, uint32 BlockSize = 0);
HRESULT applyFX(TSFXType Type, float Param1, float Param2, float Param3, float Param4);
diff --git a/engines/wintermute/Base/BSoundMgr.cpp b/engines/wintermute/Base/BSoundMgr.cpp index 18e674687c..27e96f7d75 100644 --- a/engines/wintermute/Base/BSoundMgr.cpp +++ b/engines/wintermute/Base/BSoundMgr.cpp @@ -126,20 +126,20 @@ HRESULT CBSoundMgr::initLoop() { //////////////////////////////////////////////////////////////////////////
-CBSoundBuffer *CBSoundMgr::addSound(const char *Filename, TSoundType Type, bool Streamed) {
+CBSoundBuffer *CBSoundMgr::addSound(const char *filename, TSoundType Type, bool Streamed) {
if (!_soundAvailable) return NULL;
CBSoundBuffer *sound;
// try to switch WAV to OGG file (if available)
- AnsiString ext = PathUtil::getExtension(Filename);
+ AnsiString ext = PathUtil::getExtension(filename);
if (StringUtil::compareNoCase(ext, "wav")) {
- AnsiString path = PathUtil::getDirectoryName(Filename);
- AnsiString name = PathUtil::getFileNameWithoutExtension(Filename);
+ AnsiString path = PathUtil::getDirectoryName(filename);
+ AnsiString name = PathUtil::getFileNameWithoutExtension(filename);
AnsiString newFile = PathUtil::combine(path, name + "ogg");
if (Game->_fileManager->hasFile(newFile)) {
- Filename = newFile.c_str();
+ filename = newFile.c_str();
}
}
@@ -150,9 +150,9 @@ CBSoundBuffer *CBSoundMgr::addSound(const char *Filename, TSoundType Type, bool sound->setType(Type);
- HRESULT res = sound->loadFromFile(Filename);
+ HRESULT res = sound->loadFromFile(filename);
if (FAILED(res)) {
- Game->LOG(res, "Error loading sound '%s'", Filename);
+ Game->LOG(res, "Error loading sound '%s'", filename);
delete sound;
return NULL;
}
diff --git a/engines/wintermute/Base/BSoundMgr.h b/engines/wintermute/Base/BSoundMgr.h index 313823449d..ca00ca43ee 100644 --- a/engines/wintermute/Base/BSoundMgr.h +++ b/engines/wintermute/Base/BSoundMgr.h @@ -52,7 +52,7 @@ public: int _volumeSpeech;
int _volumeSFX;
HRESULT removeSound(CBSoundBuffer *Sound);
- CBSoundBuffer *addSound(const char *Filename, TSoundType Type = SOUND_SFX, bool Streamed = false);
+ CBSoundBuffer *addSound(const char *filename, TSoundType Type = SOUND_SFX, bool Streamed = false);
HRESULT addSound(CBSoundBuffer *Sound, TSoundType Type = SOUND_SFX);
HRESULT initLoop();
HRESULT initialize();
diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp index ae5a185cc4..5c44fcf546 100644 --- a/engines/wintermute/Base/BSprite.cpp +++ b/engines/wintermute/Base/BSprite.cpp @@ -122,10 +122,10 @@ HRESULT CBSprite::Draw(int X, int Y, CBObject *Register, float ZoomX, float Zoom //////////////////////////////////////////////////////////////////////
-HRESULT CBSprite::loadFile(const char *Filename, int LifeTime, TSpriteCacheType CacheType) {
- Common::SeekableReadStream *File = Game->_fileManager->openFile(Filename);
+HRESULT CBSprite::loadFile(const char *filename, int LifeTime, TSpriteCacheType CacheType) {
+ Common::SeekableReadStream *File = Game->_fileManager->openFile(filename);
if (!File) {
- Game->LOG(0, "CBSprite::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CBSprite::LoadFile failed for file '%s'", filename);
if (Game->_dEBUG_DebugMode) return loadFile("invalid_debug.bmp", LifeTime, CacheType);
else return loadFile("invalid.bmp", LifeTime, CacheType);
} else {
@@ -135,13 +135,13 @@ HRESULT CBSprite::loadFile(const char *Filename, int LifeTime, TSpriteCacheType HRESULT ret;
- AnsiString ext = PathUtil::getExtension(Filename);
- if (StringUtil::startsWith(Filename, "savegame:", true) || StringUtil::compareNoCase(ext, "bmp") || StringUtil::compareNoCase(ext, "tga") || StringUtil::compareNoCase(ext, "png") || StringUtil::compareNoCase(ext, "jpg")) {
+ AnsiString ext = PathUtil::getExtension(filename);
+ if (StringUtil::startsWith(filename, "savegame:", true) || StringUtil::compareNoCase(ext, "bmp") || StringUtil::compareNoCase(ext, "tga") || StringUtil::compareNoCase(ext, "png") || StringUtil::compareNoCase(ext, "jpg")) {
CBFrame *frame = new CBFrame(Game);
CBSubFrame *subframe = new CBSubFrame(Game);
- subframe->setSurface(Filename, true, 0, 0, 0, LifeTime, true);
+ subframe->setSurface(filename, true, 0, 0, 0, LifeTime, true);
if (subframe->_surface == NULL) {
- Game->LOG(0, "Error loading simple sprite '%s'", Filename);
+ Game->LOG(0, "Error loading simple sprite '%s'", filename);
ret = E_FAIL;
delete frame;
delete subframe;
@@ -153,15 +153,15 @@ HRESULT CBSprite::loadFile(const char *Filename, int LifeTime, TSpriteCacheType ret = S_OK;
}
} else {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer) {
- if (FAILED(ret = loadBuffer(Buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", filename);
delete [] Buffer;
}
}
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
return ret;
@@ -563,13 +563,13 @@ HRESULT CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi else if (strcmp(name, "AddFrame") == 0) {
stack->correctParams(1);
CScValue *Val = stack->pop();
- const char *Filename = NULL;
- if (!Val->isNULL()) Filename = Val->getString();
+ const char *filename = NULL;
+ if (!Val->isNULL()) filename = Val->getString();
CBFrame *Frame = new CBFrame(Game);
- if (Filename != NULL) {
+ if (filename != NULL) {
CBSubFrame *Sub = new CBSubFrame(Game);
- if (SUCCEEDED(Sub->setSurface(Filename))) {
+ if (SUCCEEDED(Sub->setSurface(filename))) {
Sub->setDefaultRect();
Frame->_subframes.Add(Sub);
} else delete Sub;
@@ -589,13 +589,13 @@ HRESULT CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi if (Index < 0) Index = 0;
CScValue *Val = stack->pop();
- const char *Filename = NULL;
- if (!Val->isNULL()) Filename = Val->getString();
+ const char *filename = NULL;
+ if (!Val->isNULL()) filename = Val->getString();
CBFrame *Frame = new CBFrame(Game);
- if (Filename != NULL) {
+ if (filename != NULL) {
CBSubFrame *Sub = new CBSubFrame(Game);
- if (SUCCEEDED(Sub->setSurface(Filename))) Frame->_subframes.Add(Sub);
+ if (SUCCEEDED(Sub->setSurface(filename))) Frame->_subframes.Add(Sub);
else delete Sub;
}
diff --git a/engines/wintermute/Base/BSprite.h b/engines/wintermute/Base/BSprite.h index f65ed130c2..3857be14de 100644 --- a/engines/wintermute/Base/BSprite.h +++ b/engines/wintermute/Base/BSprite.h @@ -67,12 +67,12 @@ public: bool _paused;
bool _finished;
HRESULT loadBuffer(byte *Buffer, bool Compete = true, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
- HRESULT loadFile(const char *Filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
+ HRESULT loadFile(const char *filename, int LifeTime = -1, TSpriteCacheType CacheType = CACHE_ALL);
uint32 _lastFrameTime;
HRESULT Draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, uint32 Alpha = 0xFFFFFFFF);
bool _looping;
int _currentFrame;
- HRESULT AddFrame(const char *Filename, uint32 Delay = 0, int HotspotX = 0, int HotspotY = 0, RECT *Rect = NULL);
+ HRESULT AddFrame(const char *filename, uint32 Delay = 0, int HotspotX = 0, int HotspotY = 0, RECT *Rect = NULL);
CBSprite(CBGame *inGame, CBObject *Owner = NULL);
virtual ~CBSprite();
CBArray<CBFrame *, CBFrame *> _frames;
diff --git a/engines/wintermute/Base/BStringTable.cpp b/engines/wintermute/Base/BStringTable.cpp index be8707b41f..3c51866948 100644 --- a/engines/wintermute/Base/BStringTable.cpp +++ b/engines/wintermute/Base/BStringTable.cpp @@ -169,15 +169,15 @@ const char *CBStringTable::ExpandStatic(const char *String, bool ForceExpand) { //////////////////////////////////////////////////////////////////////////
-HRESULT CBStringTable::loadFile(const char *Filename, bool ClearOld) {
+HRESULT CBStringTable::loadFile(const char *filename, bool ClearOld) {
Game->LOG(0, "Loading string table...");
if (ClearOld) _strings.clear();
uint32 Size;
- byte *Buffer = Game->_fileManager->readWholeFile(Filename, &Size);
+ byte *Buffer = Game->_fileManager->readWholeFile(filename, &Size);
if (Buffer == NULL) {
- Game->LOG(0, "CBStringTable::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CBStringTable::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
diff --git a/engines/wintermute/Base/BStringTable.h b/engines/wintermute/Base/BStringTable.h index 7a6177098c..ea35cf817b 100644 --- a/engines/wintermute/Base/BStringTable.h +++ b/engines/wintermute/Base/BStringTable.h @@ -38,7 +38,7 @@ namespace WinterMute { class CBStringTable : public CBBase {
public:
const char *ExpandStatic(const char *String, bool ForceExpand = false);
- HRESULT loadFile(const char *Filename, bool DeleteAll = true);
+ HRESULT loadFile(const char *filename, bool DeleteAll = true);
void Expand(char **Str, bool ForceExpand = false);
HRESULT AddString(const char *Key, const char *Val, bool ReportDuplicities = true);
CBStringTable(CBGame *inGame);
diff --git a/engines/wintermute/Base/BSubFrame.cpp b/engines/wintermute/Base/BSubFrame.cpp index 5a46237239..ac7ecc8b20 100644 --- a/engines/wintermute/Base/BSubFrame.cpp +++ b/engines/wintermute/Base/BSubFrame.cpp @@ -368,8 +368,8 @@ HRESULT CBSubFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *t _surfaceFilename = NULL;
stack->pushBool(true);
} else {
- const char *Filename = Val->getString();
- if (SUCCEEDED(setSurface(Filename))) {
+ const char *filename = Val->getString();
+ if (SUCCEEDED(setSurface(filename))) {
setDefaultRect();
stack->pushBool(true);
} else stack->pushBool(false);
@@ -549,7 +549,7 @@ const char *CBSubFrame::scToString() { //////////////////////////////////////////////////////////////////////////
-HRESULT CBSubFrame::setSurface(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
+HRESULT CBSubFrame::setSurface(const char *filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
if (_surface) {
Game->_surfaceStorage->removeSurface(_surface);
_surface = NULL;
@@ -558,10 +558,10 @@ HRESULT CBSubFrame::setSurface(const char *Filename, bool default_ck, byte ck_re delete[] _surfaceFilename;
_surfaceFilename = NULL;
- _surface = Game->_surfaceStorage->addSurface(Filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
+ _surface = Game->_surfaceStorage->addSurface(filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
if (_surface) {
- _surfaceFilename = new char[strlen(Filename) + 1];
- strcpy(_surfaceFilename, Filename);
+ _surfaceFilename = new char[strlen(filename) + 1];
+ strcpy(_surfaceFilename, filename);
_cKDefault = default_ck;
_cKRed = ck_red;
diff --git a/engines/wintermute/Base/BSubFrame.h b/engines/wintermute/Base/BSubFrame.h index 25fce16159..a54dedefb0 100644 --- a/engines/wintermute/Base/BSubFrame.h +++ b/engines/wintermute/Base/BSubFrame.h @@ -41,7 +41,7 @@ public: bool _mirrorX;
bool _mirrorY;
bool _decoration;
- HRESULT setSurface(const char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool KeepLoaded = false);
+ HRESULT setSurface(const char *filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool KeepLoaded = false);
HRESULT setSurfaceSimple();
DECLARE_PERSISTENT(CBSubFrame, CBScriptable)
void setDefaultRect();
diff --git a/engines/wintermute/Base/BSurface.h b/engines/wintermute/Base/BSurface.h index 2e745b8ed4..2bfba077ce 100644 --- a/engines/wintermute/Base/BSurface.h +++ b/engines/wintermute/Base/BSurface.h @@ -61,7 +61,7 @@ public: virtual HRESULT displayZoom(int x, int y, RECT rect, float ZoomX, float ZoomY, uint32 alpha = 0xFFFFFFFF, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
virtual HRESULT displayTransform(int x, int y, int hotX, int hotY, RECT rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
virtual HRESULT restore();
- virtual HRESULT create(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime = -1, bool KeepLoaded = false) = 0;
+ virtual HRESULT create(const char *filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime = -1, bool KeepLoaded = false) = 0;
virtual HRESULT create(int Width, int Height);
virtual HRESULT putSurface(const Graphics::Surface &surface, bool hasAlpha = false) {
return E_FAIL;
@@ -72,7 +72,7 @@ public: virtual HRESULT startPixelOp();
virtual HRESULT endPixelOp();
virtual bool isTransparentAtLite(int x, int y);
- void setFilename(const char *Filename);
+ void setFilename(const char *filename);
void setSize(int width, int height);
int _referenceCount;
diff --git a/engines/wintermute/Base/BSurfaceStorage.cpp b/engines/wintermute/Base/BSurfaceStorage.cpp index 53fd036d49..2e98e494b1 100644 --- a/engines/wintermute/Base/BSurfaceStorage.cpp +++ b/engines/wintermute/Base/BSurfaceStorage.cpp @@ -97,16 +97,16 @@ HRESULT CBSurfaceStorage::removeSurface(CBSurface *surface) { //////////////////////////////////////////////////////////////////////
-CBSurface *CBSurfaceStorage::addSurface(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
+CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
for (int i = 0; i < _surfaces.GetSize(); i++) {
- if (scumm_stricmp(_surfaces[i]->_filename, Filename) == 0) {
+ if (scumm_stricmp(_surfaces[i]->_filename, filename) == 0) {
_surfaces[i]->_referenceCount++;
return _surfaces[i];
}
}
- if (!Game->_fileManager->hasFile(Filename)) {
- if (Filename) Game->LOG(0, "Missing image: '%s'", Filename);
+ if (!Game->_fileManager->hasFile(filename)) {
+ if (filename) Game->LOG(0, "Missing image: '%s'", filename);
if (Game->_dEBUG_DebugMode)
return addSurface("invalid_debug.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
else
@@ -118,7 +118,7 @@ CBSurface *CBSurfaceStorage::addSurface(const char *Filename, bool default_ck, b if (!surface) return NULL;
- if (FAILED(surface->create(Filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded))) {
+ if (FAILED(surface->create(filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded))) {
delete surface;
return NULL;
} else {
diff --git a/engines/wintermute/Base/BSurfaceStorage.h b/engines/wintermute/Base/BSurfaceStorage.h index ac624e70d1..adeb87c50f 100644 --- a/engines/wintermute/Base/BSurfaceStorage.h +++ b/engines/wintermute/Base/BSurfaceStorage.h @@ -45,7 +45,7 @@ public: //DECLARE_PERSISTENT(CBSurfaceStorage, CBBase);
HRESULT restoreAll();
- CBSurface *addSurface(const char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool keepLoaded = false);
+ CBSurface *addSurface(const char *filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool keepLoaded = false);
HRESULT removeSurface(CBSurface *surface);
CBSurfaceStorage(CBGame *inGame);
virtual ~CBSurfaceStorage();
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp index e38abb5005..b80d6b0b68 100644 --- a/engines/wintermute/Base/PartEmitter.cpp +++ b/engines/wintermute/Base/PartEmitter.cpp @@ -116,32 +116,32 @@ CPartEmitter::~CPartEmitter(void) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::addSprite(const char *Filename) {
- if (!Filename) return E_FAIL;
+HRESULT CPartEmitter::addSprite(const char *filename) {
+ if (!filename) return E_FAIL;
// do we already have the file?
for (int i = 0; i < _sprites.GetSize(); i++) {
- if (scumm_stricmp(Filename, _sprites[i]) == 0) return S_OK;
+ if (scumm_stricmp(filename, _sprites[i]) == 0) return S_OK;
}
// check if file exists
- Common::SeekableReadStream *File = Game->_fileManager->openFile(Filename);
+ Common::SeekableReadStream *File = Game->_fileManager->openFile(filename);
if (!File) {
- Game->LOG(0, "Sprite '%s' not found", Filename);
+ Game->LOG(0, "Sprite '%s' not found", filename);
return E_FAIL;
} else Game->_fileManager->closeFile(File);
- char *Str = new char[strlen(Filename) + 1];
- strcpy(Str, Filename);
+ char *Str = new char[strlen(filename) + 1];
+ strcpy(Str, filename);
_sprites.Add(Str);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartEmitter::removeSprite(const char *Filename) {
+HRESULT CPartEmitter::removeSprite(const char *filename) {
for (int i = 0; i < _sprites.GetSize(); i++) {
- if (scumm_stricmp(Filename, _sprites[i]) == 0) {
+ if (scumm_stricmp(filename, _sprites[i]) == 0) {
delete [] _sprites[i];
_sprites.RemoveAt(i);
return S_OK;
diff --git a/engines/wintermute/Base/PartEmitter.h b/engines/wintermute/Base/PartEmitter.h index 7464173eb3..b088ee3920 100644 --- a/engines/wintermute/Base/PartEmitter.h +++ b/engines/wintermute/Base/PartEmitter.h @@ -107,8 +107,8 @@ public: HRESULT display(CBRegion *Region);
HRESULT sortParticlesByZ();
- HRESULT addSprite(const char *Filename);
- HRESULT removeSprite(const char *Filename);
+ HRESULT addSprite(const char *filename);
+ HRESULT removeSprite(const char *filename);
HRESULT setBorder(int X, int Y, int Width, int Height);
HRESULT setBorderThickness(int ThicknessLeft, int ThicknessRight, int ThicknessTop, int ThicknessBottom);
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp index 9c938ac835..236481aec2 100644 --- a/engines/wintermute/Base/PartParticle.cpp +++ b/engines/wintermute/Base/PartParticle.cpp @@ -72,8 +72,8 @@ CPartParticle::~CPartParticle(void) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CPartParticle::setSprite(const char *Filename) {
- if (_sprite && _sprite->_filename && scumm_stricmp(Filename, _sprite->_filename) == 0) {
+HRESULT CPartParticle::setSprite(const char *filename) {
+ if (_sprite && _sprite->_filename && scumm_stricmp(filename, _sprite->_filename) == 0) {
_sprite->Reset();
return S_OK;
}
@@ -83,7 +83,7 @@ HRESULT CPartParticle::setSprite(const char *Filename) { CSysClassRegistry::getInstance()->_disabled = true;
_sprite = new CBSprite(Game, Game);
- if (_sprite && SUCCEEDED(_sprite->loadFile(Filename))) {
+ if (_sprite && SUCCEEDED(_sprite->loadFile(filename))) {
CSysClassRegistry::getInstance()->_disabled = false;
return S_OK;
} else {
@@ -240,13 +240,13 @@ HRESULT CPartParticle::persist(CBPersistMgr *persistMgr) { if (persistMgr->_saving) {
persistMgr->transfer(TMEMBER(_sprite->_filename));
} else {
- char *Filename;
- persistMgr->transfer(TMEMBER(Filename));
+ char *filename;
+ persistMgr->transfer(TMEMBER(filename));
CSysClassRegistry::getInstance()->_disabled = true;
- setSprite(Filename);
+ setSprite(filename);
CSysClassRegistry::getInstance()->_disabled = false;
- delete[] Filename;
- Filename = NULL;
+ delete[] filename;
+ filename = NULL;
}
return S_OK;
diff --git a/engines/wintermute/Base/PartParticle.h b/engines/wintermute/Base/PartParticle.h index 9edc999426..e20413726a 100644 --- a/engines/wintermute/Base/PartParticle.h +++ b/engines/wintermute/Base/PartParticle.h @@ -71,7 +71,7 @@ public: HRESULT update(CPartEmitter *Emitter, uint32 CurrentTime, uint32 TimerDelta);
HRESULT display(CPartEmitter *Emitter);
- HRESULT setSprite(const char *Filename);
+ HRESULT setSprite(const char *filename);
HRESULT fadeIn(uint32 CurrentTime, int FadeTime);
HRESULT fadeOut(uint32 CurrentTime, int FadeTime);
diff --git a/engines/wintermute/Base/file/BSaveThumbFile.cpp b/engines/wintermute/Base/file/BSaveThumbFile.cpp index 5f70f7636f..b64efe9ab6 100644 --- a/engines/wintermute/Base/file/BSaveThumbFile.cpp +++ b/engines/wintermute/Base/file/BSaveThumbFile.cpp @@ -70,7 +70,7 @@ HRESULT CBSaveThumbFile::open(const Common::String &filename) { delete [] tempFilename;
char slotFilename[MAX_PATH + 1];
- Game->GetSaveSlotFilename(slot, slotFilename);
+ Game->getSaveSlotFilename(slot, slotFilename);
CBPersistMgr *pm = new CBPersistMgr(Game);
if (!pm) return E_FAIL;
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp index e31afde2e9..dab7786e66 100644 --- a/engines/wintermute/Base/scriptables/SXFile.cpp +++ b/engines/wintermute/Base/scriptables/SXFile.cpp @@ -111,9 +111,9 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this //////////////////////////////////////////////////////////////////////////
if (strcmp(name, "SetFilename") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
cleanup();
- CBUtils::setString(&_filename, Filename);
+ CBUtils::setString(&_filename, filename);
stack->pushNULL();
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp index b0fb447e17..c9c62e5dbe 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.cpp +++ b/engines/wintermute/Base/scriptables/ScEngine.cpp @@ -189,9 +189,9 @@ HRESULT CScEngine::cleanup() { //////////////////////////////////////////////////////////////////////////
-byte *WINAPI CScEngine::loadFile(void *Data, char *Filename, uint32 *Size) {
- CBGame *Game = (CBGame *)Data;
- return Game->_fileManager->readWholeFile(Filename, Size);
+byte *WINAPI CScEngine::loadFile(void *data, char *filename, uint32 *size) {
+ CBGame *Game = (CBGame *)data;
+ return Game->_fileManager->readWholeFile(filename, size);
}
@@ -232,32 +232,32 @@ void WINAPI CScEngine::ParseElement(void *Data, int Line, int Type, void *Elemen //////////////////////////////////////////////////////////////////////////
-CScScript *CScEngine::RunScript(const char *Filename, CBScriptHolder *Owner) {
- byte *CompBuffer;
- uint32 CompSize;
+CScScript *CScEngine::RunScript(const char *filename, CBScriptHolder *owner) {
+ byte *compBuffer;
+ uint32 compSize;
// get script from cache
- CompBuffer = GetCompiledScript(Filename, &CompSize);
- if (!CompBuffer) return NULL;
+ compBuffer = GetCompiledScript(filename, &compSize);
+ if (!compBuffer) return NULL;
// add new script
CScScript *script = new CScScript(Game, this);
- HRESULT ret = script->Create(Filename, CompBuffer, CompSize, Owner);
+ HRESULT ret = script->Create(filename, compBuffer, compSize, owner);
if (FAILED(ret)) {
- Game->LOG(ret, "Error running script '%s'...", Filename);
+ Game->LOG(ret, "Error running script '%s'...", filename);
delete script;
return NULL;
} else {
// publish the "self" pseudo-variable
CScValue val(Game);
- if (Owner)val.setNative(Owner, true);
+ if (owner)val.setNative(owner, true);
else val.setNULL();
script->_globals->setProp("self", &val);
script->_globals->setProp("this", &val);
_scripts.Add(script);
- Game->getDebugMgr()->OnScriptInit(script);
+ Game->getDebugMgr()->onScriptInit(script);
return script;
}
@@ -265,13 +265,13 @@ CScScript *CScEngine::RunScript(const char *Filename, CBScriptHolder *Owner) { //////////////////////////////////////////////////////////////////////////
-byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool IgnoreCache) {
+byte *CScEngine::GetCompiledScript(const char *filename, uint32 *OutSize, bool IgnoreCache) {
int i;
// is script in cache?
if (!IgnoreCache) {
for (i = 0; i < MAX_CACHED_SCRIPTS; i++) {
- if (_cachedScripts[i] && scumm_stricmp(_cachedScripts[i]->_filename.c_str(), Filename) == 0) {
+ if (_cachedScripts[i] && scumm_stricmp(_cachedScripts[i]->_filename.c_str(), filename) == 0) {
_cachedScripts[i]->_timestamp = CBPlatform::GetTime();
*OutSize = _cachedScripts[i]->_size;
return _cachedScripts[i]->_buffer;
@@ -286,9 +286,9 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I uint32 Size;
- byte *Buffer = Game->_fileManager->readWholeFile(Filename, &Size);
+ byte *Buffer = Game->_fileManager->readWholeFile(filename, &Size);
if (!Buffer) {
- Game->LOG(0, "CScEngine::GetCompiledScript - error opening script '%s'", Filename);
+ Game->LOG(0, "CScEngine::GetCompiledScript - error opening script '%s'", filename);
return NULL;
}
@@ -298,7 +298,7 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I CompSize = Size;
} else {
if (!_compilerAvailable) {
- Game->LOG(0, "CScEngine::GetCompiledScript - script '%s' needs to be compiled but compiler is not available", Filename);
+ Game->LOG(0, "CScEngine::GetCompiledScript - script '%s' needs to be compiled but compiler is not available", filename);
delete [] Buffer;
return NULL;
}
@@ -317,10 +317,10 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I Game->PublishNatives();
// We have const char* everywhere but in the DLL-interfaces...
- char *tempFileName = new char[strlen(Filename) + 1];
- memcpy(tempFileName, Filename, strlen(Filename) + 1);
+ char *tempFileName = new char[strlen(filename) + 1];
+ memcpy(tempFileName, filename, strlen(filename) + 1);
- SetFileToCompile(Filename);
+ SetFileToCompile(filename);
CompBuffer = ExtCompileFile(tempFileName, &CompSize);
delete[] tempFileName;
if (!CompBuffer) {
@@ -333,7 +333,7 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I byte *ret = NULL;
// add script to cache
- CScCachedScript *CachedScript = new CScCachedScript(Filename, CompBuffer, CompSize);
+ CScCachedScript *CachedScript = new CScCachedScript(filename, CompBuffer, CompSize);
if (CachedScript) {
int index = 0;
uint32 MinTime = CBPlatform::GetTime();
@@ -389,7 +389,7 @@ HRESULT CScEngine::Tick() { }
if(!obj_found) _scripts[i]->finish(); // _waitObject no longer exists
*/
- if (Game->ValidObject(_scripts[i]->_waitObject)) {
+ if (Game->validObject(_scripts[i]->_waitObject)) {
if (_scripts[i]->_waitObject->isReady()) _scripts[i]->Run();
} else _scripts[i]->finish();
break;
@@ -490,7 +490,7 @@ HRESULT CScEngine::RemoveFinishedScripts() { 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]);
+ Game->getDebugMgr()->onScriptShutdown(_scripts[i]);
delete _scripts[i];
_scripts.RemoveAt(i);
i--;
@@ -615,11 +615,11 @@ HRESULT CScEngine::ResumeAll() { //////////////////////////////////////////////////////////////////////////
-HRESULT CScEngine::SetFileToCompile(const char *Filename) {
+HRESULT CScEngine::SetFileToCompile(const char *filename) {
delete[] _fileToCompile;
- _fileToCompile = new char[strlen(Filename) + 1];
+ _fileToCompile = new char[strlen(filename) + 1];
if (_fileToCompile) {
- strcpy(_fileToCompile, Filename);
+ strcpy(_fileToCompile, filename);
return S_OK;
} else return E_FAIL;
}
@@ -801,10 +801,10 @@ HRESULT CScEngine::LoadBreakpoints() { //////////////////////////////////////////////////////////////////////////
-void CScEngine::AddScriptTime(const char *Filename, uint32 Time) {
+void CScEngine::AddScriptTime(const char *filename, uint32 Time) {
if (!_isProfiling) return;
- AnsiString fileName = Filename;
+ AnsiString fileName = filename;
StringUtil::toLowerCase(fileName);
_scriptTimes[fileName] += Time;
}
diff --git a/engines/wintermute/Base/scriptables/ScEngine.h b/engines/wintermute/Base/scriptables/ScEngine.h index 703034964e..42440c8a2d 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.h +++ b/engines/wintermute/Base/scriptables/ScEngine.h @@ -57,12 +57,12 @@ class CScEngine : public CBBase { public:
class CScCachedScript {
public:
- CScCachedScript(const char *Filename, byte *Buffer, uint32 Size) {
+ CScCachedScript(const char *filename, byte *Buffer, uint32 Size) {
_timestamp = CBPlatform::GetTime();
_buffer = new byte[Size];
if (_buffer) memcpy(_buffer, Buffer, Size);
_size = Size;
- _filename = Filename;
+ _filename = filename;
};
~CScCachedScript() {
@@ -77,8 +77,8 @@ public: class CScBreakpoint {
public:
- CScBreakpoint(const char *Filename) {
- _filename = Filename;
+ CScBreakpoint(const char *filename) {
+ _filename = filename;
}
~CScBreakpoint() {
@@ -116,7 +116,7 @@ public: PARSE_ELEMENT_CALLBACK _parseElementCallback;
void *_parseElementCallbackData;
- HRESULT SetFileToCompile(const char *Filename);
+ HRESULT SetFileToCompile(const char *filename);
char *_fileToCompile;
CScScript *_currentScript;
HRESULT ResumeAll();
@@ -125,13 +125,13 @@ public: HRESULT ResetObject(CBObject *Object);
HRESULT ResetScript(CScScript *script);
HRESULT EmptyScriptCache();
- byte *GetCompiledScript(const char *Filename, uint32 *OutSize, bool IgnoreCache = false);
+ byte *GetCompiledScript(const char *filename, uint32 *OutSize, bool IgnoreCache = false);
DECLARE_PERSISTENT(CScEngine, CBBase)
HRESULT cleanup();
int GetNumScripts(int *Running = NULL, int *Waiting = NULL, int *Persistent = NULL);
HRESULT Tick();
CScValue *_globals;
- CScScript *RunScript(const char *Filename, CBScriptHolder *Owner = NULL);
+ CScScript *RunScript(const char *filename, CBScriptHolder *Owner = NULL);
bool _compilerAvailable;
HINSTANCE _compilerDLL;
CScEngine(CBGame *inGame);
@@ -155,7 +155,7 @@ public: return _isProfiling;
}
- void AddScriptTime(const char *Filename, uint32 Time);
+ void AddScriptTime(const char *filename, uint32 Time);
void DumpStats();
private:
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp index f255d2aa8a..ddb862460b 100644 --- a/engines/wintermute/Base/scriptables/ScScript.cpp +++ b/engines/wintermute/Base/scriptables/ScScript.cpp @@ -240,7 +240,7 @@ HRESULT CScScript::InitTables() { //////////////////////////////////////////////////////////////////////////
-HRESULT CScScript::Create(const char *Filename, byte *Buffer, uint32 Size, CBScriptHolder *Owner) {
+HRESULT CScScript::Create(const char *filename, byte *Buffer, uint32 Size, CBScriptHolder *Owner) {
cleanup();
_thread = false;
@@ -249,8 +249,8 @@ HRESULT CScScript::Create(const char *Filename, byte *Buffer, uint32 Size, CBScr delete[] _threadEvent;
_threadEvent = NULL;
- _filename = new char[strlen(Filename) + 1];
- if (_filename) strcpy(_filename, Filename);
+ _filename = new char[strlen(filename) + 1];
+ if (_filename) strcpy(_filename, filename);
_buffer = new byte [Size];
if (!_buffer) return E_FAIL;
@@ -491,11 +491,11 @@ HRESULT CScScript::ExecuteInstruction() { if (_scopeStack->_sP < 0) {
_globals->setProp(_symbols[dw], _operand);
if (Game->getDebugMgr()->_enabled)
- Game->getDebugMgr()->OnVariableInit(WME_DBGVAR_SCRIPT, this, NULL, _globals->getProp(_symbols[dw]), _symbols[dw]);
+ Game->getDebugMgr()->onVariableInit(WME_DBGVAR_SCRIPT, this, NULL, _globals->getProp(_symbols[dw]), _symbols[dw]);
} else {
_scopeStack->getTop()->setProp(_symbols[dw], _operand);
if (Game->getDebugMgr()->_enabled)
- Game->getDebugMgr()->OnVariableInit(WME_DBGVAR_SCOPE, this, _scopeStack->getTop(), _scopeStack->getTop()->getProp(_symbols[dw]), _symbols[dw]);
+ Game->getDebugMgr()->onVariableInit(WME_DBGVAR_SCOPE, this, _scopeStack->getTop(), _scopeStack->getTop()->getProp(_symbols[dw]), _symbols[dw]);
}
break;
@@ -510,20 +510,20 @@ HRESULT CScScript::ExecuteInstruction() { _engine->_globals->setProp(_symbols[dw], _operand, false, inst == II_DEF_CONST_VAR);
if (Game->getDebugMgr()->_enabled)
- Game->getDebugMgr()->OnVariableInit(WME_DBGVAR_GLOBAL, this, NULL, _engine->_globals->getProp(_symbols[dw]), _symbols[dw]);
+ Game->getDebugMgr()->onVariableInit(WME_DBGVAR_GLOBAL, this, NULL, _engine->_globals->getProp(_symbols[dw]), _symbols[dw]);
}
break;
}
case II_RET:
if (_scopeStack->_sP >= 0 && _callStack->_sP >= 0) {
- Game->getDebugMgr()->OnScriptShutdownScope(this, _scopeStack->getTop());
+ Game->getDebugMgr()->onScriptShutdownScope(this, _scopeStack->getTop());
_scopeStack->pop();
_iP = (uint32)_callStack->pop()->getInt();
- if (_scopeStack->_sP < 0) Game->getDebugMgr()->OnScriptChangeScope(this, NULL);
- else Game->getDebugMgr()->OnScriptChangeScope(this, _scopeStack->getTop());
+ if (_scopeStack->_sP < 0) Game->getDebugMgr()->onScriptChangeScope(this, NULL);
+ else Game->getDebugMgr()->onScriptChangeScope(this, _scopeStack->getTop());
} else {
if (_thread) {
_state = SCRIPT_THREAD_FINISHED;
@@ -640,8 +640,8 @@ HRESULT CScScript::ExecuteInstruction() { _operand->setNULL();
_scopeStack->push(_operand);
- if (_scopeStack->_sP < 0) Game->getDebugMgr()->OnScriptChangeScope(this, NULL);
- else Game->getDebugMgr()->OnScriptChangeScope(this, _scopeStack->getTop());
+ if (_scopeStack->_sP < 0) Game->getDebugMgr()->onScriptChangeScope(this, NULL);
+ else Game->getDebugMgr()->onScriptChangeScope(this, _scopeStack->getTop());
break;
@@ -692,7 +692,7 @@ HRESULT CScScript::ExecuteInstruction() { }
if (Game->getDebugMgr()->_enabled)
- Game->getDebugMgr()->OnVariableChangeValue(var, val);
+ Game->getDebugMgr()->onVariableChangeValue(var, val);
}
break;
@@ -758,7 +758,7 @@ HRESULT CScScript::ExecuteInstruction() { } else var->setProp(str, val);
if (Game->getDebugMgr()->_enabled)
- Game->getDebugMgr()->OnVariableChangeValue(var, NULL);
+ Game->getDebugMgr()->onVariableChangeValue(var, NULL);
break;
}
@@ -1023,16 +1023,16 @@ HRESULT CScScript::ExecuteInstruction() { if (NewLine != _currentLine) {
_currentLine = NewLine;
if (Game->getDebugMgr()->_enabled) {
- Game->getDebugMgr()->OnScriptChangeLine(this, _currentLine);
+ Game->getDebugMgr()->onScriptChangeLine(this, _currentLine);
for (int i = 0; i < _breakpoints.GetSize(); i++) {
if (_breakpoints[i] == _currentLine) {
- Game->getDebugMgr()->OnScriptHitBreakpoint(this);
+ Game->getDebugMgr()->onScriptHitBreakpoint(this);
Sleep(0);
break;
}
}
if (_tracingMode) {
- Game->getDebugMgr()->OnScriptHitBreakpoint(this);
+ Game->getDebugMgr()->onScriptHitBreakpoint(this);
Sleep(0);
break;
}
@@ -1259,7 +1259,7 @@ CScScript *CScScript::InvokeEventHandler(const char *EventName, bool Unbreakable if (SUCCEEDED(ret)) {
thread->_unbreakable = Unbreakable;
_engine->_scripts.Add(thread);
- Game->getDebugMgr()->OnScriptEventThreadInit(thread, this, EventName);
+ Game->getDebugMgr()->onScriptEventThreadInit(thread, this, EventName);
return thread;
} else {
delete thread;
diff --git a/engines/wintermute/Base/scriptables/ScScript.h b/engines/wintermute/Base/scriptables/ScScript.h index 308c6d9a86..812ce0359f 100644 --- a/engines/wintermute/Base/scriptables/ScScript.h +++ b/engines/wintermute/Base/scriptables/ScScript.h @@ -141,7 +141,7 @@ public: uint32 GetDWORD();
double GetFloat();
void cleanup();
- HRESULT Create(const char *Filename, byte *Buffer, uint32 Size, CBScriptHolder *Owner);
+ HRESULT Create(const char *filename, byte *Buffer, uint32 Size, CBScriptHolder *Owner);
uint32 _iP;
private:
void readHeader();
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp index 5f373498aa..ff839bb637 100644 --- a/engines/wintermute/PlatformSDL.cpp +++ b/engines/wintermute/PlatformSDL.cpp @@ -54,27 +54,27 @@ void CBPlatform::HandleEvent(Common::Event *event) { case Common::EVENT_LBUTTONDOWN:
if (Game) {
- if (Game->isLeftDoubleClick()) Game->OnMouseLeftDblClick();
- else Game->OnMouseLeftDown();
+ if (Game->isLeftDoubleClick()) Game->onMouseLeftDblClick();
+ else Game->onMouseLeftDown();
}
break;
case Common::EVENT_RBUTTONDOWN:
if (Game) {
- if (Game->isRightDoubleClick()) Game->OnMouseRightDblClick();
- else Game->OnMouseRightDown();
+ if (Game->isRightDoubleClick()) Game->onMouseRightDblClick();
+ else Game->onMouseRightDown();
}
break;
case Common::EVENT_MBUTTONDOWN:
- if (Game) Game->OnMouseMiddleDown();
+ if (Game) Game->onMouseMiddleDown();
break;
case Common::EVENT_LBUTTONUP:
- if (Game) Game->OnMouseLeftUp();
+ if (Game) Game->onMouseLeftUp();
break;
case Common::EVENT_RBUTTONUP:
- if (Game) Game->OnMouseRightUp();
+ if (Game) Game->onMouseRightUp();
break;
case Common::EVENT_MBUTTONUP:
- if (Game) Game->OnMouseMiddleUp();
+ if (Game) Game->onMouseMiddleUp();
break;
case Common::EVENT_KEYDOWN:
if (Game) Game->handleKeypress(event);
@@ -139,7 +139,7 @@ void CBPlatform::HandleEvent(Common::Event *event) { Game->_quitting = true;
}
#else
- if (Game) Game->OnWindowClose();
+ if (Game) Game->onWindowClose();
#endif
break;
diff --git a/engines/wintermute/Sys/SysClassRegistry.cpp b/engines/wintermute/Sys/SysClassRegistry.cpp index 540008571f..340c22edda 100644 --- a/engines/wintermute/Sys/SysClassRegistry.cpp +++ b/engines/wintermute/Sys/SysClassRegistry.cpp @@ -179,7 +179,7 @@ HRESULT CSysClassRegistry::saveTable(CBGame *Game, CBPersistMgr *persistMgr, boo if (!quickSave) {
Game->_indicatorProgress = (int)(50.0f / (float)((float)_classes.size() / (float)counter));
- Game->DisplayContent(false);
+ Game->displayContent(false);
Game->_renderer->flip();
}
@@ -211,7 +211,7 @@ HRESULT CSysClassRegistry::loadTable(CBGame *Game, CBPersistMgr *persistMgr) { for (uint32 i = 0; i < numClasses; i++) {
Game->_indicatorProgress = (int)(50.0f / (float)((float)numClasses / (float)i));
- Game->DisplayContentSimple();
+ Game->displayContentSimple();
Game->_renderer->flip();
Common::String className = persistMgr->getStringObj();
@@ -245,7 +245,7 @@ HRESULT CSysClassRegistry::saveInstances(CBGame *Game, CBPersistMgr *persistMgr, if (!quickSave) {
if (counter % 20 == 0) {
Game->_indicatorProgress = 50 + 50.0f / (float)((float)_classes.size() / (float)counter);
- Game->DisplayContent(false);
+ Game->displayContent(false);
Game->_renderer->flip();
}
}
@@ -265,7 +265,7 @@ HRESULT CSysClassRegistry::loadInstances(CBGame *Game, CBPersistMgr *persistMgr) for (int i = 0; i < numInstances; i++) {
if (i % 20 == 0) {
Game->_indicatorProgress = 50 + 50.0f / (float)((float)numInstances / (float)i);
- Game->DisplayContentSimple();
+ Game->displayContentSimple();
Game->_renderer->flip();
}
diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp index 69809874bf..dffb9532da 100644 --- a/engines/wintermute/UI/UIButton.cpp +++ b/engines/wintermute/UI/UIButton.cpp @@ -95,19 +95,19 @@ CUIButton::~CUIButton() { //////////////////////////////////////////////////////////////////////////
-HRESULT CUIButton::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CUIButton::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing BUTTON file '%s'", filename);
delete [] Buffer;
@@ -747,8 +747,8 @@ HRESULT CUIButton::scCallMethod(CScScript *script, CScStack *stack, CScStack *th delete _imageDisable;
_imageDisable = new CBSprite(Game);
- const char *Filename = stack->pop()->getString();
- if (!_imageDisable || FAILED(_imageDisable->loadFile(Filename))) {
+ const char *filename = stack->pop()->getString();
+ if (!_imageDisable || FAILED(_imageDisable->loadFile(filename))) {
delete _imageDisable;
_imageDisable = NULL;
stack->pushBool(false);
@@ -788,8 +788,8 @@ HRESULT CUIButton::scCallMethod(CScScript *script, CScStack *stack, CScStack *th delete _imageHover;
_imageHover = new CBSprite(Game);
- const char *Filename = stack->pop()->getString();
- if (!_imageHover || FAILED(_imageHover->loadFile(Filename))) {
+ const char *filename = stack->pop()->getString();
+ if (!_imageHover || FAILED(_imageHover->loadFile(filename))) {
delete _imageHover;
_imageHover = NULL;
stack->pushBool(false);
@@ -828,8 +828,8 @@ HRESULT CUIButton::scCallMethod(CScScript *script, CScStack *stack, CScStack *th delete _imagePress;
_imagePress = new CBSprite(Game);
- const char *Filename = stack->pop()->getString();
- if (!_imagePress || FAILED(_imagePress->loadFile(Filename))) {
+ const char *filename = stack->pop()->getString();
+ if (!_imagePress || FAILED(_imagePress->loadFile(filename))) {
delete _imagePress;
_imagePress = NULL;
stack->pushBool(false);
@@ -868,8 +868,8 @@ HRESULT CUIButton::scCallMethod(CScScript *script, CScStack *stack, CScStack *th delete _imageFocus;
_imageFocus = new CBSprite(Game);
- const char *Filename = stack->pop()->getString();
- if (!_imageFocus || FAILED(_imageFocus->loadFile(Filename))) {
+ const char *filename = stack->pop()->getString();
+ if (!_imageFocus || FAILED(_imageFocus->loadFile(filename))) {
delete _imageFocus;
_imageFocus = NULL;
stack->pushBool(false);
diff --git a/engines/wintermute/UI/UIButton.h b/engines/wintermute/UI/UIButton.h index e89c37aa0c..856afc5be0 100644 --- a/engines/wintermute/UI/UIButton.h +++ b/engines/wintermute/UI/UIButton.h @@ -63,7 +63,7 @@ public: CUITiledImage *_backFocus;
CUIButton(CBGame *inGame = NULL);
virtual ~CUIButton();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp index d87eeea630..87d70c8f88 100644 --- a/engines/wintermute/UI/UIEdit.cpp +++ b/engines/wintermute/UI/UIEdit.cpp @@ -94,19 +94,19 @@ CUIEdit::~CUIEdit() { //////////////////////////////////////////////////////////////////////////
-HRESULT CUIEdit::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CUIEdit::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing EDIT file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/UI/UIEdit.h b/engines/wintermute/UI/UIEdit.h index 2ee2d3ea3a..0db087e4df 100644 --- a/engines/wintermute/UI/UIEdit.h +++ b/engines/wintermute/UI/UIEdit.h @@ -56,7 +56,7 @@ public: CUIEdit(CBGame *inGame);
virtual ~CUIEdit();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/UI/UIEntity.cpp b/engines/wintermute/UI/UIEntity.cpp index a2b065dd3d..a396ae0560 100644 --- a/engines/wintermute/UI/UIEntity.cpp +++ b/engines/wintermute/UI/UIEntity.cpp @@ -49,25 +49,25 @@ CUIEntity::CUIEntity(CBGame *inGame): CUIObject(inGame) { //////////////////////////////////////////////////////////////////////////
CUIEntity::~CUIEntity() {
- if (_entity) Game->UnregisterObject(_entity);
+ if (_entity) Game->unregisterObject(_entity);
_entity = NULL;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CUIEntity::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CUIEntity::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing ENTITY container file '%s'", filename);
delete [] Buffer;
@@ -209,7 +209,7 @@ HRESULT CUIEntity::saveAsText(CBDynBuffer *Buffer, int Indent) { //////////////////////////////////////////////////////////////////////////
HRESULT CUIEntity::setEntity(const char *filename) {
- if (_entity) Game->UnregisterObject(_entity);
+ if (_entity) Game->unregisterObject(_entity);
_entity = new CAdEntity(Game);
if (!_entity || FAILED(_entity->loadFile(filename))) {
delete _entity;
@@ -219,7 +219,7 @@ HRESULT CUIEntity::setEntity(const char *filename) { _entity->_nonIntMouseEvents = true;
_entity->_sceneIndependent = true;
_entity->makeFreezable(false);
- Game->RegisterObject(_entity);
+ Game->registerObject(_entity);
}
return S_OK;
}
@@ -270,9 +270,9 @@ HRESULT CUIEntity::scCallMethod(CScScript *script, CScStack *stack, CScStack *th else if (strcmp(name, "SetEntity") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->getString();
+ const char *filename = stack->pop()->getString();
- if (SUCCEEDED(setEntity(Filename)))
+ if (SUCCEEDED(setEntity(filename)))
stack->pushBool(true);
else
stack->pushBool(false);
diff --git a/engines/wintermute/UI/UIEntity.h b/engines/wintermute/UI/UIEntity.h index 670973fdeb..8722ac304b 100644 --- a/engines/wintermute/UI/UIEntity.h +++ b/engines/wintermute/UI/UIEntity.h @@ -38,13 +38,13 @@ public: DECLARE_PERSISTENT(CUIEntity, CUIObject)
CUIEntity(CBGame *inGame);
virtual ~CUIEntity();
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
virtual HRESULT display(int OffsetX = 0, int OffsetY = 0);
CAdEntity *_entity;
- HRESULT setEntity(const char *Filename);
+ HRESULT setEntity(const char *filename);
// scripting interface
virtual CScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp index 7a3cd3e8a0..26d903990d 100644 --- a/engines/wintermute/UI/UIObject.cpp +++ b/engines/wintermute/UI/UIObject.cpp @@ -163,7 +163,7 @@ HRESULT CUIObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th stack->correctParams(1);
CScValue *Val = stack->pop();
- /* const char *Filename = */ Val->getString();
+ /* const char *filename = */ Val->getString();
delete _image;
_image = NULL;
diff --git a/engines/wintermute/UI/UIText.cpp b/engines/wintermute/UI/UIText.cpp index 0d7966188e..afb6a6976c 100644 --- a/engines/wintermute/UI/UIText.cpp +++ b/engines/wintermute/UI/UIText.cpp @@ -95,19 +95,19 @@ HRESULT CUIText::display(int OffsetX, int OffsetY) { //////////////////////////////////////////////////////////////////////////
-HRESULT CUIText::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CUIText::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CUIText::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CUIText::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing STATIC file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/UI/UIText.h b/engines/wintermute/UI/UIText.h index 1f5029e4a6..5ef3c85df9 100644 --- a/engines/wintermute/UI/UIText.h +++ b/engines/wintermute/UI/UIText.h @@ -43,7 +43,7 @@ public: virtual ~CUIText();
TTextAlign _textAlign;
TVerticalAlign _verticalAlign;
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/UI/UITiledImage.cpp b/engines/wintermute/UI/UITiledImage.cpp index e7734acdc5..d0f9cdb0f2 100644 --- a/engines/wintermute/UI/UITiledImage.cpp +++ b/engines/wintermute/UI/UITiledImage.cpp @@ -119,19 +119,19 @@ HRESULT CUITiledImage::display(int X, int Y, int Width, int Height) { //////////////////////////////////////////////////////////////////////////
-HRESULT CUITiledImage::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CUITiledImage::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TILED_IMAGE file '%s'", filename);
delete [] Buffer;
diff --git a/engines/wintermute/UI/UITiledImage.h b/engines/wintermute/UI/UITiledImage.h index d571f1354f..16712746c5 100644 --- a/engines/wintermute/UI/UITiledImage.h +++ b/engines/wintermute/UI/UITiledImage.h @@ -38,7 +38,7 @@ class CUITiledImage : public CBObject { public:
DECLARE_PERSISTENT(CUITiledImage, CBObject)
void correctSize(int *Width, int *Height);
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
virtual HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp index 5ed33ffd7a..fd36971847 100644 --- a/engines/wintermute/UI/UIWindow.cpp +++ b/engines/wintermute/UI/UIWindow.cpp @@ -200,19 +200,19 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) { //////////////////////////////////////////////////////////////////////////
-HRESULT CUIWindow::loadFile(const char *Filename) {
- byte *Buffer = Game->_fileManager->readWholeFile(Filename);
+HRESULT CUIWindow::loadFile(const char *filename) {
+ byte *Buffer = Game->_fileManager->readWholeFile(filename);
if (Buffer == NULL) {
- Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", Filename);
+ Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", filename);
return E_FAIL;
}
HRESULT ret;
- _filename = new char [strlen(Filename) + 1];
- strcpy(_filename, Filename);
+ _filename = new char [strlen(filename) + 1];
+ strcpy(_filename, filename);
- if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", Filename);
+ if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing WINDOW file '%s'", filename);
delete [] Buffer;
@@ -538,7 +538,7 @@ HRESULT CUIWindow::loadBuffer(byte *Buffer, bool Complete) { default:
- if (FAILED(Game->WindowLoadHook(this, (char **)&Buffer, (char **)params))) {
+ if (FAILED(Game->windowLoadHook(this, (char **)&Buffer, (char **)params))) {
cmd = PARSERR_GENERIC;
}
}
@@ -735,8 +735,8 @@ HRESULT CUIWindow::scCallMethod(CScScript *script, CScStack *stack, CScStack *th delete _imageInactive;
_imageInactive = new CBSprite(Game);
- const char *Filename = stack->pop()->getString();
- if (!_imageInactive || FAILED(_imageInactive->loadFile(Filename))) {
+ const char *filename = stack->pop()->getString();
+ if (!_imageInactive || FAILED(_imageInactive->loadFile(filename))) {
delete _imageInactive;
_imageInactive = NULL;
stack->pushBool(false);
@@ -910,7 +910,7 @@ HRESULT CUIWindow::scCallMethod(CScScript *script, CScStack *stack, CScStack *th }
stack->pushNULL();
return S_OK;
- } else if SUCCEEDED(Game->WindowScriptMethodHook(this, script, stack, name)) return S_OK;
+ } else if SUCCEEDED(Game->windowScriptMethodHook(this, script, stack, name)) return S_OK;
else return CUIObject::scCallMethod(script, stack, thisStack, name);
}
diff --git a/engines/wintermute/UI/UIWindow.h b/engines/wintermute/UI/UIWindow.h index 80dcda9333..c29038860d 100644 --- a/engines/wintermute/UI/UIWindow.h +++ b/engines/wintermute/UI/UIWindow.h @@ -73,7 +73,7 @@ public: virtual bool handleKeypress(Common::Event *event, bool printable = false);
CBArray<CUIObject *, CUIObject *> _widgets;
TTextAlign _titleAlign;
- HRESULT loadFile(const char *Filename);
+ HRESULT loadFile(const char *filename);
HRESULT loadBuffer(byte *Buffer, bool Complete = true);
CUITiledImage *_backInactive;
CBFont *_fontInactive;
diff --git a/engines/wintermute/utils/utils.h b/engines/wintermute/utils/utils.h index 219cacd249..ed6c2f3bc5 100644 --- a/engines/wintermute/utils/utils.h +++ b/engines/wintermute/utils/utils.h @@ -56,8 +56,8 @@ public: static bool matchesPattern(const char *pattern, const char *string);
- static char *getPath(const char *Filename);
- static char *getFilename(const char *Filename);
+ static char *getPath(const char *filename);
+ static char *getFilename(const char *filename);
static void RGBtoHSL(uint32 RGBColor, byte *OutH, byte *OutS, byte *OutL);
static uint32 HSLtoRGB(byte H, byte S, byte L);
diff --git a/engines/wintermute/video/VidPlayer.cpp b/engines/wintermute/video/VidPlayer.cpp index e511f52284..1e4b25e143 100644 --- a/engines/wintermute/video/VidPlayer.cpp +++ b/engines/wintermute/video/VidPlayer.cpp @@ -129,17 +129,17 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) cleanup(); char Filename[MAX_PATH]; - Game->_fileManager->GetFullPath(inFilename, Filename); + Game->_fileManager->GetFullPath(inFilename, filename); // open file if (AVIFileOpen(&_aviFile, Filename, OF_READ, NULL) != 0) { - Game->LOG(0, "Error opening AVI file '%s'", Filename); + Game->LOG(0, "Error opening AVI file '%s'", filename); return E_FAIL; } // get video stream if (AVIFileGetStream(_aviFile, &_videoStream, streamtypeVIDEO, 0) != 0) { - Game->LOG(0, "Error finding video stream in AVI file '%s'", Filename); + Game->LOG(0, "Error finding video stream in AVI file '%s'", filename); return E_FAIL; } _totalVideoTime = AVIStreamEndTime(_videoStream); @@ -155,7 +155,7 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) // get video format if (AVIStreamReadFormat(m_VideoStream, 0, NULL, &Size)) { - Game->LOG(0, "Error obtaining video stream format in AVI file '%s'", Filename); + Game->LOG(0, "Error obtaining video stream format in AVI file '%s'", filename); return E_FAIL; } _videoFormat = (LPBITMAPINFO)new BYTE[Size]; @@ -176,7 +176,7 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) m_VidRenderer = new CVidRendererDD(Game); if (!m_VidRenderer || FAILED(m_VidRenderer->Initialize(m_VideoFormat, m_TargetFormat))) { - Game->LOG(0, "Error initializing video renderer for AVI file '%s'", Filename); + Game->LOG(0, "Error initializing video renderer for AVI file '%s'", filename); SAFE_DELETE(m_VidRenderer); return E_FAIL; } @@ -190,14 +190,14 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) if (FAILED(res = _sound->InitializeBuffer(_audioStream))) { SAFE_DELETE(_sound); _soundAvailable = false; - Game->LOG(res, "Error initializing sound buffer for AVI file '%s'", Filename); + Game->LOG(res, "Error initializing sound buffer for AVI file '%s'", filename); } } if (Game->_videoSubtitles) LoadSubtitles(inFilename, SubtitleFile); - _filename = new char[strlen(Filename) + 1]; - if (_filename) strcpy(_filename, Filename); + _filename = new char[strlen(filename) + 1]; + if (_filename) strcpy(_filename, filename); #endif return S_OK; } @@ -378,7 +378,7 @@ bool CVidPlayer::isPlaying() { ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::loadSubtitles(const char *Filename, const char *SubtitleFile) { +HRESULT CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFile) { #if 0 if (!Filename) return S_OK; @@ -390,7 +390,7 @@ HRESULT CVidPlayer::loadSubtitles(const char *Filename, const char *SubtitleFile if (SubtitleFile) { strcpy(NewFile, SubtitleFile); } else { - _splitpath(Filename, drive, dir, fname, NULL); + _splitpath(filename, drive, dir, fname, NULL); _makepath(NewFile, drive, dir, fname, ".SUB"); } diff --git a/engines/wintermute/video/VidPlayer.h b/engines/wintermute/video/VidPlayer.h index f3dfa97e33..b1afa080bd 100644 --- a/engines/wintermute/video/VidPlayer.h +++ b/engines/wintermute/video/VidPlayer.h @@ -46,7 +46,7 @@ class CVidPlayer : public CBBase { public: bool _showSubtitle; int _currentSubtitle; - HRESULT loadSubtitles(const char *Filename, const char *SubtitleFile); + HRESULT loadSubtitles(const char *filename, const char *SubtitleFile); bool _slowRendering; bool isPlaying(); char *_filename; diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp index d47f3b3ae5..b8a9886105 100644 --- a/engines/wintermute/video/VidTheoraPlayer.cpp +++ b/engines/wintermute/video/VidTheoraPlayer.cpp @@ -140,7 +140,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo _file = Game->_fileManager->openFile(filename, true, false); if (!_file) return E_FAIL; - //if (Filename != _filename) CBUtils::setString(&_filename, Filename); + //if (Filename != _filename) CBUtils::setString(&_filename, filename); #if defined (USE_THEORADEC) _theoraDecoder = new TheoraDecoder(); #else @@ -164,10 +164,10 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo #if 0 cleanup(); - _file = Game->_fileManager->openFile(Filename); + _file = Game->_fileManager->openFile(filename); if (!_file) return E_FAIL; - if (Filename != _filename) CBUtils::setString(&_filename, Filename); + if (Filename != _filename) CBUtils::setString(&_filename, filename); // start up Ogg stream synchronization layer ogg_sync_init(&m_OggSyncState); @@ -303,7 +303,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo if (FAILED(Res = m_Sound->InitializeBuffer(this))) { Game->m_SoundMgr->RemoveSound(m_Sound); m_Sound = NULL; - Game->LOG(Res, "Error initializing sound buffer for Theora file '%s'", Filename); + Game->LOG(Res, "Error initializing sound buffer for Theora file '%s'", filename); } else { SAFE_DELETE_ARRAY(m_AudioBuf); m_AudioBufSize = m_Sound->m_StreamBlockSize; @@ -325,7 +325,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo if (!m_Subtitler) m_Subtitler = new CVidSubtitler(Game); - if (m_Subtitler && Game->m_VideoSubtitles) m_Subtitler->LoadSubtitles(Filename, SubtitleFile); + if (m_Subtitler && Game->m_VideoSubtitles) m_Subtitler->LoadSubtitles(filename, SubtitleFile); return Res; #endif @@ -686,12 +686,12 @@ HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) { #if 0 SAFE_DELETE(m_AlphaImage); m_AlphaImage = new CBImage(Game); - if (!m_AlphaImage || FAILED(m_AlphaImage->loadFile(Filename))) { + if (!m_AlphaImage || FAILED(m_AlphaImage->loadFile(filename))) { SAFE_DELETE(m_AlphaImage); SAFE_DELETE_ARRAY(m_AlphaFilename); return E_FAIL; } - if (m_AlphaFilename != Filename) CBUtils::setString(&m_AlphaFilename, Filename); + if (m_AlphaFilename != Filename) CBUtils::setString(&m_AlphaFilename, filename); m_AlphaImage->Convert(IMG_TRUECOLOR); #endif return S_OK; diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp index 031b081075..cc472d32da 100644 --- a/engines/wintermute/wintermute.cpp +++ b/engines/wintermute/wintermute.cpp @@ -200,7 +200,7 @@ int WinterMuteEngine::init() { _game->initialize2(); - _game->getDebugMgr()->OnGameInit(); + _game->getDebugMgr()->onGameInit(); _game->_scEngine->LoadBreakpoints(); @@ -239,7 +239,7 @@ int WinterMuteEngine::init() { _game = NULL; return false; } - _game->SetWindowTitle(); + _game->setWindowTitle(); _game->_renderer->_ready = true; _game->_miniUpdateEnabled = true; @@ -249,11 +249,11 @@ int WinterMuteEngine::init() { if (ConfMan.hasKey("save_slot")) { int slot = ConfMan.getInt("save_slot"); Common::String str = Common::String::format("save00%d.DirtySplitSav", slot); - _game->LoadGame(str.c_str()); + _game->loadGame(str.c_str()); } if (SaveGame) { - _game->LoadGame(SaveGame); + _game->loadGame(SaveGame); delete [] SaveGame; } @@ -277,10 +277,10 @@ int WinterMuteEngine::messageLoop() { } if (_game && _game->_renderer->_active && _game->_renderer->_ready) { - _game->DisplayContent(); - _game->DisplayQuickMsg(); + _game->displayContent(); + _game->displayQuickMsg(); - _game->DisplayDebugInfo(); + _game->displayDebugInfo(); time = _system->getMillis(); diff = time - prevTime; @@ -289,7 +289,7 @@ int WinterMuteEngine::messageLoop() { // ***** flip if (!_game->_suspendedRendering) _game->_renderer->flip(); - if (_game->_loading) _game->LoadGame(_game->_scheduledLoadSlot); + if (_game->_loading) _game->loadGame(_game->_scheduledLoadSlot); prevTime = time; } if (_game->_quitting) break; |