From: <re...@us...> - 2009-12-02 00:35:16
|
Revision: 33245 http://crystal.svn.sourceforge.net/crystal/?rev=33245&view=rev Author: res2002 Date: 2009-12-02 00:35:09 +0000 (Wed, 02 Dec 2009) Log Message: ----------- Ensure PD light textures don't show with garbage first time Modified Paths: -------------- CS/trunk/plugins/proctex/ptpdlight/ptpdlight.cpp CS/trunk/plugins/proctex/ptpdlight/ptpdlight.h Modified: CS/trunk/plugins/proctex/ptpdlight/ptpdlight.cpp =================================================================== --- CS/trunk/plugins/proctex/ptpdlight/ptpdlight.cpp 2009-12-02 00:16:21 UTC (rev 33244) +++ CS/trunk/plugins/proctex/ptpdlight/ptpdlight.cpp 2009-12-02 00:35:09 UTC (rev 33245) @@ -372,7 +372,7 @@ scfImplementationType (this), loader (loader), tiles (w, h), tilesDirty (tiles.ComputeTileCount()), baseColor (0, 0, 0), baseMap (tilesDirty.GetSize()), - state (stateDirty) + state (0) { mat_w = w; mat_h = h; @@ -472,6 +472,10 @@ } lightBits.SetSize (lights.GetSize ()); state.Set (statePrepared); + + // Initially fill texture (starts out with garbage) + Animate(); + return true; } @@ -481,23 +485,28 @@ { if (!loader->UpdatePT (this, current_time)) return; - csTicks startTime = csGetTicks(); + Animate(); + } +} - CS_PROFILER_ZONE(ProctexPDLight_Animate) +void ProctexPDLight::Animate () +{ + csTicks startTime = csGetTicks(); + + CS_PROFILER_ZONE(ProctexPDLight_Animate) #ifdef CS_SUPPORTS_MMX - if (state.Check ((uint32)stateDoMMX)) - Animate_MMX (); - else + if (state.Check ((uint32)stateDoMMX)) + Animate_MMX (); + else #endif - Animate_Generic (); + Animate_Generic (); - state.Reset (stateDirty); - dirtyLights.DeleteAll (); - tilesDirty.Clear (); + state.Reset (stateDirty); + dirtyLights.DeleteAll (); + tilesDirty.Clear (); - csTicks endTime = csGetTicks(); - loader->RecordUpdateTime (endTime-startTime); - } + csTicks endTime = csGetTicks(); + loader->RecordUpdateTime (endTime-startTime); } void ProctexPDLight::OnColorChange (iLight* light, const csColor& newcolor) Modified: CS/trunk/plugins/proctex/ptpdlight/ptpdlight.h =================================================================== --- CS/trunk/plugins/proctex/ptpdlight/ptpdlight.h 2009-12-02 00:16:21 UTC (rev 33244) +++ CS/trunk/plugins/proctex/ptpdlight/ptpdlight.h 2009-12-02 00:35:09 UTC (rev 33245) @@ -310,7 +310,8 @@ virtual bool PrepareAnim (); - virtual void Animate (csTicks /*current_time*/); + virtual void Animate (csTicks current_time); + void Animate (); /**\name iLightCallback implementation * @{ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |