diff options
author | Jody Northup | 2009-06-19 09:28:55 +0000 |
---|---|---|
committer | Jody Northup | 2009-06-19 09:28:55 +0000 |
commit | 704386d3b09b68f96b6d4160a1a261e3e754f461 (patch) | |
tree | 7067ae6b04495b6aa6a2d437c061a057bd1881e6 /backends/platform | |
parent | 6f2b46964bd3bee3ee12f2c3cd19b62bbb8aa9b6 (diff) | |
download | scummvm-rg350-704386d3b09b68f96b6d4160a1a261e3e754f461.tar.gz scummvm-rg350-704386d3b09b68f96b6d4160a1a261e3e754f461.tar.bz2 scummvm-rg350-704386d3b09b68f96b6d4160a1a261e3e754f461.zip |
Removed replaced Graphics::ColorMode enum type with factory methods for Graphics::PixelFormat.
svn-id: r41662
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 4 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 23 |
2 files changed, 11 insertions, 16 deletions
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 |