diff options
author | Kari Salminen | 2008-08-12 20:58:26 +0000 |
---|---|---|
committer | Kari Salminen | 2008-08-12 20:58:26 +0000 |
commit | 095fa5552754626fb12f5c6bc97104697658d671 (patch) | |
tree | 6454db62b8dd89e0fb282c45af964fdd3f3eedf1 /engines/cine | |
parent | e547eeb116a7747aaf49f82a626418ecf9cc69e9 (diff) | |
download | scummvm-rg350-095fa5552754626fb12f5c6bc97104697658d671.tar.gz scummvm-rg350-095fa5552754626fb12f5c6bc97104697658d671.tar.bz2 scummvm-rg350-095fa5552754626fb12f5c6bc97104697658d671.zip |
Fix for GCC warning in OSRenderer::renderOverlay: declaration of 'len' shadows a previous local.
svn-id: r33808
Diffstat (limited to 'engines/cine')
-rw-r--r-- | engines/cine/gfx.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index f0149043f9..3c8966b7ec 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -1071,10 +1071,11 @@ void OSRenderer::drawBackground() { * \todo Add handling of type 22 overlays */ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) { - int len; + int len, idx, width, height; objectStruct *obj; AnimData *sprite; byte *mask; + byte color; switch (it->type) { // color sprite @@ -1105,18 +1106,17 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) { break; // action failure message - case 3: { - int idx = it->objIdx * 4 + g_cine->_rnd.getRandomNumber(3); - int len = strlen(failureMessages[idx]); + case 3: + idx = it->objIdx * 4 + g_cine->_rnd.getRandomNumber(3); + len = strlen(failureMessages[idx]); _messageLen += len; - int width = 6 * len + 20; + width = 6 * len + 20; width = width > 300 ? 300 : width; // The used color here differs from Future Wars drawMessage(failureMessages[idx], (320 - width) / 2, 80, width, _messageBg); waitForPlayerClick = 1; break; - } // bitmap case 4: @@ -1147,18 +1147,17 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) { // TODO: Check how the original game looks under DOSBox to see if the oxygen gauge works in it case 21: // A filled rectangle: - case 22: { + case 22: // TODO: Check it this implementation really works correctly (Some things might be wrong, needs testing). assert(it->objIdx < NUM_MAX_OBJECT); obj = &objectTable[it->objIdx]; - byte color = obj->part & 0x0F; - int width = obj->frame; - int height = obj->costume; + color = obj->part & 0x0F; + width = obj->frame; + height = obj->costume; drawPlainBox(obj->x, obj->y, width, height, color); debug(5, "renderOverlay: type=%d, x=%d, y=%d, width=%d, height=%d, color=%d", it->type, obj->x, obj->y, width, height, color); break; - } // something else default: |