projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added copyright lines for files I've edited this year.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
modules
/
lyr_std
/
timeloop.cpp
diff --git
a/synfig-core/trunk/src/modules/lyr_std/timeloop.cpp
b/synfig-core/trunk/src/modules/lyr_std/timeloop.cpp
index
63cffcf
..
5908001
100644
(file)
--- a/
synfig-core/trunk/src/modules/lyr_std/timeloop.cpp
+++ b/
synfig-core/trunk/src/modules/lyr_std/timeloop.cpp
@@
-6,7
+6,7
@@
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-** Copyright (c) 2007 Chris Moore
+** Copyright (c) 2007
, 2008
Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
@@
-65,6
+65,8
@@
SYNFIG_LAYER_SET_CVS_ID(Layer_TimeLoop,"$Id$");
Layer_TimeLoop::Layer_TimeLoop()
{
Layer_TimeLoop::Layer_TimeLoop()
{
+ old_version=false;
+ only_for_positive_duration=false;
link_time=0;
local_time=0;
duration=1;
link_time=0;
local_time=0;
duration=1;
@@
-87,6
+89,7
@@
Layer_TimeLoop::set_param(const String & param, const ValueBase &value)
IMPORT(local_time);
IMPORT(link_time);
IMPORT(duration);
IMPORT(local_time);
IMPORT(link_time);
IMPORT(duration);
+ IMPORT(only_for_positive_duration);
}
return Layer::set_param(param,value);
}
return Layer::set_param(param,value);
@@
-98,6
+101,7
@@
Layer_TimeLoop::get_param(const String & param)const
EXPORT(link_time);
EXPORT(local_time);
EXPORT(duration);
EXPORT(link_time);
EXPORT(local_time);
EXPORT(duration);
+ EXPORT(only_for_positive_duration);
EXPORT_NAME();
EXPORT_VERSION();
EXPORT_NAME();
EXPORT_VERSION();
@@
-121,6
+125,10
@@
Layer_TimeLoop::get_param_vocab()const
.set_local_name(_("Duration"))
);
.set_local_name(_("Duration"))
);
+ ret.push_back(ParamDesc("only_for_positive_duration")
+ .set_local_name(_("Only For Positive Duration"))
+ );
+
return ret;
}
return ret;
}
@@
-154,6
+162,8
@@
Layer_TimeLoop::reset_version()
// convert the static parameters
local_time = start_time;
duration = end_time - start_time;
// convert the static parameters
local_time = start_time;
duration = end_time - start_time;
+ only_for_positive_duration = true;
+
//! \todo layer version 0.1 acted differently before start_time was reached - possibly due to a bug
link_time = 0;
//! \todo layer version 0.1 acted differently before start_time was reached - possibly due to a bug
link_time = 0;
@@
-189,13
+199,14
@@
Layer_TimeLoop::reset_version()
connect_dynamic_param("local_time", start_time_value_node);
connect_dynamic_param("duration", duration_value_node);
connect_dynamic_param("local_time", start_time_value_node);
connect_dynamic_param("duration", duration_value_node);
- connect_dynamic_param("link_time", ValueNode_Const::create(Time(0)));
}
void
Layer_TimeLoop::set_time(Context context, Time t)const
{
}
void
Layer_TimeLoop::set_time(Context context, Time t)const
{
- if (duration == 0)
+ if (only_for_positive_duration && duration <= 0)
+ ; // don't change the time
+ else if (duration == 0)
t = link_time;
else if (duration > 0)
{
t = link_time;
else if (duration > 0)
{