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

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Wed Jun 10 07:35:54 CEST 2009


Revision: 41417
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41417&view=rev
Author:   upthorn
Date:     2009-06-10 05:35:54 +0000 (Wed, 10 Jun 2009)

Log Message:
-----------
Scumm engine now dynamically requests 16-bit color based on game features, (using ad-hoc request format)

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

Modified: scummvm/branches/gsoc2009-16bit/engines/engine.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/engine.cpp	2009-06-10 05:35:18 UTC (rev 41416)
+++ scummvm/branches/gsoc2009-16bit/engines/engine.cpp	2009-06-10 05:35:54 UTC (rev 41417)
@@ -124,11 +124,23 @@
 	if (gameDomain && gameDomain->contains("fullscreen"))
 		g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
 }
+void initGraphics(int width, int height, bool defaultTo1xScaler) {
+#ifdef ENABLE_16BIT
+	Common::List<Graphics::ColorFormat> formatList;
+	formatList.push_back(Graphics::kFormat8Bit);
+	initGraphics(width,height,defaultTo1xScaler, formatList);
+}
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorFormat> formatList) {
+#endif
 
-void initGraphics(int width, int height, bool defaultTo1xScaler) {
 	g_system->beginGFXTransaction();
 
 		initCommonGFX(defaultTo1xScaler);
+#ifdef ENABLE_16BIT
+		Graphics::ColorFormat format = g_system->findCompatibleFormat(formatList);
+		debug("%X",format); //TODO: set up the pixelFormat here
+		g_system->initFormat(format);
+#endif
 		g_system->initSize(width, height);
 
 	OSystem::TransactionError gfxError = g_system->endGFXTransaction();

Modified: scummvm/branches/gsoc2009-16bit/engines/engine.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/engine.h	2009-06-10 05:35:18 UTC (rev 41416)
+++ scummvm/branches/gsoc2009-16bit/engines/engine.h	2009-06-10 05:35:54 UTC (rev 41417)
@@ -29,6 +29,9 @@
 #include "common/error.h"
 #include "common/fs.h"
 #include "common/str.h"
+#ifdef ENABLE_16BIT
+#include "graphics/pixelformat.h"
+#endif
 
 class OSystem;
 
@@ -59,6 +62,9 @@
  * Errors out when backend is not able to switch to the specified
  * mode.
  */
+#ifdef ENABLE_16BIT
+void initGraphics(int width, int height, bool defaultTo1xScaler, Common::List<Graphics::ColorFormat> formatList);
+#endif
 void initGraphics(int width, int height, bool defaultTo1xScaler);
 
 /**

Modified: scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp	2009-06-10 05:35:18 UTC (rev 41416)
+++ scummvm/branches/gsoc2009-16bit/engines/scumm/scumm.cpp	2009-06-10 05:35:54 UTC (rev 41417)
@@ -1083,6 +1083,12 @@
 					// CJK FT and DIG use usual NUT fonts, not FM-TOWNS ROM, so
 					// there is no text surface for them. This takes that into account
 					(_screenWidth * _textSurfaceMultiplier > 320));
+	} else if (_game.features & GF_16BIT_COLOR) {
+		int format = Graphics::kFormatRGB555 | Graphics::kFormatRGB;
+		Common::List<Graphics::ColorFormat> formatList;
+		formatList.push_back((Graphics::ColorFormat) format);
+		formatList.push_back(Graphics::kFormat8Bit);
+		initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, formatList);
 	} else {
 		initGraphics(_screenWidth, _screenHeight, _screenWidth > 320);
 	}


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