aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/startrek/common.cpp9
-rw-r--r--engines/startrek/common.h1
-rw-r--r--engines/startrek/graphics.cpp5
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;