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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Feb 6 18:03:18 CET 2010


Revision: 47936
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47936&view=rev
Author:   m_kiewitz
Date:     2010-02-06 17:03:18 +0000 (Sat, 06 Feb 2010)

Log Message:
-----------
SCI: put kShakeScreen into GfxPaint, called directly now

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    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
    scummvm/trunk/engines/sci/graphics/paint.cpp
    scummvm/trunk/engines/sci/graphics/paint.h
    scummvm/trunk/engines/sci/graphics/paint16.cpp
    scummvm/trunk/engines/sci/graphics/paint16.h

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-02-06 17:03:18 UTC (rev 47936)
@@ -1054,13 +1054,7 @@
 	int16 shakeCount = (argc > 0) ? argv[0].toUint16() : 1;
 	int16 directions = (argc > 1) ? argv[1].toUint16() : 1;
 
-#ifdef ENABLE_SCI32
-	if (s->_gui32)
-		s->_gui32->shakeScreen(shakeCount, directions);
-	else
-#endif
-		s->_gui->shakeScreen(shakeCount, directions);
-
+	s->_gfxPaint->kernelShakeScreen(shakeCount, directions);
 	return s->r_acc;
 }
 

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-06 17:03:18 UTC (rev 47936)
@@ -60,7 +60,7 @@
 	_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);
+	_paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, this, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions);
 	_s->_gfxPaint = _paint16;
 	_s->_gfxPaint16 = _paint16;
 	_animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions);
@@ -121,20 +121,6 @@
 	_text16->CodeSetColors(argc, argv);
 }
 
-void SciGui::shakeScreen(uint16 shakeCount, uint16 directions) {
-	while (shakeCount--) {
-		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
-			_screen->setVerticalShakePos(10);
-		// TODO: horizontal shakes
-		g_system->updateScreen();
-		wait(3);
-		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
-			_screen->setVerticalShakePos(0);
-		g_system->updateScreen();
-		wait(3);
-	}
-}
-
 reg_t SciGui::portraitLoad(Common::String resourceName) {
 	//Portrait *myPortrait = new Portrait(_s->resMan, _screen, _palette, resourceName);
 	return NULL_REG;

Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/gui.h	2010-02-06 17:03:18 UTC (rev 47936)
@@ -57,8 +57,6 @@
 	virtual void textFonts(int argc, reg_t *argv);
 	virtual void textColors(int argc, reg_t *argv);
 
-	virtual void shakeScreen(uint16 shakeCount, uint16 directions);
-
 	virtual reg_t portraitLoad(Common::String resourceName);
 	virtual void portraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
 	virtual void portraitUnload(uint16 portraitId);

Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-06 17:03:18 UTC (rev 47936)
@@ -79,20 +79,6 @@
 	*textHeight = 0;
 }
 
-void SciGui32::shakeScreen(uint16 shakeCount, uint16 directions) {
-	while (shakeCount--) {
-		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
-			_screen->setVerticalShakePos(10);
-		// TODO: horizontal shakes
-		g_system->updateScreen();
-		g_system->delayMillis(50);
-		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
-			_screen->setVerticalShakePos(0);
-		g_system->updateScreen();
-		g_system->delayMillis(50);
-	}
-}
-
 void SciGui32::drawRobot(GuiResourceId robotId) {
 	Robot *test = new Robot(_s->resMan, _screen, robotId);
 	test->draw();

Modified: scummvm/trunk/engines/sci/graphics/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.h	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/gui32.h	2010-02-06 17:03:18 UTC (rev 47936)
@@ -48,8 +48,6 @@
 
 	void textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);
 
-	void shakeScreen(uint16 shakeCount, uint16 directions);
-
 	void drawRobot(GuiResourceId robotId);
 
 	// FIXME: Don't store EngineState

Modified: scummvm/trunk/engines/sci/graphics/paint.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint.cpp	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/paint.cpp	2010-02-06 17:03:18 UTC (rev 47936)
@@ -49,4 +49,8 @@
 void GfxPaint::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
 }
 
+void GfxPaint::kernelShakeScreen(uint16 shakeCount, uint16 directions) {
+	warning("Unimplemented kShakeScreen");
+}
+
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/paint.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint.h	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/paint.h	2010-02-06 17:03:18 UTC (rev 47936)
@@ -41,6 +41,8 @@
 	virtual void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
 	virtual void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
 
+	virtual void kernelShakeScreen(uint16 shakeCount, uint16 directions);
+
 private:
 };
 

Modified: scummvm/trunk/engines/sci/graphics/paint16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/paint16.cpp	2010-02-06 17:03:18 UTC (rev 47936)
@@ -45,8 +45,8 @@
 
 namespace Sci {
 
-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(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, SciGui *gui, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions)
+	: _resMan(resMan), _segMan(segMan), _kernel(kernel), _gui(gui), _cache(cache), _ports(ports), _coordAdjuster(coordAdjuster), _screen(screen), _palette(palette), _transitions(transitions) {
 }
 
 GfxPaint16::~GfxPaint16() {
@@ -521,4 +521,19 @@
 	return result;
 }
 
+// TODO: If this matches the sci32 implementation, we may put it into GfxScreen
+void GfxPaint16::kernelShakeScreen(uint16 shakeCount, uint16 directions) {
+	while (shakeCount--) {
+		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
+			_screen->setVerticalShakePos(10);
+		// TODO: horizontal shakes
+		g_system->updateScreen();
+		_gui->wait(3);
+		if (directions & SCI_SHAKE_DIRECTION_VERTICAL)
+			_screen->setVerticalShakePos(0);
+		g_system->updateScreen();
+		_gui->wait(3);
+	}
+}
+
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/graphics/paint16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint16.h	2010-02-06 16:42:15 UTC (rev 47935)
+++ scummvm/trunk/engines/sci/graphics/paint16.h	2010-02-06 17:03:18 UTC (rev 47936)
@@ -45,7 +45,7 @@
  */
 class GfxPaint16 : public GfxPaint {
 public:
-	GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions);
+	GfxPaint16(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, SciGui *gui, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions);
 	~GfxPaint16();
 
 	void init(GfxAnimate *animate, GfxText16 *text16);
@@ -88,10 +88,13 @@
 
 	reg_t kernelDisplay(const char *text, int argc, reg_t *argv);
 
+	void kernelShakeScreen(uint16 shakeCount, uint16 directions);
+
 private:
 	ResourceManager *_resMan;
 	SegManager *_segMan;
 	Kernel *_kernel;
+	SciGui *_gui;
 	GfxAnimate *_animate;
 	GfxCache *_cache;
 	GfxPorts *_ports;


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