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.cpp | 4 ++-- backends/platform/sdl/sdl.h | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'backends/platform/sdl') diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 81b5fcc3eb..17ee5941a4 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -197,8 +197,8 @@ OSystem_SDL::OSystem_SDL() #endif _hwscreen(0), _screen(0), _tmpscreen(0), #ifdef ENABLE_16BIT - _screenFormat(Graphics::kFormatCLUT8), - _cursorFormat(Graphics::kFormatCLUT8), + _screenFormat(Graphics::PixelFormat::createFormatCLUT8()), + _cursorFormat(Graphics::PixelFormat::createFormatCLUT8()), #endif _overlayVisible(false), _overlayscreen(0), _tmpscreen2(0), 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