[Scummvm-cvs-logs] SF.net SVN: scummvm:[44807] scummvm/trunk/engines/sci/gui
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Fri Oct 9 09:50:37 CEST 2009
Revision: 44807
http://scummvm.svn.sourceforge.net/scummvm/?rev=44807&view=rev
Author: m_kiewitz
Date: 2009-10-09 07:50:37 +0000 (Fri, 09 Oct 2009)
Log Message:
-----------
SCI/newgui: Implemented kAddToPic (almost complete, but z-sorting and some extra code missing)
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-08 22:03:55 UTC (rev 44806)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-09 07:50:37 UTC (rev 44807)
@@ -431,7 +431,7 @@
if (!list)
error("kAddToPic called with non-list as parameter");
- sortedList = _gfx->AnimateMakeSortedList(list);
+// sortedList = _gfx->AnimateMakeSortedList(list);
// uint16 szList = list.getSize();
// HEAPHANDLE*arrObj = new HEAPHANDLE[szList];
@@ -449,9 +449,10 @@
// }
// animSort(arrObj, arrY, szList);
- _screen->_picNotValid = 2; // FIXME: _picNotValid is a boolean!
+ _gfx->AddToPicDrawCels(list);
- delete sortedList;
+ _screen->_picNotValid = 2;
+// delete sortedList;
}
void SciGui::addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, 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-08 22:03:55 UTC (rev 44806)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-09 07:50:37 UTC (rev 44807)
@@ -1415,6 +1415,53 @@
}
}
+void SciGuiGfx::AddToPicDrawCels(List *list) {
+ SegManager *segMan = _s->_segMan;
+ reg_t curAddress = list->first;
+ Node *curNode = _s->_segMan->lookupNode(curAddress);
+ reg_t curObject;
+ SciGuiView *view = NULL;
+ GuiResourceId viewId;
+ GuiViewLoopNo loopNo;
+ GuiViewCelNo celNo;
+ int16 x, y, z, priority;
+ uint16 paletteNo;
+ Common::Rect celRect;
+
+ while (curNode) {
+ curObject = curNode->value;
+
+ // 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 = 0; //CoordPri(y);
+ paletteNo = GET_SEL32V(curObject, palette);
+
+ // Get the corresponding view
+ view = new SciGuiView(_s->resMan, _screen, _palette, viewId);
+
+ // Create rect according to coordinates and given cel
+ view->getCelRect(loopNo, celNo, x, y, z, &celRect);
+
+ // draw corresponding cel
+ drawCel(viewId, loopNo, celNo, celRect.left, celRect.top, z, paletteNo);
+// FIXME find out what 17 is and implement this as well
+// if ((obj.getProperty(17) & 0x4000) == 0) {
+// rect.top = CLIP<int16>(PriCoord(prio) - 1, rect.top, rect.bottom - 1);
+// _gfx->RFillRect(rect, 4, 0, 0, 0xF);
+// }
+
+ curAddress = curNode->succ;
+ curNode = _s->_segMan->lookupNode(curAddress);
+ }
+}
+
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-08 22:03:55 UTC (rev 44806)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h 2009-10-09 07:50:37 UTC (rev 44807)
@@ -107,6 +107,8 @@
void AnimateUpdate(List *list);
void AnimateDrawCels(List *list);
void AnimateRestoreAndDelete(List *list, int argc, reg_t *argv);
+ void AddToPicDrawCels(List *list);
+
void SetNowSeen(reg_t objectReference);
GuiPort *_menuPort;
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