DEADSOFTWARE

Fix resolution pick
authorfred-boy <fredboy@protonmail.com>
Fri, 27 Sep 2019 11:20:28 +0000 (18:20 +0700)
committerfred-boy <fredboy@protonmail.com>
Sun, 29 Sep 2019 04:39:17 +0000 (11:39 +0700)
core/src/ru/deadsoftware/cavedroid/game/GameProc.java

index d018b3e35b6817955f6f0e529c65e349643be323..8ceb7cf80acaa2f65602d6b71bf8c17b184cbe35 100644 (file)
@@ -50,14 +50,11 @@ public class GameProc implements Serializable, Disposable {
             mobs.add(new Pig(i * 256, 196 * 16));
         }
         physics = new GamePhysics();
-        if (CaveGame.TOUCH) {
-            renderer = new GameRenderer(320,
-                    320 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
-        } else {
-            ctrlMode = 1;
-            renderer = new GameRenderer(480,
-                    480 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
-        }
+
+        int scale = CaveGame.TOUCH ? 320 : 480;
+        if (CaveGame.TOUCH) ctrlMode = 1;
+        renderer = new GameRenderer(scale, scale * GameScreen.getHeight() / GameScreen.getWidth());
+
         maxCreativeScroll = GameItems.getItemsSize() / 8;
 
         createFluidThread();