mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
don't add zero-length intervals to the ivalMgr
This commit is contained in:
parent
daedc5239b
commit
4b198f45f5
@ -251,12 +251,16 @@ class MetaInterval(CMetaInterval):
|
|||||||
CMetaInterval.setT(self, t)
|
CMetaInterval.setT(self, t)
|
||||||
|
|
||||||
def start(self, startT = 0.0, endT = -1.0, playRate = 1.0):
|
def start(self, startT = 0.0, endT = -1.0, playRate = 1.0):
|
||||||
self.__updateIvals()
|
if self.getDuration() == 0.0:
|
||||||
|
self.privInstant()
|
||||||
|
else:
|
||||||
self.setupPlay(startT, endT, playRate, 0)
|
self.setupPlay(startT, endT, playRate, 0)
|
||||||
self.__manager.addInterval(self)
|
self.__manager.addInterval(self)
|
||||||
|
|
||||||
def loop(self, startT = 0.0, endT = -1.0, playRate = 1.0):
|
def loop(self, startT = 0.0, endT = -1.0, playRate = 1.0):
|
||||||
self.__updateIvals()
|
if self.getDuration() == 0.0:
|
||||||
|
self.privInstant()
|
||||||
|
else:
|
||||||
self.setupPlay(startT, endT, playRate, 1)
|
self.setupPlay(startT, endT, playRate, 1)
|
||||||
self.__manager.addInterval(self)
|
self.__manager.addInterval(self)
|
||||||
|
|
||||||
@ -268,7 +272,9 @@ class MetaInterval(CMetaInterval):
|
|||||||
return self.getT()
|
return self.getT()
|
||||||
|
|
||||||
def resume(self, t0 = None):
|
def resume(self, t0 = None):
|
||||||
self.__updateIvals()
|
if self.getDuration() == 0.0:
|
||||||
|
self.privInstant()
|
||||||
|
else:
|
||||||
if t0 != None:
|
if t0 != None:
|
||||||
self.setT(t0)
|
self.setT(t0)
|
||||||
self.setupResume()
|
self.setupResume()
|
||||||
|
@ -91,9 +91,13 @@ set_t(double t) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CInterval::
|
void CInterval::
|
||||||
start(double start_t, double end_t, double play_rate) {
|
start(double start_t, double end_t, double play_rate) {
|
||||||
|
if (get_duration() == 0.0) {
|
||||||
|
priv_instant();
|
||||||
|
} else {
|
||||||
setup_play(start_t, end_t, play_rate, false);
|
setup_play(start_t, end_t, play_rate, false);
|
||||||
_manager->add_c_interval(this, false);
|
_manager->add_c_interval(this, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: CInterval::loop
|
// Function: CInterval::loop
|
||||||
@ -109,9 +113,14 @@ start(double start_t, double end_t, double play_rate) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CInterval::
|
void CInterval::
|
||||||
loop(double start_t, double end_t, double play_rate) {
|
loop(double start_t, double end_t, double play_rate) {
|
||||||
|
if (get_duration() == 0.0) {
|
||||||
|
// A zero-length interval can't really loop.
|
||||||
|
priv_instant();
|
||||||
|
} else {
|
||||||
setup_play(start_t, end_t, play_rate, true);
|
setup_play(start_t, end_t, play_rate, true);
|
||||||
_manager->add_c_interval(this, false);
|
_manager->add_c_interval(this, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: CInterval::pause
|
// Function: CInterval::pause
|
||||||
@ -140,9 +149,11 @@ pause() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CInterval::
|
void CInterval::
|
||||||
resume() {
|
resume() {
|
||||||
|
if (get_duration() != 0.0) {
|
||||||
setup_resume();
|
setup_resume();
|
||||||
_manager->add_c_interval(this, false);
|
_manager->add_c_interval(this, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: CInterval::resume
|
// Function: CInterval::resume
|
||||||
@ -152,10 +163,12 @@ resume() {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CInterval::
|
void CInterval::
|
||||||
resume(double start_t) {
|
resume(double start_t) {
|
||||||
|
if (get_duration() != 0.0) {
|
||||||
set_t(start_t);
|
set_t(start_t);
|
||||||
setup_resume();
|
setup_resume();
|
||||||
_manager->add_c_interval(this, false);
|
_manager->add_c_interval(this, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: CInterval::finish
|
// Function: CInterval::finish
|
||||||
|
Loading…
x
Reference in New Issue
Block a user