From 5994cdffbd8e4a4472a8b62927af508feab410d6 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 4 Aug 2003 17:47:12 +0000 Subject: [PATCH] fix setT() while interval paused --- direct/src/interval/cInterval.cxx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/direct/src/interval/cInterval.cxx b/direct/src/interval/cInterval.cxx index ca213bd707..792aa044e4 100644 --- a/direct/src/interval/cInterval.cxx +++ b/direct/src/interval/cInterval.cxx @@ -79,13 +79,6 @@ set_t(double t) { } break; - case S_final: - priv_reverse_initialize(t); - if (is_playing()) { - setup_resume(); - } - break; - case S_started: // Support modifying t while the interval is playing. We assume // is_playing() will be true in this state. @@ -95,8 +88,21 @@ set_t(double t) { setup_resume(); break; - default: + case S_paused: + // Support modifying t while the interval is paused. In this + // case, we simply step to the new value of t; but this will + // change the state to S_started, so we must then change it back + // to S_paused by hand (because we're still paused). priv_step(t); + _state = S_paused; + break; + + case S_final: + priv_reverse_initialize(t); + if (is_playing()) { + setup_resume(); + } + break; } }