Catching of schematic preview errors / Fixes
@@ -7,12 +7,15 @@ import arc.graphics.gl.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
+import arc.util.ArcAnnotate.*;
import static arc.Core.*;
public class Draw{
private static final Color[] carr = new Color[3];
private static final float[] vertices = new float[SpriteBatch.SPRITE_SIZE];
+ private static @Nullable Camera lastProj;
+
public static float scl = 1f;
public static void batch(Batch nextBatch){
@@ -246,10 +249,12 @@ public class Draw{
}
public static void proj(Mat proj){
+ lastProj = (Core.camera != null && camera.mat == proj ? camera : null);
Core.batch.setProjection(proj);
}
public static Mat proj(){
+ lastProj = null;
return Core.batch.getProjection();
}
@@ -261,6 +266,11 @@ public class Draw{
return Core.batch.getTransform();
}
+ /** @return whether the batch's projection is currently the camera. */
+ public static boolean isCamera(){
+ return lastProj == camera;
+ }
+
public static TextureRegion wrap(Texture texture){
Tmp.tr2.set(texture);
return Tmp.tr2;
