From 074c11f7e1423ba6541fe86e8302b7ae52a369f8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 8 Feb 2014 19:05:01 +0100 Subject: TSAGE: Silent some CppCheck warnings --- engines/tsage/core.cpp | 6 +++--- engines/tsage/graphics.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 16fe45044b..ba14830add 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1593,12 +1593,12 @@ bool SceneItem::startAction(CursorType action, Event &event) { } void SceneItem::doAction(int action) { - const char *msg = NULL; - if (g_vm->getGameID() == GType_Ringworld2) { Event dummyEvent; ((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->display((CursorType)action, dummyEvent); } else { + const char *msg = NULL; + switch ((int)action) { case CURSOR_LOOK: msg = LOOK_SCENE_HOTSPOT; @@ -2909,7 +2909,6 @@ void BackgroundSceneObject::copySceneToBackground() { void SceneObjectList::draw() { Common::Array objList; int paneNum = 0; - int xAmount = 0, yAmount = 0; if (_objList.size() == 0) { // Alternate draw mode @@ -2936,6 +2935,7 @@ void SceneObjectList::draw() { g_globals->_scrollFollower->_position.x - g_globals->_sceneManager._scene->_sceneBounds.left, g_globals->_scrollFollower->_position.y - g_globals->_sceneManager._scene->_sceneBounds.top); int loadCount = 0; + int xAmount = 0, yAmount = 0; if (objPos.x >= scrollerRect.right) { xAmount = 8; diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 97857aca34..eb7adbe53a 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1483,7 +1483,6 @@ int GfxFont::getStringFit(const char *&s, int maxWidth) { const char *nextWord = NULL; const char *sStart = s; int numChars = 1; - int strWidth = 1; char nextChar; for (;;) { @@ -1497,7 +1496,7 @@ int GfxFont::getStringFit(const char *&s, int maxWidth) { nextWord = s; } - strWidth = getStringWidth(sStart, numChars); + int strWidth = getStringWidth(sStart, numChars); if (strWidth > maxWidth) { if (nextWord) { s = nextWord; -- cgit v1.2.3