aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-11-01 21:14:33 +0000
committerMartin Kiewitz2009-11-01 21:14:33 +0000
commitf2dbd3357fdc78c1123253e0d039533102908bc4 (patch)
tree7ee3d1cd0325c0b11f7f8d0838ee959fd0fd7724 /engines
parent504973a0738843aed968d287416b7945bfa8f32c (diff)
downloadscummvm-rg350-f2dbd3357fdc78c1123253e0d039533102908bc4.tar.gz
scummvm-rg350-f2dbd3357fdc78c1123253e0d039533102908bc4.tar.bz2
scummvm-rg350-f2dbd3357fdc78c1123253e0d039533102908bc4.zip
SCI/newgui: kBaseSetter ported from gregs engine, kq5 pathfinding works now correctly
svn-id: r45601
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 98de5e397d..633340335b 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -670,23 +670,20 @@ void SciGui::baseSetter(reg_t object) {
int16 z = (_s->_kernel->_selectorCache.z > -1) ? GET_SEL32V(_s->_segMan, object, z) : 0;
int16 yStep = GET_SEL32V(_s->_segMan, object, yStep);
GuiResourceId viewId = GET_SEL32V(_s->_segMan, object, view);
- int16 loopNo = GET_SEL32V(_s->_segMan, object, loop);
- int16 celNo = GET_SEL32V(_s->_segMan, object, cel);
+ GuiViewLoopNo loopNo = GET_SEL32V(_s->_segMan, object, loop);
+ GuiViewCelNo celNo = GET_SEL32V(_s->_segMan, object, cel);
SciGuiView *tmpView = _gfx->getView(viewId);
- sciViewCelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
- int16 left = x + celInfo->displaceX - (celInfo->width >> 1);
- int16 right = left + celInfo->width;
- int16 bottom = y + celInfo->displaceY - z + 1;
- int16 top = bottom - yStep;
-
- debugC(2, kDebugLevelBaseSetter, "(%d,%d)+/-(%d,%d), (%d x %d) -> (%d, %d) to (%d, %d)\n",
- x, y, celInfo->displaceX, celInfo->displaceY, celInfo->width, celInfo->height, left, top, bottom, right);
-
- PUT_SEL32V(_s->_segMan, object, brLeft, left);
- PUT_SEL32V(_s->_segMan, object, brRight, right);
- PUT_SEL32V(_s->_segMan, object, brTop, top);
- PUT_SEL32V(_s->_segMan, object, brBottom, bottom);
+ Common::Rect celRect;
+
+ tmpView->getCelRect(loopNo, celNo, x, y, z, &celRect);
+ celRect.bottom = y + 1;
+ celRect.top = celRect.bottom - yStep;
+
+ PUT_SEL32V(_s->_segMan, object, brLeft, celRect.left);
+ PUT_SEL32V(_s->_segMan, object, brRight, celRect.right);
+ PUT_SEL32V(_s->_segMan, object, brTop, celRect.top);
+ PUT_SEL32V(_s->_segMan, object, brBottom, celRect.bottom);
}
}