From a488db8f93f37f79123226fdd561ba78578822f5 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 15 Jun 2012 00:28:59 +0200 Subject: WINTERMUTE: Clear out a bunch of warning (mostly shadowed variables) --- engines/wintermute/Ad/AdGame.cpp | 5 ++--- engines/wintermute/Ad/AdObject.cpp | 12 ++++++------ engines/wintermute/Ad/AdRegion.cpp | 10 ++++------ engines/wintermute/Ad/AdScene.cpp | 18 +++++++++--------- engines/wintermute/Base/BFileManager.cpp | 9 +++------ engines/wintermute/Base/BFontTT.cpp | 3 ++- engines/wintermute/Base/BGame.cpp | 20 +++++++++----------- engines/wintermute/Base/BGame.h | 2 +- engines/wintermute/Base/BImage.cpp | 2 +- engines/wintermute/Base/BSurfaceSDL.cpp | 2 +- engines/wintermute/Base/PartEmitter.cpp | 12 ++++++------ engines/wintermute/Base/scriptables/SXMemBuffer.cpp | 2 +- engines/wintermute/Base/scriptables/SXString.cpp | 2 -- engines/wintermute/Base/scriptables/ScEngine.cpp | 2 +- engines/wintermute/UI/UIObject.cpp | 2 +- engines/wintermute/video/VidTheoraPlayer.cpp | 9 ++++----- 16 files changed, 51 insertions(+), 61 deletions(-) diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp index 26cbc299bf..32c037cba8 100644 --- a/engines/wintermute/Ad/AdGame.cpp +++ b/engines/wintermute/Ad/AdGame.cpp @@ -1566,15 +1566,14 @@ HRESULT CAdGame::EndDlgBranch(const char *BranchName, const char *ScriptName, co int StartIndex = -1; - int i; - for (i = _dlgPendingBranches.GetSize() - 1; i >= 0; i--) { + for (int i = _dlgPendingBranches.GetSize() - 1; i >= 0; i--) { if (scumm_stricmp(Name, _dlgPendingBranches[i]) == 0) { StartIndex = i; break; } } if (StartIndex >= 0) { - for (i = StartIndex; i < _dlgPendingBranches.GetSize(); i++) { + for (int i = StartIndex; i < _dlgPendingBranches.GetSize(); i++) { //ClearBranchResponses(_dlgPendingBranches[i]); delete [] _dlgPendingBranches[i]; _dlgPendingBranches[i] = NULL; diff --git a/engines/wintermute/Ad/AdObject.cpp b/engines/wintermute/Ad/AdObject.cpp index 1f892f7eae..27ff2599a8 100644 --- a/engines/wintermute/Ad/AdObject.cpp +++ b/engines/wintermute/Ad/AdObject.cpp @@ -537,9 +537,9 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th } } } else { - const char *Name = Val->GetString(); + const char *attachmentName = Val->GetString(); for (int i = 0; i < _attachmentsPre.GetSize(); i++) { - if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, Name) == 0) { + if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, attachmentName) == 0) { Found = true; Game->UnregisterObject(_attachmentsPre[i]); _attachmentsPre.RemoveAt(i); @@ -547,7 +547,7 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th } } for (int i = 0; i < _attachmentsPost.GetSize(); i++) { - if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, Name) == 0) { + if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, attachmentName) == 0) { Found = true; Game->UnregisterObject(_attachmentsPost[i]); _attachmentsPost.RemoveAt(i); @@ -580,16 +580,16 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th CurrIndex++; } } else { - const char *Name = Val->GetString(); + const char *attachmentName = Val->GetString(); for (int i = 0; i < _attachmentsPre.GetSize(); i++) { - if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, Name) == 0) { + if (_attachmentsPre[i]->_name && scumm_stricmp(_attachmentsPre[i]->_name, attachmentName) == 0) { Ret = _attachmentsPre[i]; break; } } if (!Ret) { for (int i = 0; i < _attachmentsPost.GetSize(); i++) { - if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, Name) == 0) { + if (_attachmentsPost[i]->_name && scumm_stricmp(_attachmentsPost[i]->_name, attachmentName) == 0) { Ret = _attachmentsPre[i]; break; } diff --git a/engines/wintermute/Ad/AdRegion.cpp b/engines/wintermute/Ad/AdRegion.cpp index b6735f72ff..c335269885 100644 --- a/engines/wintermute/Ad/AdRegion.cpp +++ b/engines/wintermute/Ad/AdRegion.cpp @@ -128,9 +128,7 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) { Buffer = params; } - int i; - - for (i = 0; i < _points.GetSize(); i++) delete _points[i]; + for (int i = 0; i < _points.GetSize(); i++) delete _points[i]; _points.RemoveAll(); int ar = 255, ag = 255, ab = 255, alpha = 255; @@ -163,9 +161,9 @@ HRESULT CAdRegion::LoadBuffer(byte *Buffer, bool Complete) { case TOKEN_ZOOM: case TOKEN_SCALE: { - int i; - parser.ScanStr((char *)params, "%d", &i); - _zoom = (float)i; + int j; + parser.ScanStr((char *)params, "%d", &j); + _zoom = (float)j; } break; diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp index 3400fba145..53d1d78907 100644 --- a/engines/wintermute/Ad/AdScene.cpp +++ b/engines/wintermute/Ad/AdScene.cpp @@ -626,7 +626,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) { int ar, ag, ab, aa; char camera[MAX_PATH] = ""; - float WaypointHeight = -1.0f; + /* float WaypointHeight = -1.0f; */ while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) { switch (cmd) { @@ -1386,9 +1386,9 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi ////////////////////////////////////////////////////////////////////////// else if (strcmp(Name, "GetNode") == 0) { Stack->CorrectParams(1); - const char *Name = Stack->Pop()->GetString(); + const char *nodeName = Stack->Pop()->GetString(); - CBObject *node = GetNodeByName(Name); + CBObject *node = GetNodeByName(nodeName); if (node) Stack->PushNative((CBScriptable *)node, true); else Stack->PushNULL(); @@ -1407,9 +1407,9 @@ HRESULT CAdScene::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi int Index = Val->GetInt(); if (Index >= 0 && Index < _objects.GetSize()) Ret = _objects[Index]; } else { - const char *Name = Val->GetString(); + const char *nodeName = Val->GetString(); for (int i = 0; i < _objects.GetSize(); i++) { - if (_objects[i] && _objects[i]->_name && scumm_stricmp(_objects[i]->_name, Name) == 0) { + if (_objects[i] && _objects[i]->_name && scumm_stricmp(_objects[i]->_name, nodeName) == 0) { Ret = _objects[i]; break; } @@ -2115,8 +2115,8 @@ float CAdScene::GetScaleAt(int Y) { CAdScaleLevel *next = NULL; for (int i = 0; i < _scaleLevels.GetSize(); i++) { - CAdScaleLevel *xxx = _scaleLevels[i]; - int j = _scaleLevels.GetSize(); + /* CAdScaleLevel *xxx = _scaleLevels[i];*/ + /* int j = _scaleLevels.GetSize(); */ if (_scaleLevels[i]->_posY < Y) prev = _scaleLevels[i]; else { next = _scaleLevels[i]; @@ -2556,8 +2556,8 @@ float CAdScene::GetRotationAt(int X, int Y) { CAdRotLevel *next = NULL; for (int i = 0; i < _rotLevels.GetSize(); i++) { - CAdRotLevel *xxx = _rotLevels[i]; - int j = _rotLevels.GetSize(); + /* CAdRotLevel *xxx = _rotLevels[i]; + int j = _rotLevels.GetSize();*/ if (_rotLevels[i]->_posX < X) prev = _rotLevels[i]; else { next = _rotLevels[i]; diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp index ecccb04493..1848595c19 100644 --- a/engines/wintermute/Base/BFileManager.cpp +++ b/engines/wintermute/Base/BFileManager.cpp @@ -342,15 +342,12 @@ HRESULT CBFileManager::RegisterPackages() { Game->LOG(0, "Scanning packages..."); warning("Scanning packages"); -// TODO: Actually scan the folder, for now we just hardcode the files for Dirty Split. Common::ArchiveMemberList files; SearchMan.listMatchingMembers(files, "*.dcp"); - int size = files.size(); + for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) { RegisterPackage((*it)->getName().c_str()); } -/* RegisterPackage("data.dcp"); - RegisterPackage("english.dcp");*/ #if 0 AnsiString extension = AnsiString(PACKAGE_EXTENSION); @@ -378,10 +375,10 @@ HRESULT CBFileManager::RegisterPackages() { } } } - +#endif warning(" Registered %d files in %d package(s)", _files.size(), _packages.GetSize()); Game->LOG(0, " Registered %d files in %d package(s)", _files.size(), _packages.GetSize()); -#endif + warning(" Registered %d files in %d package(s)", _files.size(), _packages.GetSize()); return S_OK; } diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp index 85c2bee334..2ec1f5031b 100644 --- a/engines/wintermute/Base/BFontTT.cpp +++ b/engines/wintermute/Base/BFontTT.cpp @@ -876,9 +876,10 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight, ////////////////////////////////////////////////////////////////////////// float CBFontTT::GetKerning(wchar_t leftChar, wchar_t rightChar) { +#if 0 GlyphInfo *infoLeft = _glyphCache->GetGlyph(leftChar); GlyphInfo *infoRight = _glyphCache->GetGlyph(rightChar); -#if 0 + if (!infoLeft || !infoRight) return 0; FT_Vector delta; diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 46abfe16cf..00e5cc8ea7 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -353,15 +353,13 @@ CBGame::~CBGame() { ////////////////////////////////////////////////////////////////////////// HRESULT CBGame::Cleanup() { - int i; - delete _loadingIcon; _loadingIcon = NULL; _engineLogCallback = NULL; _engineLogCallbackData = NULL; - for (i = 0; i < NUM_MUSIC_CHANNELS; i++) { + for (int i = 0; i < NUM_MUSIC_CHANNELS; i++) { delete _music[i]; _music[i] = NULL; _musicStartTime[i] = 0; @@ -373,7 +371,7 @@ HRESULT CBGame::Cleanup() { UnregisterObject(_fader); _fader = NULL; - for (i = 0; i < _regObjects.GetSize(); i++) { + for (int i = 0; i < _regObjects.GetSize(); i++) { delete _regObjects[i]; _regObjects[i] = NULL; } @@ -399,7 +397,7 @@ HRESULT CBGame::Cleanup() { _scValue = NULL; _sFX = NULL; - for (i = 0; i < _scripts.GetSize(); i++) { + for (int i = 0; i < _scripts.GetSize(); i++) { _scripts[i]->_owner = NULL; _scripts[i]->Finish(); } @@ -411,7 +409,7 @@ HRESULT CBGame::Cleanup() { _fontStorage->RemoveFont(_videoFont); _videoFont = NULL; - for (i = 0; i < _quickMessages.GetSize(); i++) delete _quickMessages[i]; + for (int i = 0; i < _quickMessages.GetSize(); i++) delete _quickMessages[i]; _quickMessages.RemoveAll(); _viewportStack.RemoveAll(); @@ -2063,8 +2061,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS ////////////////////////////////////////////////////////////////////////// else if (strcmp(Name, "AccOutputText") == 0) { Stack->CorrectParams(2); - const char *Str = Stack->Pop()->GetString(); - int Type = Stack->Pop()->GetInt(); + /* const char *Str = */ Stack->Pop()->GetString(); + /* int Type = */ Stack->Pop()->GetInt(); // do nothing Stack->PushNULL(); @@ -3838,7 +3836,7 @@ bool CBGame::HandleKeypress(Common::Event *event, bool printable) { return false; } -bool CBGame::handleKeyRelease(Common::Event *event) { +void CBGame::handleKeyRelease(Common::Event *event) { _keyboardState->handleKeyRelease(event); } @@ -4098,7 +4096,7 @@ void CBGame::SetResourceModule(HMODULE ResModule) { ////////////////////////////////////////////////////////////////////////// -HRESULT CBGame::DisplayContent(bool Update, bool DisplayAll) { +HRESULT CBGame::DisplayContent(bool update, bool displayAll) { return S_OK; } @@ -4133,7 +4131,7 @@ HRESULT CBGame::DisplayIndicator() { ////////////////////////////////////////////////////////////////////////// HRESULT CBGame::UpdateMusicCrossfade() { - byte GlobMusicVol = _soundMgr->getVolumePercent(SOUND_MUSIC); + /* byte GlobMusicVol = _soundMgr->getVolumePercent(SOUND_MUSIC); */ if (!_musicCrossfadeRunning) return S_OK; if (_state == GAME_FROZEN) return S_OK; diff --git a/engines/wintermute/Base/BGame.h b/engines/wintermute/Base/BGame.h index a727978dd3..e3363ccf4c 100644 --- a/engines/wintermute/Base/BGame.h +++ b/engines/wintermute/Base/BGame.h @@ -261,7 +261,7 @@ public: virtual HRESULT GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byte *ExtMinor); virtual bool HandleKeypress(Common::Event *event, bool printable = false); - virtual bool handleKeyRelease(Common::Event *event); + virtual void handleKeyRelease(Common::Event *event); int _freezeLevel; HRESULT Unfreeze(); HRESULT Freeze(bool IncludingMusic = true); diff --git a/engines/wintermute/Base/BImage.cpp b/engines/wintermute/Base/BImage.cpp index 69859b4c05..e0c39ad9e9 100644 --- a/engines/wintermute/Base/BImage.cpp +++ b/engines/wintermute/Base/BImage.cpp @@ -58,7 +58,7 @@ CBImage::CBImage(CBGame *inGame, FIBITMAP *bitmap): CBBase(inGame) { ////////////////////////////////////////////////////////////////////// CBImage::~CBImage() { - delete _bitmap; +/* delete _bitmap; */ delete _decoder; #if 0 if (_bitmap) FreeImage_Unload(_bitmap); diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp index 02788e0ffc..9e77b9c1b7 100644 --- a/engines/wintermute/Base/BSurfaceSDL.cpp +++ b/engines/wintermute/Base/BSurfaceSDL.cpp @@ -229,7 +229,7 @@ void CBSurfaceSDL::genAlphaMask(Graphics::Surface *surface) { SDL_LockSurface(surface); #endif bool hasColorKey; - uint32 colorKey; + /* uint32 colorKey; */ uint8 ckRed, ckGreen, ckBlue; /* if (SDL_GetColorKey(surface, &colorKey) == 0) { hasColorKey = true; diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp index 29d51c063d..09afdcc6b4 100644 --- a/engines/wintermute/Base/PartEmitter.cpp +++ b/engines/wintermute/Base/PartEmitter.cpp @@ -519,11 +519,11 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack ////////////////////////////////////////////////////////////////////////// else if (strcmp(Name, "AddGlobalForce") == 0) { Stack->CorrectParams(3); - const char *Name = Stack->Pop()->GetString(); + const char *forceName = Stack->Pop()->GetString(); float Angle = Stack->Pop()->GetFloat(); float Strength = Stack->Pop()->GetFloat(); - Stack->PushBool(SUCCEEDED(AddForce(Name, CPartForce::FORCE_GLOBAL, 0, 0, Angle, Strength))); + Stack->PushBool(SUCCEEDED(AddForce(forceName, CPartForce::FORCE_GLOBAL, 0, 0, Angle, Strength))); return S_OK; } @@ -533,13 +533,13 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack ////////////////////////////////////////////////////////////////////////// else if (strcmp(Name, "AddPointForce") == 0) { Stack->CorrectParams(5); - const char *Name = Stack->Pop()->GetString(); + const char *forceName = Stack->Pop()->GetString(); int PosX = Stack->Pop()->GetInt(); int PosY = Stack->Pop()->GetInt(); float Angle = Stack->Pop()->GetFloat(); float Strength = Stack->Pop()->GetFloat(); - Stack->PushBool(SUCCEEDED(AddForce(Name, CPartForce::FORCE_GLOBAL, PosX, PosY, Angle, Strength))); + Stack->PushBool(SUCCEEDED(AddForce(forceName, CPartForce::FORCE_GLOBAL, PosX, PosY, Angle, Strength))); return S_OK; } @@ -549,9 +549,9 @@ HRESULT CPartEmitter::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack ////////////////////////////////////////////////////////////////////////// else if (strcmp(Name, "RemoveForce") == 0) { Stack->CorrectParams(1); - const char *Name = Stack->Pop()->GetString(); + const char *forceName = Stack->Pop()->GetString(); - Stack->PushBool(SUCCEEDED(RemoveForce(Name))); + Stack->PushBool(SUCCEEDED(RemoveForce(forceName))); return S_OK; } diff --git a/engines/wintermute/Base/scriptables/SXMemBuffer.cpp b/engines/wintermute/Base/scriptables/SXMemBuffer.cpp index ab00178b21..5737fe4d72 100644 --- a/engines/wintermute/Base/scriptables/SXMemBuffer.cpp +++ b/engines/wintermute/Base/scriptables/SXMemBuffer.cpp @@ -366,7 +366,7 @@ HRESULT CSXMemBuffer::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack else if (strcmp(Name, "SetPointer") == 0) { Stack->CorrectParams(2); int Start = Stack->Pop()->GetInt(); - CScValue *Val = Stack->Pop(); + /* CScValue *Val = */ Stack->Pop(); if (!CheckBounds(Script, Start, sizeof(void *))) Stack->PushBool(false); else { diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp index 50799d6d4a..f8de678547 100644 --- a/engines/wintermute/Base/scriptables/SXString.cpp +++ b/engines/wintermute/Base/scriptables/SXString.cpp @@ -267,8 +267,6 @@ HRESULT CSXString::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th Common::Array parts; - size_t start, pos; - start = 0; Common::StringTokenizer tokenizer(str, delims); while (!tokenizer.empty()) { diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp index 85451bb150..30bda66558 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.cpp +++ b/engines/wintermute/Base/scriptables/ScEngine.cpp @@ -684,7 +684,7 @@ HRESULT CScEngine::AddBreakpoint(const char *ScriptFilename, int Line) { Bp = new CScBreakpoint(ScriptFilename); _breakpoints.Add(Bp); } - bool Found = false; + for (int i = 0; i < Bp->_lines.GetSize(); i++) { if (Bp->_lines[i] == Line) return S_OK; } diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp index 20a89c5897..3ef052da3e 100644 --- a/engines/wintermute/UI/UIObject.cpp +++ b/engines/wintermute/UI/UIObject.cpp @@ -163,7 +163,7 @@ HRESULT CUIObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th Stack->CorrectParams(1); CScValue *Val = Stack->Pop(); - const char *Filename = Val->GetString(); + /* const char *Filename = */ Val->GetString(); delete _image; _image = NULL; diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp index 65afeb2f34..991286c56c 100644 --- a/engines/wintermute/video/VidTheoraPlayer.cpp +++ b/engines/wintermute/video/VidTheoraPlayer.cpp @@ -450,14 +450,13 @@ HRESULT CVidTheoraPlayer::stop() { ////////////////////////////////////////////////////////////////////////// HRESULT CVidTheoraPlayer::update() { _currentTime = _freezeGame ? Game->_liveTimer : Game->_timer; - + if (!isPlaying()) return S_OK; - + if (_playbackStarted /*&& m_Sound && !m_Sound->IsPlaying()*/) return S_OK; - + if (_playbackStarted && !_freezeGame && Game->_state == GAME_FROZEN) return S_OK; - - int Counter = 0; + if (_theoraDecoder) { if (_theoraDecoder->endOfVideo() && _looping) { warning("Should loop movie"); -- cgit v1.2.3