diff options
author | Denis Kasak | 2009-07-03 16:41:11 +0000 |
---|---|---|
committer | Denis Kasak | 2009-07-03 16:41:11 +0000 |
commit | 8e9771d15c3e328fb5183f78f37501f9f2646c09 (patch) | |
tree | 52f46c8ff33944ed7ba0b35c6e9344c541072a0f /engines/draci/font.cpp | |
parent | 52642e2dc9db65b87994b56e19c14b1b039dcb08 (diff) | |
download | scummvm-rg350-8e9771d15c3e328fb5183f78f37501f9f2646c09.tar.gz scummvm-rg350-8e9771d15c3e328fb5183f78f37501f9f2646c09.tar.bz2 scummvm-rg350-8e9771d15c3e328fb5183f78f37501f9f2646c09.zip |
Added bool parameter markDirty to Sprite::draw() and Text::draw() to specify whether to mark a dirty rect for a particular draw (also added such support to the Font class since it's needed by Text). Made spacing parameters for Text instances mandatory.
svn-id: r42066
Diffstat (limited to 'engines/draci/font.cpp')
-rw-r--r-- | engines/draci/font.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index b3c5768b51..17ff8644cb 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -144,7 +144,7 @@ uint8 Font::getCharWidth(uint8 chr) const { * @param ty Vertical offset on the surface */ -void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty) const { +void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) const { assert(dst != NULL); assert(tx >= 0); assert(ty >= 0); @@ -197,8 +197,10 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty) const { ptr += dst->pitch; } - Common::Rect r(tx, ty, tx + xPixelsToDraw, ty + yPixelsToDraw); - dst->markDirtyRect(r); + if (markDirty) { + Common::Rect r(tx, ty, tx + xPixelsToDraw, ty + yPixelsToDraw); + dst->markDirtyRect(r); + } } /** @@ -213,7 +215,7 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty) const { */ void Font::drawString(Surface *dst, const byte *str, uint len, - int x, int y, int spacing) const { + int x, int y, int spacing, bool markDirty) const { assert(dst != NULL); assert(x >= 0); assert(y >= 0); @@ -227,7 +229,7 @@ void Font::drawString(Surface *dst, const byte *str, uint len, return; } - drawChar(dst, str[i], curx, y); + drawChar(dst, str[i], curx, y, markDirty); curx += getCharWidth(str[i]) + spacing; } } @@ -243,9 +245,9 @@ void Font::drawString(Surface *dst, const byte *str, uint len, */ void Font::drawString(Surface *dst, const Common::String &str, - int x, int y, int spacing) const { + int x, int y, int spacing, bool markDirty) const { - drawString(dst, (byte *) str.c_str(), str.size(), x, y, spacing); + drawString(dst, (byte *) str.c_str(), str.size(), x, y, spacing, markDirty); } /** |