[Scummvm-cvs-logs] SF.net SVN: scummvm:[47072] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jan 6 13:17:04 CET 2010


Revision: 47072
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47072&view=rev
Author:   thebluegr
Date:     2010-01-06 12:17:03 +0000 (Wed, 06 Jan 2010)

Log Message:
-----------
Removed all hardcoded screen sizes

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/graphics/transitions.cpp
    scummvm/trunk/engines/sci/video/seq_decoder.cpp

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-01-06 12:15:05 UTC (rev 47071)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-01-06 12:17:03 UTC (rev 47072)
@@ -1822,6 +1822,7 @@
 			if (argc > 7)
 				opt = argv[7].toUint16();
 		} else {
+			// SCI1.1 and older games always ran with an internal resolution of 320x200
 			poly_list = argv[4];
 			width = 320;
 			height = 190;

Modified: scummvm/trunk/engines/sci/graphics/transitions.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/transitions.cpp	2010-01-06 12:15:05 UTC (rev 47071)
+++ scummvm/trunk/engines/sci/graphics/transitions.cpp	2010-01-06 12:17:03 UTC (rev 47072)
@@ -170,7 +170,7 @@
 	// Now we do the actual transition to the new screen
 	doTransition(_number, false);
 
-	if (picRect.bottom != 320) {
+	if (picRect.bottom != _screen->_height) {
 		// TODO: this is a workaround for lsl6 not showing menubar when playing
 		//  There is some new code in the sierra sci in ShowPic that seems to do something similar to this
 		_screen->copyToScreen();
@@ -305,10 +305,10 @@
 
 	do {
 		mask = (mask & 1) ? (mask >> 1) ^ 0xB400 : mask >> 1;
-		if (mask >= 320 * 200)
+		if (mask >= _screen->_width * _screen->_height)
 			continue;
-		pixelRect.left = mask % 320; pixelRect.right = pixelRect.left + 1;
-		pixelRect.top = mask / 320;	pixelRect.bottom = pixelRect.top + 1;
+		pixelRect.left = mask % _screen->_width; pixelRect.right = pixelRect.left + 1;
+		pixelRect.top = mask / _screen->_width;	pixelRect.bottom = pixelRect.top + 1;
 		pixelRect.clip(_picRect);
 		if (!pixelRect.isEmpty())
 			copyRectToScreen(pixelRect, blackoutFlag);

Modified: scummvm/trunk/engines/sci/video/seq_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sci/video/seq_decoder.cpp	2010-01-06 12:15:05 UTC (rev 47071)
+++ scummvm/trunk/engines/sci/video/seq_decoder.cpp	2010-01-06 12:17:03 UTC (rev 47072)
@@ -35,6 +35,10 @@
 
 namespace Sci {
 
+// SEQ videos always run at 320x200
+#define SCREEN_WIDTH 320
+#define SCREEN_HEIGHT 200
+
 enum seqPalTypes {
 	kSeqPalVariable = 0,
 	kSeqPalConstant = 1
@@ -59,8 +63,8 @@
 	// Seek to the first frame
 	_videoInfo.currentFrame = 0;
 
-	_videoInfo.width = 320;
-	_videoInfo.height = 200;
+	_videoInfo.width = SCREEN_WIDTH;
+	_videoInfo.height = SCREEN_HEIGHT;
 	_videoInfo.frameCount = _fileStream->readUint16LE();
 	// Our frameDelay is calculated in 1/100 ms, so we convert it here
 	_videoInfo.frameDelay = 100 * frameDelay * 1000 / 60;
@@ -129,7 +133,7 @@
 		_videoInfo.startTime = g_system->getMillis();
 
 	if (frameType == kSeqFrameFull) {
-		byte *dst = _videoFrameBuffer + frameTop * 320 + frameLeft;
+		byte *dst = _videoFrameBuffer + frameTop * SCREEN_WIDTH + frameLeft;
 		
 		byte *linebuf = new byte[frameWidth];
 
@@ -143,7 +147,7 @@
 	} else {
 		byte *buf = new byte[frameSize];
 		_fileStream->read(buf, frameSize);
-		decodeFrame(buf, rleSize, buf + rleSize, frameSize - rleSize, _videoFrameBuffer + 320 * frameTop, frameLeft, frameWidth, frameHeight, colorKey);
+		decodeFrame(buf, rleSize, buf + rleSize, frameSize - rleSize, _videoFrameBuffer + SCREEN_WIDTH * frameTop, frameLeft, frameWidth, frameHeight, colorKey);
 		delete[] buf;
 	}
 
@@ -151,14 +155,14 @@
 }
 
 #define WRITE_TO_BUFFER(n) \
-	if (writeRow * 320 + writeCol + (n) > 320 * height) { \
+	if (writeRow * SCREEN_WIDTH + writeCol + (n) > SCREEN_WIDTH * height) { \
 		warning("SEQ player: writing out of bounds, aborting"); \
 		return false; \
 	} \
 	if (litPos + (n) > litSize) { \
 		warning("SEQ player: reading out of bounds, aborting"); \
 	} \
-	memcpy(dest + writeRow * 320 + writeCol, litData + litPos, n);
+	memcpy(dest + writeRow * SCREEN_WIDTH + writeCol, litData + litPos, n);
 
 bool SeqDecoder::decodeFrame(byte *rleData, int rleSize, byte *litData, int litSize, byte *dest, int left, int width, int height, int colorKey) {
 	int writeRow = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list