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 --- engines/engine.cpp | 17 +++++++---------- engines/engine.h | 2 +- engines/scumm/scumm.cpp | 9 ++++----- 3 files changed, 12 insertions(+), 16 deletions(-) (limited to 'engines') diff --git a/engines/engine.cpp b/engines/engine.cpp index 7ddc286b0f..213f69e7b1 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -126,20 +126,17 @@ void initCommonGFX(bool defaultTo1XScaler) { } void initGraphics(int width, int height, bool defaultTo1xScaler) { #ifdef ENABLE_16BIT - Common::List formatList; - formatList.push_back(Graphics::kFormatCLUT8); - initGraphics(width,height,defaultTo1xScaler, formatList); + Graphics::PixelFormat format = Graphics::kFormatCLUT8; + initGraphics(width,height,defaultTo1xScaler, format); } -void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList) { +void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) { #endif g_system->beginGFXTransaction(); initCommonGFX(defaultTo1xScaler); #ifdef ENABLE_16BIT - Graphics::ColorMode format = g_system->findCompatibleFormat(formatList); - debug("%X",format); //TODO: set up the pixelFormat here - g_system->initFormat(g_system->getPixelFormat(format)); + g_system->initFormat(format); #endif g_system->initSize(width, height); @@ -161,16 +158,16 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List formatList); +void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format); #endif void initGraphics(int width, int height, bool defaultTo1xScaler); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 0ebf832a37..5fec6ec835 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1085,11 +1085,10 @@ Common::Error ScummEngine::init() { (_screenWidth * _textSurfaceMultiplier > 320)); #ifdef ENABLE_16BIT } else if (_game.features & GF_16BIT_COLOR) { - int format = Graphics::kFormatRGB555; - Common::List formatList; - formatList.push_back((Graphics::ColorMode) format); - formatList.push_back(Graphics::kFormatCLUT8); - initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList); + Graphics::PixelFormat format = Graphics::kFormatRGB555; + initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format); + if (format != _system->getScreenFormat()) + return Common::kUnsupportedColorMode; #endif } else { initGraphics(_screenWidth, _screenHeight, _screenWidth > 320); -- cgit v1.2.3