diff options
author | Filippos Karapetis | 2019-05-27 15:45:05 +0300 |
---|---|---|
committer | Filippos Karapetis | 2019-05-27 15:45:05 +0300 |
commit | 67f49429ae44755bd8d5a0dc0a4d383198eae848 (patch) | |
tree | 9d1da66887970ec123e6e7517ea52b27c9167f76 /engines | |
parent | 7346b69d886b10adc93e848ea3c609b253e162f6 (diff) | |
download | scummvm-rg350-67f49429ae44755bd8d5a0dc0a4d383198eae848.tar.gz scummvm-rg350-67f49429ae44755bd8d5a0dc0a4d383198eae848.tar.bz2 scummvm-rg350-67f49429ae44755bd8d5a0dc0a4d383198eae848.zip |
STARTREK: Replace getRectEncompassing() with extend()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/startrek/common.cpp | 9 | ||||
-rw-r--r-- | engines/startrek/common.h | 1 | ||||
-rw-r--r-- | engines/startrek/graphics.cpp | 5 |
3 files changed, 3 insertions, 12 deletions
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp index b88c3f63e8..657f72e3f2 100644 --- a/engines/startrek/common.cpp +++ b/engines/startrek/common.cpp @@ -26,15 +26,6 @@ namespace StarTrek { -Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2) { - uint16 l = MIN(r1.left, r2.left); - uint16 t = MIN(r1.top, r2.top); - uint16 r = MAX(r1.right, r2.right); - uint16 b = MAX(r1.bottom, r2.bottom); - - return Common::Rect(l, t, r, b); -} - void serializeRect(Common::Rect rect, Common::Serializer &ser) { ser.syncAsSint16LE(rect.left); ser.syncAsSint16LE(rect.top); diff --git a/engines/startrek/common.h b/engines/startrek/common.h index 57408b8c07..8d3c1f2b13 100644 --- a/engines/startrek/common.h +++ b/engines/startrek/common.h @@ -32,7 +32,6 @@ class Serializer; namespace StarTrek { -Common::Rect getRectEncompassing(Common::Rect r1, Common::Rect r2); void serializeRect(Common::Rect rect, Common::Serializer &ser); } // End of namespace StarTrek diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp index 31056c25fd..f92ef77594 100644 --- a/engines/startrek/graphics.cpp +++ b/engines/startrek/graphics.cpp @@ -497,7 +497,8 @@ void Graphics::drawAllSprites(bool updateScreenFlag) { if (rect.isEmpty()) spr->rect2Valid = 0; else { - spr->rectangle2 = getRectEncompassing(spr->drawRect, spr->lastDrawRect); + spr->rectangle2 = spr->drawRect; + spr->rectangle2.extend(spr->lastDrawRect); spr->rect2Valid = 1; } } else { @@ -560,7 +561,7 @@ void Graphics::drawAllSprites(bool updateScreenFlag) { if (rect1.width() != 0 && rect1.height() != 0) { if (mustRedrawSprite) - rect2 = getRectEncompassing(rect1, rect2); + rect2.extend(rect1); else rect2 = rect1; mustRedrawSprite = true; |