[Scummvm-cvs-logs] SF.net SVN: scummvm:[46310] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Dec 9 17:45:35 CET 2009


Revision: 46310
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46310&view=rev
Author:   fingolfin
Date:     2009-12-09 16:45:35 +0000 (Wed, 09 Dec 2009)

Log Message:
-----------
Move findCompatibleFormat from graphics/pixelformat.h to engines/engine.cpp

This function is used in only one place. Declaring it requires common/list.h;
by putting it into pixelformat.h, which is included by common/system.h, tons
of things suddenly included list.h for no good reason.

If we ever need to call this function in other places, we can figure out aborts
more appropriate place for it.

Modified Paths:
--------------
    scummvm/trunk/engines/engine.cpp
    scummvm/trunk/graphics/pixelformat.h

Modified: scummvm/trunk/engines/engine.cpp
===================================================================
--- scummvm/trunk/engines/engine.cpp	2009-12-09 16:44:48 UTC (rev 46309)
+++ scummvm/trunk/engines/engine.cpp	2009-12-09 16:45:35 UTC (rev 46310)
@@ -220,8 +220,32 @@
 	}
 }
 
+
+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);
 }
 

Modified: scummvm/trunk/graphics/pixelformat.h
===================================================================
--- scummvm/trunk/graphics/pixelformat.h	2009-12-09 16:44:48 UTC (rev 46309)
+++ scummvm/trunk/graphics/pixelformat.h	2009-12-09 16:45:35 UTC (rev 46310)
@@ -27,7 +27,6 @@
 #define GRAPHICS_PIXELFORMAT_H
 
 #include "common/scummsys.h"
-#include "common/list.h"
 
 namespace Graphics {
 
@@ -148,26 +147,6 @@
 	}
 };
 
-/**
- * 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list