aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/kevent.cpp21
-rw-r--r--engines/sci/engine/kgraphics.cpp2
-rw-r--r--engines/sci/engine/state.h2
-rw-r--r--engines/sci/graphics/coordadjuster.cpp84
-rw-r--r--engines/sci/graphics/coordadjuster.h80
-rw-r--r--engines/sci/graphics/gui.cpp34
-rw-r--r--engines/sci/graphics/gui.h5
-rw-r--r--engines/sci/graphics/gui32.cpp22
-rw-r--r--engines/sci/graphics/gui32.h5
-rw-r--r--engines/sci/graphics/menu.cpp4
-rw-r--r--engines/sci/graphics/paint16.cpp20
-rw-r--r--engines/sci/graphics/paint16.h7
-rw-r--r--engines/sci/graphics/ports.cpp2
-rw-r--r--engines/sci/module.mk1
14 files changed, 213 insertions, 76 deletions
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 0224ecae90..2f7a6e1068 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -32,6 +32,7 @@
#include "sci/event.h"
#include "sci/graphics/gui.h"
#include "sci/graphics/gui32.h"
+#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/cursor.h"
namespace Sci {
@@ -211,20 +212,14 @@ reg_t kMapKeyToDir(EngineState *s, int argc, reg_t *argv) {
reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) {
reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
+ reg_t planeObject = argc > 1 ? argv[1] : NULL_REG; // SCI32
SegManager *segMan = s->_segMan;
if (obj.segment) {
int16 x = GET_SEL32V(segMan, obj, x);
int16 y = GET_SEL32V(segMan, obj, y);
-#ifdef ENABLE_SCI32
- if (s->_gui)
-#endif
- s->_gui->globalToLocal(&x, &y);
-#ifdef ENABLE_SCI32
- else
- s->_gui32->globalToLocal(&x, &y, argv[1]);
-#endif
+ s->_gfxCoordAdjuster->kernelGlobalToLocal(x, y, planeObject);
PUT_SEL32V(segMan, obj, x, x);
PUT_SEL32V(segMan, obj, y, y);
@@ -236,20 +231,14 @@ reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) {
reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv) {
reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
+ reg_t planeObject = argc > 1 ? argv[1] : NULL_REG; // SCI32
SegManager *segMan = s->_segMan;
if (obj.segment) {
int16 x = GET_SEL32V(segMan, obj, x);
int16 y = GET_SEL32V(segMan, obj, y);
-#ifdef ENABLE_SCI32
- if (s->_gui)
-#endif
- s->_gui->localToGlobal(&x, &y);
-#ifdef ENABLE_SCI32
- else
- s->_gui32->localToGlobal(&x, &y, argv[1]);
-#endif
+ s->_gfxCoordAdjuster->kernelLocalToGlobal(x, y, planeObject);
PUT_SEL32V(segMan, obj, x, x);
PUT_SEL32V(segMan, obj, y, y);
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index b9d898c102..7da3a27270 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -299,7 +299,7 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
case K_GRAPH_REDRAW_BOX:
rect = kGraphCreateRect(x, y, x1, y1);
- s->_gui->graphRedrawBox(rect);
+ s->_gfxPaint16->kernelGraphRedrawBox(rect);
break;
case K_GRAPH_ADJUST_PRIORITY:
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index f61dd33920..d2981b4a89 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -54,6 +54,7 @@ class SciEvent;
class GfxAnimate;
class GfxCache;
class GfxControls;
+class GfxCoordAdjuster;
class GfxCursor;
class GfxMenu;
class GfxPaint;
@@ -147,6 +148,7 @@ public:
GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx
GfxCache *_gfxCache;
GfxControls *_gfxControls; // Controls for 16-bit gfx
+ GfxCoordAdjuster *_gfxCoordAdjuster;
GfxCursor *_gfxCursor;
GfxMenu *_gfxMenu; // Menu for 16-bit gfx
GfxPalette *_gfxPalette;
diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp
new file mode 100644
index 0000000000..44a8e60f49
--- /dev/null
+++ b/engines/sci/graphics/coordadjuster.cpp
@@ -0,0 +1,84 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/util.h"
+
+#include "sci/sci.h"
+#include "sci/engine/state.h"
+#include "sci/engine/selector.h"
+#include "sci/graphics/coordadjuster.h"
+#include "sci/graphics/ports.h"
+
+namespace Sci {
+
+GfxCoordAdjuster::GfxCoordAdjuster() {
+}
+
+GfxCoordAdjuster16::GfxCoordAdjuster16(GfxPorts *ports)
+ : _ports(ports) {
+}
+
+GfxCoordAdjuster16::~GfxCoordAdjuster16() {
+}
+
+void GfxCoordAdjuster16::kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject) {
+ Port *curPort = _ports->getPort();
+ x -= curPort->left;
+ y -= curPort->top;
+}
+
+void GfxCoordAdjuster16::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject) {
+ Port *curPort = _ports->getPort();
+ x += curPort->left;
+ y += curPort->top;
+}
+
+#ifdef ENABLE_SCI32
+GfxCoordAdjuster32::GfxCoordAdjuster32(SegManager *segMan)
+ : _segMan(segMan) {
+}
+
+GfxCoordAdjuster32::~GfxCoordAdjuster32() {
+}
+
+void GfxCoordAdjuster32::kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject) {
+ //int16 resY = GET_SEL32V(_s->_segMan, planeObj, resY);
+ //int16 resX = GET_SEL32V(_s->_segMan, planeObj, resX);
+ //*x = ( *x * _screen->getWidth()) / resX;
+ //*y = ( *y * _screen->getHeight()) / resY;
+ x -= GET_SEL32V(_segMan, planeObject, left);
+ y -= GET_SEL32V(_segMan, planeObject, top);
+}
+void GfxCoordAdjuster32::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject) {
+ //int16 resY = GET_SEL32V(_s->_segMan, planeObj, resY);
+ //int16 resX = GET_SEL32V(_s->_segMan, planeObj, resX);
+ x += GET_SEL32V(_segMan, planeObject, left);
+ y += GET_SEL32V(_segMan, planeObject, top);
+ //*x = ( *x * resX) / _screen->getWidth();
+ //*y = ( *y * resY) / _screen->getHeight();
+}
+#endif
+
+} // End of namespace Sci
diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h
new file mode 100644
index 0000000000..0423951328
--- /dev/null
+++ b/engines/sci/graphics/coordadjuster.h
@@ -0,0 +1,80 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_GRAPHICS_COORDADJUSTER_H
+#define SCI_GRAPHICS_COORDADJUSTER_H
+
+#include "common/list.h"
+#include "common/array.h"
+
+namespace Sci {
+
+class GfxPorts;
+
+/**
+ * CoordAdjuster class, does coordinate adjustment as need by various functions
+ * most of the time sci32 doesn't do any coordinate adjustment at all
+ * sci16 does a lot of port adjustment on given coordinates
+ */
+class GfxCoordAdjuster {
+public:
+ GfxCoordAdjuster();
+ ~GfxCoordAdjuster() { };
+
+ virtual void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG) { };
+ virtual void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG) { };
+
+private:
+};
+
+class GfxCoordAdjuster16 : public GfxCoordAdjuster {
+public:
+ GfxCoordAdjuster16(GfxPorts *ports);
+ ~GfxCoordAdjuster16();
+
+ void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
+ void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
+
+private:
+ GfxPorts *_ports;
+};
+
+#ifdef ENABLE_SCI32
+class GfxCoordAdjuster32 : public GfxCoordAdjuster {
+public:
+ GfxCoordAdjuster32(SegManager *segMan);
+ ~GfxCoordAdjuster32();
+
+ void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
+ void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
+
+private:
+ SegManager *_segMan;
+};
+#endif
+
+} // End of namespace Sci
+
+#endif
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 785dd32392..941278f2fc 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -39,6 +39,7 @@
#include "sci/graphics/paint16.h"
#include "sci/graphics/cache.h"
#include "sci/graphics/compare.h"
+#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/animate.h"
#include "sci/graphics/controls.h"
#include "sci/graphics/menu.h"
@@ -53,9 +54,11 @@ namespace Sci {
SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor, GfxPorts *ports, AudioPlayer *audio)
: _s(state), _screen(screen), _palette(palette), _cache(cache), _cursor(cursor), _ports(ports), _audio(audio) {
+ _coordAdjuster = new GfxCoordAdjuster16(_ports);
+ _s->_gfxCoordAdjuster = _coordAdjuster;
_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen);
_transitions = new GfxTransitions(this, _screen, _palette, _s->resMan->isVGA());
- _paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, _cache, _ports, _screen, _palette, _transitions);
+ _paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions);
_s->_gfxPaint = _paint16;
_s->_gfxPaint16 = _paint16;
_animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions);
@@ -75,6 +78,7 @@ SciGui::~SciGui() {
delete _paint16;
delete _transitions;
delete _compare;
+ delete _coordAdjuster;
}
void SciGui::resetEngineState(EngineState *s) {
@@ -86,7 +90,7 @@ void SciGui::init(bool usesOldGfxFunctions) {
_usesOldGfxFunctions = usesOldGfxFunctions;
_ports->init(this, _paint16, _text16, _s->_gameId);
- _paint16->init(_text16);
+ _paint16->init(_animate, _text16);
initPriorityBands();
}
@@ -112,18 +116,6 @@ void SciGui::wait(int16 ticks) {
kernel_sleep(_s->_event, ticks * 1000 / 60);
}
-void SciGui::globalToLocal(int16 *x, int16 *y) {
- Port *curPort = _ports->getPort();
- *x = *x - curPort->left;
- *y = *y - curPort->top;
-}
-
-void SciGui::localToGlobal(int16 *x, int16 *y) {
- Port *curPort = _ports->getPort();
- *x = *x + curPort->left;
- *y = *y + curPort->top;
-}
-
int16 SciGui::coordinateToPriority(int16 y) {
return _ports->coordinateToPriority(y);
}
@@ -198,7 +190,7 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
_paint16->bitsGetRect(argv[0], &rect);
rect.translate(-_ports->getPort()->left, -_ports->getPort()->top);
_paint16->bitsRestore(argv[0]);
- graphRedrawBox(rect);
+ _paint16->kernelGraphRedrawBox(rect);
// finishing loop
argc = 0;
break;
@@ -276,18 +268,6 @@ void SciGui::drawMenuBar(bool clear) {
}
}
-void SciGui::graphRedrawBox(Common::Rect rect) {
- localToGlobal(&rect.left, &rect.top);
- localToGlobal(&rect.right, &rect.bottom);
- Port *oldPort = _ports->setPort((Port *)_ports->_picWind);
- globalToLocal(&rect.left, &rect.top);
- globalToLocal(&rect.right, &rect.bottom);
-
- _animate->reAnimate(rect);
-
- _ports->setPort(oldPort);
-}
-
void SciGui::graphAdjustPriority(int top, int bottom) {
if (_usesOldGfxFunctions) {
_ports->priorityBandsInit(15, top, bottom);
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index 2bf7b8a92e..93e49df3a9 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -46,6 +46,7 @@ class GfxPalette;
class GfxCursor;
class GfxCache;
class GfxCompare;
+class GfxCoordAdjuster16;
class GfxPorts;
class GfxPaint16;
class GfxAnimate;
@@ -62,8 +63,6 @@ public:
virtual void init(bool usesOldGfxFunctions);
virtual void wait(int16 ticks);
- virtual void globalToLocal(int16 *x, int16 *y);
- virtual void localToGlobal(int16 *x, int16 *y);
virtual int16 coordinateToPriority(int16 y);
virtual int16 priorityToCoordinate(int16 priority);
@@ -76,7 +75,6 @@ public:
virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack);
virtual void drawMenuBar(bool clear);
- virtual void graphRedrawBox(Common::Rect rect);
virtual void graphAdjustPriority(int top, int bottom);
virtual void shakeScreen(uint16 shakeCount, uint16 directions);
@@ -106,6 +104,7 @@ protected:
GfxScreen *_screen;
GfxPalette *_palette;
GfxCache *_cache;
+ GfxCoordAdjuster16 *_coordAdjuster;
GfxCompare *_compare;
GfxPorts *_ports;
GfxPaint16 *_paint16;
diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp
index f8c54c0fe4..031544e663 100644
--- a/engines/sci/graphics/gui32.cpp
+++ b/engines/sci/graphics/gui32.cpp
@@ -37,6 +37,7 @@
#include "sci/graphics/cursor.h"
#include "sci/graphics/cache.h"
#include "sci/graphics/compare.h"
+#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/frameout.h"
#include "sci/graphics/paint32.h"
#include "sci/graphics/picture.h"
@@ -48,6 +49,8 @@ namespace Sci {
SciGui32::SciGui32(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, GfxCursor *cursor)
: _s(state), _screen(screen), _palette(palette), _cache(cache), _cursor(cursor) {
+ _coordAdjuster = new GfxCoordAdjuster32(_s->_segMan);
+ _s->_gfxCoordAdjuster = _coordAdjuster;
_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen);
_paint32 = new GfxPaint32(_s->resMan, _s->_segMan, _s->_kernel, _cache, _screen, _palette);
_s->_gfxPaint = _paint32;
@@ -59,6 +62,7 @@ SciGui32::~SciGui32() {
delete _frameout;
delete _paint32;
delete _compare;
+ delete _coordAdjuster;
}
void SciGui32::resetEngineState(EngineState *s) {
@@ -68,24 +72,6 @@ void SciGui32::resetEngineState(EngineState *s) {
void SciGui32::init() {
}
-void SciGui32::globalToLocal(int16 *x, int16 *y, reg_t planeObj) {
- //int16 resY = GET_SEL32V(_s->_segMan, planeObj, resY);
- //int16 resX = GET_SEL32V(_s->_segMan, planeObj, resX);
- //*x = ( *x * _screen->getWidth()) / resX;
- //*y = ( *y * _screen->getHeight()) / resY;
- *x -= GET_SEL32V(_s->_segMan, planeObj, left);
- *y -= GET_SEL32V(_s->_segMan, planeObj, top);
-}
-
-void SciGui32::localToGlobal(int16 *x, int16 *y, reg_t planeObj) {
- //int16 resY = GET_SEL32V(_s->_segMan, planeObj, resY);
- //int16 resX = GET_SEL32V(_s->_segMan, planeObj, resX);
- *x += GET_SEL32V(_s->_segMan, planeObj, left);
- *y += GET_SEL32V(_s->_segMan, planeObj, top);
- //*x = ( *x * resX) / _screen->getWidth();
- //*y = ( *y * resY) / _screen->getHeight();
-}
-
void SciGui32::textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight) {
*textWidth = 0;
*textHeight = 0;
diff --git a/engines/sci/graphics/gui32.h b/engines/sci/graphics/gui32.h
index 615c0ea5e8..6d9eed5b8e 100644
--- a/engines/sci/graphics/gui32.h
+++ b/engines/sci/graphics/gui32.h
@@ -34,6 +34,7 @@ class GfxCursor;
class GfxScreen;
class GfxPalette;
class GfxCache;
+class GfxCoordAdjuster32;
class GfxCompare;
class GfxFrameout;
class GfxPaint32;
@@ -59,9 +60,6 @@ public:
void moveCursor(Common::Point pos);
void setCursorZone(Common::Rect zone);
- void globalToLocal(int16 *x, int16 *y, reg_t planeObj);
- void localToGlobal(int16 *x, int16 *y, reg_t planeObj);
-
void drawRobot(GuiResourceId robotId);
// FIXME: Don't store EngineState
@@ -73,6 +71,7 @@ protected:
GfxScreen *_screen;
GfxPalette *_palette;
GfxCache *_cache;
+ GfxCoordAdjuster32 *_coordAdjuster;
GfxCompare *_compare;
GfxFrameout *_frameout;
GfxPaint32 *_paint32;
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 78f5899b32..b3ddf46837 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -422,7 +422,7 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject) {
Common::Rect menuLine = _menuRect;
menuLine.bottom = menuLine.top + 1;
_paint16->bitsShow(menuLine);
- _gui->graphRedrawBox(_menuRect);
+ _paint16->kernelGraphRedrawBox(_menuRect);
_menuSaveHandle = NULL_REG;
}
if (!_barSaveHandle.isNull()) {
@@ -489,7 +489,7 @@ void GfxMenu::drawMenu(uint16 oldMenuId, uint16 newMenuId) {
Common::Rect menuLine = _menuRect;
menuLine.bottom = menuLine.top + 1;
_paint16->bitsShow(menuLine);
- _gui->graphRedrawBox(_menuRect);
+ _paint16->kernelGraphRedrawBox(_menuRect);
}
// First calculate rect of menu and also invert old and new menu text
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index e058899756..16c2dd03b5 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -31,6 +31,7 @@
#include "sci/engine/state.h"
#include "sci/engine/selector.h"
#include "sci/graphics/cache.h"
+#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/ports.h"
#include "sci/graphics/paint16.h"
#include "sci/graphics/animate.h"
@@ -44,14 +45,15 @@
namespace Sci {
-GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions)
- : _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _ports(ports), _screen(screen), _palette(palette), _transitions(transitions) {
+GfxPaint16::GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions)
+ : _resMan(resMan), _segMan(segMan), _kernel(kernel), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions) {
}
GfxPaint16::~GfxPaint16() {
}
-void GfxPaint16::init(GfxText16 *text16) {
+void GfxPaint16::init(GfxAnimate *animate, GfxText16 *text16) {
+ _animate = animate;
_text16 = text16;
_EGAdrawingVisualize = false;
@@ -400,4 +402,16 @@ void GfxPaint16::kernelGraphUpdateBox(Common::Rect rect, bool hiresMode) {
bitsShowHires(rect);
}
+void GfxPaint16::kernelGraphRedrawBox(Common::Rect rect) {
+ _coordAdjuster->kernelLocalToGlobal(rect.left, rect.top);
+ _coordAdjuster->kernelLocalToGlobal(rect.right, rect.bottom);
+ Port *oldPort = _ports->setPort((Port *)_ports->_picWind);
+ _coordAdjuster->kernelGlobalToLocal(rect.left, rect.top);
+ _coordAdjuster->kernelGlobalToLocal(rect.right, rect.bottom);
+
+ _animate->reAnimate(rect);
+
+ _ports->setPort(oldPort);
+}
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h
index 76ec1b98de..06a0cc5f8c 100644
--- a/engines/sci/graphics/paint16.h
+++ b/engines/sci/graphics/paint16.h
@@ -45,10 +45,10 @@ class GfxView;
*/
class GfxPaint16 : public GfxPaint {
public:
- GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions);
+ GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions);
~GfxPaint16();
- void init(GfxText16 *text16);
+ void init(GfxAnimate *animate, GfxText16 *text16);
void setEGAdrawingVisualize(bool state);
@@ -84,13 +84,16 @@ public:
reg_t kernelGraphSaveUpscaledHiresBox(Common::Rect rect);
void kernelGraphRestoreBox(reg_t handle);
void kernelGraphUpdateBox(Common::Rect rect, bool hiresMode);
+ void kernelGraphRedrawBox(Common::Rect rect);
private:
ResourceManager *_resMan;
SegManager *_segMan;
Kernel *_kernel;
+ GfxAnimate *_animate;
GfxCache *_cache;
GfxPorts *_ports;
+ GfxCoordAdjuster *_coordAdjuster;
GfxScreen *_screen;
GfxPalette *_palette;
GfxText16 *_text16;
diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 4da451bdde..6457b46f7d 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -339,7 +339,7 @@ void GfxPorts::disposeWindow(Window *pWnd, bool reanimate) {
if (!reanimate)
_paint16->bitsShow(pWnd->restoreRect);
else
- _gui->graphRedrawBox(pWnd->restoreRect);
+ _paint16->kernelGraphRedrawBox(pWnd->restoreRect);
_windowList.remove(pWnd);
setPort(_windowList.back());
_windowsById[pWnd->id] = 0;
diff --git a/engines/sci/module.mk b/engines/sci/module.mk
index f09e8a8eeb..0a110f2aa1 100644
--- a/engines/sci/module.mk
+++ b/engines/sci/module.mk
@@ -38,6 +38,7 @@ MODULE_OBJS := \
graphics/cache.o \
graphics/compare.o \
graphics/controls.o \
+ graphics/coordadjuster.o \
graphics/cursor.o \
graphics/font.o \
graphics/gui.o \