v3.2.2: Removed power saver, no longer useful now that we're Android 5+

This commit is contained in:
Evan Debenham
2025-08-17 11:44:57 -04:00
parent 83535d9723
commit 45c8eb3e70
8 changed files with 9 additions and 168 deletions

View File

@@ -33,36 +33,7 @@ public class InputHandler extends InputAdapter {
private InputMultiplexer multiplexer;
public InputHandler( Input input ){
//An input multiplexer, with additional coord tweaks for power saver mode
multiplexer = new InputMultiplexer(){
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
screenX /= (Game.dispWidth / (float)Game.width);
screenY /= (Game.dispHeight / (float)Game.height);
return super.touchDown(screenX, screenY, pointer, button);
}
@Override
public boolean touchDragged(int screenX, int screenY, int pointer) {
screenX /= (Game.dispWidth / (float)Game.width);
screenY /= (Game.dispHeight / (float)Game.height);
return super.touchDragged(screenX, screenY, pointer);
}
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
screenX /= (Game.dispWidth / (float)Game.width);
screenY /= (Game.dispHeight / (float)Game.height);
return super.touchUp(screenX, screenY, pointer, button);
}
@Override
public boolean mouseMoved(int screenX, int screenY) {
screenX /= (Game.dispWidth / (float)Game.width);
screenY /= (Game.dispHeight / (float)Game.height);
return super.mouseMoved(screenX, screenY);
}
};
multiplexer = new InputMultiplexer();
input.setInputProcessor(multiplexer);
addInputProcessor(this);
input.setCatchKey( Input.Keys.BACK, true);

View File

@@ -21,7 +21,6 @@
package com.watabou.noosa;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.controllers.Controllers;
@@ -46,10 +45,6 @@ import java.io.StringWriter;
public class Game implements ApplicationListener {
public static Game instance;
//actual size of the display
public static int dispWidth;
public static int dispHeight;
// Size of the EGL surface view
public static int width;
@@ -93,13 +88,12 @@ public class Game implements ApplicationListener {
@Override
public void create() {
dispHeight = Gdx.graphics.getDisplayMode().height;
dispWidth = Gdx.graphics.getDisplayMode().width;
density = Gdx.graphics.getDensity();
if (density == Float.POSITIVE_INFINITY){
density = 100f / 160f; //assume 100PPI if density can't be found
} else if (DeviceCompat.isDesktop()) {
int dispWidth = Gdx.graphics.getDisplayMode().width;
int dispHeight = Gdx.graphics.getDisplayMode().height;
float reportedWidth = dispWidth / Gdx.graphics.getPpiX();
float reportedHeight = dispHeight / Gdx.graphics.getPpiY();
@@ -148,12 +142,6 @@ public class Game implements ApplicationListener {
Game.width = width;
Game.height = height;
//TODO might be better to put this in platform support
if (Gdx.app.getType() != Application.ApplicationType.Android){
Game.dispWidth = Game.width;
Game.dispHeight = Game.height;
}
resetScene();
}
}