[Scummvm-cvs-logs] SF.net SVN: scummvm:[42330] scummvm/branches/gsoc2009-16bit/engines

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Fri Jul 10 12:43:49 CEST 2009


Revision: 42330
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42330&view=rev
Author:   upthorn
Date:     2009-07-10 10:43:48 +0000 (Fri, 10 Jul 2009)

Log Message:
-----------
Overloaded initGraphics to provide for simpler procedures for engines supporting more than one format.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/engines/engine.cpp
    scummvm/branches/gsoc2009-16bit/engines/engine.h

Modified: scummvm/branches/gsoc2009-16bit/engines/engine.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/engine.cpp	2009-07-10 09:45:26 UTC (rev 42329)
+++ scummvm/branches/gsoc2009-16bit/engines/engine.cpp	2009-07-10 10:43:48 UTC (rev 42330)
@@ -131,7 +131,13 @@
 
 		initCommonGFX(defaultTo1xScaler);
 #ifdef ENABLE_RGB_COLOR
-		g_system->initSize(width, height, format);
+		if (format)
+			g_system->initSize(width, height, format);
+		else { 
+			Graphics::PixelFormat Format = g_system->getSupportedFormats().front();
+			debug("%d,%X,%X,%X",Format.bytesPerPixel << 3, Format.rBits(), Format.gBits(), Format.bBits());
+			g_system->initSize(width, height, &Format);
+		}
 #else
 		g_system->initSize(width, height);
 #endif
@@ -183,6 +189,14 @@
 		dialog.runModal();
 	}
 }
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList) {
+	Graphics::PixelFormat format = Graphics::findCompatibleFormat(g_system->getSupportedFormats(),formatList);
+	initGraphics(width,height,defaultTo1xScaler,&format);
+}
+void initGraphics(int width, int height, bool defaultTo1xScaler) {
+	Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
+	initGraphics(width,height,defaultTo1xScaler,&format);
+}
 
 void GUIErrorMessage(const Common::String msg) {
 	g_system->setWindowCaption("Error");

Modified: scummvm/branches/gsoc2009-16bit/engines/engine.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/engine.h	2009-07-10 09:45:26 UTC (rev 42329)
+++ scummvm/branches/gsoc2009-16bit/engines/engine.h	2009-07-10 10:43:48 UTC (rev 42330)
@@ -62,7 +62,9 @@
  *
  * Defaults to 256 color paletted mode if no graphics format is provided.
  */
-void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format = NULL);
+void initGraphics(int width, int height, bool defaultTo1xScaler);
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics::PixelFormat *format);
+void initGraphics(int width, int height, bool defaultTo1xScaler, const Common::List<Graphics::PixelFormat> &formatList);
 
 /**
  * Initializes graphics and shows error message.


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