aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/neighborhood/mars/spacejunk.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-10-29 12:19:58 -0400
committerMatthew Hoops2011-10-29 12:19:58 -0400
commitbcf5ea1dc246b86a06ca9f1f97fa5525bd0a006b (patch)
treecdc3a9b20da604713b53c1c48c085d9871efd5a6 /engines/pegasus/neighborhood/mars/spacejunk.cpp
parent1ca6da46ad55a26dab7b8d9b8ad5d8e354f99097 (diff)
downloadscummvm-rg350-bcf5ea1dc246b86a06ca9f1f97fa5525bd0a006b.tar.gz
scummvm-rg350-bcf5ea1dc246b86a06ca9f1f97fa5525bd0a006b.tar.bz2
scummvm-rg350-bcf5ea1dc246b86a06ca9f1f97fa5525bd0a006b.zip
PEGASUS: Keep the space junk from flying beyond the screen boundary
Diffstat (limited to 'engines/pegasus/neighborhood/mars/spacejunk.cpp')
-rwxr-xr-xengines/pegasus/neighborhood/mars/spacejunk.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/pegasus/neighborhood/mars/spacejunk.cpp b/engines/pegasus/neighborhood/mars/spacejunk.cpp
index 8ae36cec0f..a1f9bf7c37 100755
--- a/engines/pegasus/neighborhood/mars/spacejunk.cpp
+++ b/engines/pegasus/neighborhood/mars/spacejunk.cpp
@@ -82,7 +82,7 @@ void SpaceJunk::setCenter(const tCoordType centerX, const tCoordType centerY) {
Common::Rect r;
getBounds(r);
- r.moveTo(centerX - (r.width() >> 1), centerY - (r.height() >> 1));
+ r.moveTo(MAX<int>(centerX - (r.width() >> 1), 0), MAX<int>(centerY - (r.height() >> 1), 0));
setBounds(r);
}
@@ -170,7 +170,7 @@ void SpaceJunk::rebound(const TimeValue reboundTime) {
_bounceStop.y = kMaxBounceSize / 2 + 1 + vm->getRandomNumber(kBounceTargetVRange - 1);
break;
}
-
+
_bounceSizeStart = bounds.width();
_bounceSizeStop = MIN(_bounceSizeStart, kMaxBounceSize);