commit 81dd14c85cb0563456451fdc3510b469411454f0
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Tue Jun 13 12:03:04 2017 +0100

    Fix 'Cat and Dog' APP. Now  24 out of 31 APPs work.

diff --git a/src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java b/src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java
index 3ca2a53..c93937f 100644
--- a/src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java
+++ b/src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java
@@ -68,15 +68,13 @@ class CatAndDogRenderer implements GLSurfaceView.Renderer
       mView = v;
 
       mMesh = new MeshFlat(1,1);  // no vertex effects, grid can be a (1x1) quad.
-      mEffects = new DistortedEffects();
 
-      Dynamic3D move   = new Dynamic3D(DURATION,0.0f);
+      Dynamic3D moveDyn= new Dynamic3D(DURATION,0.0f);
       mRotate = new Static3D(0,0,0);
       mMove   = new Static3D(0,0,0);
-      Static3D move2  = new Static3D(0,0,0);
 
-      move.add(mMove);
-      move.add(move2);
+      moveDyn.add(mMove);
+      moveDyn.add(new Static3D(0,0,0));
 
       Static4D chromaRegion= new Static4D( 530, 200,100,100);
       Static4D alphaRegion = new Static4D( 230, 200,100,100);
@@ -94,9 +92,10 @@ class CatAndDogRenderer implements GLSurfaceView.Renderer
       diRotate.add(new Static1D(  0));
       diRotate.add(new Static1D(360));
 
+      mEffects = new DistortedEffects();
       mEffects.apply( new FragmentEffectChroma( chromaDyn, new Static3D(1,0,0), chromaRegion ,true) );
       mEffects.apply( new FragmentEffectAlpha(alphaDyn, alphaRegion, false) );
-      mEffects.apply( new MatrixEffectMove(mMove));
+      mEffects.apply( new MatrixEffectMove(moveDyn));
       mEffects.apply( new MatrixEffectScale(diScale));
       mEffects.apply( new MatrixEffectRotate( diRotate, new Static3D(0,0,1), mRotate) );
 
@@ -108,7 +107,6 @@ class CatAndDogRenderer implements GLSurfaceView.Renderer
     public void onSurfaceChanged(GL10 glUnused, int width, int height)
       {
       mMove.set(width-mObjWidth,height-mObjHeight,0);
-      mRotate.set(mObjWidth/2,mObjHeight/2,0);
       mScreen.resize(width, height);
       }
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -140,6 +138,7 @@ class CatAndDogRenderer implements GLSurfaceView.Renderer
       
       mObjHeight = bitmap.getHeight();
       mObjWidth  = bitmap.getWidth();
+      mRotate.set(mObjWidth/2,mObjHeight/2,0);
 
       if( mTexture==null ) mTexture = new DistortedTexture(mObjWidth,mObjHeight);
       mTexture.setTexture(bitmap);
