aboutsummaryrefslogtreecommitdiff
path: root/saga/sprite.cpp
diff options
context:
space:
mode:
authorAndrew Kurushin2005-04-16 16:55:35 +0000
committerAndrew Kurushin2005-04-16 16:55:35 +0000
commitbffeb58d06f89fc49d64c349d3d8cfa4f65a0664 (patch)
treebb7c509d7f845d024b422d2d5aebe8bbad2d21a3 /saga/sprite.cpp
parent7b9a3b1fa73a2433201ac1c9d63952b5e9076158 (diff)
downloadscummvm-rg350-bffeb58d06f89fc49d64c349d3d8cfa4f65a0664.tar.gz
scummvm-rg350-bffeb58d06f89fc49d64c349d3d8cfa4f65a0664.tar.bz2
scummvm-rg350-bffeb58d06f89fc49d64c349d3d8cfa4f65a0664.zip
fixed: sprite hittest, speech draws in screen bounds
svn-id: r17635
Diffstat (limited to 'saga/sprite.cpp')
-rw-r--r--saga/sprite.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/saga/sprite.cpp b/saga/sprite.cpp
index 23f6a8e66c..46a55d73d7 100644
--- a/saga/sprite.cpp
+++ b/saga/sprite.cpp
@@ -241,8 +241,6 @@ bool Sprite::hitTest(SpriteList &spriteList, int spriteNumber, const Point &scre
const byte *spriteBuffer;
int i, j;
const byte *srcRowPointer;
- int clipWidth;
- int clipHeight;
int width;
int height;
int xAlign;
@@ -255,27 +253,10 @@ bool Sprite::hitTest(SpriteList &spriteList, int spriteNumber, const Point &scre
spritePointer.x = screenCoord.x + xAlign;
spritePointer.y = screenCoord.y + yAlign;
- if (spritePointer.x < 0) {
- return false;
- }
- if (spritePointer.y < 0) {
- return false;
- }
-
- clipWidth = width;
- if (width > (_vm->getDisplayWidth() - spritePointer.x)) {
- clipWidth = (_vm->getDisplayWidth() - spritePointer.x);
- }
-
- clipHeight = height;
- if (height > (_vm->getDisplayHeight() - spritePointer.y)) {
- clipHeight = (_vm->getDisplayHeight() - spritePointer.y);
- }
-
- if ((testPoint.y < spritePointer.y) || (testPoint.y >= spritePointer.y + clipHeight)) {
+ if ((testPoint.y < spritePointer.y) || (testPoint.y >= spritePointer.y + height)) {
return false;
}
- if ((testPoint.x < spritePointer.x) || (testPoint.x >= spritePointer.x + clipWidth)) {
+ if ((testPoint.x < spritePointer.x) || (testPoint.x >= spritePointer.x + width)) {
return false;
}
i = testPoint.y - spritePointer.y;