aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.h
diff options
context:
space:
mode:
authorFlorian Kagerer2009-10-06 17:22:40 +0000
committerFlorian Kagerer2009-10-06 17:22:40 +0000
commit45fda46cf31884ca446c23e6c6df50794145cf9e (patch)
tree328bf37e8211368e96d7d45c1351d440544e5006 /graphics/sjis.h
parent1481c78d1a61937d9339563a521b3b87c14520e9 (diff)
downloadscummvm-rg350-45fda46cf31884ca446c23e6c6df50794145cf9e.tar.gz
scummvm-rg350-45fda46cf31884ca446c23e6c6df50794145cf9e.tar.bz2
scummvm-rg350-45fda46cf31884ca446c23e6c6df50794145cf9e.zip
KYRA/LOL: - get rid of ascii/sjis detection which could cause problems when typing savegame names
- fixed some minor bugs svn-id: r44709
Diffstat (limited to 'graphics/sjis.h')
-rw-r--r--graphics/sjis.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/graphics/sjis.h b/graphics/sjis.h
index 14a5187914..87882e2fae 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -72,13 +72,20 @@ public:
/**
* Enable outline drawing.
- *
- * After changing outline state, getFontHeight and getMaxFontWidth / getCharWidth might return
- * different values!
*/
virtual void enableOutline(bool enable) {}
/**
+ * Toggle values returned by getFontHeight and getMaxFontWidth / getCharWidth.
+ * These methods have to return different values when emulating PC-98 text mode.
+ * We cannot simply match this with enableOutline(), since there are situations
+ * where outlines get disabled in graphic mode, too. In these admittedly rare
+ * cases (Kyra 1: Brynn's note, Kyra 2: spell book) the values returned by
+ * getFontHeight and getMaxFontWidth / getCharWidth have to remain the same.
+ */
+ virtual void toggleCharSize(bool textMode) {}
+
+ /**
* Returns the height of the font.
*/
virtual uint getFontHeight() const = 0;
@@ -122,12 +129,13 @@ public:
*/
class FontSJIS16x16 : public FontSJIS {
public:
- FontSJIS16x16() : _outlineEnabled(false) {}
+ FontSJIS16x16() : _outlineEnabled(false), _pc98TextModeCharSize(false) {}
void enableOutline(bool enable) { _outlineEnabled = enable; }
+ void toggleCharSize(bool textMode) { _pc98TextModeCharSize = textMode; }
- uint getFontHeight() const { return _outlineEnabled ? 18 : 16; }
- uint getMaxFontWidth() const { return _outlineEnabled ? 18 : 16; }
+ uint getFontHeight() const { return _pc98TextModeCharSize ? 16 : 18; }
+ uint getMaxFontWidth() const { return _pc98TextModeCharSize ? 16 : 18; }
virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const;
@@ -140,6 +148,7 @@ private:
protected:
bool _outlineEnabled;
+ bool _pc98TextModeCharSize;
virtual const uint16 *getCharData(uint16 c) const = 0;
};