diff -purN REminiscence-0.1.9.orig/video.cpp REminiscence-0.1.9/video.cpp --- REminiscence-0.1.9.orig/video.cpp 2010-01-21 20:37:10.000000000 +0100 +++ REminiscence-0.1.9/video.cpp 2010-01-21 21:16:09.000000000 +0100 @@ -67,7 +67,7 @@ void Video::updateScreen() { debug(DBG_VIDEO, "Video::updateScreen()"); // _fullRefresh = true; if (_fullRefresh) { - _stub->copyRect(0, 0, Video::GAMESCREEN_W, Video::GAMESCREEN_H, _frontLayer, 256); + _stub->copyRect(0, 0, Video::GAMESCREEN_W, Video::GAMESCREEN_H, _frontLayer, GAMESCREEN_W); _stub->updateScreen(_shakeOffset); _fullRefresh = false; } else { @@ -82,14 +82,14 @@ void Video::updateScreen() { ++nh; } else if (nh != 0) { int16 x = (i - nh) * SCREENBLOCK_W; - _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, 256); + _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, GAMESCREEN_W); nh = 0; ++count; } } if (nh != 0) { int16 x = (i - nh) * SCREENBLOCK_W; - _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, 256); + _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, GAMESCREEN_W); ++count; } p += GAMESCREEN_W / SCREENBLOCK_W; @@ -113,7 +113,7 @@ void Video::fullRefresh() { void Video::fadeOut() { debug(DBG_VIDEO, "Video::fadeOut()"); for (int step = 16; step >= 0; --step) { - for (int c = 0; c < 256; ++c) { + for (int c = 0; c < GAMESCREEN_W; ++c) { Color col; _stub->getPaletteEntry(c, &col); col.r = col.r * step >> 4; @@ -200,14 +200,14 @@ void Video::copyLevelMap(uint16 room) { for (int i = 0; i < 4; ++i) { uint16 sz = READ_LE_UINT16(p); p += 2; decodeLevelMap(sz, p, _res->_memBuf); p += sz; - memcpy(vid, _res->_memBuf, 256 * 56); - vid += 256 * 56; + memcpy(vid, _res->_memBuf, GAMESCREEN_W * 56); + vid += GAMESCREEN_W * 56; } } else { for (int i = 0; i < 4; ++i) { - for (int y = 0; y < 224; ++y) { + for (int y = 0; y < GAMESCREEN_H; ++y) { for (int x = 0; x < 64; ++x) { - _frontLayer[i + x * 4 + 256 * y] = p[256 * 56 * i + x + 64 * y]; + _frontLayer[i + x * 4 + GAMESCREEN_W * y] = p[GAMESCREEN_W * 56 * i + x + 64 * y]; } } } @@ -268,7 +268,7 @@ void Video::drawSpriteSub1(const uint8 * } } src += pitch; - dst += 256; + dst += GAMESCREEN_W; } } @@ -281,7 +281,7 @@ void Video::drawSpriteSub2(const uint8 * } } src += pitch; - dst += 256; + dst += GAMESCREEN_W; } } @@ -294,7 +294,7 @@ void Video::drawSpriteSub3(const uint8 * } } src += pitch; - dst += 256; + dst += GAMESCREEN_W; } } @@ -307,7 +307,7 @@ void Video::drawSpriteSub4(const uint8 * } } src += pitch; - dst += 256; + dst += GAMESCREEN_W; } } @@ -320,7 +320,7 @@ void Video::drawSpriteSub5(const uint8 * } } ++src; - dst += 256; + dst += GAMESCREEN_W; } } @@ -333,7 +333,7 @@ void Video::drawSpriteSub6(const uint8 * } } ++src; - dst += 256; + dst += GAMESCREEN_W; } } @@ -342,7 +342,7 @@ void Video::drawChar(uint8 c, int16 y, i y *= 8; x *= 8; const uint8 *src = _res->_fnt + (c - 32) * 32; - uint8 *dst = _frontLayer + x + 256 * y; + uint8 *dst = _frontLayer + x + GAMESCREEN_W * y; for (int h = 0; h < 8; ++h) { for (int i = 0; i < 4; ++i) { uint8 c1 = (*src & 0xF0) >> 4; @@ -371,14 +371,14 @@ void Video::drawChar(uint8 c, int16 y, i } ++dst; } - dst += 256 - 8; + dst += GAMESCREEN_W - 8; } } const char *Video::drawString(const char *str, int16 x, int16 y, uint8 col) { debug(DBG_VIDEO, "Video::drawString('%s', %d, %d, 0x%X)", str, x, y, col); int len = 0; - int offset = y * 256 + x; + int offset = y * GAMESCREEN_W + x; uint8 *dst = _frontLayer + offset; while (1) { uint8 c = *str++; @@ -401,7 +401,7 @@ const char *Video::drawString(const char } ++dst_char; } - dst_char += 256 - 8; + dst_char += GAMESCREEN_W - 8; } dst += 8; // character width ++len;