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

scott_t at users.sourceforge.net scott_t at users.sourceforge.net
Thu Dec 24 09:33:38 CET 2009


Revision: 46523
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46523&view=rev
Author:   scott_t
Date:     2009-12-24 08:33:37 +0000 (Thu, 24 Dec 2009)

Log Message:
-----------
Tweak Groovie2 video buffer handling

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-12-24 08:26:13 UTC (rev 46522)
+++ scummvm/trunk/engines/groovie/roq.cpp	2009-12-24 08:33:37 UTC (rev 46523)
@@ -43,7 +43,8 @@
 #ifdef DITHER
 	_dither(NULL),
 #endif
-	VideoPlayer(vm), _codingTypeCount(0) {
+	VideoPlayer(vm), _codingTypeCount(0),
+	_fg(&_vm->_graphicsMan->_foreground), _bg(&_vm->_graphicsMan->_background) {
 
 	// Create the work surfaces
 	_currBuf = new Graphics::Surface();
@@ -103,7 +104,6 @@
 	delete _currBuf;
 	_prevBuf->free();
 	delete _prevBuf;
-	_showBuf.free();
 
 #ifdef DITHER
 	// Free the dithering algorithm
@@ -158,10 +158,10 @@
 	_dither->newFrame();
 #endif
 
-	for (int line = 0; line < _showBuf.h; line++) {
-		byte *out = (byte *)_showBuf.getBasePtr(0, line);
+	for (int line = 0; line < _bg->h; line++) {
+		byte *out = (byte *)_bg->getBasePtr(0, line);
 		byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY);
-		for (int x = 0; x < _showBuf.w; x++) {
+		for (int x = 0; x < _bg->w; x++) {
 			if (_vm->_mode8bit) {
 #ifdef DITHER
 				*out = _dither->dither(*in, *(in + 1), *(in + 2), x);
@@ -214,7 +214,7 @@
 
 	if (_dirty) {
 		// Update the screen
-		_syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.pitch, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.w, _showBuf.h);
+		_syst->copyRectToScreen((byte *)_bg->getBasePtr(0, 0), _bg->pitch, 0, (_syst->getHeight() - _bg->h) / 2, _bg->w, _bg->h);
 		_syst->updateScreen();
 
 		// Clear the dirty flag
@@ -333,12 +333,10 @@
 		// Free the previous surfaces
 		_currBuf->free();
 		_prevBuf->free();
-		_showBuf.free();
 
 		// Allocate new buffers
 		_currBuf->create(width, height, 3);
 		_prevBuf->create(width, height, 3);
-		_showBuf.create(width * _scaleX, height * _scaleY, _vm->_pixelFormat.bytesPerPixel);
 
 		// Clear the buffers with black YUV values
 		byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0);
@@ -503,7 +501,6 @@
 		*ptr++ = *u++;
 		*ptr++ = *v++;
 	}
-	memcpy(_prevBuf->getBasePtr(0, 0), _currBuf->getBasePtr(0, 0), _prevBuf->w * _prevBuf->h * 3);
 
 	delete jpg;
 	return true;

Modified: scummvm/trunk/engines/groovie/roq.h
===================================================================
--- scummvm/trunk/engines/groovie/roq.h	2009-12-24 08:26:13 UTC (rev 46522)
+++ scummvm/trunk/engines/groovie/roq.h	2009-12-24 08:33:37 UTC (rev 46523)
@@ -84,9 +84,8 @@
 	byte _codebook4[256 * 4];
 
 	// Buffers
-	Graphics::Surface *_currBuf;
-	Graphics::Surface *_prevBuf;
-	Graphics::Surface _showBuf;
+	Graphics::Surface *_fg, *_bg, *_thirdBuf;
+	Graphics::Surface *_currBuf, *_prevBuf;
 	void buildShowBuf();
 	byte _scaleX, _scaleY;
 	byte _offScale;


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