aboutsummaryrefslogtreecommitdiff
path: root/graphics/pixelformat.h
diff options
context:
space:
mode:
authorJody Northup2009-07-01 06:33:50 +0000
committerJody Northup2009-07-01 06:33:50 +0000
commit75507138cc6b2ae37ea848d77586128ac1023f69 (patch)
tree4f19a753991d41e9ae9aeae2606843096b8d55e3 /graphics/pixelformat.h
parentf10946545ad62c0157d1b0bcfcf12dcb614aaedb (diff)
downloadscummvm-rg350-75507138cc6b2ae37ea848d77586128ac1023f69.tar.gz
scummvm-rg350-75507138cc6b2ae37ea848d77586128ac1023f69.tar.bz2
scummvm-rg350-75507138cc6b2ae37ea848d77586128ac1023f69.zip
Implemented Graphics::PixelFormat Graphics::findCompatibleFormat(Common::List<Graphics::PixelFormat> backend, Common::List<Graphics::PixelFormat> frontend)
svn-id: r41986
Diffstat (limited to 'graphics/pixelformat.h')
-rw-r--r--graphics/pixelformat.h12
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