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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Sep 30 15:03:23 CEST 2010


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

Log Message:
-----------
GOB: Create 16bit surfaces for true color games

Enabling basic Urban drawing again

Modified Paths:
--------------
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/inter_v4.cpp
    scummvm/trunk/engines/gob/inter_v5.cpp
    scummvm/trunk/engines/gob/video.cpp
    scummvm/trunk/engines/gob/video_v6.cpp

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2010-09-30 13:02:50 UTC (rev 52948)
+++ scummvm/trunk/engines/gob/gob.cpp	2010-09-30 13:03:22 UTC (rev 52949)
@@ -230,11 +230,6 @@
 }
 
 bool GobEngine::isTrueColor() const {
-	if (_features & kFeaturesTrueColor) {
-		warning("TODO: _features & kFeaturesTrueColor");
-		return false;
-	}
-
 	return (_features & kFeaturesTrueColor) != 0;
 }
 
@@ -580,7 +575,7 @@
 	_global->_mouseMaxX = _width;
 	_global->_mouseMaxY = _height;
 
-	_global->_primarySurfDesc = SurfacePtr(new Surface(_width, _height, 1));
+	_global->_primarySurfDesc = SurfacePtr(new Surface(_width, _height, _pixelFormat.bytesPerPixel));
 
 	return true;
 }

Modified: scummvm/trunk/engines/gob/inter_v4.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v4.cpp	2010-09-30 13:02:50 UTC (rev 52948)
+++ scummvm/trunk/engines/gob/inter_v4.cpp	2010-09-30 13:03:22 UTC (rev 52949)
@@ -134,8 +134,8 @@
 	_vm->_util->setScrollOffset();
 
 	if (offY > 0) {
-		_vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, 1));
-		_vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, 1));
+		_vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel));
+		_vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel));
 		_vm->_video->_splitSurf = _vm->_draw->_spritesArray[25];
 	}
 }

Modified: scummvm/trunk/engines/gob/inter_v5.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v5.cpp	2010-09-30 13:02:50 UTC (rev 52948)
+++ scummvm/trunk/engines/gob/inter_v5.cpp	2010-09-30 13:03:22 UTC (rev 52949)
@@ -194,8 +194,8 @@
 	_vm->_util->setScrollOffset();
 
 	if (offY > 0) {
-		_vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, 1));
-		_vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, 1));
+		_vm->_draw->_spritesArray[24] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel));
+		_vm->_draw->_spritesArray[25] = SurfacePtr(new Surface(_vm->_width, offY, _vm->getPixelFormat().bytesPerPixel));
 		_vm->_video->_splitSurf = _vm->_draw->_spritesArray[25];
 	}
 }

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2010-09-30 13:02:50 UTC (rev 52948)
+++ scummvm/trunk/engines/gob/video.cpp	2010-09-30 13:03:22 UTC (rev 52949)
@@ -209,7 +209,7 @@
 		if (!(flags & SCUMMVM_CURSOR))
 			width = (width + 7) & 0xFFF8;
 
-		descPtr = SurfacePtr(new Surface(width, height, 1));
+		descPtr = SurfacePtr(new Surface(width, height, _vm->getPixelFormat().bytesPerPixel));
 	}
 	return descPtr;
 }

Modified: scummvm/trunk/engines/gob/video_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/video_v6.cpp	2010-09-30 13:02:50 UTC (rev 52948)
+++ scummvm/trunk/engines/gob/video_v6.cpp	2010-09-30 13:03:22 UTC (rev 52949)
@@ -26,6 +26,8 @@
 #include "common/endian.h"
 #include "common/savefile.h"
 
+#include "graphics/conversion.h"
+
 #include "gob/gob.h"
 #include "gob/video.h"
 #include "gob/util.h"
@@ -192,39 +194,42 @@
 		int16 dataWidth, int16 dataHeight, int16 width, int16 height,
 		const byte *dataY, const byte *dataU, const byte *dataV) {
 
-	warning("TODO: Video_v6::drawYUV");
+	const Graphics::PixelFormat &pixelFormat = _vm->getPixelFormat();
 
-	/*
-	byte *vidMem = destDesc.getVidMem() + y * destDesc.getWidth() + x;
-
 	if ((x + width - 1) >= destDesc.getWidth())
 		width = destDesc.getWidth() - x;
 	if ((y + height - 1) >= destDesc.getHeight())
 		height = destDesc.getHeight() - y;
 
-	Graphics::SierraLight *dither =
-		new Graphics::SierraLight(width, _palLUT);
+	Pixel dst = destDesc.get(x, y);
 
 	for (int i = 0; i < height; i++) {
-		byte *dest = vidMem;
+		Pixel dstRow = dst;
+
 		const byte *srcY = dataY +  i       *  dataWidth;
 		const byte *srcU = dataU + (i >> 2) * (dataWidth >> 2);
 		const byte *srcV = dataV + (i >> 2) * (dataWidth >> 2);
 
 		for (int j = 0; j < (width >> 2); j++, srcU++, srcV++) {
-			for (int n = 0; n < 4; n++, dest++, srcY++) {
+			for (int n = 0; n < 4; n++, dstRow++, srcY++) {
 				byte dY = *srcY << 1, dU = *srcU << 1, dV = *srcV << 1;
 
-				*dest = (dY == 0) ? 0 : dither->dither(dY, dU, dV, j * 4 + n);
+				byte r, g, b;
+				Graphics::YUV2RGB(dY, dU, dV, r, g, b);
+
+				if (dY != 0) {
+					uint32 c = pixelFormat.RGBToColor(r, g, b);
+
+					dstRow.set((c == 0) ? 1 : c);
+				} else
+					dstRow.set(0);
+
 			}
 		}
 
-		dither->nextLine();
-		vidMem += destDesc.getWidth();
+		dst += destDesc.getWidth();
 	}
 
-	delete dither;
-	*/
 }
 
 } // 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