diff options
author | Colin Snover | 2016-03-02 00:02:25 -0600 |
---|---|---|
committer | Colin Snover | 2016-03-02 00:02:25 -0600 |
commit | 2e75f4b2b898866ffeafca5c69709dd3e358dcb5 (patch) | |
tree | a25cd88003aa8f89070ec876a6dd9aa134419ff2 /engines/sci/graphics | |
parent | 97d5e9218519049bf7d4403682129173ef5d44e3 (diff) | |
download | scummvm-rg350-2e75f4b2b898866ffeafca5c69709dd3e358dcb5.tar.gz scummvm-rg350-2e75f4b2b898866ffeafca5c69709dd3e358dcb5.tar.bz2 scummvm-rg350-2e75f4b2b898866ffeafca5c69709dd3e358dcb5.zip |
SCI32: Add consts and remove redundant conditional
Adding consts to try to isolate rectangles that change during
draw list processing, to be investigated for incorrect mutations
causing lower screen items to be drawn over higher screen items at
their edges.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/plane32.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp index 1a1a7893dd..5ae3ed979d 100644 --- a/engines/sci/graphics/plane32.cpp +++ b/engines/sci/graphics/plane32.cpp @@ -388,14 +388,14 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList bool v81 = false; for (RectList::size_type i = 0; i < eraseList.size(); ++i) { - Common::Rect *rect = eraseList[i]; + const Common::Rect *rect = eraseList[i]; for (ScreenItemList::size_type j = 0; j < _screenItemList.size(); ++j) { ScreenItem *item = _screenItemList[j]; if (j < _screenItemList.size() && item != nullptr) { if (rect->intersects(item->_screenRect)) { - Common::Rect intersection = rect->findIntersectingRect(item->_screenRect); + const Common::Rect intersection = rect->findIntersectingRect(item->_screenRect); if (!item->_deleted) { if (encounteredPic) { if (item->_celInfo.type == kCelTypePic) { @@ -428,7 +428,7 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList for (RectList::size_type i = 0; i < eraseList.size(); ++i) { for (ScreenItemList::size_type j = 0; j < _screenItemList.size(); ++j) { ScreenItem *item = _screenItemList[j]; - if (j < _screenItemList.size() && item != nullptr && !item->_updated && !item->_deleted && !item->_created && eraseList[i]->intersects(item->_screenRect)) { + if (item != nullptr && !item->_updated && !item->_deleted && !item->_created && eraseList[i]->intersects(item->_screenRect)) { drawList.add(item, eraseList[i]->findIntersectingRect(item->_screenRect)); } } @@ -511,7 +511,7 @@ void Plane::decrementScreenItemArrayCounts(Plane *visiblePlane, const bool force void Plane::filterDownEraseRects(DrawList &drawList, RectList &eraseList, RectList &transparentEraseList) const { if (_type == kPlaneTypeTransparent) { for (RectList::size_type i = 0; i < transparentEraseList.size(); ++i) { - Common::Rect *r = transparentEraseList[i]; + const Common::Rect *r = transparentEraseList[i]; for (ScreenItemList::size_type j = 0; j < _screenItemList.size(); ++j) { ScreenItem *item = _screenItemList[j]; if (item != nullptr) { @@ -539,7 +539,7 @@ void Plane::filterDownEraseRects(DrawList &drawList, RectList &eraseList, RectLi } Common::Rect ptr[4]; - Common::Rect *r2 = transparentEraseList[i]; + const Common::Rect *r2 = transparentEraseList[i]; int count = splitRects(*r2, *r, ptr); for (int k = count - 1; k >= 0; --k) { transparentEraseList.add(ptr[k]); @@ -554,7 +554,7 @@ void Plane::filterDownEraseRects(DrawList &drawList, RectList &eraseList, RectLi void Plane::filterUpDrawRects(DrawList &transparentDrawList, const DrawList &drawList) const { for (DrawList::size_type i = 0; i < drawList.size(); ++i) { - Common::Rect &r = drawList[i]->rect; + const Common::Rect &r = drawList[i]->rect; for (ScreenItemList::size_type j = 0; j < _screenItemList.size(); ++j) { ScreenItem *item = _screenItemList[j]; @@ -569,7 +569,7 @@ void Plane::filterUpDrawRects(DrawList &transparentDrawList, const DrawList &dra void Plane::filterUpEraseRects(DrawList &drawList, RectList &eraseList) const { for (RectList::size_type i = 0; i < eraseList.size(); ++i) { - Common::Rect &r = *eraseList[i]; + const Common::Rect &r = *eraseList[i]; for (ScreenItemList::size_type j = 0; j < _screenItemList.size(); ++j) { ScreenItem *item = _screenItemList[j]; @@ -595,7 +595,7 @@ void Plane::mergeToDrawList(const DrawList::size_type index, const Common::Rect r = *rects[i]; for (DrawList::size_type j = 0; j < drawList.size(); ++j) { - DrawItem *drawitem = drawList[j]; + const DrawItem *drawitem = drawList[j]; if (item->_object == drawitem->screenItem->_object) { if (drawitem->rect.contains(r)) { rects.erase_at(i); @@ -603,7 +603,7 @@ void Plane::mergeToDrawList(const DrawList::size_type index, const Common::Rect } Common::Rect outRects[4]; - int count = splitRects(r, drawitem->rect, outRects); + const int count = splitRects(r, drawitem->rect, outRects); if (count != -1) { for (int k = count - 1; k >= 0; --k) { rects.add(outRects[k]); @@ -633,14 +633,14 @@ void Plane::mergeToRectList(const Common::Rect &rect, RectList &rectList) const Common::Rect r = *temp[i]; for (RectList::size_type j = 0; j < rectList.size(); ++j) { - Common::Rect *innerRect = rectList[j]; + const Common::Rect *innerRect = rectList[j]; if (innerRect->contains(r)) { temp.erase_at(i); break; } Common::Rect out[4]; - int count = splitRects(r, *innerRect, out); + const int count = splitRects(r, *innerRect, out); if (count != -1) { for (int k = count - 1; k >= 0; --k) { temp.add(out[k]); |