v0.4.3: implemented a new 'Power Saver' mode

As a bonus, this allows shattered to run on small screen devices, by forcing power saver, which downsamples in this specific case allowing for the minimum 2x game scale.
This commit is contained in:
Evan Debenham
2016-09-30 04:30:24 -04:00
parent 8591a0b3dc
commit debbb57066
9 changed files with 138 additions and 27 deletions
@@ -53,8 +53,12 @@ import android.view.View;
public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTouchListener {
public static Game instance;
//actual size of the display
public static int dispWidth;
public static int dispHeight;
// Actual size of the screen
// Size of the EGL surface view
public static int width;
public static int height;
@@ -107,6 +111,8 @@ public class Game extends Activity implements GLSurfaceView.Renderer, View.OnTou
DisplayMetrics m = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics( m );
density = m.density;
dispHeight = m.heightPixels;
dispWidth = m.widthPixels;
try {
version = getPackageManager().getPackageInfo( getPackageName(), 0 ).versionName;