commit 7f9c3cce5d3180ecae6b99b7fa51e7cda4ca04b8
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Aug 17 15:02:42 2022 +0200

    IAP part 6: new 'Present' object effect.

diff --git a/src/main/java/org/distorted/purchase/PurchaseObjectLibInterface.java b/src/main/java/org/distorted/purchase/PurchaseObjectLibInterface.java
index 99b5c224..8d6ebe06 100644
--- a/src/main/java/org/distorted/purchase/PurchaseObjectLibInterface.java
+++ b/src/main/java/org/distorted/purchase/PurchaseObjectLibInterface.java
@@ -30,6 +30,7 @@ public class PurchaseObjectLibInterface implements ObjectLibInterface
   public void onFinishRotation(int axis, int row, int angle) { }
   public void failedToDrag() { }
   public void reportJSONError(String error, int ordinal) { }
+  public void reportBlockProblem(int type, int place, long pause, long resume, long time) { }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -55,76 +56,4 @@ public class PurchaseObjectLibInterface implements ObjectLibInterface
         }
       }
     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void reportUIProblem(int place, long pause, long resume, long time)
-    {
-    String error = "UI BLOCK "+place+" blocked for "+time;
-
-    if( BuildConfig.DEBUG )
-       {
-       android.util.Log.e("D", error);
-       }
-    else
-      {
-      Exception ex = new Exception(error);
-      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
-      crashlytics.setCustomKey("pause" , pause );
-      crashlytics.setCustomKey("resume", resume );
-      crashlytics.recordException(ex);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void reportTouchProblem(int place, long pause, long resume, long time)
-    {
-    String error = "TOUCH BLOCK "+place+" blocked for "+time;
-
-    if( BuildConfig.DEBUG )
-       {
-       android.util.Log.e("D", error);
-       }
-    else
-      {
-      Exception ex = new Exception(error);
-      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
-      crashlytics.setCustomKey("pause" , pause );
-      crashlytics.setCustomKey("resume", resume);
-      crashlytics.recordException(ex);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void reportThreadProblem(int place, long pause, long resume, long time)
-    {
-    String error = EffectMessageSender.reportState();
-
-    if( BuildConfig.DEBUG )
-       {
-       android.util.Log.e("D", error);
-       }
-    else
-      {
-      Exception ex = new Exception(error);
-      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
-      crashlytics.setCustomKey("pause" , pause  );
-      crashlytics.setCustomKey("resume", resume );
-      crashlytics.recordException(ex);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void reportBlockProblem(int type, int place, long pause, long resume, long time)
-    {
-    switch(type)
-      {
-      case BlockController.TYPE_UI    : reportUIProblem(place,pause,resume,time); break;
-      case BlockController.TYPE_TOUCH : reportTouchProblem(place,pause,resume,time); break;
-      case BlockController.TYPE_THREAD: reportThreadProblem(place,pause,resume,time); break;
-      }
-    }
 }
diff --git a/src/main/java/org/distorted/purchase/PurchaseRenderer.java b/src/main/java/org/distorted/purchase/PurchaseRenderer.java
index ab112798..6542f71a 100644
--- a/src/main/java/org/distorted/purchase/PurchaseRenderer.java
+++ b/src/main/java/org/distorted/purchase/PurchaseRenderer.java
@@ -26,15 +26,20 @@ import javax.microedition.khronos.opengles.GL10;
 
 public class PurchaseRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener
 {
+   private static final int NUM_SCRAMBLES = 5;
+
    private final PurchaseSurfaceView mView;
    private final DistortedScreen mScreen;
 
+   private boolean mFirstRender;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
    PurchaseRenderer(PurchaseSurfaceView v)
      {
      final float BRIGHTNESS = 0.333f;
 
+     mFirstRender = true;
      mView = v;
      mScreen = new DistortedScreen();
      mScreen.glClearColor(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 1.0f);
@@ -48,6 +53,12 @@ public class PurchaseRenderer implements GLSurfaceView.Renderer, DistortedLibrar
      long time = System.currentTimeMillis();
      mView.getObjectControl().preRender();
      mScreen.render(time);
+
+     if( mFirstRender )
+       {
+       mFirstRender=false;
+       mView.getObjectControl().presentObject(NUM_SCRAMBLES);
+       }
      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
