aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp29
-rw-r--r--engines/sci/gui/gui.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 321ff074c7..fd5df6c365 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -637,6 +637,35 @@ bool SciGui::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::P
return result;
}
+void SciGui::baseSetter(reg_t object) {
+ if (lookup_selector(_s->_segMan, object, _s->_kernel->_selectorCache.brLeft, NULL, NULL) == kSelectorVariable) {
+ int16 x = GET_SEL32V(_s->_segMan, object, x);
+ int16 y = GET_SEL32V(_s->_segMan, object, y);
+ 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);
+
+ SciGuiView *tmpView = new SciGuiView(_s->resMan, NULL, NULL, 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);
+
+ delete tmpView;
+
+ 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);
+ }
+}
+
void SciGui::hideCursor() {
_cursor->hide();
}
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index b39cb59bf9..2ed9a253c8 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -117,6 +117,7 @@ public:
virtual void setNowSeen(reg_t objectReference);
virtual bool canBeHere(reg_t curObject, reg_t listReference);
virtual bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
+ virtual void baseSetter(reg_t object);
virtual void hideCursor();
virtual void showCursor();