[Scummvm-cvs-logs] SF.net SVN: scummvm:[42467] scummvm/branches/gsoc2009-16bit

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Tue Jul 14 10:27:36 CEST 2009


Revision: 42467
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42467&view=rev
Author:   upthorn
Date:     2009-07-14 08:27:36 +0000 (Tue, 14 Jul 2009)

Log Message:
-----------
changed generic Graphics::PixelFormat constructor to take xBits instead of xLoss. Modified OSystem_SDL::getSupportedFormats and ScummEngine::init to account for this change.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp
    scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp
    scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h

Modified: scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp	2009-07-14 02:15:31 UTC (rev 42466)
+++ scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp	2009-07-14 08:27:36 UTC (rev 42467)
@@ -213,30 +213,30 @@
 const Graphics::PixelFormat RGBList[] = {
 #ifdef ENABLE_32BIT
 	// RGBA8888, ARGB8888, RGB888
-	Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0),
-	Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24),
-	Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0),
+	Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0),
+	Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24),
+	Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0),
 #endif
 	// RGB565, XRGB1555, RGB555, RGBA4444, ARGB4444
-	Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0),
-	Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15),
-	Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0),
+	Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),
+	Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15),
+	Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0),
 	Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0),
 	Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)
 };
 const Graphics::PixelFormat BGRList[] = {
 #ifdef ENABLE_32BIT
 	// ABGR8888, BGRA8888, BGR888
-	Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24),
-	Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0),
-	Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0),
+	Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24),
+	Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0),
+	Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 8, 16, 0),
 #endif
 	// BGR565, XBGR1555, BGR555, ABGR4444, BGRA4444
-	Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0),
-	Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15),
-	Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0),
+	Graphics::PixelFormat(2, 5, 6, 5, 0, 0, 5, 11, 0),
+	Graphics::PixelFormat(2, 5, 5, 5, 1, 0, 5, 10, 15),
+	Graphics::PixelFormat(2, 5, 5, 5, 0, 0, 5, 10, 0),
 	Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12),
-	Graphics::PixelFormat(2, 3, 3, 3, 8, 4, 8, 12, 0)
+	Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)
 };
 
 // TODO: prioritize matching alpha masks

Modified: scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp	2009-07-14 02:15:31 UTC (rev 42466)
+++ scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp	2009-07-14 08:27:36 UTC (rev 42467)
@@ -1085,7 +1085,7 @@
 					(_screenWidth * _textSurfaceMultiplier > 320));
 	} else if (_game.features & GF_16BIT_COLOR) {
 #ifdef ENABLE_RGB_COLOR
-		Graphics::PixelFormat format = Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0);
+		Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
 		initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, &format);
 		if (format != _system->getScreenFormat())
 			return Common::kUnsupportedColorMode;

Modified: scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h	2009-07-14 02:15:31 UTC (rev 42466)
+++ scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h	2009-07-14 08:27:36 UTC (rev 42467)
@@ -57,16 +57,16 @@
 		rShift = gShift = bShift = aShift = 0;
 	}
 
-	inline PixelFormat(int BytesPerPixel, 
-						int RLoss, int GLoss, int BLoss, int ALoss, 
-						int RShift, int GShift, int BShift, int AShift) {
+	inline PixelFormat(byte BytesPerPixel, 
+						byte RBits, byte GBits, byte BBits, byte ABits, 
+						byte RShift, byte GShift, byte BShift, byte AShift) {
 		bytesPerPixel = BytesPerPixel;
-		rLoss = RLoss, gLoss = GLoss, bLoss = BLoss, aLoss = ALoss;
+		rLoss = 8 - RBits, gLoss = 8 - GBits, bLoss = 8 - BBits, aLoss = 8 - ABits;
 		rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
 	}
 
 	static inline PixelFormat createFormatCLUT8() {
-		return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0);
+		return PixelFormat(1, 0, 0, 0, 0, 0, 0, 0, 0);
 	}
 
 	inline bool operator==(const PixelFormat &fmt) const {


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