SCI/newgui: kAnimate - more implemented, cels are now drawn but isnt working correctly currently

svn-id: r44781
This commit is contained in:
Martin Kiewitz 2009-10-08 10:35:12 +00:00
parent d1dcd82ac0
commit cce8d2e279
3 changed files with 60 additions and 4 deletions

View file

@ -405,7 +405,7 @@ void SciGui::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) {
_gfx->AnimateUpdate();
}
_gfx->AnimateDrawCels();
_gfx->AnimateDrawCels(list);
if (_screen->_picNotValid) {
//(this->*ShowPic)(_showMap, _showStyle);

View file

@ -1115,7 +1115,7 @@ void SciGuiGfx::AnimateFill(List *list, byte &old_picNotValid) {
while (curNode) {
curObject = curNode->value;
// Get cel data...
// Get animation data...
viewId = GET_SEL32V(curObject, view);
loopNo = GET_SEL32V(curObject, loop);
celNo = GET_SEL32V(curObject, cel);
@ -1200,7 +1200,63 @@ Common::List<GuiAnimateList> *SciGuiGfx::AnimateMakeSortedList(List *list) {
void SciGuiGfx::AnimateUpdate() {
}
void SciGuiGfx::AnimateDrawCels() {
void SciGuiGfx::AnimateDrawCels(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, priority;
Common::Rect rect;
uint16 mask, paletteNo;
reg_t hSaved;
while (curNode) {
curObject = curNode->value;
mask = GET_SEL32V(curObject, signal);
if (!(mask & (SCI_ANIMATE_MASK_NOUPDATE | SCI_ANIMATE_MASK_HIDDEN | SCI_ANIMATE_MASK_ALWAYSUPDATE))) {
// Get animation 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);
priority = GET_SEL32V(curObject, priority);
paletteNo = GET_SEL32V(curObject, palette);
//rect = (Common::Rect *)&cobj[_objOfs[8]];
//hSaved = SaveBits(rect, SCI_SCREEN_MASK_ALL);
//PUT_SEL32V(curObject, 11, hSaved.toUint16());
// draw corresponding cel
drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo);
// arr1[inx] = 1;
if (mask & SCI_ANIMATE_MASK_REMOVEVIEW) {
mask &= 0xFFFF ^ GFX_REMOVEVIEW;
PUT_SEL32V(curObject, signal, mask);
}
// HEAPHANDLE hNewCast = heapNewPtr(sizeof(sciCast), kDataCast);
// sciCast *pNewCast = (sciCast *)heap2Ptr(hNewCast);
// pNewCast->view = view;
// pNewCast->loop = loop;
// pNewCast->cel = cel;
// pNewCast->z = z;
// pNewCast->pal = pal;
// pNewCast->hSaved = 0;
// pNewCast->rect = *rect;
// _lastCast->AddToEnd(hNewCast);
}
curAddress = curNode->succ;
curNode = _s->_segMan->lookupNode(curAddress);
}
}
void SciGuiGfx::AnimateRestoreAndDelete() {

View file

@ -109,7 +109,7 @@ public:
void AnimateFill(List *list, byte &oldPicNotValid);
Common::List<GuiAnimateList> *AnimateMakeSortedList(List *list);
void AnimateUpdate();
void AnimateDrawCels();
void AnimateDrawCels(List *list);
void AnimateRestoreAndDelete();
void SetNowSeen(reg_t objectReference);