aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorDenis Kasak2009-08-14 16:12:17 +0000
committerDenis Kasak2009-08-14 16:12:17 +0000
commitfad77de23486d806f5cc94ae65e0df5953511a73 (patch)
tree23b270b372dae0f3b27730ef1c22c79a64186840 /engines/draci
parent87e64d27f7f1ef3d1f5a635198f006ff89df1f26 (diff)
downloadscummvm-rg350-fad77de23486d806f5cc94ae65e0df5953511a73.tar.gz
scummvm-rg350-fad77de23486d806f5cc94ae65e0df5953511a73.tar.bz2
scummvm-rg350-fad77de23486d806f5cc94ae65e0df5953511a73.zip
Sped up the game during dialogues by not updating every drawn char separately but the whole string at once. Also removed the markDirty parameter from Font::drawChar() since it's not needed anymore.
svn-id: r43368
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/font.cpp14
-rw-r--r--engines/draci/font.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp
index 2a9185e725..093b8d9d17 100644
--- a/engines/draci/font.cpp
+++ b/engines/draci/font.cpp
@@ -132,7 +132,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, bool markDirty) const {
+void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty) const {
assert(dst != NULL);
assert(tx >= 0);
assert(ty >= 0);
@@ -189,11 +189,6 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) con
// Advance to next row
ptr += dst->pitch;
}
-
- if (markDirty) {
- Common::Rect r(tx, ty, tx + xPixelsToDraw + 1, ty + yPixelsToDraw);
- dst->markDirtyRect(r);
- }
}
/**
@@ -248,9 +243,14 @@ void Font::drawString(Surface *dst, const Common::String &str,
break;
}
- drawChar(dst, str[i], curx, cury, markDirty);
+ drawChar(dst, str[i], curx, cury);
curx += getCharWidth(str[i]) + spacing;
}
+
+ if (markDirty) {
+ Common::Rect r(x, y, x + widest, y + getStringHeight(str));
+ dst->markDirtyRect(r);
+ }
}
/**
diff --git a/engines/draci/font.h b/engines/draci/font.h
index e81b344af1..5258108add 100644
--- a/engines/draci/font.h
+++ b/engines/draci/font.h
@@ -61,7 +61,7 @@ public:
uint8 getFontHeight() const { return _fontHeight; };
uint8 getMaxCharWidth() const { return _maxCharWidth; };
uint8 getCharWidth(byte chr) const;
- void drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty = true) const;
+ void drawChar(Surface *dst, uint8 chr, int tx, int ty) const;
void drawString(Surface *dst, const byte *str, uint len, int x, int y,
int spacing, bool markDirty = true) const;