From 0f249f55db2f2d4b6f94b9eea195d42e49a74248 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Wed, 4 Jul 2012 13:15:47 +0200 Subject: WINTERMUTE: Rename FuncName->funcName and VarName->varName mainly in AdGame. (But also all const char* Filename->filename) --- engines/wintermute/Base/BDebugger.cpp | 28 ++-- engines/wintermute/Base/BDebugger.h | 32 ++--- engines/wintermute/Base/BFileManager.cpp | 84 +++++------ engines/wintermute/Base/BFont.cpp | 22 +-- engines/wintermute/Base/BFont.h | 4 +- engines/wintermute/Base/BFontBitmap.cpp | 12 +- engines/wintermute/Base/BFontBitmap.h | 2 +- engines/wintermute/Base/BFontStorage.cpp | 10 +- engines/wintermute/Base/BFontStorage.h | 2 +- engines/wintermute/Base/BFontTT.cpp | 12 +- engines/wintermute/Base/BFrame.cpp | 16 +-- engines/wintermute/Base/BGame.cpp | 172 +++++++++++------------ engines/wintermute/Base/BGame.h | 110 +++++++-------- engines/wintermute/Base/BImage.cpp | 4 +- engines/wintermute/Base/BImage.h | 2 +- engines/wintermute/Base/BObject.cpp | 22 +-- engines/wintermute/Base/BObject.h | 6 +- engines/wintermute/Base/BPersistMgr.cpp | 4 +- engines/wintermute/Base/BRegion.cpp | 12 +- engines/wintermute/Base/BRegion.h | 2 +- engines/wintermute/Base/BRegistry.cpp | 4 +- engines/wintermute/Base/BRenderSDL.cpp | 6 +- engines/wintermute/Base/BRenderSDL.h | 2 +- engines/wintermute/Base/BRenderer.h | 2 +- engines/wintermute/Base/BSaveThumbHelper.cpp | 4 +- engines/wintermute/Base/BScriptHolder.cpp | 30 ++-- engines/wintermute/Base/BSoundBuffer.cpp | 30 ++-- engines/wintermute/Base/BSoundBuffer.h | 2 +- engines/wintermute/Base/BSoundMgr.cpp | 14 +- engines/wintermute/Base/BSoundMgr.h | 2 +- engines/wintermute/Base/BSprite.cpp | 38 ++--- engines/wintermute/Base/BSprite.h | 4 +- engines/wintermute/Base/BStringTable.cpp | 6 +- engines/wintermute/Base/BStringTable.h | 2 +- engines/wintermute/Base/BSubFrame.cpp | 12 +- engines/wintermute/Base/BSubFrame.h | 2 +- engines/wintermute/Base/BSurface.h | 4 +- engines/wintermute/Base/BSurfaceStorage.cpp | 10 +- engines/wintermute/Base/BSurfaceStorage.h | 2 +- engines/wintermute/Base/PartEmitter.cpp | 18 +-- engines/wintermute/Base/PartEmitter.h | 4 +- engines/wintermute/Base/PartParticle.cpp | 16 +-- engines/wintermute/Base/PartParticle.h | 2 +- engines/wintermute/Base/file/BSaveThumbFile.cpp | 2 +- engines/wintermute/Base/scriptables/SXFile.cpp | 4 +- engines/wintermute/Base/scriptables/ScEngine.cpp | 56 ++++---- engines/wintermute/Base/scriptables/ScEngine.h | 16 +-- engines/wintermute/Base/scriptables/ScScript.cpp | 34 ++--- engines/wintermute/Base/scriptables/ScScript.h | 2 +- 49 files changed, 444 insertions(+), 444 deletions(-) (limited to 'engines/wintermute/Base') 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 _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 _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 _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 _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(); -- cgit v1.2.3