aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/sjis.cpp15
-rw-r--r--graphics/sjis.h14
2 files changed, 23 insertions, 6 deletions
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index 0fad3fff94..a00fdc83cb 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -101,10 +101,19 @@ void FontSJIS16x16::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1
}
}
-bool FontTowns::loadFromStream(Common::ReadStream &stream) {
+// FM-TOWNS ROM font
+
+bool FontTowns::loadData() {
+ Common::SeekableReadStream *data = SearchMan.createReadStreamForMember("FMT_FNT.ROM");
+ if (!data)
+ return false;
+
for (uint i = 0; i < (kFontRomSize / 2); ++i)
- _fontData[i] = stream.readUint16BE();
- return !stream.err();
+ _fontData[i] = data->readUint16BE();
+
+ bool retValue = !data->err();
+ delete data;
+ return retValue;
}
const uint16 *FontTowns::getCharData(uint16 ch) const {
diff --git a/graphics/sjis.h b/graphics/sjis.h
index 661a8834b0..141a1ed13a 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -50,6 +50,11 @@ public:
virtual ~FontSJIS() {}
/**
+ * Load the font data.
+ */
+ virtual bool loadData() = 0;
+
+ /**
* Enable outline drawing.
*
* After changing outline state, getFontHeight and getFontWidth might return
@@ -87,6 +92,9 @@ public:
virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const = 0;
};
+/**
+ * A base class to render 16x16 monochrome SJIS fonts.
+ */
class FontSJIS16x16 : public FontSJIS {
public:
FontSJIS16x16() : _outlineEnabled(false) {}
@@ -119,9 +127,9 @@ protected:
class FontTowns : public FontSJIS16x16 {
public:
/**
- * Loads the ROM data from the given read stream.
+ * Loads the ROM data from "FMT_FNT.ROM".
*/
- bool loadFromStream(Common::ReadStream &stream);
+ bool loadData();
private:
enum {
@@ -142,7 +150,7 @@ public:
~FontSjisSVM() { delete[] _fontData; }
/**
- * Load the ROM data from "SJIS.FNT".
+ * Load the font data from "SJIS.FNT".
*/
bool loadData();