Project

General

Profile

« Previous | Next » 

Revision e7a20702

Added by Leszek Koltunski over 7 years ago

Simplify DistortedTexture.

View differences:

src/main/java/org/distorted/library/DistortedTree.java
208 208

  
209 209
    if( mNumChildren[0]<=0 )
210 210
      {
211
      GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTexture.mTextureDataH[0]);
211
      mTexture.setAsInput();
212 212
      }
213 213
    else
214 214
      {
......
221 221
        GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
222 222
        GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
223 223

  
224
        if( mTexture.mBitmapSet[0] )
225
          {
226
          GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTexture.mTextureDataH[0]);
224
        if( mTexture.setAsInput() )
227 225
          mEffects.drawNoEffectsPriv(mTexture.mHalfX, mTexture.mHalfY, mGrid, mData.mDF);
228
          }
229 226

  
230 227
        synchronized(this)
231 228
          {
......
295 292
  public DistortedTree(DistortedTree node, int flags)
296 293
    {
297 294
    mParent = null;
298
    mTexture= new DistortedTexture(node.mTexture,flags);
299 295
    mEffects= new DistortedEffects(node.mEffects,flags);
300 296
    mGrid   = node.mGrid;
301 297

  
298
    if( (flags & Distorted.CLONE_BITMAP) != 0 )
299
      {
300
      mTexture = node.mTexture;
301
      }
302
    else
303
      {
304
      mTexture = new DistortedTexture(node.mTexture.getWidth(), node.mTexture.getHeight());
305
      }
302 306
    if( (flags & Distorted.CLONE_CHILDREN) != 0 )
303 307
      {
304 308
      mChildren = node.mChildren;

Also available in: Unified diff