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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Oct 19 15:26:13 CEST 2009


Revision: 45243
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45243&view=rev
Author:   m_kiewitz
Date:     2009-10-19 13:26:13 +0000 (Mon, 19 Oct 2009)

Log Message:
-----------
SCI/newgui: kAnimate support for globalVar 84 in kq5 to fix cels drawn into talking boxes

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

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-19 09:56:11 UTC (rev 45242)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-19 13:26:13 UTC (rev 45243)
@@ -528,8 +528,10 @@
 	if (!list)
 		error("kAnimate called with non-list as parameter");
 
-	if (cycle)
-		_animate->invoke(list, argc, argv);
+	if (cycle) {
+		if (!_animate->invoke(list, argc, argv))
+			return;
+	}
 
 	GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
 	_animate->disposeLastCast();

Modified: scummvm/trunk/engines/sci/gui/gui_animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_animate.cpp	2009-10-19 09:56:11 UTC (rev 45242)
+++ scummvm/trunk/engines/sci/gui/gui_animate.cpp	2009-10-19 13:26:13 UTC (rev 45243)
@@ -29,6 +29,7 @@
 
 #include "sci/sci.h"
 #include "sci/engine/state.h"
+#include "sci/engine/vm.h"
 #include "sci/gui/gui_gfx.h"
 #include "sci/gui/gui_view.h"
 #include "sci/gui/gui_screen.h"
@@ -56,7 +57,7 @@
 		//_lastCast->DeleteList();
 }
 
-void SciGuiAnimate::invoke(List *list, int argc, reg_t *argv) {
+bool SciGuiAnimate::invoke(List *list, int argc, reg_t *argv) {
 	SegManager *segMan = _s->_segMan;
 	reg_t curAddress = list->first;
 	Node *curNode = _s->_segMan->lookupNode(curAddress);
@@ -65,6 +66,13 @@
 
 	while (curNode) {
 		curObject = curNode->value;
+		if (_s->_gameName == "kq5") {
+			// This is special to King's Quest 5, globalVar 84 aborts kAnimate completely. If we dont do this
+			//  sometimes animation cels will appear within talking boxes
+			if (_s->script_000->_localsBlock->_locals[84].toUint16()) {
+				return false;
+			}
+		}
 		signal = GET_SEL32V(segMan, curObject, signal);
 		if (!(signal & SCI_ANIMATE_SIGNAL_FROZEN)) {
 			// Call .doit method of that object
@@ -75,6 +83,7 @@
 		curAddress = curNode->succ;
 		curNode = _s->_segMan->lookupNode(curAddress);
 	}
+	return true;
 }
 
 bool sortHelper(const GuiAnimateEntry* entry1, const GuiAnimateEntry* entry2) {

Modified: scummvm/trunk/engines/sci/gui/gui_animate.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_animate.h	2009-10-19 09:56:11 UTC (rev 45242)
+++ scummvm/trunk/engines/sci/gui/gui_animate.h	2009-10-19 13:26:13 UTC (rev 45243)
@@ -62,7 +62,7 @@
 	void resetEngineState(EngineState *newState) { _s = newState; }
 
 	void disposeLastCast();
-	void invoke(List *list, int argc, reg_t *argv);
+	bool invoke(List *list, int argc, reg_t *argv);
 	void makeSortedList(List *list);
 	void fill(byte &oldPicNotValid);
 	void update();


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