aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.h
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-26 14:16:51 +0000
committerJohannes Schickel2009-07-26 14:16:51 +0000
commit712e0c80eaef79870a302749ae3e91c637088f81 (patch)
tree0305d5046b14e4abbcdf8ec0cd8fcbda130494f5 /graphics/sjis.h
parent997f7b9a3b261b263c70f36e262849058b65d54f (diff)
downloadscummvm-rg350-712e0c80eaef79870a302749ae3e91c637088f81.tar.gz
scummvm-rg350-712e0c80eaef79870a302749ae3e91c637088f81.tar.bz2
scummvm-rg350-712e0c80eaef79870a302749ae3e91c637088f81.zip
Create base class FontSJIS16x16 for our own SJIS font.
svn-id: r42812
Diffstat (limited to 'graphics/sjis.h')
-rw-r--r--graphics/sjis.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/graphics/sjis.h b/graphics/sjis.h
index f7321742af..954f673f54 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -87,19 +87,9 @@ public:
virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const = 0;
};
-/**
- * FM-TOWNS ROM based SJIS compatible font.
- *
- * This is used in KYRA and SCI.
- */
-class FontTowns : public FontSJIS {
+class FontSJIS16x16 : public FontSJIS {
public:
- FontTowns() : _outlineEnabled(false) {}
-
- /**
- * Loads the ROM data from the given read stream.
- */
- bool loadFromStream(Common::ReadStream &stream);
+ FontSJIS16x16() : _outlineEnabled(false) {}
void enableOutline(bool enable) { _outlineEnabled = enable; }
@@ -115,14 +105,32 @@ private:
template<typename Color>
void drawCharIntern(const uint16 *glyph, uint8 *dst, int pitch, Color c1) const;
+ bool _outlineEnabled;
+protected:
+
+ virtual const uint16 *getCharData(uint16 c) const = 0;
+};
+
+/**
+ * FM-TOWNS ROM based SJIS compatible font.
+ *
+ * This is used in KYRA and SCI.
+ */
+class FontTowns : public FontSJIS16x16 {
+public:
+ /**
+ * Loads the ROM data from the given read stream.
+ */
+ bool loadFromStream(Common::ReadStream &stream);
+
+private:
enum {
kFontRomSize = 262144
};
- bool _outlineEnabled;
uint16 _fontData[kFontRomSize / 2];
- static uint sjisToChunk(uint8 low, uint8 high);
+ const uint16 *getCharData(uint16 c) const;
};
// TODO: Consider adding support for PC98 ROM