[Scummvm-cvs-logs] SF.net SVN: scummvm:[42816] scummvm/trunk/graphics
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Jul 26 16:17:54 CEST 2009
Revision: 42816
http://scummvm.svn.sourceforge.net/scummvm/?rev=42816&view=rev
Author: lordhoto
Date: 2009-07-26 14:17:54 +0000 (Sun, 26 Jul 2009)
Log Message:
-----------
Add a factory method, which tries to open different SJIS fonts/ROMs and returns a font for the first present data.
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:17:40 UTC (rev 42815)
+++ scummvm/trunk/graphics/sjis.cpp 2009-07-26 14:17:54 UTC (rev 42816)
@@ -31,6 +31,24 @@
namespace Graphics {
+FontSJIS *FontSJIS::createFont() {
+ FontSJIS *ret = 0;
+
+ // First 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;
+}
+
template<typename Color>
void FontSJIS16x16::drawCharInternOutline(const uint16 *glyph, uint8 *dst, int pitch, Color c1, Color c2) const {
uint32 outlineGlyph[18];
Modified: scummvm/trunk/graphics/sjis.h
===================================================================
--- scummvm/trunk/graphics/sjis.h 2009-07-26 14:17:40 UTC (rev 42815)
+++ scummvm/trunk/graphics/sjis.h 2009-07-26 14:17:54 UTC (rev 42816)
@@ -50,6 +50,19 @@
virtual ~FontSJIS() {}
/**
+ * Creates the first SJIS font, which ROM/font file is present.
+ * It will also call loadData, so the user can just start
+ * using the font.
+ *
+ * It will prefer ScummVM's font.
+ *
+ * TODO: Consider adding some way to overwrite the first checked
+ * font, some games might want to prefer the original ROM over
+ * ScummVM's.
+ */
+ static FontSJIS *createFont();
+
+ /**
* Load the font data.
*/
virtual bool loadData() = 0;
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