[Scummvm-cvs-logs] SF.net SVN: scummvm:[52945] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Sep 30 15:00:31 CEST 2010


Revision: 52945
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52945&view=rev
Author:   drmccoy
Date:     2010-09-30 13:00:30 +0000 (Thu, 30 Sep 2010)

Log Message:
-----------
GOB: Remove dither stuff, commenting out most v6 drawing

Modified Paths:
--------------
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/gob.h
    scummvm/trunk/engines/gob/init.cpp
    scummvm/trunk/engines/gob/inter.h
    scummvm/trunk/engines/gob/inter_v6.cpp
    scummvm/trunk/engines/gob/util.cpp
    scummvm/trunk/engines/gob/video.cpp
    scummvm/trunk/engines/gob/video.h
    scummvm/trunk/engines/gob/video_v6.cpp

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/gob.cpp	2010-09-30 13:00:30 UTC (rev 52945)
@@ -242,6 +242,10 @@
 	return (isSCNDemo() || isBATDemo());
 }
 
+const Graphics::PixelFormat &GobEngine::getPixelFormat() const {
+	return _pixelFormat;
+}
+
 Common::Error GobEngine::run() {
 	if (!initGameParts()) {
 		GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
@@ -578,8 +582,6 @@
 
 	_global->_primarySurfDesc = SurfaceDescPtr(new SurfaceDesc(_mode, _width, _height));
 
-	_video->init();
-
 	return true;
 }
 

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/gob.h	2010-09-30 13:00:30 UTC (rev 52945)
@@ -221,6 +221,8 @@
 	bool isTrueColor() const;
 	bool isDemo() const;
 
+	const Graphics::PixelFormat &getPixelFormat() const;
+
 	GobEngine(OSystem *syst);
 	virtual ~GobEngine();
 

Modified: scummvm/trunk/engines/gob/init.cpp
===================================================================
--- scummvm/trunk/engines/gob/init.cpp	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/init.cpp	2010-09-30 13:00:30 UTC (rev 52945)
@@ -65,8 +65,6 @@
 	if (_vm->isSCNDemo()) {
 		// This is a non-interactive demo with a SCN script and VMD videos
 
-		_vm->_video->setPrePalette();
-
 		SCNPlayer scnPlayer(_vm);
 
 		if (_vm->_demoIndex > 0)

Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/inter.h	2010-09-30 13:00:30 UTC (rev 52945)
@@ -542,7 +542,6 @@
 
 	bool o6_loadCursor(OpFuncParams &params);
 	bool o6_assign(OpFuncParams &params);
-	bool o6_palLoad(OpFuncParams &params);
 	bool o6_removeHotspot(OpFuncParams &params);
 	bool o6_fillRect(OpFuncParams &params);
 

Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/inter_v6.cpp	2010-09-30 13:00:30 UTC (rev 52945)
@@ -65,7 +65,6 @@
 
 	OPCODEFUNC(0x03, o6_loadCursor);
 	OPCODEFUNC(0x09, o6_assign);
-	OPCODEFUNC(0x13, o6_palLoad);
 	OPCODEFUNC(0x19, o6_removeHotspot);
 	OPCODEFUNC(0x33, o6_fillRect);
 }
@@ -357,17 +356,6 @@
 	return false;
 }
 
-bool Inter_v6::o6_palLoad(OpFuncParams &params) {
-	o1_palLoad(params);
-
-	if (_gotFirstPalette)
-		_vm->_video->_palLUT->setPalette((const byte *)_vm->_global->_pPaletteDesc->vgaPal,
-				Graphics::PaletteLUT::kPaletteRGB, 6, 0);
-
-	_gotFirstPalette = true;
-	return false;
-}
-
 bool Inter_v6::o6_removeHotspot(OpFuncParams &params) {
 	int16 id;
 	uint8 stateType1    = Hotspots::kStateFilledDisabled | Hotspots::kStateType1;

Modified: scummvm/trunk/engines/gob/util.cpp
===================================================================
--- scummvm/trunk/engines/gob/util.cpp	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/util.cpp	2010-09-30 13:00:30 UTC (rev 52945)
@@ -316,8 +316,11 @@
 	_vm->validateVideoMode(_vm->_global->_videoMode);
 
 	if (_vm->_global->_setAllPalette) {
-		memset(colors, 0, 1024);
-		g_system->setPalette(colors, 0, 256);
+		if (_vm->getPixelFormat().bytesPerPixel == 1) {
+			memset(colors, 0, 1024);
+			g_system->setPalette(colors, 0, 256);
+		}
+
 		return;
 	}
 

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/video.cpp	2010-09-30 13:00:30 UTC (rev 52945)
@@ -30,7 +30,6 @@
 #include "graphics/cursorman.h"
 #include "graphics/fontman.h"
 #include "graphics/surface.h"
-#include "graphics/dither.h"
 
 #include "gob/gob.h"
 #include "gob/video.h"
@@ -186,8 +185,6 @@
 	_lastSparse = 0xFFFFFFFF;
 
 	_dirtyAll = false;
-
-	_palLUT = new Graphics::PaletteLUT(5, Graphics::PaletteLUT::kPaletteYUV);
 }
 
 char Video::initDriver(int16 vidMode) {
@@ -199,7 +196,6 @@
 }
 
 Video::~Video() {
-	delete _palLUT;
 }
 
 void Video::freeDriver() {
@@ -524,7 +520,8 @@
 	_vm->_global->_bluePalette[index] = blue;
 	setPalColor(pal, red, green, blue);
 
-	g_system->setPalette(pal, index, 1);
+	if (_vm->getPixelFormat().bytesPerPixel == 1)
+		g_system->setPalette(pal, index, 1);
 }
 
 void Video::setPalette(PalDesc *palDesc) {
@@ -537,7 +534,8 @@
 	for (int i = 0; i < numcolors; i++)
 		setPalColor(pal + i * 4, palDesc->vgaPal[i]);
 
-	g_system->setPalette(pal, 0, numcolors);
+	if (_vm->getPixelFormat().bytesPerPixel == 1)
+		g_system->setPalette(pal, 0, numcolors);
 }
 
 void Video::setFullPalette(PalDesc *palDesc) {
@@ -552,7 +550,8 @@
 			setPalColor(pal + i * 4, colors[i]);
 		}
 
-		g_system->setPalette(pal, 0, 256);
+		if (_vm->getPixelFormat().bytesPerPixel == 1)
+			g_system->setPalette(pal, 0, 256);
 	} else
 		Video::setPalette(palDesc);
 }
@@ -619,32 +618,4 @@
 	}
 }
 
-void Video::initOSD() {
-	const byte palOSD[] = {
-		0, 0, 0, 0,
-		0, 0, 171, 0,
-		0, 171, 0, 0,
-		0, 171, 171, 0,
-		171, 0, 0, 0
-	};
-
-	g_system->setPalette(palOSD, 0, 5);
-}
-
-void Video::drawOSDText(const char *text) {
-	const Graphics::Font &font(*FontMan.getFontByUsage(Graphics::FontManager::kOSDFont));
-	uint32 color = 0x2;
-	Graphics::Surface surf;
-
-	surf.create(g_system->getWidth(), font.getFontHeight(), 1);
-
-	font.drawString(&surf, text, 0, 0, surf.w, color, Graphics::kTextAlignCenter);
-
-	int y = g_system->getHeight() / 2 - font.getFontHeight() / 2;
-	g_system->copyRectToScreen((byte *)surf.pixels, surf.pitch, 0, y, surf.w, surf.h);
-	g_system->updateScreen();
-
-	surf.free();
-}
-
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/video.h
===================================================================
--- scummvm/trunk/engines/gob/video.h	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/video.h	2010-09-30 13:00:30 UTC (rev 52945)
@@ -32,10 +32,6 @@
 
 #include "gob/gob.h"
 
-namespace Graphics {
-	class PaletteLUT;
-}
-
 namespace Gob {
 
 class Font {
@@ -140,8 +136,6 @@
 	int16 _screenDeltaX;
 	int16 _screenDeltaY;
 
-	Graphics::PaletteLUT *_palLUT;
-
 	void freeDriver();
 	void initPrimary(int16 mode);
 	SurfaceDescPtr initSurfDesc(int16 vidMode, int16 width,
@@ -198,10 +192,6 @@
 			int16 srcHeight, int16 x, int16 y, int16 transp,
 			SurfaceDesc &destDesc) = 0;
 
-	virtual void init() {}
-
-	virtual void setPrePalette() { }
-
 	Video(class GobEngine *vm);
 	virtual ~Video();
 
@@ -217,9 +207,6 @@
 	GobEngine *_vm;
 
 	char initDriver(int16 vidMode);
-
-	void initOSD();
-	void drawOSDText(const char *text);
 };
 
 class Video_v1 : public Video {
@@ -248,10 +235,6 @@
 	virtual void fillRect(SurfaceDesc &dest, int16 left, int16 top,
 			int16 right, int16 bottom, int16 color);
 
-	virtual void init();
-
-	virtual void setPrePalette();
-
 	Video_v6(GobEngine *vm);
 	virtual ~Video_v6() {}
 

Modified: scummvm/trunk/engines/gob/video_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/video_v6.cpp	2010-09-30 12:59:48 UTC (rev 52944)
+++ scummvm/trunk/engines/gob/video_v6.cpp	2010-09-30 13:00:30 UTC (rev 52945)
@@ -25,7 +25,6 @@
 
 #include "common/endian.h"
 #include "common/savefile.h"
-#include "graphics/dither.h"
 
 #include "gob/gob.h"
 #include "gob/video.h"
@@ -38,43 +37,6 @@
 Video_v6::Video_v6(GobEngine *vm) : Video_v2(vm) {
 }
 
-void Video_v6::setPrePalette() {
-	byte *tpal = (byte *)_vm->_draw->_vgaPalette;
-	const byte *fpal = (const byte *)_ditherPalette;
-
-	for (int i = 0; i < 256; i++) {
-		byte r, g, b;
-
-		Graphics::PaletteLUT::YUV2RGB(fpal[i * 3 + 0], fpal[i * 3 + 1], fpal[i * 3 + 2],
-		                              r, g, b);
-
-		tpal[i * 3 + 0] = r >> 2;
-		tpal[i * 3 + 1] = g >> 2;
-		tpal[i * 3 + 2] = b >> 2;
-	}
-	_vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette;
-	_vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
-
-}
-
-void Video_v6::init() {
-	initOSD();
-
-	buildPalLUT();
-}
-
-void Video_v6::buildPalLUT() {
-	char text[30];
-
-	_palLUT->setPalette(_ditherPalette, Graphics::PaletteLUT::kPaletteYUV, 8, 0);
-
-	sprintf(text, "Building palette table");
-	drawOSDText(text);
-
-	for (int i = 0; (i < 32) && !_vm->shouldQuit(); i++)
-		_palLUT->buildNext();
-}
-
 char Video_v6::spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
 	    int16 x, int16 y, int16 transp, SurfaceDesc &destDesc) {
 	_vm->validateVideoMode(destDesc._vidMode);
@@ -140,13 +102,16 @@
 void Video_v6::shadeRect(SurfaceDesc &dest,
 		int16 left, int16 top, int16 right, int16 bottom, byte color, byte strength) {
 
+	warning("TODO: Video_v6::shadeRect()");
+
+	/*
 	int width  = right  - left + 1;
 	int height = bottom - top  + 1;
 	int dWidth = dest.getWidth();
 	byte *vidMem = dest.getVidMem() + dWidth * top + left;
 
 	byte sY, sU, sV;
-	_palLUT->getEntry(color, sY, sU, sV);
+	//_palLUT->getEntry(color, sY, sU, sV);
 
 	int shadeY = sY * (16 - strength);
 	int shadeU = sU * (16 - strength);
@@ -176,6 +141,7 @@
 	}
 
 	delete dither;
+	*/
 }
 
 void Video_v6::drawPacked(const byte *sprBuf, int16 x, int16 y, SurfaceDesc &surfDesc) {
@@ -227,6 +193,9 @@
 		int16 dataWidth, int16 dataHeight, int16 width, int16 height,
 		const byte *dataY, const byte *dataU, const byte *dataV) {
 
+	warning("TODO: Video_v6::drawYUV");
+
+	/*
 	byte *vidMem = destDesc.getVidMem() + y * destDesc.getWidth() + x;
 
 	if ((x + width - 1) >= destDesc.getWidth())
@@ -256,73 +225,7 @@
 	}
 
 	delete dither;
+	*/
 }
 
-const byte Video_v6::_ditherPalette[768] = {
-	0x00,0x80,0x80,0x26,0x6B,0xC0,0x4B,0x56,0x4B,0x71,0x41,0x8B,
-	0x0E,0xC0,0x76,0x34,0xAB,0xB6,0x59,0x96,0x41,0xBE,0x81,0x81,
-	0xCF,0x77,0x75,0xC1,0x9B,0x6C,0x7F,0x81,0x81,0x7F,0x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x6D,
-	0x26,0x6B,0x7E,0x21,0x6F,0x93,0x22,0x82,0xA7,0x25,0x6C,0xA4,
-	0x0E,0x81,0x81,0x0F,0xA5,0x81,0x13,0x91,0x73,0x15,0x75,0x71,
-	0x14,0x75,0x7D,0x11,0x77,0x93,0x15,0x7D,0xA1,0x16,0x74,0xA1,
-	0x00,0x80,0x80,0x07,0xA0,0x7B,0x05,0x8F,0x7D,0x09,0x7B,0x7A,
-	0x07,0x7D,0x7B,0x07,0x7C,0x8C,0x0E,0x78,0x98,0x0E,0x78,0x98,
-	0x7F,0x81,0x81,0x80,0x83,0x81,0xF7,0x7C,0x84,0x9E,0x83,0x80,
-	0x7F,0x81,0x81,0x4B,0x56,0xFE,0x93,0x2D,0x17,0xDE,0x03,0x95,
-	0x1C,0xFE,0x6C,0x67,0xD4,0xEA,0xAF,0xAB,0x03,0xFA,0x81,0x81
-};
-
 } // End of namespace Gob


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