[Scummvm-git-logs] scummvm master -> 67f49429ae44755bd8d5a0dc0a4d383198eae848
bluegr
bluegr at gmail.com
Mon May 27 14:45:30 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
67f49429ae STARTREK: Replace getRectEncompassing() with extend()
Commit: 67f49429ae44755bd8d5a0dc0a4d383198eae848
https://github.com/scummvm/scummvm/commit/67f49429ae44755bd8d5a0dc0a4d383198eae848
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2019-05-27T15:45:05+03:00
Commit Message:
STARTREK: Replace getRectEncompassing() with extend()
Changed paths:
engines/startrek/common.cpp
engines/startrek/common.h
engines/startrek/graphics.cpp
diff --git a/engines/startrek/common.cpp b/engines/startrek/common.cpp
index b88c3f6..657f72e 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 57408b8..8d3c1f2 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 31056c2..f92ef77 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;
More information about the Scummvm-git-logs
mailing list