diff options
author | johndoe123 | 2014-02-16 00:12:26 +0100 |
---|---|---|
committer | johndoe123 | 2014-02-16 00:12:26 +0100 |
commit | 6078bf7eba1a10bfd737a874744a11870f485f75 (patch) | |
tree | 5d30e4a265b66ac8de6ac78875db444f3ce354c1 | |
parent | 82bb55aa892365b1f5e9835d20e2487f0faf3232 (diff) | |
download | scummvm-rg350-6078bf7eba1a10bfd737a874744a11870f485f75.tar.gz scummvm-rg350-6078bf7eba1a10bfd737a874744a11870f485f75.tar.bz2 scummvm-rg350-6078bf7eba1a10bfd737a874744a11870f485f75.zip |
BBVS: Remove rectIntersection and use Rect::findIntersectingRect instead
-rw-r--r-- | engines/bbvs/bbvs.cpp | 12 | ||||
-rw-r--r-- | engines/bbvs/bbvs.h | 1 |
2 files changed, 2 insertions, 11 deletions
diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp index d3af885599..77288b58c7 100644 --- a/engines/bbvs/bbvs.cpp +++ b/engines/bbvs/bbvs.cpp @@ -1780,18 +1780,10 @@ void BbvsEngine::turnObject(SceneObject *sceneObject) { } } -bool BbvsEngine::rectIntersection(const Common::Rect &rect1, const Common::Rect &rect2, Common::Rect &outRect) { - outRect.left = MAX(rect1.left, rect2.left); - outRect.top = MAX(rect1.top, rect2.top); - outRect.right = MIN(rect1.right, rect2.right); - outRect.bottom = MIN(rect1.bottom, rect2.bottom); - return !outRect.isEmpty(); -} - int BbvsEngine::rectSubtract(const Common::Rect &rect1, const Common::Rect &rect2, Common::Rect *outRects) { int count = 0; - Common::Rect workRect; - if (rectIntersection(rect1, rect2, workRect)) { + Common::Rect workRect = rect1.findIntersectingRect(rect2); + if (!workRect.isEmpty()) { count = 0; outRects[count] = Common::Rect(rect2.width(), workRect.top - rect2.top); if (!outRects[count].isEmpty()) { diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h index 4a134032de..5853b8074e 100644 --- a/engines/bbvs/bbvs.h +++ b/engines/bbvs/bbvs.h @@ -341,7 +341,6 @@ public: void walkObject(SceneObject *sceneObject, const Common::Point &destPt, int walkSpeed); void turnObject(SceneObject *sceneObject); - bool rectIntersection(const Common::Rect &rect1, const Common::Rect &rect2, Common::Rect &outRect); int rectSubtract(const Common::Rect &rect1, const Common::Rect &rect2, Common::Rect *outRects); WalkInfo *addWalkInfo(int16 x, int16 y, int delta, int direction, int16 midPtX, int16 midPtY, int walkAreaIndex); |