From 127900b33c8e7c817e9b676064e832192d8e7bc7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 8 Sep 2007 11:17:13 +0000 Subject: Fixed various warnings svn-id: r28879 --- engines/agi/picture.cpp | 14 +++++++------- engines/agi/preagi_mickey.cpp | 9 ++++----- engines/agi/saveload.cpp | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index 3ba861f44e..27df79f5c3 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -66,6 +66,7 @@ void PictureMgr::putVirtPixel(int x, int y) { /* For the flood fill routines */ /* MH2 needs stack size > 300 */ +// FIXME: Consider using FixedStack<> or Stack<> from common/stack.h here #define STACK_SIZE 512 static unsigned int stackPtr; static uint16 stack[STACK_SIZE]; @@ -401,12 +402,12 @@ void PictureMgr::fill() { **************************************************************************/ void PictureMgr::plotPattern(int x, int y) { - static uint16 binary_list[] = {0x8000, 0x4000, 0x2000, 0x1000, 0x800, 0x400, 0x200, 0x100, + static const uint16 binary_list[] = {0x8000, 0x4000, 0x2000, 0x1000, 0x800, 0x400, 0x200, 0x100, 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1}; - static uint8 circle_list[] = {0, 1, 4, 9, 16, 25, 37, 50}; + static const uint8 circle_list[] = {0, 1, 4, 9, 16, 25, 37, 50}; - static uint16 circle_data[] = + static const uint16 circle_data[] = {0x8000, 0xE000, 0xE000, 0xE000, 0x7000, 0xF800, 0x0F800, 0x0F800, 0x7000, @@ -417,7 +418,7 @@ void PictureMgr::plotPattern(int x, int y) { 0x07C0, 0x1FF0, 0x3FF8, 0x7FFC, 0x7FFC, 0x0FFFE, 0x0FFFE, 0x0FFFE, 0x0FFFE, 0x0FFFE, 0x7FFC, 0x7FFC, 0x3FF8, 0x1FF0, 0x07C0}; uint16 circle_word; - uint16 *circle_ptr; + const uint16 *circle_ptr; uint16 counter; uint16 pen_width = 0; int pen_final_x = 0; @@ -541,7 +542,6 @@ void PictureMgr::plotBrush() { void PictureMgr::drawPicture() { uint8 act; int drawing; - int storedXOffset = 0, storedYOffset = 0; _patCode = 0; _patNum = 0; @@ -695,8 +695,8 @@ void PictureMgr::drawPicture() { // FIXME: This is used by Mickey for the crystal animation, but // currently it's very very very slow /* - storedXOffset = _xOffset; - storedYOffset = _yOffset; + int storedXOffset = _xOffset; + int storedYOffset = _yOffset; // FIXME: picture coordinates are correct for Mickey only showPic(10, 0, _width, _height); _gfx->doUpdate(); diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index 212ffeee58..ef56272d92 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -869,7 +869,6 @@ void Mickey::drawLogo() { const int w = 80; const int h = 170; uint8 bitmap[h][w]; - uint8 color = 0, color2 = 0, color3 = 0, color4 = 0; // read in logos.bcg sprintf(szFile, IDS_MSA_PATH_LOGO); @@ -886,10 +885,10 @@ void Mickey::drawLogo() { // TODO: Show BCG picture for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { - color = (uint8)colorBCG[(bitmap[y][x] & 0xf0) / 0x10][0]; // background - color2 = (uint8)colorBCG[(bitmap[y][x] & 0xf0) / 0x10][1]; // background - color3 = (uint8)colorBCG[ bitmap[y][x] & 0x0f][0]; // foreground - color4 = (uint8)colorBCG[ bitmap[y][x] & 0x0f][1]; // foreground + uint8 color = (uint8)colorBCG[(bitmap[y][x] & 0xf0) / 0x10][0]; // background + uint8 color2 = (uint8)colorBCG[(bitmap[y][x] & 0xf0) / 0x10][1]; // background + uint8 color3 = (uint8)colorBCG[ bitmap[y][x] & 0x0f][0]; // foreground + uint8 color4 = (uint8)colorBCG[ bitmap[y][x] & 0x0f][1]; // foreground _vm->_picture->putPixel(x * 4, y, color); _vm->_picture->putPixel(x * 4 + 1, y, color2); diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 05ce80b1a3..c8cae3b479 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -525,7 +525,7 @@ int AgiEngine::selectSlot() { int oldActive = active + 1; for (;;) { - int sbPos; + int sbPos = 0; if (oldFirstSlot != _firstSlot || oldActive != active) { char dstr[64]; -- cgit v1.2.3