aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/anim.cpp
diff options
context:
space:
mode:
authoreriktorbjorn2011-06-26 23:13:49 +0200
committereriktorbjorn2011-06-26 23:13:49 +0200
commite8c704a02573fca7ebe99cbaa9b27eb4382d40f6 (patch)
tree23dddd18fe5b223da8ec737506ad3ac7e2e4de1b /engines/toon/anim.cpp
parentbce549f42a374e47c5de794c863d6cbe0842bfb4 (diff)
downloadscummvm-rg350-e8c704a02573fca7ebe99cbaa9b27eb4382d40f6.tar.gz
scummvm-rg350-e8c704a02573fca7ebe99cbaa9b27eb4382d40f6.tar.bz2
scummvm-rg350-e8c704a02573fca7ebe99cbaa9b27eb4382d40f6.zip
TOON: Fix the bottom pixels of text being cut off
It's a dirty rect problem. The computeSize() function needs to take into consideration that the glyph may be offset, so it's not enough to just look at its size. For now, I'm assuming that this is only a problem with characters that stick out below the base line, so that's all this patch tries to fix. Let's see if that's enough.
Diffstat (limited to 'engines/toon/anim.cpp')
-rw-r--r--engines/toon/anim.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 23bd0f6487..07d51ef1b9 100644
--- a/engines/toon/anim.cpp
+++ b/engines/toon/anim.cpp
@@ -271,6 +271,18 @@ void Animation::applyPalette(int32 offset, int32 srcOffset, int32 numEntries) {
_vm->setPaletteEntries(_palette + srcOffset, offset, numEntries);
}
+Common::Rect Animation::getFrameRect(int32 frame) {
+ debugC(4, kDebugAnim, "getFrameRect(%d)", frame);
+ if ((frame < 0) || (frame >= _numFrames)) {
+ return Common::Rect();
+ }
+
+ if (_frames[frame]._ref != -1)
+ frame = _frames[frame]._ref;
+
+ return Common::Rect(_frames[frame]._x1, _frames[frame]._y1, _frames[frame]._x2, _frames[frame]._y2);
+}
+
int32 Animation::getFrameWidth(int32 frame) {
debugC(4, kDebugAnim, "getFrameWidth(%d)", frame);
if ((frame < 0) || (frame >= _numFrames))