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') 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