summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/UnitDock.java4
-rw-r--r--core/src/ch/asynk/rustanddust/screens/GameCamera.java5
-rw-r--r--core/src/ch/asynk/rustanddust/screens/MenuCamera.java3
3 files changed, 7 insertions, 5 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
index c5d7df2..458821e 100644
--- a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
+++ b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
@@ -2,6 +2,7 @@ package ch.asynk.rustanddust.game.hud;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
+import com.badlogic.gdx.graphics.glutils.HdpiUtils;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Vector3;
@@ -234,9 +235,8 @@ public class UnitDock extends Bg implements Animation
batch.setTransformMatrix(transform);
// batch.flush();
- // FIXME please use HdpiUtils instead release 1.8 https://libgdx.badlogicgames.com/news.html
Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST);
- Gdx.gl.glScissor((int)scissors.x, (int)scissors.y, (int)scissors.width, (int)scissors.height);
+ HdpiUtils.glScissor((int)scissors.x, (int)scissors.y, (int)scissors.width, (int)scissors.height);
super.draw(batch);
if (selectedUnit != null) selected.draw(batch);
diff --git a/core/src/ch/asynk/rustanddust/screens/GameCamera.java b/core/src/ch/asynk/rustanddust/screens/GameCamera.java
index 8ca06d5..19c1b37 100644
--- a/core/src/ch/asynk/rustanddust/screens/GameCamera.java
+++ b/core/src/ch/asynk/rustanddust/screens/GameCamera.java
@@ -2,6 +2,7 @@ package ch.asynk.rustanddust.screens;
import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.graphics.glutils.HdpiUtils;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Rectangle;
@@ -96,13 +97,13 @@ public class GameCamera extends OrthographicCamera
public void applyMapViewport()
{
- Gdx.gl.glViewport((int)window.x, (int)window.y, (int)window.width, (int)window.height);
+ HdpiUtils.glViewport((int)window.x, (int)window.y, (int)window.width, (int)window.height);
}
public void applyHudViewport()
{
if (fixedHud)
- Gdx.gl.glViewport(0, 0, screenWidth, screenHeight);
+ HdpiUtils.glViewport(0, 0, screenWidth, screenHeight);
}
public Matrix4 getHudMatrix()
diff --git a/core/src/ch/asynk/rustanddust/screens/MenuCamera.java b/core/src/ch/asynk/rustanddust/screens/MenuCamera.java
index be8341a..2f4217c 100644
--- a/core/src/ch/asynk/rustanddust/screens/MenuCamera.java
+++ b/core/src/ch/asynk/rustanddust/screens/MenuCamera.java
@@ -1,6 +1,7 @@
package ch.asynk.rustanddust.screens;
import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.graphics.glutils.HdpiUtils;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Matrix4;
@@ -55,7 +56,7 @@ public class MenuCamera extends OrthographicCamera
hudLeft = hudCorrection;
hudBottom = (int) (hudLeft / aspect);
- Gdx.gl.glViewport((int)window.x, (int)window.y, (int)window.width, (int)window.height);
+ HdpiUtils.glViewport((int)window.x, (int)window.y, (int)window.width, (int)window.height);
update(true);