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/graphics.cpp | 41 +++++++++++++++++++++++++++++++++----- backends/platform/sdl/sdl.h | 4 ++-- base/main.cpp | 2 +- common/system.h | 2 +- engines/engine.cpp | 2 +- graphics/pixelformat.h | 14 ++++++------- 6 files changed, 48 insertions(+), 17 deletions(-) diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 51f63a364a..e5d8ba4fbc 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -128,7 +128,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) { errors |= kTransactionPixelFormatNotSupported; _videoMode.format = _oldVideoMode.format; - _screenFormat = getPixelFormat(_videoMode.format); + _screenFormat = _videoMode.format; #endif } else if (_videoMode.screenWidth != _oldVideoMode.screenWidth || _videoMode.screenHeight != _oldVideoMode.screenHeight) { errors |= kTransactionSizeChangeFailed; @@ -362,7 +362,7 @@ Graphics::ColorMode OSystem_SDL::findCompatibleFormat(Common::ListfindCompatibleFormat(formatList); debug("%X",format); //TODO: set up the pixelFormat here - g_system->initFormat(format); + g_system->initFormat(g_system->getPixelFormat(format)); #endif g_system->initSize(width, height); diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index d37a7794f4..fa5925b1f9 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -44,15 +44,15 @@ namespace Graphics { * to get the applicable color order. */ enum ColorMode { - kFormatCLUT8 = 0, + kFormatCLUT8 = 0, //256 color palette. kFormatRGB555 = 1, - kFormatRGB556 = 2, // 6 bits for blue, in case this ever happens + kFormatXRGB1555 = 2, // Special case, high bit has special purpose, which may be alpha. + // Engines should probably handle this bit internally and pass RGB only, though kFormatRGB565 = 3, - kFormatRGB655 = 4, // 6 bits for red, in case this ever happens - kFormatRGBA4444 = 5, - kFormatRGB888 = 6, - kFormatRGBA6666 = 7, // I've never heard of this, but it's theoretically possible - kFormatRGBA8888 = 8 + kFormatRGBA4444 = 4, // since this mode is commonly supported in game hardware, some unimplemented engines may use it? + kFormatRGB888 = 5, + kFormatRGBA6666 = 6, // I've never heard of this, but it's vaguely plausible + kFormatRGBA8888 = 7 }; #endif -- cgit v1.2.3