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

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Tue Jun 9 09:55:44 CEST 2009


Revision: 41396
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41396&view=rev
Author:   upthorn
Date:     2009-06-09 07:55:43 +0000 (Tue, 09 Jun 2009)

Log Message:
-----------
Laying the foundation for preliminary bitdepth negotiation. (No functionality changes yet)

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h
    scummvm/branches/gsoc2009-16bit/common/system.h
    scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h

Modified: scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h	2009-06-09 06:37:42 UTC (rev 41395)
+++ scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h	2009-06-09 07:55:43 UTC (rev 41396)
@@ -178,6 +178,12 @@
 
 	// Overlay
 	virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; }
+
+#ifdef ENABLE_16BIT
+	// Game screen
+	virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
+#endif
+
 	virtual void showOverlay();
 	virtual void hideOverlay();
 	virtual void clearOverlay();
@@ -232,7 +238,12 @@
 	// unseen game screen
 	SDL_Surface *_screen;
 #ifdef ENABLE_16BIT
-	SDL_Surface *_screen16;
+	Graphics::PixelFormat _screenFormat;
+
+	//HACK This is a temporary hack to get 16-bit graphics
+	//displaying quickly, which will be removed in favor of 
+	//configuring the format of _screen on a per-game basis
+	SDL_Surface *_screen16;	
 #endif
 
 	// temporary screen (for scalers)

Modified: scummvm/branches/gsoc2009-16bit/common/system.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/common/system.h	2009-06-09 06:37:42 UTC (rev 41395)
+++ scummvm/branches/gsoc2009-16bit/common/system.h	2009-06-09 07:55:43 UTC (rev 41396)
@@ -407,6 +407,9 @@
 		kTransactionAspectRatioFailed = (1 << 0),	/**< Failed switchting aspect ratio correction mode */
 		kTransactionFullscreenFailed = (1 << 1),	/**< Failed switchting fullscreen mode */
 		kTransactionModeSwitchFailed = (1 << 2),	/**< Failed switchting the GFX graphics mode (setGraphicsMode) */
+#ifdef ENABLE_16BIT
+		kTransactionPixelFormatNotSupported = (1 << 4), /**< Failed setting the color format (function not yet implemented) */
+#endif
 		kTransactionSizeChangeFailed = (1 << 3)		/**< Failed switchting the screen dimensions (initSize) */
 	};
 
@@ -605,7 +608,15 @@
 	 */
 	virtual Graphics::PixelFormat getOverlayFormat() const = 0;
 
+#ifdef ENABLE_16BIT
 	/**
+	 * Returns the pixel format description of the game screen.
+	 * @see Graphics::PixelFormat
+	 */
+	virtual Graphics::PixelFormat getScreenFormat() const = 0;
+#endif
+
+	/**
 	 * Reset the overlay.
 	 *
 	 * After calling this method while the overlay mode is active, the user

Modified: scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h	2009-06-09 06:37:42 UTC (rev 41395)
+++ scummvm/branches/gsoc2009-16bit/graphics/pixelformat.h	2009-06-09 07:55:43 UTC (rev 41396)
@@ -30,7 +30,67 @@
 
 namespace Graphics {
 
+#ifdef ENABLE_16BIT
 /**
+ * A condensed bit format description.
+ *
+ * It includes the necessary information to create a PixelFormat and/or 
+ * ColorMask which fully describe the given color format.
+ *
+ * It contains two components, the format (8Bit paletted, RGB555, etc)
+ * and the order (palette, ARGB, ABGR, etc)
+ *
+ * Use (format & kFormatTypeMask) to get the type, and (format & kFormatOrderMask)
+ * to get the applicable color order.
+  */
+enum ColorFormat {
+	kFormat8Bit = 0,
+	kFormatRGB555 = 1,
+	kFormatARGB1555 = 2,	// Rare, but I know a guy who knows a guy who's heard of it being used
+	kFormatRGB556 = 3,		// 6 bits for blue, in case this ever happens
+	kFormatRGB565 = 4,
+	kFormatRGB655 = 5,		// 6 bits for red, in case this ever happens
+	kFormatARGB4444 = 6,
+	kFormatRGB888 = 7,
+	kFormatARGB6666 = 8,	// I've never heard of this, but it's theoretically possible
+	kFormatARGB8888 = 9,
+	kFormatTypeMask = 0xFF, // & by this to get the overall bit format
+	kFormatPalette = 0 << 8,
+	kFormatRGB = 1 << 8,
+	kFormatRBG = 2 << 8,
+	kFormatGRB = 3 << 8,
+	kFormatGBR = 4 << 8,
+	kFormatBRG = 5 << 8,
+	kFormatBGR = 6 << 8,
+	kFormatARGB = 7 << 8,
+	kFormatARBG = 8 << 8,
+	kFormatAGRB = 9 << 8,
+	kFormatAGBR = 10 << 8,
+	kFormatABRG = 11 << 8,
+	kFormatABGR = 12 << 8,
+	kFormatRAGB = 13 << 8,
+	kFormatRABG = 14 << 8,
+	kFormatGARB = 15 << 8,
+	kFormatGABR = 16 << 8,
+	kFormatBARG = 17 << 8,
+	kFormatBAGR = 18 << 8,
+	kFormatRGAB = 19 << 8,
+	kFormatRBAG = 20 << 8,
+	kFormatGRAB = 21 << 8,
+	kFormatGBAR = 22 << 8,
+	kFormatBRAG = 23 << 8,
+	kFormatBGAR = 24 << 8,
+	kFormatRGBA = 25 << 8,
+	kFormatRBGA = 26 << 8,
+	kFormatGRBA = 27 << 8,
+	kFormatGBRA = 28 << 8,
+	kFormatBRGA = 29 << 8,
+	kFormatBGRA = 30 << 8,
+	kFormatOrderMask = 0xFF << 8 // & by this to get the order
+};
+#endif
+
+/**
  * A pixel format description.
  *
  * Like ColorMasks it includes the given values to create colors from RGB


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