From 75507138cc6b2ae37ea848d77586128ac1023f69 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Wed, 1 Jul 2009 06:33:50 +0000 Subject: Implemented Graphics::PixelFormat Graphics::findCompatibleFormat(Common::List backend, Common::List frontend) svn-id: r41986 --- graphics/pixelformat.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'graphics/pixelformat.h') diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index 063c989371..7c0d008b60 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -27,6 +27,7 @@ #define GRAPHICS_PIXELFORMAT_H #include "common/scummsys.h" +#include "common/list.h" namespace Graphics { @@ -199,6 +200,17 @@ struct PixelFormat { return (1 << aBits()) - 1; } }; +inline PixelFormat findCompatibleFormat(Common::List backend, Common::List frontend) { +#ifdef ENABLE_RGB_COLOR + for (Common::List::iterator i = backend.begin(); i != backend.end(); ++i) { + for (Common::List::iterator j = frontend.begin(); j != frontend.end(); ++j) { + if (*i == *j) + return *i; + } + } +#endif + return PixelFormat::createFormatCLUT8(); +}; } // end of namespace Graphics -- cgit v1.2.3