diff options
author | Arnaud Boutonné | 2011-02-11 07:12:29 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2011-02-11 07:12:29 +0000 |
commit | 3c5fb26a913b1b8c97da6a0ef0b6b0f2f1498b4b (patch) | |
tree | c003649b2806e76dc21b9f5eca96b412d10a3413 /engines/hugo/object_v2d.cpp | |
parent | d8d9305c22969e98ac8e0c987ac27e7508ff705c (diff) | |
download | scummvm-rg350-3c5fb26a913b1b8c97da6a0ef0b6b0f2f1498b4b.tar.gz scummvm-rg350-3c5fb26a913b1b8c97da6a0ef0b6b0f2f1498b4b.tar.bz2 scummvm-rg350-3c5fb26a913b1b8c97da6a0ef0b6b0f2f1498b4b.zip |
HUGO: refactoring: move boundaries to object class
svn-id: r55879
Diffstat (limited to 'engines/hugo/object_v2d.cpp')
-rw-r--r-- | engines/hugo/object_v2d.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp index 17adae846a..7a4e5ce9a2 100644 --- a/engines/hugo/object_v2d.cpp +++ b/engines/hugo/object_v2d.cpp @@ -239,7 +239,7 @@ void ObjectHandler_v2d::moveObjects() { obj->cycling = kCycleForward; } else { obj->cycling = kCycleNotCycling; - _vm->boundaryCollision(obj); // Must have got hero! + boundaryCollision(obj); // Must have got hero! } obj->oldvx = obj->vx; obj->oldvy = obj->vy; @@ -280,7 +280,7 @@ void ObjectHandler_v2d::moveObjects() { } // Store boundaries if ((obj->cycling > kCycleAlmostInvisible) && (obj->priority == kPriorityFloating)) - _vm->storeBoundary(obj->x + currImage->x1, obj->x + currImage->x2, obj->y + currImage->y2); + storeBoundary(obj->x + currImage->x1, obj->x + currImage->x2, obj->y + currImage->y2); } } @@ -300,25 +300,25 @@ void ObjectHandler_v2d::moveObjects() { int y2 = obj->y + currImage->y2; // Bottom edge if ((obj->cycling > kCycleAlmostInvisible) && (obj->priority == kPriorityFloating)) - _vm->clearBoundary(x1, x2, y2); // Clear our own boundary + clearBoundary(x1, x2, y2); // Clear our own boundary // Allowable motion wrt boundary - int dx = _vm->deltaX(x1, x2, obj->vx, y2); + int dx = deltaX(x1, x2, obj->vx, y2); if (dx != obj->vx) { // An object boundary collision! - _vm->boundaryCollision(obj); + boundaryCollision(obj); obj->vx = 0; } - int dy = _vm->deltaY(x1, x2, obj->vy, y2); + int dy = deltaY(x1, x2, obj->vy, y2); if (dy != obj->vy) { // An object boundary collision! - _vm->boundaryCollision(obj); + boundaryCollision(obj); obj->vy = 0; } if ((obj->cycling > kCycleAlmostInvisible) && (obj->priority == kPriorityFloating)) - _vm->storeBoundary(x1, x2, y2); // Re-store our own boundary + storeBoundary(x1, x2, y2); // Re-store our own boundary obj->x += dx; // Update object position obj->y += dy; @@ -343,7 +343,7 @@ void ObjectHandler_v2d::moveObjects() { object_t *obj = &_objects[i]; // Get pointer to object seq_t *currImage = obj->currImagePtr; // Get ptr to current image if ((obj->screenIndex == *_vm->_screen_p) && (obj->cycling > kCycleAlmostInvisible) && (obj->priority == kPriorityFloating)) - _vm->clearBoundary(obj->oldx + currImage->x1, obj->oldx + currImage->x2, obj->oldy + currImage->y2); + clearBoundary(obj->oldx + currImage->x1, obj->oldx + currImage->x2, obj->oldy + currImage->y2); } // If maze mode is enabled, do special maze processing |