Project

General

Profile

« Previous | Next » 

Revision 3a70bd6d

Added by Leszek Koltunski almost 8 years ago

Bugfix in EffectQueues: if we interpolate something, then stop and again start interpolating, it used to use the old position (position from the moment when we stopped interpolating!) during the first run after the resume. Fix that.

View differences:

src/main/java/org/distorted/library/DistortedNode.java
33 33
 * <p>
34 34
 * The class takes special care to only render identical sub-trees once. Each Node holds a reference
35 35
 * to sub-class 'NodeData'. Two identical sub-trees attached at different points of the main tree
36
 * will point to the same NodeData; only the first of this is rendered (when mData.numRendered==0).
36
 * will point to the same NodeData; only the first of this is rendered (mData.numRender!).
37 37
 */
38 38
public class DistortedNode implements DistortedAttacheable
39 39
  {
src/main/java/org/distorted/library/DistortedSurface.java
247 247
///////////////////////////////////////////////////////////////////////////////////////////////////
248 248

  
249 249
/**
250
 * Return the height of this Surface.
250
 * Return the width of this Surface.
251 251
 *
252
 * @return height of the object, in pixels.
252
 * @return width of the Object, in pixels.
253 253
 */
254 254
  public int getWidth()
255 255
    {
......
258 258

  
259 259
///////////////////////////////////////////////////////////////////////////////////////////////////
260 260
/**
261
 * Return the width of this Surface.
261
 * Return the height of this Surface.
262 262
 *
263
 * @return width of the Object, in pixels.
263
 * @return height of the Object, in pixels.
264 264
 */
265 265
  public int getHeight()
266 266
    {
src/main/java/org/distorted/library/EffectQueueFragment.java
69 69
   
70 70
    for(int i=0; i<mNumEffects; i++)
71 71
      {
72
      mCurrentDuration[i] += step;
73

  
72 74
      if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
73 75
        {
74 76
        for(int j=0; j<mNumListeners; j++)   
......
89 91

  
90 92
      if( mInter[1][i]!=null ) mInter[1][i].interpolateMain( mCache   , NUM_CACHE*i     , mCurrentDuration[i], step);
91 93
      if( mInter[2][i]!=null ) mInter[2][i].interpolateMain( mUniforms, NUM_UNIFORMS*i+1, mCurrentDuration[i], step);
92

  
93
      mCurrentDuration[i] += step;
94 94
      }
95 95
   
96 96
    mTime = currTime;  
src/main/java/org/distorted/library/EffectQueueMatrix.java
240 240
   
241 241
    for(int i=0; i<mNumEffects; i++)
242 242
      {
243
      mCurrentDuration[i] += step;
244

  
243 245
      if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
244 246
        {
245 247
        for(int j=0; j<mNumListeners; j++)
......
262 264
        {
263 265
        mInter[1][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+4, mCurrentDuration[i], step);
264 266
        }
265

  
266
      mCurrentDuration[i] += step;
267 267
      }
268 268
     
269 269
    mTime = currTime;  
src/main/java/org/distorted/library/EffectQueuePostprocess.java
144 144
   
145 145
    for(int i=0; i<mNumEffects; i++)
146 146
      {
147
      mCurrentDuration[i] += step;
148

  
147 149
      if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
148 150
        {
149 151
        for(int j=0; j<mNumListeners; j++)
......
161 163
          }
162 164
        else mInter[0][i] = null;
163 165
        }
164

  
165
      mCurrentDuration[i] += step;
166 166
      }
167 167
     
168 168
    mTime = currTime;  
src/main/java/org/distorted/library/EffectQueueVertex.java
75 75
   
76 76
    for(int i=0; i<mNumEffects; i++)
77 77
      {
78
      mCurrentDuration[i] += step;
79

  
78 80
      if( mInter[0][i]!=null )
79 81
        {
80 82
        if( mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
......
104 106

  
105 107
      if( mInter[1][i]!=null ) mInter[1][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+8, mCurrentDuration[i], step);
106 108
      if( mInter[2][i]!=null ) mInter[2][i].interpolateMain(mCache   , NUM_CACHE*i     , mCurrentDuration[i], step);
107

  
108
      mCurrentDuration[i] += step;
109 109
      }
110 110
     
111 111
    mTime = currTime;  

Also available in: Unified diff