aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.h
diff options
context:
space:
mode:
authorFlorian Kagerer2010-10-17 13:08:00 +0000
committerFlorian Kagerer2010-10-17 13:08:00 +0000
commitc841c3fb7c9b93d48512c4480753ca409770990f (patch)
tree8e54a799b750048d770f5778c7ad4d64b8ff4778 /graphics/sjis.h
parent728a231d7b8b392b933e507f17f20afe91fd0eed (diff)
downloadscummvm-rg350-c841c3fb7c9b93d48512c4480753ca409770990f.tar.gz
scummvm-rg350-c841c3fb7c9b93d48512c4480753ca409770990f.tar.bz2
scummvm-rg350-c841c3fb7c9b93d48512c4480753ca409770990f.zip
SCUMM/FM-TOWNS: more improvements to japanese font drawing
- made use of LordHotos graphics/sjis code to reduce code duplication - japanese mode for version 3 and 5 works fine now with few exceptions (some line spacing glitches in MI1 intro etc.) svn-id: r53554
Diffstat (limited to 'graphics/sjis.h')
-rw-r--r--graphics/sjis.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/graphics/sjis.h b/graphics/sjis.h
index e0b760fc78..b6e99c7f91 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -71,12 +71,19 @@ public:
virtual bool loadData() = 0;
/**
- * Enable outline drawing.
+ * Enable outline/shadow drawing.
*
* After changing outline state, getFontHeight and getMaxFontWidth / getCharWidth might return
* different values!
*/
- virtual void enableOutline(bool enable) {}
+ enum ShadowType {
+ kShadowTypeNone,
+ kShadowTypeOutline,
+ kShadowTypeScumm3,
+ kShadowTypeScumm3Towns
+ };
+
+ virtual void setShadowMode(ShadowType type) {}
/**
* Returns the height of the font.
@@ -122,22 +129,23 @@ public:
*/
class FontSJISBase : public FontSJIS {
public:
- FontSJISBase() : _outlineEnabled(false) {}
+ FontSJISBase() : _shadowType(kShadowTypeNone) {}
- void enableOutline(bool enable) { _outlineEnabled = enable; }
+ void setShadowMode(ShadowType type) { _shadowType = type; }
- uint getFontHeight() const { return _outlineEnabled ? 18 : 16; }
- uint getMaxFontWidth() const { return _outlineEnabled ? 18 : 16; }
+ uint getFontHeight() const { return (_shadowType == kShadowTypeOutline) ? 18 : (_shadowType == kShadowTypeNone ? 16 : 17); }
+
+ uint getMaxFontWidth() const { return (_shadowType == kShadowTypeOutline) ? 18 : (_shadowType == kShadowTypeNone ? 16 : 17); }
uint getCharWidth(uint16 ch) const;
void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const;
private:
template<typename Color>
- void blitCharacter(const uint8 *glyph, const int w, const int h, uint8 *dst, int pitch, Color c) const;
+ void blitCharacter(const uint8 *glyph, const int w, const int h, uint8 *dst, int pitch, Color c1, Color c2 = 0) const;
void createOutline(uint8 *outline, const uint8 *glyph, const int w, const int h) const;
protected:
- bool _outlineEnabled;
+ ShadowType _shadowType;
bool is8x16(uint16 ch) const;