diff options
author | Martin Kiewitz | 2010-01-29 16:20:22 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-29 16:20:22 +0000 |
commit | 69b7497cf73018868aac5c64d434f08e1f2d9116 (patch) | |
tree | fc5e4176533a451d438109da46183bd6bacdb693 | |
parent | 01fd01122a3e4b018079d5d5dd0228b56f5701f5 (diff) | |
download | scummvm-rg350-69b7497cf73018868aac5c64d434f08e1f2d9116.tar.gz scummvm-rg350-69b7497cf73018868aac5c64d434f08e1f2d9116.tar.bz2 scummvm-rg350-69b7497cf73018868aac5c64d434f08e1f2d9116.zip |
SCI: calculating celRect the right way for sci32
svn-id: r47672
-rw-r--r-- | engines/sci/graphics/gui.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 22e39b4f50..255d95a622 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -971,8 +971,9 @@ void SciGui::frameOut() { uint16 viewId = GET_SEL32V(_s->_segMan, viewObj, view); uint16 loopNo = GET_SEL32V(_s->_segMan, viewObj, loop); uint16 celNo = GET_SEL32V(_s->_segMan, viewObj, cel); - uint16 leftPos = GET_SEL32V(_s->_segMan, viewObj, x); - uint16 topPos = GET_SEL32V(_s->_segMan, viewObj, y); + uint16 x = GET_SEL32V(_s->_segMan, viewObj, x); + uint16 y = GET_SEL32V(_s->_segMan, viewObj, y); + uint16 z = GET_SEL32V(_s->_segMan, viewObj, z); priority = GET_SEL32V(_s->_segMan, viewObj, priority); uint16 scaleX = GET_SEL32V(_s->_segMan, viewObj, scaleX); uint16 scaleY = GET_SEL32V(_s->_segMan, viewObj, scaleY); @@ -985,11 +986,11 @@ void SciGui::frameOut() { // Theoretically, leftPos and topPos should be sane // Apparently, sometimes they're not, therefore I'm adding some sanity checks here so that // the hack underneath does not try and draw cels outside the screen coordinates - if (leftPos >= _screen->getWidth()) { + if (x >= _screen->getWidth()) { continue; } - if (topPos >= _screen->getHeight()) { + if (y >= _screen->getHeight()) { continue; } @@ -997,10 +998,16 @@ void SciGui::frameOut() { Common::Rect celRect; View *view = _gfx->getView(viewId); // Sometimes x,y are bottom right - celRect.left = leftPos; - celRect.top = topPos; - celRect.right = leftPos + view->getWidth(loopNo, celNo); - celRect.bottom = topPos + view->getHeight(loopNo, celNo); + view->getCelRect(loopNo, celNo, x, y, z, &celRect); +// leftPos = GET_SEL32V(_s->_segMan, viewObj, x); +// topPos = GET_SEL32V(_s->_segMan, viewObj, y); +// celRect.left = leftPos; +// celRect.top = topPos; +// celRect.right = leftPos + view->getWidth(loopNo, celNo); +// celRect.bottom = topPos + view->getHeight(loopNo, celNo); +// warning("view %d, loop %d, cel %d", viewId, loopNo, celNo); + +//void View::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) { //celRect.right = leftPos; //celRect.bottom = topPos; //celRect.left = celRect.right - view->getWidth(loopNo, celNo);; |