[Scummvm-cvs-logs] SF.net SVN: scummvm:[47912] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Feb 5 21:44:03 CET 2010


Revision: 47912
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47912&view=rev
Author:   m_kiewitz
Date:     2010-02-05 20:44:03 +0000 (Fri, 05 Feb 2010)

Log Message:
-----------
SCI: moved onControl etc. into GfxCompare, now getting called directly. also fixed loading saved games due Gfx* changes

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/graphics/compare.cpp
    scummvm/trunk/engines/sci/graphics/compare.h
    scummvm/trunk/engines/sci/graphics/coordadjuster.cpp
    scummvm/trunk/engines/sci/graphics/coordadjuster.h
    scummvm/trunk/engines/sci/graphics/gui.cpp
    scummvm/trunk/engines/sci/graphics/gui.h
    scummvm/trunk/engines/sci/graphics/gui32.cpp
    scummvm/trunk/engines/sci/graphics/gui32.h

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-02-05 20:44:03 UTC (rev 47912)
@@ -38,6 +38,7 @@
 #include "sci/graphics/gui32.h"
 #include "sci/graphics/animate.h"
 #include "sci/graphics/cache.h"
+#include "sci/graphics/compare.h"
 #include "sci/graphics/controls.h"
 #include "sci/graphics/cursor.h"
 #include "sci/graphics/palette.h"
@@ -403,15 +404,8 @@
 reg_t kCanBeHere(EngineState *s, int argc, reg_t *argv) {
 	reg_t curObject = argv[0];
 	reg_t listReference = (argc > 1) ? argv[1] : NULL_REG;
-	bool canBeHere;
-	
-#ifdef ENABLE_SCI32
-	if (s->_gui32)
-		canBeHere = s->_gui32->canBeHere(curObject, listReference);
-	else
-#endif
-		canBeHere = s->_gui->canBeHere(curObject, listReference);
-		
+
+	bool canBeHere = s->_gfxCompare->kernelCanBeHere(curObject, listReference);
 	return make_reg(0, canBeHere);
 }
 
@@ -419,15 +413,8 @@
 reg_t kCantBeHere(EngineState *s, int argc, reg_t *argv) {
 	reg_t curObject = argv[0];
 	reg_t listReference = (argc > 1) ? argv[1] : NULL_REG;
-	bool canBeHere;
 	
-#ifdef ENABLE_SCI32
-	if (s->_gui32)
-		canBeHere = s->_gui32->canBeHere(curObject, listReference);
-	else
-#endif
-		canBeHere = s->_gui->canBeHere(curObject, listReference);
-
+	bool canBeHere = s->_gfxCompare->kernelCanBeHere(curObject, listReference);
 	return make_reg(0, !canBeHere);
 }
 
@@ -437,7 +424,7 @@
 	int16 celNo = argv[2].toSint16();
 	Common::Point position(argv[4].toUint16(), argv[3].toUint16());
 
-	bool result = s->_gui->isItSkip(viewId, loopNo, celNo, position);
+	bool result = s->_gfxCompare->kernelIsItSkip(viewId, loopNo, celNo, position);
 	return make_reg(0, result);
 }
 
@@ -512,7 +499,7 @@
 		rect.right = rect.left + 1;
 		rect.bottom = rect.top + 1;
 	}
-	uint16 result = s->_gui->onControl(screenMask, rect);
+	uint16 result = s->_gfxCompare->kernelOnControl(screenMask, rect);
 	return make_reg(0, result);
 }
 
@@ -553,12 +540,7 @@
 reg_t kBaseSetter(EngineState *s, int argc, reg_t *argv) {
 	reg_t object = argv[0];
 
-#ifdef ENABLE_SCI32
-	if (s->_gui32)
-		s->_gui32->baseSetter(object);
-	else
-#endif
-		s->_gui->baseSetter(object);
+	s->_gfxCompare->kernelBaseSetter(object);
 
 	// WORKAROUND for a problem in LSL1VGA. This allows the casino door to be opened,
 	// till the actual problem is found
@@ -571,12 +553,7 @@
 }
 
 reg_t kSetNowSeen(EngineState *s, int argc, reg_t *argv) {
-#ifdef ENABLE_SCI32
-	if (s->_gui32)
-		s->_gui32->setNowSeen(argv[0]);
-	else
-#endif
-		s->_gui->setNowSeen(argv[0]);
+	s->_gfxCompare->kernelSetNowSeen(argv[0]);
 
 	return s->r_acc;
 }

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2010-02-05 20:44:03 UTC (rev 47912)
@@ -945,8 +945,12 @@
 
 	retval->_gfxAnimate = s->_gfxAnimate;
 	retval->_gfxCache = s->_gfxCache;
+	retval->_gfxCompare = s->_gfxCompare;
 	retval->_gfxControls = s->_gfxControls;
+	retval->_gfxCoordAdjuster = s->_gfxCoordAdjuster;
+	retval->_gfxCursor = s->_gfxCursor;
 	retval->_gfxMenu = s->_gfxMenu;
+	retval->_gfxPaint16 = s->_gfxPaint16;
 	retval->_gfxPalette = s->_gfxPalette;
 	retval->_gfxPorts = s->_gfxPorts;
 	retval->_gfxScreen = s->_gfxScreen;
@@ -954,6 +958,7 @@
 #ifdef ENABLE_SCI32
 	// Copy the Gui32 pointer over to the new EngineState, if it exists
 	retval->_gui32 = s->_gui32;
+	retval->_gfxFrameout = s->_gfxFrameout;
 #endif
 
 	// Copy some old data

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/engine/state.h	2010-02-05 20:44:03 UTC (rev 47912)
@@ -53,6 +53,7 @@
 class SciEvent;
 class GfxAnimate;
 class GfxCache;
+class GfxCompare;
 class GfxControls;
 class GfxCoordAdjuster;
 class GfxCursor;
@@ -147,6 +148,7 @@
 
 	GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx
 	GfxCache *_gfxCache;
+	GfxCompare *_gfxCompare;
 	GfxControls *_gfxControls; // Controls for 16-bit gfx
 	GfxCoordAdjuster *_gfxCoordAdjuster;
 	GfxCursor *_gfxCursor;

Modified: scummvm/trunk/engines/sci/graphics/compare.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.cpp	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/compare.cpp	2010-02-05 20:44:03 UTC (rev 47912)
@@ -31,6 +31,7 @@
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
 #include "sci/graphics/compare.h"
+#include "sci/graphics/coordadjuster.h"
 #include "sci/graphics/animate.h"
 #include "sci/graphics/cache.h"
 #include "sci/graphics/screen.h"
@@ -38,14 +39,14 @@
 
 namespace Sci {
 
-GfxCompare::GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen)
-	: _segMan(segMan), _kernel(kernel), _cache(cache), _screen(screen) {
+GfxCompare::GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster)
+	: _segMan(segMan), _kernel(kernel), _cache(cache), _screen(screen), _coordAdjuster(coordAdjuster) {
 }
 
 GfxCompare::~GfxCompare() {
 }
 
-uint16 GfxCompare::onControl(uint16 screenMask, Common::Rect rect) {
+uint16 GfxCompare::isOnControl(uint16 screenMask, Common::Rect rect) {
 	int16 x, y;
 	uint16 result = 0;
 
@@ -75,7 +76,7 @@
 		return value;
 }
 
-bool GfxCompare::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {
+bool GfxCompare::canBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {
 	reg_t curAddress = list->first;
 	Node *curNode = _segMan->lookupNode(curAddress);
 	reg_t curObject;
@@ -103,7 +104,14 @@
 	return true;
 }
 
-void GfxCompare::SetNowSeen(reg_t objectReference) {
+uint16 GfxCompare::kernelOnControl(byte screenMask, Common::Rect rect) {
+	Common::Rect adjustedRect = _coordAdjuster->onControl(rect);
+
+	uint16 result = isOnControl(screenMask, adjustedRect);
+	return result;
+}
+
+void GfxCompare::kernelSetNowSeen(reg_t objectReference) {
 	GfxView *view = NULL;
 	Common::Rect celRect(0, 0);
 	GuiResourceId viewId = (GuiResourceId)GET_SEL32V(_segMan, objectReference, view);
@@ -128,4 +136,64 @@
 	}
 }
 
+bool GfxCompare::kernelCanBeHere(reg_t curObject, reg_t listReference) {
+	Common::Rect checkRect;
+	Common::Rect adjustedRect;
+	uint16 signal, controlMask;
+	bool result;
+
+	checkRect.left = GET_SEL32V(_segMan, curObject, brLeft);
+	checkRect.top = GET_SEL32V(_segMan, curObject, brTop);
+	checkRect.right = GET_SEL32V(_segMan, curObject, brRight);
+	checkRect.bottom = GET_SEL32V(_segMan, curObject, brBottom);
+
+	adjustedRect = _coordAdjuster->onControl(checkRect);
+
+	signal = GET_SEL32V(_segMan, curObject, signal);
+	controlMask = GET_SEL32V(_segMan, curObject, illegalBits);
+	result = (isOnControl(SCI_SCREEN_MASK_CONTROL, adjustedRect) & controlMask) ? false : true;
+	if ((result) && (signal & (kSignalIgnoreActor | kSignalRemoveView)) == 0) {
+		List *list = _segMan->lookupList(listReference);
+		if (!list)
+			error("kCanBeHere called with non-list as parameter");
+
+		result = canBeHereCheckRectList(curObject, checkRect, list);
+	}
+	return result;
+}
+
+bool GfxCompare::kernelIsItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
+	GfxView *tmpView = _cache->getView(viewId);
+	CelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
+	position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
+	position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
+	byte *celData = tmpView->getBitmap(loopNo, celNo);
+	bool result = (celData[position.y * celInfo->width + position.x] == celInfo->clearKey);
+	return result;
+}
+
+void GfxCompare::kernelBaseSetter(reg_t object) {
+	if (lookup_selector(_segMan, object, _kernel->_selectorCache.brLeft, NULL, NULL) == kSelectorVariable) {
+		int16 x = GET_SEL32V(_segMan, object, x);
+		int16 y = GET_SEL32V(_segMan, object, y);
+		int16 z = (_kernel->_selectorCache.z > -1) ? GET_SEL32V(_segMan, object, z) : 0;
+		int16 yStep = GET_SEL32V(_segMan, object, yStep);
+		GuiResourceId viewId = GET_SEL32V(_segMan, object, view);
+		int16 loopNo = GET_SEL32V(_segMan, object, loop);
+		int16 celNo = GET_SEL32V(_segMan, object, cel);
+
+		GfxView *tmpView = _cache->getView(viewId);
+		Common::Rect celRect;
+
+		tmpView->getCelRect(loopNo, celNo, x, y, z, &celRect);
+		celRect.bottom = y + 1;
+		celRect.top = celRect.bottom - yStep;
+
+		PUT_SEL32V(_segMan, object, brLeft, celRect.left);
+		PUT_SEL32V(_segMan, object, brRight, celRect.right);
+		PUT_SEL32V(_segMan, object, brTop, celRect.top);
+		PUT_SEL32V(_segMan, object, brBottom, celRect.bottom);
+	}
+}
+
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/compare.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.h	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/compare.h	2010-02-05 20:44:03 UTC (rev 47912)
@@ -39,18 +39,24 @@
  */
 class GfxCompare {
 public:
-	GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen);
+	GfxCompare(SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxScreen *screen, GfxCoordAdjuster *coordAdjuster);
 	~GfxCompare();
 
-	uint16 onControl(uint16 screenMask, Common::Rect rect);
-	bool CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list);
-	void SetNowSeen(reg_t objectReference);
+	uint16 isOnControl(uint16 screenMask, Common::Rect rect);
+	bool canBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list);
 
+	uint16 kernelOnControl(byte screenMask, Common::Rect rect);
+	void kernelSetNowSeen(reg_t objectReference);
+	bool kernelCanBeHere(reg_t curObject, reg_t listReference);
+	bool kernelIsItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
+	void kernelBaseSetter(reg_t object);
+
 private:
 	SegManager *_segMan;
 	Kernel *_kernel;
 	GfxCache *_cache;
 	GfxScreen *_screen;
+	GfxCoordAdjuster *_coordAdjuster;
 };
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/coordadjuster.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/coordadjuster.cpp	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/coordadjuster.cpp	2010-02-05 20:44:03 UTC (rev 47912)
@@ -55,6 +55,16 @@
 	y += curPort->top;
 }
 
+Common::Rect GfxCoordAdjuster16::onControl(Common::Rect rect) {
+	Port *oldPort = _ports->setPort((Port *)_ports->_picWind);
+	Common::Rect adjustedRect(rect.left, rect.top, rect.right, rect.bottom);
+
+	adjustedRect.clip(_ports->getPort()->rect);
+	_ports->offsetRect(adjustedRect);
+	_ports->setPort(oldPort);
+	return adjustedRect;
+}
+
 #ifdef ENABLE_SCI32
 GfxCoordAdjuster32::GfxCoordAdjuster32(SegManager *segMan)
 	: _segMan(segMan) {
@@ -79,6 +89,12 @@
 	//*x = ( *x * resX) / _screen->getWidth();
 	//*y = ( *y * resY) / _screen->getHeight();
 }
+
+Common::Rect GfxCoordAdjuster32::onControl(Common::Rect rect) {
+	Common::Rect adjustedRect = rect;
+	adjustedRect.translate(0, 10);
+	return adjustedRect;
+}
 #endif
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/coordadjuster.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/coordadjuster.h	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/coordadjuster.h	2010-02-05 20:44:03 UTC (rev 47912)
@@ -46,6 +46,8 @@
 	virtual void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG) { };
 	virtual void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG) { };
 
+	virtual Common::Rect onControl(Common::Rect rect) { return rect; };
+
 private:
 };
 
@@ -56,9 +58,13 @@
 
 	void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
 	void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
+
+	Common::Rect onControl(Common::Rect rect);
 	
 private:
 	GfxPorts *_ports;
+
+	Port *backuppedPort;
 };
 
 #ifdef ENABLE_SCI32
@@ -69,6 +75,8 @@
 
 	void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
 	void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG);
+
+	Common::Rect onControl(Common::Rect rect);
 	
 private:
 	SegManager *_segMan;

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-05 20:44:03 UTC (rev 47912)
@@ -56,7 +56,8 @@
 
 	_coordAdjuster = new GfxCoordAdjuster16(_ports);
 	_s->_gfxCoordAdjuster = _coordAdjuster;
-	_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen);
+	_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen, _coordAdjuster);
+	_s->_gfxCompare = _compare;
 	_transitions = new GfxTransitions(this, _screen, _palette, _s->resMan->isVGA());
 	_paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions);
 	_s->_gfxPaint = _paint16;
@@ -290,87 +291,6 @@
 	}
 }
 
-uint16 SciGui::onControl(byte screenMask, Common::Rect rect) {
-	Port *oldPort = _ports->setPort((Port *)_ports->_picWind);
-	Common::Rect adjustedRect(rect.left, rect.top, rect.right, rect.bottom);
-	uint16 result;
-
-	adjustedRect.clip(_ports->getPort()->rect);
-	_ports->offsetRect(adjustedRect);
-	result = _compare->onControl(screenMask, adjustedRect);
-
-	_ports->setPort(oldPort);
-	return result;
-}
-
-void SciGui::setNowSeen(reg_t objectReference) {
-	_compare->SetNowSeen(objectReference);
-}
-
-bool SciGui::canBeHere(reg_t curObject, reg_t listReference) {
-	Port *oldPort = _ports->setPort((Port *)_ports->_picWind);
-	Common::Rect checkRect;
-	Common::Rect adjustedRect;
-	uint16 signal, controlMask;
-	bool result;
-
-	checkRect.left = GET_SEL32V(_s->_segMan, curObject, brLeft);
-	checkRect.top = GET_SEL32V(_s->_segMan, curObject, brTop);
-	checkRect.right = GET_SEL32V(_s->_segMan, curObject, brRight);
-	checkRect.bottom = GET_SEL32V(_s->_segMan, curObject, brBottom);
-
-	adjustedRect = checkRect;
-	adjustedRect.clip(_ports->getPort()->rect);
-	_ports->offsetRect(adjustedRect);
-
-	signal = GET_SEL32V(_s->_segMan, curObject, signal);
-	controlMask = GET_SEL32V(_s->_segMan, curObject, illegalBits);
-	result = (_compare->onControl(SCI_SCREEN_MASK_CONTROL, adjustedRect) & controlMask) ? false : true;
-	if ((result) && (signal & (kSignalIgnoreActor | kSignalRemoveView)) == 0) {
-		List *list = _s->_segMan->lookupList(listReference);
-		if (!list)
-			error("kCanBeHere called with non-list as parameter");
-
-		result = _compare->CanBeHereCheckRectList(curObject, checkRect, list);
-	}
-	_ports->setPort(oldPort);
-	return result;
-}
-
-bool SciGui::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
-	GfxView *tmpView = _cache->getView(viewId);
-	CelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
-	position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
-	position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
-	byte *celData = tmpView->getBitmap(loopNo, celNo);
-	bool result = (celData[position.y * celInfo->width + position.x] == celInfo->clearKey);
-	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);
-
-		GfxView *tmpView = _cache->getView(viewId);
-		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);
-	}
-}
-
 void SciGui::setCursorPos(Common::Point pos) {
 	pos.y += _ports->getPort()->top;
 	pos.x += _ports->getPort()->left;

Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/gui.h	2010-02-05 20:44:03 UTC (rev 47912)
@@ -79,12 +79,6 @@
 
 	virtual void shakeScreen(uint16 shakeCount, uint16 directions);
 
-	virtual uint16 onControl(byte screenMask, Common::Rect rect);
-	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 setCursorPos(Common::Point pos);
 	virtual void moveCursor(Common::Point pos);
 	void setCursorZone(Common::Rect zone);

Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-05 20:44:03 UTC (rev 47912)
@@ -51,7 +51,8 @@
 
 	_coordAdjuster = new GfxCoordAdjuster32(_s->_segMan);
 	_s->_gfxCoordAdjuster = _coordAdjuster;
-	_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen);
+	_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen, _coordAdjuster);
+	_s->_gfxCompare = _compare;
 	_paint32 = new GfxPaint32(_s->resMan, _s->_segMan, _s->_kernel, _cache, _screen, _palette);
 	_s->_gfxPaint = _paint32;
 	_frameout = new GfxFrameout(_s->_segMan, _s->resMan, _cache, _screen, _palette, _paint32);
@@ -91,78 +92,6 @@
 	}
 }
 
-uint16 SciGui32::onControl(byte screenMask, Common::Rect rect) {
-	Common::Rect adjustedRect = rect;
-	uint16 result;
-
-	adjustedRect.translate(0, 10);
-
-	result = _compare->onControl(screenMask, rect);
-	return result;
-}
-
-void SciGui32::setNowSeen(reg_t objectReference) {
-	_compare->SetNowSeen(objectReference);
-}
-
-bool SciGui32::canBeHere(reg_t curObject, reg_t listReference) {
-	Common::Rect checkRect;
-	uint16 signal, controlMask;
-	bool result;
-
-	checkRect.left = GET_SEL32V(_s->_segMan, curObject, brLeft);
-	checkRect.top = GET_SEL32V(_s->_segMan, curObject, brTop);
-	checkRect.right = GET_SEL32V(_s->_segMan, curObject, brRight);
-	checkRect.bottom = GET_SEL32V(_s->_segMan, curObject, brBottom);
-	signal = GET_SEL32V(_s->_segMan, curObject, signal);
-	controlMask = GET_SEL32V(_s->_segMan, curObject, illegalBits);
-	result = (_compare->onControl(SCI_SCREEN_MASK_CONTROL, checkRect) & controlMask) ? false : true;
-	if ((result)) { // gui16 && (signal & (kSignalIgnoreActor | kSignalRemoveView)) == 0) {
-		List *list = _s->_segMan->lookupList(listReference);
-		if (!list)
-			error("kCanBeHere called with non-list as parameter");
-
-		result = _compare->CanBeHereCheckRectList(curObject, checkRect, list);
-	}
-	return result;
-}
-
-bool SciGui32::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
-	GfxView *tmpView = _cache->getView(viewId);
-	CelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
-	position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
-	position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
-	byte *celData = tmpView->getBitmap(loopNo, celNo);
-	bool result = (celData[position.y * celInfo->width + position.x] == celInfo->clearKey);
-	return result;
-}
-
-void SciGui32::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);
-
-		if (viewId != SIGNAL_OFFSET) {
-			GfxView *tmpView = _cache->getView(viewId);
-			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);
-		}
-	}
-}
-
 void SciGui32::setCursorPos(Common::Point pos) {
 	//pos.y += _gfx->GetPort()->top;
 	//pos.x += _gfx->GetPort()->left;

Modified: scummvm/trunk/engines/sci/graphics/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.h	2010-02-05 19:41:06 UTC (rev 47911)
+++ scummvm/trunk/engines/sci/graphics/gui32.h	2010-02-05 20:44:03 UTC (rev 47912)
@@ -50,7 +50,6 @@
 
 	void shakeScreen(uint16 shakeCount, uint16 directions);
 
-	uint16 onControl(byte screenMask, Common::Rect rect);
 	void setNowSeen(reg_t objectReference);
 	bool canBeHere(reg_t curObject, reg_t listReference);
 	bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list