Skip to content

Commit

Permalink
PEGASUS: Keep the space junk from flying beyond the screen boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hoops committed Oct 29, 2011
1 parent 1ca6da4 commit bcf5ea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/pegasus/neighborhood/mars/spacejunk.cpp
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit bcf5ea1

Please sign in to comment.