Project

General

Profile

« Previous | Next » 

Revision 8fbd0237

Added by Leszek Koltunski over 7 years ago

Fix 'Different Bitmaps' APP. Now 27 out of 31 APPs work.

View differences:

src/main/java/org/distorted/library/main/DistortedEffects.java
270 270

  
271 271
  void drawPriv(float halfW, float halfH, MeshObject mesh, DistortedOutputSurface surface, long currTime, float marginInPixels)
272 272
    {
273
    mM.compute(currTime);
274
    mV.compute(currTime);
275
    mF.compute(currTime);
276

  
277 273
    float halfZ = halfW*mesh.zFactor;
278 274

  
275
    mM.compute(currTime);
276
    mV.compute(currTime,halfW,halfH,halfZ);
277
    mF.compute(currTime,halfW,halfH);
278

  
279 279
    GLES30.glViewport(0, 0, surface.mWidth, surface.mHeight );
280 280

  
281 281
    mMainProgram.useProgram();
......
300 300
      }
301 301

  
302 302
    mM.send(surface,halfW,halfH,halfZ,marginInPixels);
303
    mV.send(halfW,halfH,halfZ);
304
    mF.send(halfW,halfH);
303
    mV.send();
304
    mF.send();
305 305

  
306 306
    GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, mesh.numVertices);
307 307

  
src/main/java/org/distorted/library/main/EffectQueueFragment.java
53 53

  
54 54
///////////////////////////////////////////////////////////////////////////////////////////////////
55 55
  
56
  synchronized void compute(long currTime) 
56
  synchronized void compute(long currTime,float halfX, float halfY)
57 57
    { 
58 58
    if( currTime==mTime ) return;
59 59
    if( mTime==0 ) mTime = currTime;
......
69 69
          EffectMessageSender.newMessage( mListeners.elementAt(j), EffectMessage.EFFECT_FINISHED, mEffects[i].getID(), mID);
70 70

  
71 71
        if( mEffects[i].isUnity( mUniforms, NUM_UNIFORMS*i) )
72
          {
72 73
          remove(i--);
74
          continue;
75
          }
73 76
        }
77

  
78
      mUniforms[NUM_UNIFORMS*i+4] = mUniforms[NUM_UNIFORMS*i+4]-halfX;
79
      mUniforms[NUM_UNIFORMS*i+5] =-mUniforms[NUM_UNIFORMS*i+5]+halfY;
74 80
      }
75 81

  
76 82
    mTime = currTime;  
......
78 84

  
79 85
///////////////////////////////////////////////////////////////////////////////////////////////////
80 86
  
81
  synchronized void send(float halfX, float halfY)
87
  synchronized void send()
82 88
    {
83 89
    GLES30.glUniform1i( mNumEffectsH, mNumEffects);
84 90

  
85 91
    if( mNumEffects>0 )
86 92
      {
87
      for(int i=0; i<mNumEffects; i++)
88
        {
89
        mUniforms[NUM_UNIFORMS*i+4] = mUniforms[NUM_UNIFORMS*i+4]-halfX;
90
        mUniforms[NUM_UNIFORMS*i+5] =-mUniforms[NUM_UNIFORMS*i+5]+halfY;
91
        }
92

  
93 93
      GLES30.glUniform1iv( mNameH    ,                 mNumEffects, mName    ,0);
94 94
      GLES30.glUniform4fv( mUniformsH,(NUM_UNIFORMS/4)*mNumEffects, mUniforms,0);
95 95
      }  
src/main/java/org/distorted/library/main/EffectQueueVertex.java
53 53

  
54 54
///////////////////////////////////////////////////////////////////////////////////////////////////
55 55
  
56
  synchronized void compute(long currTime) 
56
  synchronized void compute(long currTime,float halfX, float halfY, float halfZ)
57 57
    {
58 58
    if( currTime==mTime ) return;
59 59
    if( mTime==0 ) mTime = currTime;
......
69 69
          EffectMessageSender.newMessage( mListeners.elementAt(j), EffectMessage.EFFECT_FINISHED, mEffects[i].getID(), mID);
70 70

  
71 71
        if( mEffects[i].isUnity( mUniforms, NUM_UNIFORMS*i) )
72
          {
72 73
          remove(i--);
74
          continue;
75
          }
73 76
        }
77

  
78
      mUniforms[NUM_UNIFORMS*i+5] = mUniforms[NUM_UNIFORMS*i+5]-halfX;
79
      mUniforms[NUM_UNIFORMS*i+6] =-mUniforms[NUM_UNIFORMS*i+6]+halfY;
80
      mUniforms[NUM_UNIFORMS*i+7] = mUniforms[NUM_UNIFORMS*i+7]-halfZ;
74 81
      }
75 82

  
76 83
    mTime = currTime;
......
78 85

  
79 86
///////////////////////////////////////////////////////////////////////////////////////////////////
80 87

  
81
  synchronized void send(float halfX, float halfY, float halfZ)
88
  synchronized void send()
82 89
    {
83 90
    GLES30.glUniform1i( mNumEffectsH, mNumEffects);
84 91
      
85 92
    if( mNumEffects>0 )
86 93
      {
87
      for(int i=0; i<mNumEffects; i++)
88
        {
89
        mUniforms[NUM_UNIFORMS*i+5] = mUniforms[NUM_UNIFORMS*i+5]-halfX;
90
        mUniforms[NUM_UNIFORMS*i+6] =-mUniforms[NUM_UNIFORMS*i+6]+halfY;
91
        mUniforms[NUM_UNIFORMS*i+7] = mUniforms[NUM_UNIFORMS*i+7]-halfZ;
92
        }
93

  
94 94
      GLES30.glUniform1iv( mNameH    ,                 mNumEffects, mName    ,0);
95 95
      GLES30.glUniform4fv( mUniformsH,(NUM_UNIFORMS/4)*mNumEffects, mUniforms,0);
96 96
      }

Also available in: Unified diff