[Scummvm-cvs-logs] scummvm master -> 862a4ca929ef82044601a4c2597d7f3bc69e70f8

scott-t s at sthomas.id.au
Tue Sep 6 14:34:59 CEST 2011


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:
862a4ca929 GROOVIE: Remove dither code from ROQ


Commit: 862a4ca929ef82044601a4c2597d7f3bc69e70f8
    https://github.com/scummvm/scummvm/commit/862a4ca929ef82044601a4c2597d7f3bc69e70f8
Author: Scott Thomas (scott_t at users.sourceforge.net)
Date: 2011-09-06T05:29:24-07:00

Commit Message:
GROOVIE: Remove dither code from ROQ

Changed paths:
    engines/groovie/roq.cpp
    engines/groovie/roq.h



diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 7f477c4..ca896a8 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -43,9 +43,6 @@
 namespace Groovie {
 
 ROQPlayer::ROQPlayer(GroovieEngine *vm) :
-#ifdef DITHER
-	_dither(NULL),
-#endif
 	VideoPlayer(vm), _codingTypeCount(0),
 	_fg(&_vm->_graphicsMan->_foreground), _bg(&_vm->_graphicsMan->_background) {
 
@@ -55,38 +52,13 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
 
 	if (_vm->_mode8bit) {
 		byte pal[256 * 3];
-#ifdef DITHER
-		// Initialize to a black palette
-		memset(pal, 0, 256 * 3);
-
-		// Build a basic color palette
-		for (int r = 0; r < 4; r++) {
-			for (int g = 0; g < 4; g++) {
-				for (int b = 0; b < 4; b++) {
-					byte col = (r << 4) | (g << 2) | (b << 0);
-					pal[3 * col + 0] = r << 6;
-					pal[3 * col + 1] = g << 6;
-					pal[3 * col + 2] = b << 6;
-				}
-			}
-		}
-
-		// Initialize the dithering algorithm
-		_paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
-		_paletteLookup->setPalette(pal, Graphics::PaletteLUT::kPaletteRGB, 8);
-		for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
-			debug("Groovie::ROQ: Building palette table: %02d/63", i);
-			_paletteLookup->buildNext();
-		}
 
-#else // !DITHER
 		// Set a grayscale palette
 		for (int i = 0; i < 256; i++) {
 			pal[(i * 3) + 0] = i;
 			pal[(i * 3) + 1] = i;
 			pal[(i * 3) + 2] = i;
 		}
-#endif // DITHER
 
 		_syst->getPaletteManager()->setPalette(pal, 0, 256);
 	}
@@ -98,12 +70,6 @@ ROQPlayer::~ROQPlayer() {
 	delete _currBuf;
 	_prevBuf->free();
 	delete _prevBuf;
-
-#ifdef DITHER
-	// Free the dithering algorithm
-	delete _dither;
-	delete _paletteLookup;
-#endif
 }
 
 uint16 ROQPlayer::loadInternal() {
@@ -147,22 +113,13 @@ uint16 ROQPlayer::loadInternal() {
 }
 
 void ROQPlayer::buildShowBuf() {
-#ifdef DITHER
-	// Start a new frame dithering
-	_dither->newFrame();
-#endif
-
 	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 < _bg->w; x++) {
 			if (_vm->_mode8bit) {
-#ifdef DITHER
-				*out = _dither->dither(*in, *(in + 1), *(in + 2), x);
-#else
 				// Just use the luminancy component
 				*out = *in;
-#endif // DITHER
 #ifdef USE_RGB_COLOR
 			} else {
 				// Do the format conversion (YUV -> RGB -> Screen format)
@@ -178,9 +135,6 @@ void ROQPlayer::buildShowBuf() {
 			if (!(x % _scaleX))
 				in += _currBuf->format.bytesPerPixel;
 		}
-#ifdef DITHER
-		_dither->nextLine();
-#endif
 	}
 
 	// Swap buffers
@@ -349,11 +303,6 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
 			*ptr2++ = 128;
 		}
 
-#ifdef DITHER
-		// Reset the dithering algorithm with the new width
-		delete _dither;
-		_dither = new Graphics::SierraLight(width * _scaleX, _paletteLookup);
-#endif
 	}
 
 	return true;
diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h
index ddb3070..c5d3f25 100644
--- a/engines/groovie/roq.h
+++ b/engines/groovie/roq.h
@@ -25,12 +25,6 @@
 
 #include "groovie/player.h"
 
-//#define DITHER
-
-#ifdef DITHER
-#include "graphics/dither.h"
-#endif
-
 namespace Groovie {
 
 class GroovieEngine;
@@ -89,11 +83,6 @@ private:
 	bool _dirty;
 	byte _alpha;
 
-#ifdef DITHER
-	// Dithering
-	Graphics::PaletteLUT *_paletteLookup;
-	Graphics::SierraLight *_dither;
-#endif
 };
 
 } // End of Groovie namespace






More information about the Scummvm-git-logs mailing list