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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Jul 26 16:18:35 CEST 2009


Revision: 42819
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42819&view=rev
Author:   lordhoto
Date:     2009-07-26 14:18:34 +0000 (Sun, 26 Jul 2009)

Log Message:
-----------
Add way to overwrite default SJIS font.

Modified Paths:
--------------
    scummvm/trunk/graphics/sjis.cpp
    scummvm/trunk/graphics/sjis.h

Modified: scummvm/trunk/graphics/sjis.cpp
===================================================================
--- scummvm/trunk/graphics/sjis.cpp	2009-07-26 14:18:21 UTC (rev 42818)
+++ scummvm/trunk/graphics/sjis.cpp	2009-07-26 14:18:34 UTC (rev 42819)
@@ -31,21 +31,23 @@
 
 namespace Graphics {
 
-FontSJIS *FontSJIS::createFont() {
+FontSJIS *FontSJIS::createFont(const Common::Platform platform) {
 	FontSJIS *ret = 0;
 
-	// First try ScummVM's font.
+	// Try the font ROM of the specified platform
+	if (platform == Common::kPlatformFMTowns) {
+		ret = new FontTowns();
+		if (ret && ret->loadData())
+			return ret;
+		delete ret;
+	}
+
+	// Try ScummVM's font.
 	ret = new FontSjisSVM();
 	if (ret && ret->loadData())
 		return ret;
 	delete ret;
 
-	// Next try the FM-Towns font ROM.
-	ret = new FontTowns();
-	if (ret && ret->loadData())
-		return ret;
-	delete ret;
-
 	return 0;
 }
 

Modified: scummvm/trunk/graphics/sjis.h
===================================================================
--- scummvm/trunk/graphics/sjis.h	2009-07-26 14:18:21 UTC (rev 42818)
+++ scummvm/trunk/graphics/sjis.h	2009-07-26 14:18:34 UTC (rev 42819)
@@ -35,6 +35,7 @@
 
 #include "common/scummsys.h"
 #include "common/stream.h"
+#include "common/util.h"
 
 #include "graphics/surface.h"
 
@@ -54,13 +55,13 @@
 	 * It will also call loadData, so the user can just start
 	 * using the font.
 	 *
-	 * It will prefer ScummVM's font.
+	 * It'll prefer the platform specific ROM file, when platform
+	 * is set to a value, which's font ROM is supported.
+	 * So far that is only kPlatformFMTowns.
 	 *
-	 * TODO: Consider adding some way to overwrite the first checked
-	 * font, some games might want to prefer the original ROM over
-	 * ScummVM's.
+	 * The last file tried is ScummVM's SJIS.FNT file.
 	 */
-	static FontSJIS *createFont();
+	static FontSJIS *createFont(const Common::Platform platform = Common::kPlatformUnknown);
 
 	/**
 	 * Load the font data.


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