[Scummvm-cvs-logs] scummvm master -> 06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566

digitall dgturner at iee.org
Fri Nov 30 11:50:56 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
06cc3b051a DREAMWEB: Further migration to screen size constants.


Commit: 06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566
    https://github.com/scummvm/scummvm/commit/06cc3b051ae03c0a7eafa52089ae3d9bfa4ba566
Author: D G Turner (digitall at scummvm.org)
Date: 2012-11-30T02:49:25-08:00

Commit Message:
DREAMWEB: Further migration to screen size constants.

Changed paths:
    engines/dreamweb/backdrop.cpp
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/keypad.cpp
    engines/dreamweb/rain.cpp



diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 1db2663..f410ee1 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 d65da8b..f7b291b 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 3580f8a..28d073e 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 8e42e0c..b636b7d 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
 		}
 	}
 






More information about the Scummvm-git-logs mailing list