[Scummvm-cvs-logs] SF.net SVN: scummvm:[39408] scummvm/trunk/engines/groovie

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Sun Mar 15 05:34:01 CET 2009


Revision: 39408
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39408&view=rev
Author:   jvprat
Date:     2009-03-15 04:34:00 +0000 (Sun, 15 Mar 2009)

Log Message:
-----------
Groovie: Add non-uniform scaling to the ROQ player

Modified Paths:
--------------
    scummvm/trunk/engines/groovie/roq.cpp
    scummvm/trunk/engines/groovie/roq.h

Modified: scummvm/trunk/engines/groovie/roq.cpp
===================================================================
--- scummvm/trunk/engines/groovie/roq.cpp	2009-03-15 04:29:26 UTC (rev 39407)
+++ scummvm/trunk/engines/groovie/roq.cpp	2009-03-15 04:34:00 UTC (rev 39408)
@@ -152,7 +152,7 @@
 
 	for (int line = 0; line < _showBuf.h; line++) {
 		byte *out = (byte *)_showBuf.getBasePtr(0, line);
-		byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scale);
+		byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
 		for (int x = 0; x < _showBuf.w; x++) {
 #ifdef DITHER
 			*out = _dither->dither(*in, *(in + 1), *(in + 2), x);
@@ -161,7 +161,7 @@
 			*out = *in;
 #endif
 			out++;
-			if (!(x % _scale))
+			if (!(x % _scaleX))
 				in += _prevBuf->bytesPerPixel;
 		}
 #ifdef DITHER
@@ -305,7 +305,8 @@
 	// If the size of the image has changed, resize the buffers
 	if ((width != _currBuf->w) || (height != _currBuf->h)) {
 		// Calculate the maximum scale that fits the screen
-		_scale = MIN(_syst->getWidth() / width, _syst->getHeight() / height);
+		_scaleX = MIN(_syst->getWidth() / width, 2);
+		_scaleY = MIN(_syst->getHeight() / height, 2);
 
 		// Free the previous surfaces
 		_currBuf->free();
@@ -315,12 +316,12 @@
 		// Allocate new buffers
 		_currBuf->create(width, height, 3);
 		_prevBuf->create(width, height, 3);
-		_showBuf.create(width * _scale, height * _scale, 1);
+		_showBuf.create(width * _scaleX, height * _scaleY, 1);
 
 #ifdef DITHER
 		// Reset the dithering algorithm with the new width
 		delete _dither;
-		_dither = new Graphics::SierraLight(width * _scale, _paletteLookup);
+		_dither = new Graphics::SierraLight(width * _scaleX, _paletteLookup);
 #endif
 	}
 
@@ -650,8 +651,8 @@
 }
 
 void ROQPlayer::copy(byte size, int destx, int desty, int offx, int offy) {
-	offx *= _offScale / _scale;
-	offy *= _scale;
+	offx *= _offScale / _scaleX;
+	offy *= _offScale / _scaleY;
 
 	// Get the beginning of the first line
 	byte *dst = (byte *)_currBuf->getBasePtr(destx, desty);

Modified: scummvm/trunk/engines/groovie/roq.h
===================================================================
--- scummvm/trunk/engines/groovie/roq.h	2009-03-15 04:29:26 UTC (rev 39407)
+++ scummvm/trunk/engines/groovie/roq.h	2009-03-15 04:34:00 UTC (rev 39408)
@@ -88,7 +88,7 @@
 	Graphics::Surface *_prevBuf;
 	Graphics::Surface _showBuf;
 	void buildShowBuf();
-	byte _scale;
+	byte _scaleX, _scaleY;
 	byte _offScale;
 	bool _dirty;
 	byte _alpha;


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