aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJody Northup2009-06-10 05:35:18 +0000
committerJody Northup2009-06-10 05:35:18 +0000
commit0a793f08a4d198f3f766214ed4ce85ac51ccea5e (patch)
treecff62f704ef84f40dcdc17631500c6e61b6af276 /common
parentc426dd99a4c4149418fa16996e38f0995ddcaea5 (diff)
downloadscummvm-rg350-0a793f08a4d198f3f766214ed4ce85ac51ccea5e.tar.gz
scummvm-rg350-0a793f08a4d198f3f766214ed4ce85ac51ccea5e.tar.bz2
scummvm-rg350-0a793f08a4d198f3f766214ed4ce85ac51ccea5e.zip
SDL backend now dynamically generates 8 or 16-bit color surface depending on engine request (using ad-hoc format).
svn-id: r41416
Diffstat (limited to 'common')
-rw-r--r--common/system.h55
1 files changed, 47 insertions, 8 deletions
diff --git a/common/system.h b/common/system.h
index 50d00bb8e2..59da28c990 100644
--- a/common/system.h
+++ b/common/system.h
@@ -343,6 +343,53 @@ public:
*/
virtual int getGraphicsMode() const = 0;
+#ifdef ENABLE_16BIT
+ /**
+ * Find a supported color format from a list of requested formats. Typical formats include:
+ * CLUT8 (e.g. 256 color, for most games), all backends must provide support for this format
+ * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
+ * RGB565 (e.g. 16-bit color, for Urban Runner)
+ *
+ * These are the pixel formats for which the client code can generates data;
+ * they are not necessarily equal to the hardware pixel format. For example,
+ * a backend may perform color lookup of 8-bit graphics before pushing the
+ * screen buffer to hardware, or perform transformations of the ARGB color order.
+ *
+ * @param formatList A list of requested pixel formats, ordered by priority
+ *
+ * @return a supported ColorFormat from the list, or kFormat8Bit if no supported format was found
+ */
+ virtual Graphics::ColorFormat findCompatibleFormat(Common::List<Graphics::ColorFormat> formatList) = 0;
+
+ /**
+ * Set the color format of the virtual screen. Typical formats include:
+ * CLUT8 (e.g. 256 color, for most games)
+ * RGB555 (e.g. 16-bit color, for later SCUMM HE games)
+ * RGB565 (e.g. 16-bit color, for Urban Runner)
+ *
+ * This is the pixel format for which the client code generates data;
+ * this is not necessarily equal to the hardware pixel format. For example,
+ * a backend may perform color lookup of 8-bit graphics before pushing
+ * a screen to hardware, or correct the ARGB color order.
+ *
+ * @param format A pixel format that the backend screen will use
+ */
+ virtual void initFormat(Graphics::ColorFormat format) = 0;
+
+ /**
+ * Returns the pixel format description of the screen.
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getScreenFormat() const = 0;
+
+ /**
+ * Returns the pixel format description of the requested color mode
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format) = 0;
+
+#endif
+
/**
* Set the size of the virtual screen. Typical sizes include:
* - 320x200 (e.g. for most SCUMM games, and Simon)
@@ -608,14 +655,6 @@ public:
*/
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.
*