aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2012-11-30 10:49:25 +0000
committerD G Turner2012-11-30 10:49:25 +0000
commit06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566 (patch)
tree4d3ab04bf3a97a246ffa9885052ada4b003d96d7
parent396f45f551bbfacd3dfd46177d27b68a9bc4ffd0 (diff)
downloadscummvm-rg350-06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566.tar.gz
scummvm-rg350-06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566.tar.bz2
scummvm-rg350-06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566.zip
DREAMWEB: Further migration to screen size constants.
-rw-r--r--engines/dreamweb/backdrop.cpp14
-rw-r--r--engines/dreamweb/dreamweb.cpp10
-rw-r--r--engines/dreamweb/keypad.cpp5
-rw-r--r--engines/dreamweb/rain.cpp4
4 files changed, 16 insertions, 17 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 1db2663624..f410ee16cf 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -25,7 +25,7 @@
namespace DreamWeb {
void DreamWebEngine::doBlocks() {
- uint16 dstOffset = _mapAdY * 320 + _mapAdX;
+ uint16 dstOffset = _mapAdY * kScreenwidth + _mapAdX;
uint16 mapOffset = _mapY * kMapWidth + _mapX;
const uint8 *mapData = _mapData + mapOffset;
uint8 *dstBuffer = workspace() + dstOffset;
@@ -34,26 +34,26 @@ void DreamWebEngine::doBlocks() {
for (size_t j = 0; j < 11; ++j) {
uint16 blockType = mapData[j];
if (blockType != 0) {
- uint8 *dst = dstBuffer + i * 320 * 16 + j * 16;
+ uint8 *dst = dstBuffer + i * kScreenwidth * 16 + j * 16;
const uint8 *block = _backdropBlocks + blockType * 256;
for (size_t k = 0; k < 4; ++k) {
memcpy(dst, block, 16);
block += 16;
- dst += 320;
+ dst += kScreenwidth;
}
for (size_t k = 0; k < 12; ++k) {
memcpy(dst, block, 16);
memset(dst + 16, 0xdf, 4);
block += 16;
- dst += 320;
+ dst += kScreenwidth;
}
dst += 4;
memset(dst, 0xdf, 16);
- dst += 320;
+ dst += kScreenwidth;
memset(dst, 0xdf, 16);
- dst += 320;
+ dst += kScreenwidth;
memset(dst, 0xdf, 16);
- dst += 320;
+ dst += kScreenwidth;
memset(dst, 0xdf, 16);
}
}
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index d65da8b65c..f7b291b983 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -416,7 +416,7 @@ void DreamWebEngine::getPalette(uint8 *data, uint start, uint count) {
void DreamWebEngine::setPalette(const uint8 *data, uint start, uint count) {
assert(start + count <= 256);
- uint8 fixed[768];
+ uint8 fixed[3*256];
for (uint i = 0; i < count * 3; ++i) {
fixed[i] = data[i] << 2;
}
@@ -424,10 +424,10 @@ void DreamWebEngine::setPalette(const uint8 *data, uint start, uint count) {
}
void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int h) {
- if (y + h > 200)
- h = 200 - y;
- if (x + w > 320)
- w = 320 - x;
+ if (y + h > (int)kScreenheight)
+ h = kScreenheight - y;
+ if (x + w > (int)kScreenwidth)
+ w = kScreenwidth - x;
if (h <= 0 || w <= 0)
return;
_system->copyRectToScreen(src, pitch, x, y, w, h);
diff --git a/engines/dreamweb/keypad.cpp b/engines/dreamweb/keypad.cpp
index 3580f8ad52..28d073ec2f 100644
--- a/engines/dreamweb/keypad.cpp
+++ b/engines/dreamweb/keypad.cpp
@@ -103,7 +103,6 @@ void DreamWebEngine::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 d
// Note: isItRight comes from use.asm, but is only used by enterCode(),
// so we place it here.
bool DreamWebEngine::isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3) {
-
return digit0 == _pressList[0] && digit1 == _pressList[1]
&& digit2 == _pressList[2] && digit3 == _pressList[3];
}
@@ -455,12 +454,12 @@ void DreamWebEngine::showLeftPage() {
_kerning = 0;
_charShift = 0;
_lineSpacing = 10;
- uint8 *bufferToSwap = workspace() + (48*320)+2;
+ uint8 *bufferToSwap = workspace() + (48*kScreenwidth)+2;
for (size_t i = 0; i < 120; ++i) {
for (size_t j = 0; j < 65; ++j) {
SWAP(bufferToSwap[j], bufferToSwap[130 - j]);
}
- bufferToSwap += 320;
+ bufferToSwap += kScreenwidth;
}
}
diff --git a/engines/dreamweb/rain.cpp b/engines/dreamweb/rain.cpp
index 8e42e0c161..b636b7def7 100644
--- a/engines/dreamweb/rain.cpp
+++ b/engines/dreamweb/rain.cpp
@@ -42,12 +42,12 @@ void DreamWebEngine::showRain() {
uint16 offset = (rain.w3 - rain.b5) & 511;
rain.w3 = offset;
const uint8 *src = frameData + offset;
- uint8 *dst = workspace() + y * 320 + x;
+ uint8 *dst = workspace() + y * kScreenwidth + x;
for (uint16 j = 0; j < size; ++j) {
uint8 v = src[j];
if (v != 0)
*dst = v;
- dst += 320-1; // advance diagonally
+ dst += kScreenwidth-1; // advance diagonally
}
}