From ea4053567806ab80037fdd5060503731e6991362 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 3 Feb 2007 05:50:35 +0000 Subject: Applied the revised NUT font renderer patch #1635584, which combines cyx's patch for correct (not to mention more efficient) rendering of CMI's shadowed letters, while retaining most of the memory savings of my original patch. This time, SMUSH and INSANE fonts also benefit from it. svn-id: r25345 --- engines/scumm/nut_renderer.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'engines/scumm/nut_renderer.h') diff --git a/engines/scumm/nut_renderer.h b/engines/scumm/nut_renderer.h index 26a3f0a302..4fb01fc572 100644 --- a/engines/scumm/nut_renderer.h +++ b/engines/scumm/nut_renderer.h @@ -31,31 +31,41 @@ class ScummEngine; class NutRenderer { protected: + + enum { + kDefaultTransparentColor = 0, + kSmush44TransparentColor = 2 + }; + ScummEngine *_vm; - bool _bitmapFont; int _numChars; + int _maxCharSize; + byte *_charBuffer; byte *_decodedData; + byte *_paletteMap; + byte _bpp; + byte _palette[16]; struct { uint16 width; uint16 height; byte *src; + byte transparency; } _chars[256]; void codec1(byte *dst, const byte *src, int width, int height, int pitch); void codec21(byte *dst, const byte *src, int width, int height, int pitch); - void drawChar(const Graphics::Surface &s, byte c, int x, int y, byte color); - void draw2byte(const Graphics::Surface &s, int c, int x, int y, byte color); - void loadFont(const char *filename); + byte *unpackChar(byte c); public: - NutRenderer(ScummEngine *vm, const char *filename, bool bitmap); + NutRenderer(ScummEngine *vm, const char *filename); virtual ~NutRenderer(); int getNumChars() const { return _numChars; } void drawFrame(byte *dst, int c, int x, int y); - void drawShadowChar(const Graphics::Surface &s, int c, int x, int y, byte color, bool showShadow); + void drawChar(const Graphics::Surface &s, byte c, int x, int y, byte color); + void draw2byte(const Graphics::Surface &s, int c, int x, int y, byte color); int getCharWidth(byte c) const; int getCharHeight(byte c) const; -- cgit v1.2.3