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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Oct 11 18:47:01 CEST 2009


Revision: 44934
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44934&view=rev
Author:   thebluegr
Date:     2009-10-11 16:47:01 +0000 (Sun, 11 Oct 2009)

Log Message:
-----------
Reset the EngineState pointer in the SciGuiGfx class when loading. Fixes loading with the new GUI

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/gui/gui_gfx.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-11 16:15:42 UTC (rev 44933)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-11 16:47:01 UTC (rev 44934)
@@ -63,6 +63,11 @@
 SciGui::~SciGui() {
 }
 
+void SciGui::resetEngineState(EngineState *s) {
+	_s = s;
+	_gfx->resetEngineState(s);
+}
+
 void SciGui::init(bool usesOldGfxFunctions) {
 	// Initialize priority bands
 	if (usesOldGfxFunctions) {

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-11 16:15:42 UTC (rev 44933)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-11 16:47:01 UTC (rev 44934)
@@ -107,7 +107,7 @@
 	virtual bool debugShowMap(int mapNo);
 
 	// FIXME: Don't store EngineState
-	virtual void resetEngineState(EngineState *s) { _s = s; }
+	virtual void resetEngineState(EngineState *s);
 
 private:
 	EngineState *_s;

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-11 16:15:42 UTC (rev 44933)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-11 16:47:01 UTC (rev 44934)
@@ -56,6 +56,9 @@
 
 	void init(void);
 
+	// FIXME: Don't store EngineState
+	void resetEngineState(EngineState *newState) { _s = newState; }
+
 	byte *GetSegment(byte seg);
 	void ResetScreen();
 

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-10-11 16:15:42 UTC (rev 44933)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-10-11 16:47:01 UTC (rev 44934)
@@ -134,13 +134,13 @@
 	// We'll set the GUI below
 	_gamestate = new EngineState(_resMan, _kernel, _vocabulary, NULL, cursor);
 
+	if (script_init_engine(_gamestate))
+		return Common::kUnknownError;
+
 	// Gui change
 	//_gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor);    // new
 	_gamestate->_gui = new SciGui32(_gamestate, screen, palette, cursor);  // old
 
-	if (script_init_engine(_gamestate))
-		return Common::kUnknownError;
-
 	if (game_init(_gamestate)) { /* Initialize */
 		warning("Game initialization failed: Aborting...");
 		// TODO: Add an "init failed" error?


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