From 8447a3650e7de2fc780c1c354f70bf0d119622b3 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Wed, 3 Jun 2009 23:36:23 +0000 Subject: Applying the temporary 16-bit SDL hack. svn-id: r41152 --- backends/platform/sdl/sdl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 7498f48b08..f843066749 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -227,6 +227,9 @@ protected: // unseen game screen SDL_Surface *_screen; +#ifdef ENABLE_16BIT + SDL_Surface *_screen16; +#endif // temporary screen (for scalers) SDL_Surface *_tmpscreen; -- cgit v1.2.3 From 9789ba7f28d2c0a093adda01435306f28e91fede Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Fri, 5 Jun 2009 08:09:37 +0000 Subject: Corrected backend to be able to accept a 16-bit mouseKeyColor without overflow svn-id: r41194 --- backends/platform/sdl/sdl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index f843066749..3e0bf19f8f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -112,6 +112,10 @@ public: virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME) // Set the bitmap that's used when drawing the cursor. +#ifdef ENABLE_16BIT + //HACK Made a second method as a quick and dirty workaround to avoid linker errors with engine libs + virtual void setMouseCursor16(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint16 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) +#endif virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) // Set colors of cursor palette -- cgit v1.2.3 From 56e5920bba753820c457c078237a8c06241302ed Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 6 Jun 2009 01:16:04 +0000 Subject: Corrected cursor display errors introduced by revision 41204, reimplemented 16-bit cursor support in a less hacky, but still temporary way. svn-id: r41209 --- backends/platform/sdl/sdl.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 3e0bf19f8f..7d71ecb6ab 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -113,10 +113,10 @@ public: // Set the bitmap that's used when drawing the cursor. #ifdef ENABLE_16BIT - //HACK Made a second method as a quick and dirty workaround to avoid linker errors with engine libs - virtual void setMouseCursor16(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint16 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) -#endif + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, uint8 bitDepth = 8); // overloaded by CE backend (FIXME) +#else virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) +#endif // Set colors of cursor palette void setCursorPalette(const byte *colors, uint start, uint num); @@ -413,7 +413,11 @@ protected: virtual void drawMouse(); // overloaded by CE backend virtual void undrawMouse(); // overloaded by CE backend (FIXME) +#ifdef ENABLE_16BIT + virtual void blitCursor(uint8 bitDepth = 8); // overloaded by CE backend (FIXME) +#else virtual void blitCursor(); // overloaded by CE backend (FIXME) +#endif /** Set the position of the virtual mouse cursor. */ void setMousePos(int x, int y); -- cgit v1.2.3 From 4087a3e6e8ebc0b519fc4c178a29696bd64fdd6f Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 6 Jun 2009 08:02:45 +0000 Subject: Corrected 16-bit cursor blit errors on GFX mode change. svn-id: r41212 --- backends/platform/sdl/sdl.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 7d71ecb6ab..b6b7a8b284 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -124,7 +124,11 @@ public: // Disables or enables cursor palette void disableCursorPalette(bool disable) { _cursorPaletteDisabled = disable; +#ifdef ENABLE_16BIT + blitCursor(_cursorBitDepth); +#else blitCursor(); +#endif } // Shaking is used in SCUMM. Set current shake position. @@ -354,6 +358,9 @@ protected: MousePos _mouseCurState; byte _mouseKeyColor; int _cursorTargetScale; +#ifdef ENABLE_16BIT + uint8 _cursorBitDepth; +#endif bool _cursorPaletteDisabled; SDL_Surface *_mouseOrigSurface; SDL_Surface *_mouseSurface; -- cgit v1.2.3 From 0323638ce933e1dea7dd81b35a6646a9773a01ea Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 6 Jun 2009 08:41:03 +0000 Subject: Streamlined the cursor blitting changes introduced in revision 41412 svn-id: r41213 --- backends/platform/sdl/sdl.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index b6b7a8b284..6fe871fa83 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -124,11 +124,7 @@ public: // Disables or enables cursor palette void disableCursorPalette(bool disable) { _cursorPaletteDisabled = disable; -#ifdef ENABLE_16BIT - blitCursor(_cursorBitDepth); -#else blitCursor(); -#endif } // Shaking is used in SCUMM. Set current shake position. @@ -420,11 +416,7 @@ protected: virtual void drawMouse(); // overloaded by CE backend virtual void undrawMouse(); // overloaded by CE backend (FIXME) -#ifdef ENABLE_16BIT - virtual void blitCursor(uint8 bitDepth = 8); // overloaded by CE backend (FIXME) -#else virtual void blitCursor(); // overloaded by CE backend (FIXME) -#endif /** Set the position of the virtual mouse cursor. */ void setMousePos(int x, int y); -- cgit v1.2.3 From c426dd99a4c4149418fa16996e38f0995ddcaea5 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Tue, 9 Jun 2009 07:55:43 +0000 Subject: Laying the foundation for preliminary bitdepth negotiation. (No functionality changes yet) svn-id: r41396 --- backends/platform/sdl/sdl.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 6fe871fa83..22d3d41b00 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -178,6 +178,12 @@ public: // 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 @@ protected: // 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) -- cgit v1.2.3 From 0a793f08a4d198f3f766214ed4ce85ac51ccea5e Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Wed, 10 Jun 2009 05:35:18 +0000 Subject: SDL backend now dynamically generates 8 or 16-bit color surface depending on engine request (using ad-hoc format). svn-id: r41416 --- backends/platform/sdl/sdl.h | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 22d3d41b00..513ad73934 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -81,6 +81,22 @@ public: void beginGFXTransaction(void); TransactionError endGFXTransaction(void); +#ifdef ENABLE_16BIT + // Find a compatible format from the list of formats supported by the engine + // Fallback to CLUT8 if none found + virtual Graphics::ColorFormat findCompatibleFormat(Common::List formatList); + + // Set the depth and format of the video bitmap + // Typically, CLUT8 + virtual void initFormat(Graphics::ColorFormat format); + + // Game screen + virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } + + //Create a Graphics::PixelFormat to describe the requested color mode + virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format); +#endif + // Set the size of the video bitmap. // Typically, 320x200 virtual void initSize(uint w, uint h); // overloaded by CE backend @@ -179,11 +195,6 @@ public: // 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(); @@ -239,11 +250,6 @@ protected: SDL_Surface *_screen; #ifdef ENABLE_16BIT 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) @@ -278,6 +284,9 @@ protected: bool needHotswap; bool needUpdatescreen; bool normal1xScaler; +#ifdef ENABLE_16BIT + bool formatChanged; +#endif }; TransactionDetails _transactionDetails; @@ -292,6 +301,9 @@ protected: int screenWidth, screenHeight; int overlayWidth, overlayHeight; +#ifdef ENABLE_16BIT + Graphics::ColorFormat format; +#endif }; VideoState _videoMode, _oldVideoMode; -- cgit v1.2.3 From 6adbd0c41e79b5a21f0430e060347d4978e9ce78 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Thu, 11 Jun 2009 05:56:00 +0000 Subject: Renamed Graphics::ColorFormat to Graphics::ColorMode, streamlined enum by removing order section and temporarily removing kFormatARGB1555 Converted cursor code to make use of _screenFormat, instead of a parameter passed directly to it by the engine. Adjusted scumm engine to account for these changes. This should probably have been two separate commits, but the changes concern the same files... svn-id: r41443 --- backends/platform/sdl/sdl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 513ad73934..4d5ea3f548 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -84,17 +84,17 @@ public: #ifdef ENABLE_16BIT // Find a compatible format from the list of formats supported by the engine // Fallback to CLUT8 if none found - virtual Graphics::ColorFormat findCompatibleFormat(Common::List formatList); + virtual Graphics::ColorMode findCompatibleFormat(Common::List formatList); // Set the depth and format of the video bitmap // Typically, CLUT8 - virtual void initFormat(Graphics::ColorFormat format); + virtual void initFormat(Graphics::ColorMode format); // Game screen virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } //Create a Graphics::PixelFormat to describe the requested color mode - virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorFormat format); + virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorMode format); #endif // Set the size of the video bitmap. @@ -129,7 +129,7 @@ public: // Set the bitmap that's used when drawing the cursor. #ifdef ENABLE_16BIT - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, uint8 bitDepth = 8); // overloaded by CE backend (FIXME) + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) #else virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) #endif @@ -302,7 +302,7 @@ protected: int screenWidth, screenHeight; int overlayWidth, overlayHeight; #ifdef ENABLE_16BIT - Graphics::ColorFormat format; + Graphics::ColorMode format; #endif }; VideoState _videoMode, _oldVideoMode; -- cgit v1.2.3 From 2ee51a8fa189fc7817fd6d78533664ec870fca48 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Fri, 12 Jun 2009 08:49:45 +0000 Subject: Unfinished proof of concept regarding my compromise with LordHoto in IRC. svn-id: r41464 --- backends/platform/sdl/sdl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 4d5ea3f548..69b85c7959 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -88,7 +88,7 @@ public: // Set the depth and format of the video bitmap // Typically, CLUT8 - virtual void initFormat(Graphics::ColorMode format); + virtual void initFormat(Graphics::PixelFormat format); // Game screen virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } @@ -302,7 +302,7 @@ protected: int screenWidth, screenHeight; int overlayWidth, overlayHeight; #ifdef ENABLE_16BIT - Graphics::ColorMode format; + Graphics::PixelFormat format; #endif }; VideoState _videoMode, _oldVideoMode; -- cgit v1.2.3 From 350dc4290fd5dd8f28af9e63713b48ef2c131f09 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 13 Jun 2009 10:24:52 +0000 Subject: Fixed cursor code to keep track of cursor formats so that ThemeEngine and/or GuiManager cursors will render properly over the game (on spacebar hit, for instance) svn-id: r41491 --- backends/platform/sdl/sdl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 69b85c7959..a25f697c80 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -130,6 +130,7 @@ public: // Set the bitmap that's used when drawing the cursor. #ifdef ENABLE_16BIT virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) + virtual void setCursorFormat(Graphics::PixelFormat format); #else virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) #endif @@ -250,6 +251,7 @@ protected: SDL_Surface *_screen; #ifdef ENABLE_16BIT Graphics::PixelFormat _screenFormat; + Graphics::PixelFormat _cursorFormat; #endif // temporary screen (for scalers) -- cgit v1.2.3 From 8d306ebccfa7e88b2e4f4635bff3987e550f98d3 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Mon, 15 Jun 2009 09:45:19 +0000 Subject: Added kUnsupportedColorMode error code brought Scumm engine and SDL backend into compliance with API outlined in http://scummvmupthorn09.wordpress.com/2009/06/14/how-this-is-going-to-work/ Provided convenient Graphics::PixelFormat constructors for ColorMode enums, and bitformat integers. Removed last vestiges (I think) of initial cursor hack. svn-id: r41539 --- backends/platform/sdl/sdl.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index a25f697c80..b36139f24b 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -82,19 +82,12 @@ public: TransactionError endGFXTransaction(void); #ifdef ENABLE_16BIT - // Find a compatible format from the list of formats supported by the engine - // Fallback to CLUT8 if none found - virtual Graphics::ColorMode findCompatibleFormat(Common::List formatList); - // Set the depth and format of the video bitmap // Typically, CLUT8 virtual void initFormat(Graphics::PixelFormat format); // Game screen virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } - - //Create a Graphics::PixelFormat to describe the requested color mode - virtual Graphics::PixelFormat getPixelFormat(Graphics::ColorMode format); #endif // Set the size of the video bitmap. @@ -379,9 +372,6 @@ protected: MousePos _mouseCurState; byte _mouseKeyColor; int _cursorTargetScale; -#ifdef ENABLE_16BIT - uint8 _cursorBitDepth; -#endif bool _cursorPaletteDisabled; SDL_Surface *_mouseOrigSurface; SDL_Surface *_mouseSurface; -- cgit v1.2.3 From cb56169a2770c25ce27256db339353011158998f Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Tue, 16 Jun 2009 09:04:37 +0000 Subject: Declared getBestFormat in OSystem base class, and implemented in SDL backend. svn-id: r41580 --- backends/platform/sdl/sdl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index b36139f24b..b788022d57 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -88,6 +88,18 @@ public: // 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. -- cgit v1.2.3 From db9cfc6f962790a270b357c3d47a5dc0e15a37b0 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Tue, 16 Jun 2009 09:15:06 +0000 Subject: Corrected oversight in earlier ifdef simplification which leads to compilation failure if ENABLE_16BIT is not defined. svn-id: r41581 --- backends/platform/sdl/sdl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index b788022d57..074a55069d 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -133,11 +133,9 @@ public: virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME) // Set the bitmap that's used when drawing the cursor. -#ifdef ENABLE_16BIT virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) +#ifdef ENABLE_16BIT virtual void setCursorFormat(Graphics::PixelFormat format); -#else - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) #endif // Set colors of cursor palette -- cgit v1.2.3 From f55419ee451070dbe07014bc7d747507e431edf6 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Wed, 17 Jun 2009 10:03:59 +0000 Subject: OSystem_SDL::GetBestFormat will no longer return modes greater than that which hardware supports. svn-id: r41606 --- backends/platform/sdl/sdl.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 074a55069d..598b943e4b 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -92,13 +92,26 @@ public: // 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 +#if (defined ENABLE_32BIT) || (defined ENABLE_16BIT) + { + SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt; +#ifdef ENABLE_32BIT + if (HWFormat->BitsPerPixel > 32) + return Graphics::PixelFormat(Graphics::kFormatRGBA8888); + return Graphics::PixelFormat(HWFormat->BytesPerPixel, + HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss, + HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift); +#else //16 + if (HWFormat->BitsPerPixel > 16) + return Graphics::PixelFormat(Graphics::kFormatRGB565); + return Graphics::PixelFormat(HWFormat->BytesPerPixel, + HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss, + HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift); + } +#endif //ENABLE_32BIT +#else //8BIT only return Graphics::PixelFormat(Graphics::kFormatCLUT8); -#endif +#endif //ENABLE_32BIT or ENABLE_16BIT } #endif -- cgit v1.2.3 From 704386d3b09b68f96b6d4160a1a261e3e754f461 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Fri, 19 Jun 2009 09:28:55 +0000 Subject: Removed replaced Graphics::ColorMode enum type with factory methods for Graphics::PixelFormat. svn-id: r41662 --- backends/platform/sdl/sdl.h | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 598b943e4b..2cb9451a0d 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -96,22 +96,17 @@ public: { SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt; #ifdef ENABLE_32BIT - if (HWFormat->BitsPerPixel > 32) - return Graphics::PixelFormat(Graphics::kFormatRGBA8888); - return Graphics::PixelFormat(HWFormat->BytesPerPixel, - HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss, - HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift); -#else //16 - if (HWFormat->BitsPerPixel > 16) - return Graphics::PixelFormat(Graphics::kFormatRGB565); - return Graphics::PixelFormat(HWFormat->BytesPerPixel, - HWFormat->Rloss, HWFormat->Gloss, HWFormat->Bloss, HWFormat->Aloss, - HWFormat->Rshift, HWFormat->Gshift, HWFormat->Bshift, HWFormat->Ashift); + if (HWFormat->BitsPerPixel >= 32) + return Graphics::PixelFormat::createFormatRGBA8888(); + if (HWFormat->BitsPerPixel >= 24) + return Graphics:: + FormatRGB888(); +#endif //ENABLE_32BIT + if (HWFormat->BitsPerPixel >= 16) + return Graphics::PixelFormat::createFormatRGB565(); } -#endif //ENABLE_32BIT -#else //8BIT only - return Graphics::PixelFormat(Graphics::kFormatCLUT8); #endif //ENABLE_32BIT or ENABLE_16BIT + return Graphics::PixelFormat::createFormatCLUT8(); } #endif -- cgit v1.2.3 From f7dd1c15ed38418a0371032966144eb6c2e004cb Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 20 Jun 2009 05:23:09 +0000 Subject: renamed ENABLE_16BIT define to more accurate ENABLE_RGB_COLOR svn-id: r41696 --- backends/platform/sdl/sdl.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 2cb9451a0d..aee15fcbd0 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -81,7 +81,7 @@ public: void beginGFXTransaction(void); TransactionError endGFXTransaction(void); -#ifdef ENABLE_16BIT +#ifdef ENABLE_RGB_COLOR // Set the depth and format of the video bitmap // Typically, CLUT8 virtual void initFormat(Graphics::PixelFormat format); @@ -92,7 +92,6 @@ public: // Highest supported virtual Graphics::PixelFormat getBestFormat() const { //TODO scale down 16/32 bit based on hardware support -#if (defined ENABLE_32BIT) || (defined ENABLE_16BIT) { SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt; #ifdef ENABLE_32BIT @@ -105,7 +104,6 @@ public: if (HWFormat->BitsPerPixel >= 16) return Graphics::PixelFormat::createFormatRGB565(); } -#endif //ENABLE_32BIT or ENABLE_16BIT return Graphics::PixelFormat::createFormatCLUT8(); } #endif @@ -142,7 +140,7 @@ public: // Set the bitmap that's used when drawing the cursor. virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) -#ifdef ENABLE_16BIT +#ifdef ENABLE_RGB_COLOR virtual void setCursorFormat(Graphics::PixelFormat format); #endif @@ -260,7 +258,7 @@ protected: // unseen game screen SDL_Surface *_screen; -#ifdef ENABLE_16BIT +#ifdef ENABLE_RGB_COLOR Graphics::PixelFormat _screenFormat; Graphics::PixelFormat _cursorFormat; #endif @@ -297,7 +295,7 @@ protected: bool needHotswap; bool needUpdatescreen; bool normal1xScaler; -#ifdef ENABLE_16BIT +#ifdef ENABLE_RGB_COLOR bool formatChanged; #endif }; @@ -314,7 +312,7 @@ protected: int screenWidth, screenHeight; int overlayWidth, overlayHeight; -#ifdef ENABLE_16BIT +#ifdef ENABLE_RGB_COLOR Graphics::PixelFormat format; #endif }; -- cgit v1.2.3 From 7c622423157e29b7206ba0c39a7756443ed1e70d Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Tue, 23 Jun 2009 02:02:51 +0000 Subject: Merged format initialization into InitSize to allow for backends not supporting gfx transactions. svn-id: r41801 --- backends/platform/sdl/sdl.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index aee15fcbd0..db855094cb 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -82,10 +82,6 @@ public: TransactionError endGFXTransaction(void); #ifdef ENABLE_RGB_COLOR - // Set the depth and format of the video bitmap - // Typically, CLUT8 - virtual void initFormat(Graphics::PixelFormat format); - // Game screen virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } @@ -108,9 +104,9 @@ public: } #endif - // Set the size of the video bitmap. - // Typically, 320x200 - virtual void initSize(uint w, uint h); // overloaded by CE backend + // Set the size and format of the video bitmap. + // Typically, 320x200 CLUT8 + virtual void initSize(uint w, uint h, Graphics::PixelFormat format); // overloaded by CE backend virtual int getScreenChangeID() const { return _screenChangeCount; } -- cgit v1.2.3 From 865129a5630017f05d08e778ba1ef430c23cd55a Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Wed, 24 Jun 2009 06:44:30 +0000 Subject: made the cursor's pixel format a member of the cursor object, merged ____CursorFormat functions into equivalent ____Cursor functions. svn-id: r41825 --- backends/platform/sdl/sdl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index db855094cb..7aeebf9264 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -135,7 +135,7 @@ public: virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME) // Set the bitmap that's used when drawing the cursor. - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale); // overloaded by CE backend (FIXME) + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format); // overloaded by CE backend (FIXME) #ifdef ENABLE_RGB_COLOR virtual void setCursorFormat(Graphics::PixelFormat format); #endif -- cgit v1.2.3 From 53eb83dc95b825b2bf4f5f3943e8f10d9add3aa6 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Thu, 25 Jun 2009 08:55:16 +0000 Subject: API modification -- replaced "Graphics::PixelFormat getBestFormat()" with "Common::List getSupportedFormats()" svn-id: r41854 --- backends/platform/sdl/sdl.h | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 7aeebf9264..efe1984446 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -86,21 +86,38 @@ public: virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } // Highest supported - virtual Graphics::PixelFormat getBestFormat() const { - //TODO scale down 16/32 bit based on hardware support - { - SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt; + virtual Common::List getSupportedFormats() const { + //TODO determine hardware color component order + Common::List list; + SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt; #ifdef ENABLE_32BIT - if (HWFormat->BitsPerPixel >= 32) - return Graphics::PixelFormat::createFormatRGBA8888(); - if (HWFormat->BitsPerPixel >= 24) - return Graphics:: - FormatRGB888(); + if (HWFormat->BitsPerPixel >= 32) + { + list.push_back(Graphics::PixelFormat::createFormatRGBA8888()); + list.push_back(Graphics::PixelFormat::createFormatARGB8888()); + list.push_back(Graphics::PixelFormat::createFormatABGR8888()); + list.push_back(Graphics::PixelFormat::createFormatBGRA8888()); } + if (HWFormat->BitsPerPixel >= 24) + { + list.push_back(Graphics::PixelFormat::createFormatRGB888()); + list.push_back(Graphics::PixelFormat::createFormatBGR888()); + } #endif //ENABLE_32BIT - if (HWFormat->BitsPerPixel >= 16) - return Graphics::PixelFormat::createFormatRGB565(); + if (HWFormat->BitsPerPixel >= 16) + { + list.push_back(Graphics::PixelFormat::createFormatRGB565()); + list.push_back(Graphics::PixelFormat::createFormatXRGB1555()); + list.push_back(Graphics::PixelFormat::createFormatRGB555()); + list.push_back(Graphics::PixelFormat::createFormatRGBA4444()); + list.push_back(Graphics::PixelFormat::createFormatARGB4444()); + list.push_back(Graphics::PixelFormat::createFormatBGR565()); + list.push_back(Graphics::PixelFormat::createFormatXBGR1555()); + list.push_back(Graphics::PixelFormat::createFormatBGR555()); + list.push_back(Graphics::PixelFormat::createFormatABGR4444()); + list.push_back(Graphics::PixelFormat::createFormatBGRA4444()); } - return Graphics::PixelFormat::createFormatCLUT8(); + list.push_back(Graphics::PixelFormat::createFormatCLUT8()); + return list; } #endif -- cgit v1.2.3 From 27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Fri, 26 Jun 2009 10:37:00 +0000 Subject: Converted OSystem::SetMouseCursor to take pointer to PixelFormat, instead of full PixelFormat. Removed OSystem::setCursorFormat (since I forgot to do so several commits ago) svn-id: r41901 --- backends/platform/sdl/sdl.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index efe1984446..2048b7f536 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -152,10 +152,7 @@ public: virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME) // Set the bitmap that's used when drawing the cursor. - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format); // overloaded by CE backend (FIXME) -#ifdef ENABLE_RGB_COLOR - virtual void setCursorFormat(Graphics::PixelFormat format); -#endif + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format); // overloaded by CE backend (FIXME) // Set colors of cursor palette void setCursorPalette(const byte *colors, uint start, uint num); -- cgit v1.2.3 From 853aec05ba4485f0bfc90e7515322dfd56a8d4af Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 27 Jun 2009 05:58:44 +0000 Subject: changed initGraphics, and OSystem::initSize to take Graphics::PixelFormat * parameters instead of Graphics::PixelFormat parameters, to save unnecessary pixelformat initialization if ENABLE_RGB_COLOR is not set. svn-id: r41909 --- backends/platform/sdl/sdl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 2048b7f536..befb82cc89 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -123,7 +123,7 @@ public: // Set the size and format of the video bitmap. // Typically, 320x200 CLUT8 - virtual void initSize(uint w, uint h, Graphics::PixelFormat format); // overloaded by CE backend + virtual void initSize(uint w, uint h, Graphics::PixelFormat *format); // overloaded by CE backend virtual int getScreenChangeID() const { return _screenChangeCount; } -- cgit v1.2.3 From 9e1916bcad3cc33a870bdbff5bd01b39e523492d Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Tue, 30 Jun 2009 07:30:57 +0000 Subject: renamed kTransactionPixelFormatNotSupported to kTransactionFormatNotSupported, retyped all Graphics::PixelFormat * parameters to const Graphics::PixelFormat *, (hopefully) repaired all memory leaks on screen and cursor format changes, provided OSystem::getScreenFormat and OSystem::getSupportedFormats methods for when ENABLE_RGB_COLOR is not set, completely forgot the "commit early, commit often" mantra. svn-id: r41972 --- backends/platform/sdl/sdl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index befb82cc89..68dfe64d53 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -123,7 +123,7 @@ public: // Set the size and format of the video bitmap. // Typically, 320x200 CLUT8 - virtual void initSize(uint w, uint h, Graphics::PixelFormat *format); // overloaded by CE backend + virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format); // overloaded by CE backend virtual int getScreenChangeID() const { return _screenChangeCount; } @@ -152,7 +152,7 @@ public: virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME) // Set the bitmap that's used when drawing the cursor. - virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format); // overloaded by CE backend (FIXME) + virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format); // overloaded by CE backend (FIXME) // Set colors of cursor palette void setCursorPalette(const byte *colors, uint start, uint num); -- cgit v1.2.3 From 2c5d11b67b35f93b2292c1ca56d0c9fc89608921 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Tue, 7 Jul 2009 07:50:40 +0000 Subject: Removed PixelFormat convenience constructors at behest of Max and Eugene. svn-id: r42207 --- backends/platform/sdl/sdl.h | 47 ++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 68dfe64d53..b8ab2f6d97 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -94,29 +94,44 @@ public: if (HWFormat->BitsPerPixel >= 32) { list.push_back(Graphics::PixelFormat::createFormatRGBA8888()); - list.push_back(Graphics::PixelFormat::createFormatARGB8888()); - list.push_back(Graphics::PixelFormat::createFormatABGR8888()); - list.push_back(Graphics::PixelFormat::createFormatBGRA8888()); } + list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24) +); + list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24) +); + list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0) +); } if (HWFormat->BitsPerPixel >= 24) { - list.push_back(Graphics::PixelFormat::createFormatRGB888()); - list.push_back(Graphics::PixelFormat::createFormatBGR888()); + list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0) +); + list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0) +); } #endif //ENABLE_32BIT if (HWFormat->BitsPerPixel >= 16) { - list.push_back(Graphics::PixelFormat::createFormatRGB565()); - list.push_back(Graphics::PixelFormat::createFormatXRGB1555()); - list.push_back(Graphics::PixelFormat::createFormatRGB555()); - list.push_back(Graphics::PixelFormat::createFormatRGBA4444()); - list.push_back(Graphics::PixelFormat::createFormatARGB4444()); - list.push_back(Graphics::PixelFormat::createFormatBGR565()); - list.push_back(Graphics::PixelFormat::createFormatXBGR1555()); - list.push_back(Graphics::PixelFormat::createFormatBGR555()); - list.push_back(Graphics::PixelFormat::createFormatABGR4444()); - list.push_back(Graphics::PixelFormat::createFormatBGRA4444()); + list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0) +); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15) +); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0) +); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0) +); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) +); + list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0) +); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15) +); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0) +); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12) +); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0) +); } - list.push_back(Graphics::PixelFormat::createFormatCLUT8()); + list.push_back(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)); return list; } #endif -- cgit v1.2.3 From 828ed66555b99363fed62b4cbb83c36de68c3024 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Wed, 8 Jul 2009 16:07:58 +0000 Subject: Reinstated static inline Graphics::PixelFormat::createFormatCLUT8(), which I am told was not supposed to be removed with the others. svn-id: r42268 --- backends/platform/sdl/sdl.h | 51 ++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index b8ab2f6d97..c2648e8ed7 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -94,44 +94,29 @@ public: if (HWFormat->BitsPerPixel >= 32) { list.push_back(Graphics::PixelFormat::createFormatRGBA8888()); - list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24) -); - list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24) -); - list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0) -); } + list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24)); + list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)); + list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0)); + } if (HWFormat->BitsPerPixel >= 24) { - list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0) -); - list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0) -); + list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0)); + list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0)); } #endif //ENABLE_32BIT - if (HWFormat->BitsPerPixel >= 16) - { - list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0) -); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15) -); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0) -); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0) -); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) -); - list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0) -); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15) -); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0) -); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12) -); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0) -); + if (HWFormat->BitsPerPixel >= 16) { + list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0)); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15)); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)); + list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0)); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15)); + list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12)); + list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)); } - list.push_back(Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0)); + list.push_back(Graphics::PixelFormat::createFormatCLUT8()); return list; } #endif -- cgit v1.2.3 From a5d374bded6204c9250155d572d23b0caef636a5 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Fri, 10 Jul 2009 06:46:50 +0000 Subject: Moved OSystem_SDL::getSupportedFormats function body from platforms/sdl/sdl.h to platforms/sdl/graphics.cpp, Improved and simplified list-generation method for OSystem_SDL::getSupportedFormats. svn-id: r42325 --- backends/platform/sdl/sdl.h | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index c2648e8ed7..3e074a884a 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -86,39 +86,7 @@ public: virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } // Highest supported - virtual Common::List getSupportedFormats() const { - //TODO determine hardware color component order - Common::List list; - SDL_PixelFormat *HWFormat = SDL_GetVideoInfo()->vfmt; -#ifdef ENABLE_32BIT - if (HWFormat->BitsPerPixel >= 32) - { - list.push_back(Graphics::PixelFormat::createFormatRGBA8888()); - list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 16, 8, 0, 24)); - list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)); - list.push_back(Graphics::PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0)); - } - if (HWFormat->BitsPerPixel >= 24) - { - list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0)); - list.push_back(Graphics::PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0)); - } -#endif //ENABLE_32BIT - if (HWFormat->BitsPerPixel >= 16) { - list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0)); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15)); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12)); - list.push_back(Graphics::PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0)); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15)); - list.push_back(Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12)); - list.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0)); - } - list.push_back(Graphics::PixelFormat::createFormatCLUT8()); - return list; - } + virtual Common::List getSupportedFormats(); #endif // Set the size and format of the video bitmap. -- cgit v1.2.3 From 007f68366fd55a519753bf533c7c3a80db3754f0 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Fri, 21 Aug 2009 18:16:37 +0000 Subject: Renamed ENABLE_RGB_COLOR to USE_RGB_COLOR, and added it to config.h to guarantee a consistent build. svn-id: r43604 --- backends/platform/sdl/sdl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 09213ad417..3da9a433b7 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -93,7 +93,7 @@ public: void beginGFXTransaction(void); TransactionError endGFXTransaction(void); -#ifdef ENABLE_RGB_COLOR +#ifdef USE_RGB_COLOR // Game screen virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } @@ -248,7 +248,7 @@ protected: // unseen game screen SDL_Surface *_screen; -#ifdef ENABLE_RGB_COLOR +#ifdef USE_RGB_COLOR Graphics::PixelFormat _screenFormat; Graphics::PixelFormat _cursorFormat; #endif @@ -285,7 +285,7 @@ protected: bool needHotswap; bool needUpdatescreen; bool normal1xScaler; -#ifdef ENABLE_RGB_COLOR +#ifdef USE_RGB_COLOR bool formatChanged; #endif }; @@ -304,7 +304,7 @@ protected: int screenWidth, screenHeight; int overlayWidth, overlayHeight; int hardwareWidth, hardwareHeight; -#ifdef ENABLE_RGB_COLOR +#ifdef USE_RGB_COLOR Graphics::PixelFormat format; #endif }; -- cgit v1.2.3 From 70b7ebb33901d3dff5426c1c2fa12bc5087b721a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 22 Aug 2009 12:35:49 +0000 Subject: Patch #2826508: "Motorola A1200/E6/A1600 (motoezx) patch" svn-id: r43636 --- backends/platform/sdl/sdl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 3da9a433b7..e5c41e6611 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -216,6 +216,7 @@ public: virtual bool hasFeature(Feature f); virtual void setFeatureState(Feature f, bool enable); virtual bool getFeatureState(Feature f); + virtual void preprocessEvents(SDL_Event *event) {}; #ifdef USE_OSD void displayMessageOnOSD(const char *msg); @@ -230,6 +231,7 @@ public: protected: bool _inited; + SDL_AudioSpec _obtained; #ifdef USE_OSD SDL_Surface *_osdSurface; -- cgit v1.2.3 From 1cedb6577111bca746628b0d3f4b0e8b232338c5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 22 Aug 2009 13:18:26 +0000 Subject: Give meaningful name to variable svn-id: r43647 --- backends/platform/sdl/sdl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/platform/sdl/sdl.h') diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index e5c41e6611..82c1e7bf1b 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -231,7 +231,7 @@ public: protected: bool _inited; - SDL_AudioSpec _obtained; + SDL_AudioSpec _obtainedRate; #ifdef USE_OSD SDL_Surface *_osdSurface; -- cgit v1.2.3