Commit | Line | Data |
---|---|---|
dc11a0cb JB |
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() {\r | |
5 | debug(DBG_VIDEO, "Video::updateScreen()");\r | |
6 | // _fullRefresh = true;\r | |
7 | if (_fullRefresh) {\r | |
8 | - _stub->copyRect(0, 0, Video::GAMESCREEN_W, Video::GAMESCREEN_H, _frontLayer, 256);\r | |
9 | + _stub->copyRect(0, 0, Video::GAMESCREEN_W, Video::GAMESCREEN_H, _frontLayer, GAMESCREEN_W);\r | |
10 | _stub->updateScreen(_shakeOffset);\r | |
11 | _fullRefresh = false;\r | |
12 | } else {\r | |
13 | @@ -82,14 +82,14 @@ void Video::updateScreen() {\r | |
14 | ++nh;\r | |
15 | } else if (nh != 0) {\r | |
16 | int16 x = (i - nh) * SCREENBLOCK_W;\r | |
17 | - _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, 256);\r | |
18 | + _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, GAMESCREEN_W);\r | |
19 | nh = 0;\r | |
20 | ++count;\r | |
21 | }\r | |
22 | }\r | |
23 | if (nh != 0) {\r | |
24 | int16 x = (i - nh) * SCREENBLOCK_W;\r | |
25 | - _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, 256);\r | |
26 | + _stub->copyRect(x, j * SCREENBLOCK_H, nh * SCREENBLOCK_W, SCREENBLOCK_H, _frontLayer, GAMESCREEN_W);\r | |
27 | ++count;\r | |
28 | }\r | |
29 | p += GAMESCREEN_W / SCREENBLOCK_W;\r | |
30 | @@ -113,7 +113,7 @@ void Video::fullRefresh() {\r | |
31 | void Video::fadeOut() {\r | |
32 | debug(DBG_VIDEO, "Video::fadeOut()");\r | |
33 | for (int step = 16; step >= 0; --step) {\r | |
34 | - for (int c = 0; c < 256; ++c) {\r | |
35 | + for (int c = 0; c < GAMESCREEN_W; ++c) {\r | |
36 | Color col;\r | |
37 | _stub->getPaletteEntry(c, &col);\r | |
38 | col.r = col.r * step >> 4;\r | |
39 | @@ -200,14 +200,14 @@ void Video::copyLevelMap(uint16 room) {\r | |
40 | for (int i = 0; i < 4; ++i) {\r | |
41 | uint16 sz = READ_LE_UINT16(p); p += 2;\r | |
42 | decodeLevelMap(sz, p, _res->_memBuf); p += sz;\r | |
43 | - memcpy(vid, _res->_memBuf, 256 * 56);\r | |
44 | - vid += 256 * 56;\r | |
45 | + memcpy(vid, _res->_memBuf, GAMESCREEN_W * 56);\r | |
46 | + vid += GAMESCREEN_W * 56;\r | |
47 | }\r | |
48 | } else {\r | |
49 | for (int i = 0; i < 4; ++i) {\r | |
50 | - for (int y = 0; y < 224; ++y) {\r | |
51 | + for (int y = 0; y < GAMESCREEN_H; ++y) {\r | |
52 | for (int x = 0; x < 64; ++x) {\r | |
53 | - _frontLayer[i + x * 4 + 256 * y] = p[256 * 56 * i + x + 64 * y];\r | |
54 | + _frontLayer[i + x * 4 + GAMESCREEN_W * y] = p[GAMESCREEN_W * 56 * i + x + 64 * y];\r | |
55 | }\r | |
56 | }\r | |
57 | }\r | |
58 | @@ -268,7 +268,7 @@ void Video::drawSpriteSub1(const uint8 * | |
59 | }\r | |
60 | }\r | |
61 | src += pitch;\r | |
62 | - dst += 256;\r | |
63 | + dst += GAMESCREEN_W;\r | |
64 | }\r | |
65 | }\r | |
66 | \r | |
67 | @@ -281,7 +281,7 @@ void Video::drawSpriteSub2(const uint8 * | |
68 | }\r | |
69 | }\r | |
70 | src += pitch;\r | |
71 | - dst += 256;\r | |
72 | + dst += GAMESCREEN_W;\r | |
73 | }\r | |
74 | }\r | |
75 | \r | |
76 | @@ -294,7 +294,7 @@ void Video::drawSpriteSub3(const uint8 * | |
77 | }\r | |
78 | }\r | |
79 | src += pitch;\r | |
80 | - dst += 256;\r | |
81 | + dst += GAMESCREEN_W;\r | |
82 | }\r | |
83 | }\r | |
84 | \r | |
85 | @@ -307,7 +307,7 @@ void Video::drawSpriteSub4(const uint8 * | |
86 | }\r | |
87 | }\r | |
88 | src += pitch;\r | |
89 | - dst += 256;\r | |
90 | + dst += GAMESCREEN_W;\r | |
91 | }\r | |
92 | }\r | |
93 | \r | |
94 | @@ -320,7 +320,7 @@ void Video::drawSpriteSub5(const uint8 * | |
95 | }\r | |
96 | }\r | |
97 | ++src;\r | |
98 | - dst += 256;\r | |
99 | + dst += GAMESCREEN_W;\r | |
100 | }\r | |
101 | }\r | |
102 | \r | |
103 | @@ -333,7 +333,7 @@ void Video::drawSpriteSub6(const uint8 * | |
104 | }\r | |
105 | }\r | |
106 | ++src;\r | |
107 | - dst += 256;\r | |
108 | + dst += GAMESCREEN_W;\r | |
109 | }\r | |
110 | }\r | |
111 | \r | |
112 | @@ -342,7 +342,7 @@ void Video::drawChar(uint8 c, int16 y, i | |
113 | y *= 8;\r | |
114 | x *= 8;\r | |
115 | const uint8 *src = _res->_fnt + (c - 32) * 32;\r | |
116 | - uint8 *dst = _frontLayer + x + 256 * y;\r | |
117 | + uint8 *dst = _frontLayer + x + GAMESCREEN_W * y;\r | |
118 | for (int h = 0; h < 8; ++h) {\r | |
119 | for (int i = 0; i < 4; ++i) {\r | |
120 | uint8 c1 = (*src & 0xF0) >> 4;\r | |
121 | @@ -371,14 +371,14 @@ void Video::drawChar(uint8 c, int16 y, i | |
122 | }\r | |
123 | ++dst;\r | |
124 | }\r | |
125 | - dst += 256 - 8;\r | |
126 | + dst += GAMESCREEN_W - 8;\r | |
127 | }\r | |
128 | }\r | |
129 | \r | |
130 | const char *Video::drawString(const char *str, int16 x, int16 y, uint8 col) {\r | |
131 | debug(DBG_VIDEO, "Video::drawString('%s', %d, %d, 0x%X)", str, x, y, col);\r | |
132 | int len = 0;\r | |
133 | - int offset = y * 256 + x;\r | |
134 | + int offset = y * GAMESCREEN_W + x;\r | |
135 | uint8 *dst = _frontLayer + offset;\r | |
136 | while (1) {\r | |
137 | uint8 c = *str++;\r | |
138 | @@ -401,7 +401,7 @@ const char *Video::drawString(const char | |
139 | }\r | |
140 | ++dst_char;\r | |
141 | }\r | |
142 | - dst_char += 256 - 8;\r | |
143 | + dst_char += GAMESCREEN_W - 8;\r | |
144 | }\r | |
145 | dst += 8; // character width\r | |
146 | ++len;\r |