aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.h
diff options
context:
space:
mode:
authorJohannes Schickel2011-07-01 04:13:37 +0200
committerJohannes Schickel2011-07-01 05:42:54 +0200
commitc047f871d646e89ccaacedb83136112244eb1b44 (patch)
tree8fe988c9425a0c79061fa004c9b329e27e8284ea /graphics/sjis.h
parent173db53e4b89dfafe9582a48d28a3450c888e200 (diff)
downloadscummvm-rg350-c047f871d646e89ccaacedb83136112244eb1b44.tar.gz
scummvm-rg350-c047f871d646e89ccaacedb83136112244eb1b44.tar.bz2
scummvm-rg350-c047f871d646e89ccaacedb83136112244eb1b44.zip
GRAPHICS: Cleanup SJIS font code a bit.
Diffstat (limited to 'graphics/sjis.h')
-rw-r--r--graphics/sjis.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/graphics/sjis.h b/graphics/sjis.h
index 0c3b057cc4..d455a96e64 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -134,19 +134,19 @@ public:
*/
class FontSJISBase : public FontSJIS {
public:
- FontSJISBase() : _drawMode(kDefaultMode), _flippedMode(false) {}
+ FontSJISBase();
- void setDrawingMode(DrawingMode mode) { _drawMode = mode; }
+ virtual void setDrawingMode(DrawingMode mode);
- void toggleFlippedMode(bool enable) { _flippedMode = enable; }
+ virtual void toggleFlippedMode(bool enable);
- uint getFontHeight() const { return (_drawMode == kOutlineMode) ? 18 : (_drawMode == kDefaultMode ? 16 : 17); }
+ virtual uint getFontHeight() const;
- uint getMaxFontWidth() const { return (_drawMode == kOutlineMode) ? 18 : (_drawMode == kDefaultMode ? 16 : 17); }
+ virtual uint getMaxFontWidth() const;
- uint getCharWidth(uint16 ch) const;
+ virtual uint getCharWidth(uint16 ch) const;
- void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2, int maxW = -1, int maxH = -1) const;
+ virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2, int maxW = -1, int maxH = -1) const;
private:
template<typename Color>
void blitCharacter(const uint8 *glyph, const int w, const int h, uint8 *dst, int pitch, Color c) const;
@@ -162,10 +162,9 @@ protected:
DrawingMode _drawMode;
bool _flippedMode;
- bool is8x16(uint16 ch) const;
+ bool isASCII(uint16 ch) const;
virtual const uint8 *getCharData(uint16 c) const = 0;
- virtual const uint8 *getCharData8x16(uint16 c) const = 0;
};
/**
@@ -188,8 +187,7 @@ private:
uint8 _fontData16x16[kFont16x16Chars * 32];
uint8 _fontData8x16[kFont8x16Chars * 32];
- const uint8 *getCharData(uint16 c) const;
- const uint8 *getCharData8x16(uint16 c) const;
+ virtual const uint8 *getCharData(uint16 c) const;
};
/**
@@ -197,8 +195,8 @@ private:
*/
class FontSjisSVM : public FontSJISBase {
public:
- FontSjisSVM() : _fontData16x16(0), _fontData16x16Size(0), _fontData8x16(0), _fontData8x16Size(0) {}
- ~FontSjisSVM() { delete[] _fontData16x16; delete[] _fontData8x16; }
+ FontSjisSVM();
+ ~FontSjisSVM();
/**
* Load the font data from "SJIS.FNT".
@@ -211,8 +209,7 @@ private:
uint8 *_fontData8x16;
uint _fontData8x16Size;
- const uint8 *getCharData(uint16 c) const;
- const uint8 *getCharData8x16(uint16 c) const;
+ virtual const uint8 *getCharData(uint16 c) const;
};
// TODO: Consider adding support for PC98 ROM