From 4de2f8311e350ef9b1e9ae709daaad7c0d922faf Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 7 Jun 2018 19:53:02 +0200 Subject: [PATCH] more Android fixes --- .../roguetemple/hyperroid/HyperRenderer.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hyperroid/app/src/main/java/com/roguetemple/hyperroid/HyperRenderer.java b/hyperroid/app/src/main/java/com/roguetemple/hyperroid/HyperRenderer.java index c40a6015..a46da896 100644 --- a/hyperroid/app/src/main/java/com/roguetemple/hyperroid/HyperRenderer.java +++ b/hyperroid/app/src/main/java/com/roguetemple/hyperroid/HyperRenderer.java @@ -27,7 +27,7 @@ public class HyperRenderer implements GLSurfaceView.Renderer { int [] graphdata; int gdpos; int gdpop() { return graphdata[gdpos++]; } - boolean initialized; + boolean initialized; public void onDrawFrame(GL10 unused) { if(game.forceCanvas) return; @@ -39,10 +39,10 @@ public class HyperRenderer implements GLSurfaceView.Renderer { GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT); synchronized(game) { - if(!initialized) { game.glhrinit(); initialized = true; } - game.hv.updateGame(); - game.draw(); - graphdata = game.loadMap(); + if(!initialized) { game.glhrinit(); initialized = true; } + game.hv.updateGame(); + game.draw(); + graphdata = game.loadMap(); glText.shader.aPosition = game.getaPosition(); glText.shader.aTexture = game.getaTexture(); glText.shader.uColor = game.getuColor(); @@ -51,7 +51,8 @@ public class HyperRenderer implements GLSurfaceView.Renderer { if(graphdata == null) return; gdpos = 0; - while(gdpos < graphdata.length) { + + while(gdpos < graphdata.length) { switch(gdpop()) { case 2: { int x = gdpop(); @@ -98,8 +99,8 @@ public class HyperRenderer implements GLSurfaceView.Renderer { GLES20.glViewport(0, 0, width, height); // Save width and height - this.width = width; // Save Current Width - this.height = height; // Save Current Height + this.width = width; // Save Current Width + this.height = height; // Save Current Height initialized = false; } @@ -108,7 +109,7 @@ public class HyperRenderer implements GLSurfaceView.Renderer { glText = new GLText( new Shader() ); glText.load(Typeface.DEFAULT_BOLD, 48, 2, 2 ); // Create Font (Height: 48 Pixels / X+Y Padding 2 Pixels) - initialized = false; + initialized = false; }