[Scummvm-cvs-logs] SF.net SVN: scummvm: [27465] scummvm/trunk/engines/saga
sev at users.sourceforge.net
sev at users.sourceforge.net
Sat Jun 16 16:06:18 CEST 2007
Revision: 27465
http://scummvm.svn.sourceforge.net/scummvm/?rev=27465&view=rev
Author: sev
Date: 2007-06-16 07:06:17 -0700 (Sat, 16 Jun 2007)
Log Message:
-----------
An attempt to fix restoring from cutaway. Still not perfect.
Modified Paths:
--------------
scummvm/trunk/engines/saga/animation.cpp
scummvm/trunk/engines/saga/animation.h
scummvm/trunk/engines/saga/events.cpp
scummvm/trunk/engines/saga/events.h
Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp 2007-06-16 11:45:40 UTC (rev 27464)
+++ scummvm/trunk/engines/saga/animation.cpp 2007-06-16 14:06:17 UTC (rev 27465)
@@ -243,9 +243,9 @@
}
// Note that clearCutaway() sets _cutawayActive to false.
- clearCutaway();
+ // clearCutaway();
// TODO: Clearing the cutaway via an event is better, but it breaks things up
- /*
+
event.type = kEvTImmediate;
event.code = kCutawayEvent;
event.op = kEventClearCutaway;
@@ -256,35 +256,40 @@
q_event = _vm->_events->chain(q_event, &event); // chain with the other events
else
q_event = _vm->_events->queue(&event);
- */
// Restore the scene
- _vm->_scene->restoreScene();
+ event.type = kEvTImmediate;
+ event.code = kSceneEvent;
+ event.op = kEventRestore;
+ event.time = 0;
+ event.duration = 0;
+ q_event = _vm->_events->chain(q_event, &event); // chain with the other events
+
+ // Restore the animations
+ event.type = kEvTImmediate;
+ event.code = kAnimEvent;
+ event.op = kEventResumeAll;
+ event.time = 0;
+ event.duration = 0;
+
+ q_event = _vm->_events->chain(q_event, &event); // chain with the other events
+
// Handle fade up, if we previously faded down
if (_cutAwayFade) {
event.type = kEvTImmediate;
event.code = kPalEvent;
event.op = kEventBlackToPal;
event.time = 0;
- event.duration = kNormalFadeDuration;
+ event.duration = 3000; //kNormalFadeDuration;
event.data = saved_pal;
q_event = _vm->_events->chain(q_event, &event);
}
-
- // Restore the animations
- for (int i = 0; i < MAX_ANIMATIONS; i++) {
- if (_animations[i] && _animations[i]->state == ANIM_PLAYING) {
- resume(i, 0);
- }
- }
}
}
void Anim::clearCutaway(void) {
- debug(0, "clearCutaway()");
-
if (_cutawayActive) {
_cutawayActive = false;
@@ -851,4 +856,13 @@
}
}
+void Anim::resumeAll() {
+ // Restore the animations
+ for (int i = 0; i < MAX_ANIMATIONS; i++) {
+ if (_animations[i] && _animations[i]->state == ANIM_PLAYING) {
+ resume(i, 0);
+ }
+ }
+}
+
} // End of namespace Saga
Modified: scummvm/trunk/engines/saga/animation.h
===================================================================
--- scummvm/trunk/engines/saga/animation.h 2007-06-16 11:45:40 UTC (rev 27464)
+++ scummvm/trunk/engines/saga/animation.h 2007-06-16 14:06:17 UTC (rev 27465)
@@ -138,6 +138,7 @@
void stop(uint16 animId);
void finish(uint16 animId);
void resume(uint16 animId, int cycles);
+ void resumeAll();
int16 getCurrentFrame(uint16 animId);
bool hasCutaway(void) {
return _cutawayActive;
Modified: scummvm/trunk/engines/saga/events.cpp
===================================================================
--- scummvm/trunk/engines/saga/events.cpp 2007-06-16 11:45:40 UTC (rev 27464)
+++ scummvm/trunk/engines/saga/events.cpp 2007-06-16 14:06:17 UTC (rev 27465)
@@ -247,10 +247,14 @@
case kScriptEvent:
case kBgEvent:
case kInterfaceEvent:
+ case kSceneEvent:
+ case kAnimEvent:
+ case kCutawayEvent:
handleOneShot(event);
event_done = true;
break;
default:
+ warning("Unhandled Immediate event type (%d)", event->code & EVENT_MASK);
break;
}
@@ -356,6 +360,9 @@
case kEventClearFlag:
_vm->_anim->clearFlag(event->param, event->param2);
break;
+ case kEventResumeAll:
+ _vm->_anim->resumeAll();
+ break;
default:
break;
}
@@ -365,6 +372,9 @@
case kEventEnd:
_vm->_scene->nextScene();
return kEvStBreak;
+ case kEventRestore:
+ _vm->_scene->restoreScene();
+ return kEvStBreak;
default:
break;
}
Modified: scummvm/trunk/engines/saga/events.h
===================================================================
--- scummvm/trunk/engines/saga/events.h 2007-06-16 11:45:40 UTC (rev 27464)
+++ scummvm/trunk/engines/saga/events.h 2007-06-16 14:06:17 UTC (rev 27465)
@@ -73,11 +73,13 @@
kEventFrame = 3,
kEventSetFlag = 4,
kEventClearFlag = 5,
+ kEventResumeAll = 6,
// MUISC & SOUND events
kEventPlay = 1,
kEventStop = 2,
// SCENE events
kEventEnd = 2,
+ kEventRestore = 3,
// TEXT events
kEventHide = 2,
kEventRemove = 3,
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