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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Oct 4 20:34:54 CEST 2009


Revision: 44627
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44627&view=rev
Author:   m_kiewitz
Date:     2009-10-04 18:34:53 +0000 (Sun, 04 Oct 2009)

Log Message:
-----------
SCI/newgui: invokeselector implemented into kAnimate

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

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-04 18:01:38 UTC (rev 44626)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-04 18:34:53 UTC (rev 44627)
@@ -240,7 +240,7 @@
 	_screen->UpdateWhole();
 
 	_gfx->SetPort(oldPort);
-	_s->pic_not_valid = 1;
+	_gfx->_picNotValid = true;
 }
 
 void SciGUI::drawCell(GUIResourceId viewId, GUIViewLoopNo loopNo, GUIViewCellNo cellNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
@@ -313,7 +313,7 @@
 }
 
 void SciGUI::paletteAnimate(int fromColor, int toColor, int speed) {
-	_gfx->animatePalette(fromColor, toColor, speed);
+	_gfx->PaletteAnimate(fromColor, toColor, speed);
 }
 
 int16 SciGUI::onControl(byte screenMask, Common::Rect rect) {
@@ -325,8 +325,49 @@
 	return result;
 }
 
-void SciGUI::animate(reg_t castListReference, bool cycle, int argc, reg_t *argv) {
-	// FIXME: port over from gregs engine
+void SciGUI::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) {
+	bool old_picNotValid = _gfx->_picNotValid;
+
+	if (listReference.isNull()) {
+		_gfx->AnimateDisposeLastCast();
+		if (_gfx->_picNotValid) {
+			//(this->*ShowPic)(_showMap, _showStyle);
+			_gfx->_picNotValid = false;
+		}
+		return;
+	}
+
+	List *list = lookup_list(_s, listReference);
+	if (!list) {
+		error("kAnimate called with non-list as parameter");
+	}
+
+	if (cycle) {
+		_gfx->AnimateInvoke(list, argc, argv);
+	}
+
+	GUIPort *oldPort = _gfx->SetPort((GUIPort *)_windowMgr->_picWind);
+	_gfx->AnimateDisposeLastCast();
+
+	_gfx->AnimateFill();
+
+	_gfx->AnimateSort();
+	if (old_picNotValid) {
+		_gfx->AnimateUpdate();
+	}
+
+	_gfx->AnimateDrawCells();
+
+	if (_gfx->_picNotValid) {
+		//(this->*ShowPic)(_showMap, _showStyle);
+		_gfx->_picNotValid = false;
+	}
+
+	//_gfx->AnimateUpdateScreen();
+	_screen->UpdateWhole();
+	_gfx->AnimateRestoreAndDelete();
+
+	_gfx->SetPort(oldPort);
 }
 
 void SciGUI::addToPicList(reg_t listReference, int argc, reg_t *argv) {

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-04 18:01:38 UTC (rev 44626)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-04 18:34:53 UTC (rev 44627)
@@ -75,7 +75,6 @@
 	virtual void paletteAnimate(int fromColor, int toColor, int speed);
 
 	virtual int16 onControl(byte screenMask, Common::Rect rect);
-	// FIXME: argc/argv because of gui32.cpp, should get removed sometime
 	virtual void animate(reg_t listReference, bool cycle, int argc, reg_t *argv);
 	virtual void addToPicList(reg_t listReference, int argc, reg_t *argv);
 	virtual void addToPicView(GUIResourceId viewId, GUIViewLoopNo loopNo, GUIViewCellNo cellNo, int16 leftPos, int16 topPos, int16 priority, int16 control);

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-04 18:01:38 UTC (rev 44626)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-04 18:34:53 UTC (rev 44627)
@@ -53,6 +53,8 @@
 	_textFonts = NULL; _textFontsCount = 0;
 	_textColors = NULL; _textColorsCount = 0;
 
+	_picNotValid = false;
+
 	_mainPort = mallocPort();
 	SetPort(_mainPort);
 	OpenPort(_mainPort);
@@ -209,7 +211,7 @@
 	if (flag == 2 || sciPal->timestamp != systime) {
 		MergePalettes(sciPal, &_sysPalette, flag);
 		sciPal->timestamp = _sysPalette.timestamp;
-		if (_s->pic_not_valid == 0 && systime != _sysPalette.timestamp)
+		if (_picNotValid == 0 && systime != _sysPalette.timestamp)
 			SetCLUT(&_sysPalette);
 	}
 }
@@ -1222,7 +1224,7 @@
 	}
 }
 
-void SciGUIgfx::animatePalette(byte fromColor, byte toColor, int speed) {
+void SciGUIgfx::PaletteAnimate(byte fromColor, byte toColor, int speed) {
 	GUIColor col;
 	int len = toColor - fromColor - 1;
 	uint32 now = _sysTicks;
@@ -1287,6 +1289,47 @@
 		return value;
 }
 
+void SciGUIgfx::AnimateDisposeLastCast() {
+	// FIXME
+	//if (!_lastCast->first.isNull())
+		//_lastCast->DeleteList();
+}
+
+void SciGUIgfx::AnimateInvoke(List *list, int argc, reg_t *argv) {
+	reg_t curAddress = list->first;
+	Node *curNode = lookup_node(_s, curAddress);
+	reg_t curObject;
+	//uint16 mask;
+
+	while (curNode) {
+		curObject = curNode->value;
+//      FIXME: check what this code does and remove it or fix it, gregs engine had this check included
+//		mask = cobj[_objOfs[2]];
+//		if ((mask & 0x100) == 0) {
+			invoke_selector(_s, curObject, _s->_kernel->_selectorCache.doit, kContinueOnInvalidSelector, argv, argc, __FILE__, __LINE__, 0);
+			// Lookup node again, since the nodetable it was in may have been reallocated
+			curNode = lookup_node(_s, curAddress);
+//		}
+		curAddress = curNode->succ;
+		curNode = lookup_node(_s, curAddress);
+	}
+}
+
+void SciGUIgfx::AnimateFill() {
+}
+
+void SciGUIgfx::AnimateSort() {
+}
+
+void SciGUIgfx::AnimateUpdate() {
+}
+
+void SciGUIgfx::AnimateDrawCells() {
+}
+
+void SciGUIgfx::AnimateRestoreAndDelete() {
+}
+
 void SciGUIgfx::SetNowSeen(reg_t objectReference) {
 	SegManager *segMan = _s->segMan;
 	SciGUIview *view = NULL;

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-04 18:01:38 UTC (rev 44626)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-04 18:34:53 UTC (rev 44627)
@@ -110,9 +110,16 @@
 	void drawPicture(GUIResourceId pictureId, uint16 style, bool addToFlag, GUIResourceId paletteId);
 	void drawCell(GUIResourceId viewId, GUIViewLoopNo loopNo, GUIViewCellNo cellNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo);
 
-	void animatePalette(byte fromColor, byte toColor, int speed);
+	void PaletteAnimate(byte fromColor, byte toColor, int speed);
 
 	int16 onControl(uint16 screenMask, Common::Rect rect);
+	void AnimateDisposeLastCast();
+	void AnimateInvoke(List *list, int argc, reg_t *argv);
+	void AnimateFill();
+	void AnimateSort();
+	void AnimateUpdate();
+	void AnimateDrawCells();
+	void AnimateRestoreAndDelete();
 	void SetNowSeen(reg_t objectReference);
 
 	GUIPort *_menuPort;
@@ -120,9 +127,7 @@
 	int32 _sysSpeed; // ticker timer in ms 
 	GUIPalette _sysPalette;
 
-	uint16 _resolutionWidth;
-	uint16 _resolutionHeight;
-	uint _resolutionPixels;
+	bool _picNotValid;
 
 private:
 	int16 TextCodeProcessing(const char *&text, GUIResourceId orgFontId, int16 orgPenColor);
@@ -150,6 +155,9 @@
 	int _textColorsCount;
 	uint16 *_textColors;
 
+	// Animate* related variables
+	List *_lastCast;
+
 	SciGUIfont *_font;
 };
 


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