diff options
-rw-r--r-- | graphics/pixelformat.h | 12 |
1 files changed, 12 insertions, 0 deletions
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<PixelFormat> backend, Common::List<PixelFormat> frontend) { +#ifdef ENABLE_RGB_COLOR + for (Common::List<PixelFormat>::iterator i = backend.begin(); i != backend.end(); ++i) { + for (Common::List<PixelFormat>::iterator j = frontend.begin(); j != frontend.end(); ++j) { + if (*i == *j) + return *i; + } + } +#endif + return PixelFormat::createFormatCLUT8(); +}; } // end of namespace Graphics |