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

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Tue Jun 16 11:04:37 CEST 2009


Revision: 41580
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41580&view=rev
Author:   upthorn
Date:     2009-06-16 09:04:37 +0000 (Tue, 16 Jun 2009)

Log Message:
-----------
Declared getBestFormat in OSystem base class, and implemented in SDL backend.

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

Modified: scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h	2009-06-16 07:14:07 UTC (rev 41579)
+++ scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h	2009-06-16 09:04:37 UTC (rev 41580)
@@ -88,7 +88,19 @@
 
 	// Game screen
 	virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
+
+	// Highest supported
+	virtual Graphics::PixelFormat getBestFormat() const {
+	//TODO scale down 16/32 bit based on hardware support
+#ifdef ENABLE_32BIT		
+		return Graphics::PixelFormat(Graphics::kFormatRGBA8888);
+#elif defined ENABLE_16BIT
+		return Graphics::PixelFormat(Graphics::kFormatRGB565);
+#else
+		return Graphics::PixelFormat(Graphics::kFormatCLUT8);
 #endif
+	}
+#endif
 
 	// Set the size of the video bitmap.
 	// Typically, 320x200

Modified: scummvm/branches/gsoc2009-16bit/common/system.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/common/system.h	2009-06-16 07:14:07 UTC (rev 41579)
+++ scummvm/branches/gsoc2009-16bit/common/system.h	2009-06-16 09:04:37 UTC (rev 41580)
@@ -360,10 +360,16 @@
 	virtual void initFormat(Graphics::PixelFormat format) = 0;
 
 	/**
-	 * Returns the pixel format description of the screen.
+	 * Returns the pixel format of the screen.
 	 * @see Graphics::PixelFormat
 	 */
 	virtual Graphics::PixelFormat getScreenFormat() const = 0;
+
+	/**
+	 * Returns the highest color pixel format supported by the backend
+	 * @see Graphics::PixelFormat
+	 */
+	virtual Graphics::PixelFormat getBestFormat() const = 0;
 #endif
 
 	/**


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