aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/engine.cpp26
-rw-r--r--graphics/pixelformat.h21
2 files changed, 25 insertions, 22 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp
index d8aeb88278..4f908d96f6 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -220,8 +220,32 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
}
}
+
+using Graphics::PixelFormat;
+
+/**
+ * Determines the first matching format between two lists.
+ *
+ * @param backend The higher priority list, meant to be a list of formats supported by the backend
+ * @param frontend The lower priority list, meant to be a list of formats supported by the engine
+ * @return The first item on the backend list that also occurs on the frontend list
+ * or PixelFormat::createFormatCLUT8() if no matching formats were found.
+ */
+inline PixelFormat findCompatibleFormat(Common::List<PixelFormat> backend, Common::List<PixelFormat> frontend) {
+#ifdef USE_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();
+}
+
+
void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList) {
- Graphics::PixelFormat format = Graphics::findCompatibleFormat(g_system->getSupportedFormats(), formatList);
+ Graphics::PixelFormat format = findCompatibleFormat(g_system->getSupportedFormats(), formatList);
initGraphics(width, height, defaultTo1xScaler, &format);
}
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 1822370fcd..7b95eabd35 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -27,7 +27,6 @@
#define GRAPHICS_PIXELFORMAT_H
#include "common/scummsys.h"
-#include "common/list.h"
namespace Graphics {
@@ -148,26 +147,6 @@ struct PixelFormat {
}
};
-/**
- * Determines the first matching format between two lists.
- *
- * @param backend The higher priority list, meant to be a list of formats supported by the backend
- * @param frontend The lower priority list, meant to be a list of formats supported by the engine
- * @return The first item on the backend list that also occurs on the frontend list
- * or PixelFormat::createFormatCLUT8() if no matching formats were found.
- */
-inline PixelFormat findCompatibleFormat(Common::List<PixelFormat> backend, Common::List<PixelFormat> frontend) {
-#ifdef USE_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
#endif