aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.h
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-07 18:10:35 +0000
committerJohannes Schickel2009-07-07 18:10:35 +0000
commit62eebc3e17f952defaa779ed1dc770570dac309d (patch)
treead1af4d9a6c700c6dcdbb15169408d209bff2c16 /graphics/sjis.h
parent9bdf1a2ab139d364ee30906a18dc05de8c88e487 (diff)
downloadscummvm-rg350-62eebc3e17f952defaa779ed1dc770570dac309d.tar.gz
scummvm-rg350-62eebc3e17f952defaa779ed1dc770570dac309d.tar.bz2
scummvm-rg350-62eebc3e17f952defaa779ed1dc770570dac309d.zip
- Added support for outlined FM-Towns ROM drawing
- Adapted KYRA to use that svn-id: r42230
Diffstat (limited to 'graphics/sjis.h')
-rw-r--r--graphics/sjis.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/graphics/sjis.h b/graphics/sjis.h
index f6277b62a4..63013dccf1 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -42,6 +42,14 @@ public:
virtual ~FontSJIS() {}
/**
+ * Enable shadow drawing.
+ *
+ * After changing shadow state, getFontHeight and getFontWidth might return
+ * different values!
+ */
+ virtual void enableShadow(bool enable) {}
+
+ /**
* Returns the height of the font.
*/
virtual uint getFontHeight() const = 0;
@@ -54,8 +62,8 @@ public:
/**
* Draws a SJIS encoded character on the given surface.
*/
- void drawChar(Graphics::Surface &dst, uint16 ch, int x, int y, uint32 c1) const {
- drawChar(dst.getBasePtr(x, y), ch, c1, dst.pitch, dst.bytesPerPixel);
+ void drawChar(Graphics::Surface &dst, uint16 ch, int x, int y, uint32 c1, uint32 c2) const {
+ drawChar(dst.getBasePtr(x, y), ch, c1, c2, dst.pitch, dst.bytesPerPixel);
}
/**
@@ -66,8 +74,9 @@ public:
* @param pitch pitch of the destination buffer (size in *bytes*)
* @param bpp bytes per pixel of the destination buffer
* @param c1 forground color
+ * @param c2 shadow/outline color
*/
- virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1) const = 0;
+ virtual void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const = 0;
};
/**
@@ -82,19 +91,25 @@ public:
*/
bool loadFromStream(Common::ReadStream &stream);
- uint getFontHeight() const { return 16; }
- uint getFontWidth() const { return 16; }
+ void enableShadow(bool enable) { _shadowEnabled = enable; }
- void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1) const;
+ uint getFontHeight() const { return _shadowEnabled ? 18 : 16; }
+ uint getFontWidth() const { return _shadowEnabled ? 18 : 16; }
+
+ void drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1, uint32 c2) const;
private:
template<typename Color>
+ void drawCharInternShadow(const uint16 *glyph, uint8 *dst, int pitch, Color c1, Color c2) const;
+
+ template<typename Color>
void drawCharIntern(const uint16 *glyph, uint8 *dst, int pitch, Color c1) const;
enum {
kFontRomSize = 262144
};
+ bool _shadowEnabled;
uint16 _fontData[kFontRomSize / 2];
static uint sjisToChunk(uint8 low, uint8 high);