aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorRobert Špalek2009-09-27 23:57:39 +0000
committerRobert Špalek2009-09-27 23:57:39 +0000
commitd0db5963110929d0d2353278a4d64caca358f48a (patch)
tree33549a703e2a8d4d511ac46526bc48db1b9e4b58 /engines/draci
parent725377f090b538acd209c353c965fe93af450b56 (diff)
downloadscummvm-rg350-d0db5963110929d0d2353278a4d64caca358f48a.tar.gz
scummvm-rg350-d0db5963110929d0d2353278a4d64caca358f48a.tar.bz2
scummvm-rg350-d0db5963110929d0d2353278a4d64caca358f48a.zip
Fix rounding coordinates at the edge of the screen.
svn-id: r44430
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/game.cpp4
-rw-r--r--engines/draci/surface.cpp6
2 files changed, 3 insertions, 7 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index a3f73aaac6..12944ce210 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -1041,7 +1041,9 @@ void Game::walkHero(int x, int y) {
// click but sprites are drawn from their top-left corner so we subtract
// the current height of the dragon's sprite
y -= (int)(scaleY * height);
- //x -= (int)(scaleX * width) / 2;
+ x -= (int)(scaleX * width) / 2;
+ if (x < 0)
+ x = 0;
anim->setRelative(x, y);
// Play the animation
diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp
index 4f97ee75c8..872b228797 100644
--- a/engines/draci/surface.cpp
+++ b/engines/draci/surface.cpp
@@ -138,9 +138,6 @@ uint Surface::centerOnX(uint x, uint width) const {
int newX = x - width / 2;
- if (newX < 0)
- newX = 0;
-
if (newX + width >= (uint)w - 1)
newX = (w - 1) - width;
@@ -162,9 +159,6 @@ uint Surface::centerOnY(uint y, uint height) const {
int newY = y - height / 2;
- if (newY < 0)
- newY = 0;
-
if (newY + height >= (uint)h - 1)
newY = (h - 1) - height;