diff --git a/Engine/source/gui/theora/guiTheoraCtrl.cpp b/Engine/source/gui/theora/guiTheoraCtrl.cpp index 145b3474c..f6d5fd213 100644 --- a/Engine/source/gui/theora/guiTheoraCtrl.cpp +++ b/Engine/source/gui/theora/guiTheoraCtrl.cpp @@ -73,6 +73,7 @@ GuiTheoraCtrl::GuiTheoraCtrl() mPlayOnWake = true; mRenderDebugInfo = false; mTranscoder = OggTheoraDecoder::TRANSCODER_Auto; + mLoop = false; mBackgroundColor.set( 0, 0, 0, 255); } @@ -89,6 +90,8 @@ void GuiTheoraCtrl::initPersistFields() "Fill color when video is not playing." ); addField( "playOnWake", TypeBool, Offset( mPlayOnWake, GuiTheoraCtrl ), "Whether to start playing video when control is woken up." ); + addField( "loop", TypeBool, Offset( mLoop, GuiTheoraCtrl ), + "Loop playback." ); addField( "stopOnSleep", TypeBool, Offset( mStopOnSleep, GuiTheoraCtrl ), "Whether to stop video when control is set to sleep.\n\n" "If this is not set to true, the video will be paused when the control is put to sleep. This is because there is no support " @@ -221,7 +224,14 @@ void GuiTheoraCtrl::onRender(Point2I offset, const RectI &updateRect) } } else - mDone = true; + { + if(mLoop) + { + play(); + } else { + mDone = true; + } + } } else GFX->getDrawUtil()->drawRectFill(rect, mBackgroundColor); // black rect diff --git a/Engine/source/gui/theora/guiTheoraCtrl.h b/Engine/source/gui/theora/guiTheoraCtrl.h index e85ff6986..635c515da 100644 --- a/Engine/source/gui/theora/guiTheoraCtrl.h +++ b/Engine/source/gui/theora/guiTheoraCtrl.h @@ -57,6 +57,8 @@ class GuiTheoraCtrl : public GuiControl /// If true, playback will start automatically when the control receives its /// onWake(). bool mPlayOnWake; + + bool mLoop; /// Which transcoder to use on the Theora decoder. This is mostly /// meant as a development aid.