Thu 10 May 2007 11:13:32 AM UTC, comment #2:
I think I don't get full understand about theTimelineInfo records things. My connection to wiki is too slow. I'd like to add my pesudo code here to show how to reconstruct the DisplayList when jumping back in my model.
DisplayItem
{
boost::intrusive_ptr<character> item;
/// the depth in the display list;
/// I assume that item.getDepth() returns the depths value
/// defined in the placeObjet* tag;
int new_depth; <------------ [1]
/// the frame number at which the item is created;
/// take swapDepths(depth) as creating a new item; <-----[2]
int created_at_frame;
/// true if the item is script-created, including created by
/// swapDepths();
/// false if the item is tag created;
bool is_script_created;
}
(1) scan the DisplayList, remove the DisplayItems satisfied one of(a) or (b);
(a) if the follow condition is true
(is_script_created
&& new_depth fall into static range depths
&& new_depth != item.getDepth() )
(b) if the follow condition is true
(!is_script_created
&& created_at_frame fall into [target_frame+1, current_frame])
(2)excute frame tags from frame_1 to target_frame. Do not re-create(for PLACE) any character if the specified depth is already occupied(this is already true curently).
Notes:
[1]need this for some insane cases, just give one for example:
PlaceObject2("mc") at -16383;
mc.swapDepth(-1); //swap to another depth
mc.swapDepth(-16383); //swap back
after this, mc is immune to later MOVE tags, and won't get destroied when loop/jump back.
[2]based on the 4th point in section "What "should" happen when jumping backwards" in following link
http://www.gnashdev.org/wiki/index.php/TimelineControl
any comments or any conflicts with your tests?
|