X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Ftimegather.h;h=5792496508a8fd43f9f2b479bb993cb18ea60fe9;hb=606a53ecae1c2993a50f9af49f65864d7bcab656;hp=b8df633e80fe0ca296357908d105320624687813;hpb=c34eaa5441242b3e9a7b7645e9ee4983d14eae85;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/timegather.h b/synfig-studio/trunk/src/synfigapp/timegather.h index b8df633..5792496 100644 --- a/synfig-studio/trunk/src/synfigapp/timegather.h +++ b/synfig-studio/trunk/src/synfigapp/timegather.h @@ -2,7 +2,7 @@ /*! \file timegather.h ** \brief Time Gather Header ** -** $Id: timegather.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2004 Adrian Bentley @@ -92,40 +92,36 @@ struct timepoints_ref //assumes they're sorted... (incremental advance) //checks the intersection of the two sets... might be something better in the stl template < typename I1, typename I2 > -bool check_intersect(I1 b1, I1 end1, I2 b2, I2 end2) +bool check_intersect(I1 b1, I1 end1, I2 b2, I2 end2, synfig::Time time_offset = 0) { if(b1 == end1 || b2 == end2) return false; for(; b1 != end1 && b2 != end2;) { - if(*b1 < *b2) ++b1; - else if(*b2 < *b1) ++b2; + if(*b1 < *b2 + time_offset) ++b1; + else if(*b2 + time_offset < *b1) ++b2; else { - assert(*b1 == *b2); + assert(*b1 == *b2 + time_offset); return true; } } return false; } -//pointer kind of a hack, gets the accurate times from a value desc -// (deals with dynamic list member correctly... i.e. gathers activepoints) -const synfig::Node::time_set *get_times_from_vdesc(const synfigapp::ValueDesc &v); - -//get's the closest time inside the set +//gets the closest time inside the set bool get_closest_time(const synfig::Node::time_set &tset, const synfig::Time &t, const synfig::Time &range, synfig::Time &out); //recursion functions based on time restrictions (can be expanded later)... //builds a list of relevant waypoints and activepoints inside the timepoints_ref structure void recurse_valuedesc(synfigapp::ValueDesc valdesc, const std::set &tlist, - timepoints_ref &vals); + timepoints_ref &vals, synfig::Time time = 0); void recurse_layer(synfig::Layer::Handle layer, const std::set &tlist, - timepoints_ref &vals); + timepoints_ref &vals, synfig::Time time = 0); void recurse_canvas(synfig::Canvas::Handle canvas, const std::set &tlist, - timepoints_ref &vals); + timepoints_ref &vals, synfig::Time time = 0);