diff options
author | Torbjörn Andersson | 2007-01-21 17:14:53 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-01-21 17:14:53 +0000 |
commit | 01a5faa6a0ba89b7f774efe33839a077eeaa5f9d (patch) | |
tree | 64ebe05de9e2d099e85f2053b591b8cbdafe80e0 /engines/scumm/nut_renderer.h | |
parent | 44cbf4996b7a26832e566bfada4d186643056234 (diff) | |
download | scummvm-rg350-01a5faa6a0ba89b7f774efe33839a077eeaa5f9d.tar.gz scummvm-rg350-01a5faa6a0ba89b7f774efe33839a077eeaa5f9d.tar.bz2 scummvm-rg350-01a5faa6a0ba89b7f774efe33839a077eeaa5f9d.zip |
Applied my own patch #1635584 (after discussing with Fingolfin) to reduce the
memory usage and number of allocations made by the NUT font renderer.
svn-id: r25155
Diffstat (limited to 'engines/scumm/nut_renderer.h')
-rw-r--r-- | engines/scumm/nut_renderer.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/scumm/nut_renderer.h b/engines/scumm/nut_renderer.h index 8972fef949..c3bc68477a 100644 --- a/engines/scumm/nut_renderer.h +++ b/engines/scumm/nut_renderer.h @@ -33,15 +33,18 @@ class NutRenderer { protected: ScummEngine *_vm; bool _loaded; + bool _bitmapFont; int _numChars; + byte *_decodedData; struct { - int xoffs; - int yoffs; - int width; - int height; + uint16 width; + uint16 height; byte *src; } _chars[256]; + static void codec1(bool bitmap, byte *dst, const byte *src, int width, int height, int pitch); + static void codec21(bool bitmap, 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); @@ -50,7 +53,7 @@ public: virtual ~NutRenderer(); int getNumChars() const { return _numChars; } - bool loadFont(const char *filename); + bool loadFont(const char *filename, bool bitmap); 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); |