From a09bb8a15401068102c494578fee1ae120e5f322 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 28 Nov 2011 15:22:48 +0000 Subject: [PATCH] fix MovieTexture::get_time() --- panda/src/grutil/movieTexture.cxx | 11 ++--------- panda/src/grutil/movieTexture.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/panda/src/grutil/movieTexture.cxx b/panda/src/grutil/movieTexture.cxx index 0afc4a4fee..5b2f4f237c 100644 --- a/panda/src/grutil/movieTexture.cxx +++ b/panda/src/grutil/movieTexture.cxx @@ -68,7 +68,6 @@ CData() : _clock(0.0), _playing(false), _loop_count(1), - _loops_total(1), _play_rate(1.0) { } @@ -87,7 +86,6 @@ CData(const CData ©) : _clock(0.0), _playing(false), _loop_count(1), - _loops_total(1), _play_rate(1.0) { } @@ -361,7 +359,7 @@ cull_callback(CullTraverser *, const CullTraverserData &) const { if (cdata->_playing) { offset += now * cdata->_play_rate; } - true_loop_count = cdata->_loops_total; + true_loop_count = cdata->_loop_count; } for (int i=0; i<((int)(cdata->_pages.size())); i++) { @@ -549,7 +547,6 @@ play() { double now = ClockObject::get_global_clock()->get_frame_time(); cdata->_clock = 0.0 - (now * cdata->_play_rate); cdata->_playing = true; - cdata->_loops_total = cdata->_loop_count; } //////////////////////////////////////////////////////////////////// @@ -587,11 +584,7 @@ get_time() const { double now = ClockObject::get_global_clock()->get_frame_time(); clock += (now * cdata->_play_rate); } - if (clock >= cdata->_video_length * cdata->_loops_total) { - return cdata->_video_length; - } else { - return fmod(clock, cdata->_video_length); - } + return clock; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/grutil/movieTexture.h b/panda/src/grutil/movieTexture.h index 82cb5ed5ca..d65e614a19 100644 --- a/panda/src/grutil/movieTexture.h +++ b/panda/src/grutil/movieTexture.h @@ -122,7 +122,6 @@ protected: double _clock; bool _playing; int _loop_count; - int _loops_total; double _play_rate; PT(AudioSound) _synchronize; };