1 diff -purN REminiscence-0.1.9.orig/video.cpp REminiscence-0.1.9/video.cpp
2 --- REminiscence-0.1.9.orig/video.cpp 2010-01-21 20:37:10.000000000 +0100
3 +++ REminiscence-0.1.9/video.cpp 2010-01-21 21:16:09.000000000 +0100
4 @@ -67,7 +67,7 @@ void Video::updateScreen() {
5 debug(DBG_VIDEO, "Video::updateScreen()");
6 // _fullRefresh = true;
8 - _stub->copyRect(0, 0, Video::GAMESCREEN_W, Video::GAMESCREEN_H, _frontLayer, 256);
9 + _stub->copyRect(0, 0, Video::GAMESCREEN_W, Video::GAMESCREEN_H, _frontLayer, GAMESCREEN_W);
10 _stub->updateScreen(_shakeOffset);
13 @@ -82,14 +82,14 @@ void Video::updateScreen() {
16 int16 x = (i - nh) * SCREENBLOCK_W;
17 - _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, 256);
18 + _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, GAMESCREEN_W);
24 int16 x = (i - nh) * SCREENBLOCK_W;
25 - _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, 256);
26 + _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, GAMESCREEN_W);
29 p += GAMESCREEN_W / SCREENBLOCK_W;
30 @@ -113,7 +113,7 @@ void Video::fullRefresh() {
31 void Video::fadeOut() {
32 debug(DBG_VIDEO, "Video::fadeOut()");
33 for (int step = 16; step >= 0; --step) {
34 - for (int c = 0; c < 256; ++c) {
35 + for (int c = 0; c < GAMESCREEN_W; ++c) {
37 _stub->getPaletteEntry(c, &col);
38 col.r = col.r * step >> 4;
39 @@ -200,14 +200,14 @@ void Video::copyLevelMap(uint16 room) {
40 for (int i = 0; i < 4; ++i) {
41 uint16 sz = READ_LE_UINT16(p); p += 2;
42 decodeLevelMap(sz, p, _res->_memBuf); p += sz;
43 - memcpy(vid, _res->_memBuf, 256 * 56);
45 + memcpy(vid, _res->_memBuf, GAMESCREEN_W * 56);
46 + vid += GAMESCREEN_W * 56;
49 for (int i = 0; i < 4; ++i) {
50 - for (int y = 0; y < 224; ++y) {
51 + for (int y = 0; y < GAMESCREEN_H; ++y) {
52 for (int x = 0; x < 64; ++x) {
53 - _frontLayer[i + x * 4 + 256 * y] = p[256 * 56 * i + x + 64 * y];
54 + _frontLayer[i + x * 4 + GAMESCREEN_W * y] = p[GAMESCREEN_W * 56 * i + x + 64 * y];
58 @@ -268,7 +268,7 @@ void Video::drawSpriteSub1(const uint8 *
63 + dst += GAMESCREEN_W;
67 @@ -281,7 +281,7 @@ void Video::drawSpriteSub2(const uint8 *
72 + dst += GAMESCREEN_W;
76 @@ -294,7 +294,7 @@ void Video::drawSpriteSub3(const uint8 *
81 + dst += GAMESCREEN_W;
85 @@ -307,7 +307,7 @@ void Video::drawSpriteSub4(const uint8 *
90 + dst += GAMESCREEN_W;
94 @@ -320,7 +320,7 @@ void Video::drawSpriteSub5(const uint8 *
99 + dst += GAMESCREEN_W;
103 @@ -333,7 +333,7 @@ void Video::drawSpriteSub6(const uint8 *
108 + dst += GAMESCREEN_W;
112 @@ -342,7 +342,7 @@ void Video::drawChar(uint8 c, int16 y, i
115 const uint8 *src = _res->_fnt + (c - 32) * 32;
116 - uint8 *dst = _frontLayer + x + 256 * y;
117 + uint8 *dst = _frontLayer + x + GAMESCREEN_W * y;
118 for (int h = 0; h < 8; ++h) {
119 for (int i = 0; i < 4; ++i) {
120 uint8 c1 = (*src & 0xF0) >> 4;
121 @@ -371,14 +371,14 @@ void Video::drawChar(uint8 c, int16 y, i
126 + dst += GAMESCREEN_W - 8;
130 const char *Video::drawString(const char *str, int16 x, int16 y, uint8 col) {
131 debug(DBG_VIDEO, "Video::drawString('%s', %d, %d, 0x%X)", str, x, y, col);
133 - int offset = y * 256 + x;
134 + int offset = y * GAMESCREEN_W + x;
135 uint8 *dst = _frontLayer + offset;
138 @@ -401,7 +401,7 @@ const char *Video::drawString(const char
142 - dst_char += 256 - 8;
143 + dst_char += GAMESCREEN_W - 8;
145 dst += 8; // character width