aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-26 14:18:34 +0000
committerJohannes Schickel2009-07-26 14:18:34 +0000
commitec67b583b05ace5a0e70449cf335deeba6df5e14 (patch)
tree7aa67d6899234f36251274baff19e2d6f6df5ed3
parentbe9c906c728087c7ab10b33d55065f6cf3f1d201 (diff)
downloadscummvm-rg350-ec67b583b05ace5a0e70449cf335deeba6df5e14.tar.gz
scummvm-rg350-ec67b583b05ace5a0e70449cf335deeba6df5e14.tar.bz2
scummvm-rg350-ec67b583b05ace5a0e70449cf335deeba6df5e14.zip
Add way to overwrite default SJIS font.
svn-id: r42819
-rw-r--r--graphics/sjis.cpp18
-rw-r--r--graphics/sjis.h11
2 files changed, 16 insertions, 13 deletions
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index d46ac3e965..589e27fd43 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -31,17 +31,19 @@
namespace Graphics {
-FontSJIS *FontSJIS::createFont() {
+FontSJIS *FontSJIS::createFont(const Common::Platform platform) {
FontSJIS *ret = 0;
- // First try ScummVM's font.
- ret = new FontSjisSVM();
- if (ret && ret->loadData())
- return ret;
- delete ret;
+ // Try the font ROM of the specified platform
+ if (platform == Common::kPlatformFMTowns) {
+ ret = new FontTowns();
+ if (ret && ret->loadData())
+ return ret;
+ delete ret;
+ }
- // Next try the FM-Towns font ROM.
- ret = new FontTowns();
+ // Try ScummVM's font.
+ ret = new FontSjisSVM();
if (ret && ret->loadData())
return ret;
delete ret;
diff --git a/graphics/sjis.h b/graphics/sjis.h
index b690401547..ea485db460 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -35,6 +35,7 @@
#include "common/scummsys.h"
#include "common/stream.h"
+#include "common/util.h"
#include "graphics/surface.h"
@@ -54,13 +55,13 @@ public:
* 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.