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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Oct 11 09:21:59 CEST 2009


Revision: 44892
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44892&view=rev
Author:   m_kiewitz
Date:     2009-10-11 07:21:59 +0000 (Sun, 11 Oct 2009)

Log Message:
-----------
SCI/newgui: kAddToPic fully implemented

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui.cpp
    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-11 05:15:47 UTC (rev 44891)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-11 07:21:59 UTC (rev 44892)
@@ -462,33 +462,15 @@
 	if (!list)
 		error("kAddToPic called with non-list as parameter");
 
-//	Common::List<GuiAnimateList> *sortedList;
-//	sortedList = _gfx->AnimateMakeSortedList(list);
-
-//	uint16 szList = list.getSize();
-//	HEAPHANDLE*arrObj = new HEAPHANDLE[szList];
-//	int16*arrY = new int16[szList];
-//	HEAPHANDLE hnode = list.getFirst();
-//	sciNode1*pnode;
-//
-//	for (int i = 0; i < szList; i++) {
-//		pnode = (sciNode1*)heap2Ptr(hnode);
-//		obj.set(pnode->value);
-//		arrY[i] = obj.getProperty(3);
-//arrZ[i] = obj.getProperty(
-//		arrObj[i] = pnode->value;
-//		hnode = pnode->next;
-//	}
-//	animSort(arrObj, arrY, szList);
-
+	_gfx->AnimateMakeSortedList(list);
 	_gfx->AddToPicDrawCels(list);
 
 	_screen->_picNotValid = 2;
-//	delete sortedList;
 }
 
 void SciGui::addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
-	// FIXME: port over from gregs engine
+	_gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+	_gfx->AddToPicDrawView(viewId, loopNo, celNo, leftPos, topPos, priority, control);
 }
 
 void SciGui::setNowSeen(reg_t objectReference) {

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-11 05:15:47 UTC (rev 44891)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-11 07:21:59 UTC (rev 44892)
@@ -1158,51 +1158,48 @@
 
 void SciGuiGfx::AddToPicDrawCels(List *list) {
 	SegManager *segMan = _s->_segMan;
-	reg_t curAddress = list->first;
-	Node *curNode = _s->_segMan->lookupNode(curAddress);
 	reg_t curObject;
+	GuiAnimateEntry *listEntry;
 	SciGuiView *view = NULL;
-	GuiResourceId viewId;
-	GuiViewLoopNo loopNo;
-	GuiViewCelNo celNo;
-	int16 x, y, z, priority;
-	uint16 paletteNo, signal;
-	Common::Rect celRect;
+	GuiAnimateList::iterator listIterator;
+	GuiAnimateList::iterator listEnd = _animateList.end();
 
-	while (curNode) {
-		curObject = curNode->value;
+	listIterator = _animateList.begin();
+	while (listIterator != listEnd) {
+		listEntry = (GuiAnimateEntry *)*listIterator;
+		curObject = listEntry->object;
 
-		// Get cel data...
-		viewId = GET_SEL32V(curObject, view);
-		loopNo = GET_SEL32V(curObject, loop);
-		celNo = GET_SEL32V(curObject, cel);
-		x = GET_SEL32V(curObject, x);
-		y = GET_SEL32V(curObject, y);
-		z = GET_SEL32V(curObject, z);
-		priority = GET_SEL32V(curObject, priority);
-		if (priority == -1)
-			priority = CoordinateToPriority(y);
-		paletteNo = GET_SEL32V(curObject, palette);
-		signal = GET_SEL32V(curObject, signal);
+		if (listEntry->priority == -1)
+			listEntry->priority = CoordinateToPriority(listEntry->y);
 
 		// Get the corresponding view
-		view = new SciGuiView(_s->resMan, _screen, _palette, viewId);
+		view = new SciGuiView(_s->resMan, _screen, _palette, listEntry->viewId);
 
 		// Create rect according to coordinates and given cel
-		view->getCelRect(loopNo, celNo, x, y, priority, &celRect);
+		view->getCelRect(listEntry->loopNo, listEntry->celNo, listEntry->x, listEntry->y, listEntry->priority, &listEntry->celRect);
 
 		// draw corresponding cel
-		drawCel(viewId, loopNo, celNo, celRect.left, celRect.top, priority, paletteNo);
-		if ((signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
-			celRect.top = CLIP<int16>(PriorityToCoordinate(priority) - 1, celRect.top, celRect.bottom - 1);
-			FillRect(celRect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
+		drawCel(listEntry->viewId, listEntry->loopNo, listEntry->celNo, listEntry->celRect.left, listEntry->celRect.top, listEntry->priority, listEntry->paletteNo);
+		if ((listEntry->signal & SCI_ANIMATE_SIGNAL_IGNOREACTOR) == 0) {
+			listEntry->celRect.top = CLIP<int16>(PriorityToCoordinate(listEntry->priority) - 1, listEntry->celRect.top, listEntry->celRect.bottom - 1);
+			FillRect(listEntry->celRect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15);
 		}
 
-		curAddress = curNode->succ;
-		curNode = _s->_segMan->lookupNode(curAddress);
+		listIterator++;
 	}
 }
 
+void SciGuiGfx::AddToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+	SciGuiView *view = NULL;
+	Common::Rect celRect;
+
+	view = new SciGuiView(_s->resMan, _screen, _palette, viewId);
+
+	// Create rect according to coordinates and given cel
+	view->getCelRect(loopNo, celNo, leftPos, topPos, priority, &celRect);
+	drawCel(viewId, loopNo, celNo, celRect.left, celRect.top, priority, 0);
+}
+
 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-11 05:15:47 UTC (rev 44891)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-11 07:21:59 UTC (rev 44892)
@@ -122,6 +122,7 @@
 	void AnimateDrawCels();
 	void AnimateRestoreAndDelete(int argc, reg_t *argv);
 	void AddToPicDrawCels(List *list);
+	void AddToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 
 	void SetNowSeen(reg_t objectReference);
 


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