From 45fda46cf31884ca446c23e6c6df50794145cf9e Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Tue, 6 Oct 2009 17:22:40 +0000 Subject: KYRA/LOL: - get rid of ascii/sjis detection which could cause problems when typing savegame names - fixed some minor bugs svn-id: r44709 --- graphics/sjis.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'graphics/sjis.h') diff --git a/graphics/sjis.h b/graphics/sjis.h index 14a5187914..87882e2fae 100644 --- a/graphics/sjis.h +++ b/graphics/sjis.h @@ -72,12 +72,19 @@ 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. */ @@ -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; }; -- cgit v1.2.3