From e2af13a7f688f6447b4ec1ad30b7127323245924 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 27 May 2007 11:54:01 +0000 Subject: Adjust code for paranoid compilers. svn-id: r26971 --- engines/agos/cursor.cpp | 6 ++---- engines/agos/gfx.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp index ffb752f411..77d811dbd7 100644 --- a/engines/agos/cursor.cpp +++ b/engines/agos/cursor.cpp @@ -664,7 +664,7 @@ void AGOSEngine::drawMousePointer() { } else if (getGameType() == GType_SIMON1) { CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF); } else { - const uint16 *src = NULL; + const uint16 *src; int i, j; const uint8 color = (getGameType() == GType_ELVIRA1) ? 15: 65; @@ -708,7 +708,7 @@ void AGOSEngine::drawMousePointer() { } else { src = _common_crossbowInfo2; } - } else if (getGameType() == GType_ELVIRA1) { + } else { if (_mouseCursor == 0) { src = _common_mouseInfo; } else if (_mouseCursor == 1) { @@ -721,8 +721,6 @@ void AGOSEngine::drawMousePointer() { if (_dragFlag != 0) src = _common_handInfo; - assert(src); - for (i = 0; i < 16; i++) { for (j = 0; j < 16; j++) { if (src[0] & (1 << (15 - (j % 16)))) { diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 68c405ba8c..33e3d97184 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -630,7 +630,7 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) { if (getFeatures() & GF_32COLOR) state->palette = 0xC0; - uint16 xoffs = 0, yoffs = 0; + uint16 xoffs, yoffs; if (getGameType() == GType_SIMON2) { state->surf2_addr = getBackGround(); state->surf2_pitch = _screenWidth; @@ -667,7 +667,7 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) { xoffs = (vlut[0] * 2 + state->x) * 8; yoffs = vlut[1] + state->y; } - } else if (getGameType() == GType_SIMON1) { + } else { if (_windowNum == 3 || _windowNum == 4 || _windowNum >= 10) { if (_window3Flag == 1) { state->surf2_addr = getBackGround(); @@ -810,7 +810,7 @@ void AGOSEngine::drawImage(VC10_state *state) { if (!drawImage_clip(state)) return; - uint16 xoffs = 0, yoffs = 0; + uint16 xoffs, yoffs; if (getGameType() == GType_WW) { if (_windowNum == 4 || (_windowNum >= 10 && _windowNum <= 27)) { state->surf_addr = _window4BackScn; @@ -851,7 +851,7 @@ void AGOSEngine::drawImage(VC10_state *state) { xoffs = (vlut[0] * 2 + state->x) * 8; yoffs = vlut[1] + state->y; } - } else if (getGameType() == GType_ELVIRA1) { + } else { if (_windowNum == 6) { state->surf_addr = _window6BackScn; state->surf_pitch = 48; @@ -1301,8 +1301,8 @@ void AGOSEngine::setWindowImage(uint16 mode, uint16 vga_res_id) { uint height = _videoWindows[updateWindow * 4 + 3]; byte *dst = getBackGround() + xoffs + yoffs * _screenWidth; - byte *src = dst; - uint srcWidth = 0; + byte *src; + uint srcWidth; if (getGameType() == GType_SIMON2) { src = _window4BackScn + xoffs + yoffs * 320; @@ -1355,7 +1355,7 @@ void AGOSEngine::setWindowImage(uint16 mode, uint16 vga_res_id) { _lockWord &= ~0x20; return; } - } else if (getGameType() == GType_ELVIRA1) { + } else { if (updateWindow == 6) { _window6Flag = 1; src = _window6BackScn; -- cgit v1.2.3