v0.7.4b: cleaned up a few leftovers from new init logic

This commit is contained in:
Evan Debenham 2019-08-01 19:09:50 -04:00
parent 3e815a3165
commit 7885da4b99
6 changed files with 16 additions and 28 deletions

View File

@ -22,6 +22,8 @@ https://github.com/00-Evan/pixel-dungeon-gradle
# Compiling Shattered Pixel Dungeon # Compiling Shattered Pixel Dungeon
**Note that Shattered Pixel Dungeon is currently in the process of being converted to use the multiplatform game library LibGDX. The codebase is fully functional, but still contains some code which depends on Android, and so cannot be built for other platforms yet.**
To compile Shattered Pixel Dungeon you will need: To compile Shattered Pixel Dungeon you will need:
- A computer which meets the [system requirements for Android Studio](https://developer.android.com/studio#Requirements) - A computer which meets the [system requirements for Android Studio](https://developer.android.com/studio#Requirements)
- (optional) a GitHub account to fork this repository, if you wish to use version control - (optional) a GitHub account to fork this repository, if you wish to use version control
@ -69,7 +71,7 @@ An APK (Android PacKage) is a file used to distribute Android applications. The
Note that APKs must be signed with a signing key. If you are making a small personal modification to Shattered Pixel Dungeon then your signing key is not important, but if you intend to distribute your modification to other people and want them to be able to receive updates, then your signing key is critical. The Android studio website has [a guide on signing keys.](https://developer.android.com/studio/publish/app-signing.html#opt-out) Note that APKs must be signed with a signing key. If you are making a small personal modification to Shattered Pixel Dungeon then your signing key is not important, but if you intend to distribute your modification to other people and want them to be able to receive updates, then your signing key is critical. The Android studio website has [a guide on signing keys.](https://developer.android.com/studio/publish/app-signing.html#opt-out)
Additionally, note that by default Shattered Pixel Dungeon uses R8 on release builds. R8 is a code optimizer which decreases the size of the APK and improves performance, but also makes error reports more difficult to read. You can disable R8 by setting minifyEnabled to false in 'core/build.grade'. If you wish to keep R8 enabled, you can learn more about it [here.](https://developer.android.com/studio/build/shrink-code) Additionally, note that by default Shattered Pixel Dungeon uses R8 on release builds. R8 is a code optimizer which decreases the size of the APK and improves performance, but also makes error reports more difficult to read. You can disable R8 by setting minifyEnabled to false in 'android/build.grade'. If you wish to keep R8 enabled, you can learn more about it [here.](https://developer.android.com/studio/build/shrink-code)
#### 6. Distributing Your APK #### 6. Distributing Your APK

View File

@ -21,9 +21,6 @@
package com.watabou.noosa; package com.watabou.noosa;
import android.opengl.GLSurfaceView;
import android.os.SystemClock;
import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.watabou.glscripts.Script; import com.watabou.glscripts.Script;
@ -76,9 +73,6 @@ public class Game implements ApplicationListener {
public static float elapsed = 0f; public static float elapsed = 0f;
public static float timeTotal = 0f; public static float timeTotal = 0f;
protected GLSurfaceView view;
//protected SurfaceHolder holder;
protected static InputHandler inputHandler; protected static InputHandler inputHandler;
protected static PlatformSupport platform; protected static PlatformSupport platform;
@ -150,7 +144,7 @@ public class Game implements ApplicationListener {
Gdx.gl.glFlush(); Gdx.gl.glFlush();
SystemTime.tick(); SystemTime.tick();
long rightNow = SystemClock.elapsedRealtime(); long rightNow = SystemTime.now;
step = (now == 0 ? 0 : rightNow - now); step = (now == 0 ? 0 : rightNow - now);
now = rightNow; now = rightNow;

View File

@ -21,7 +21,6 @@
package com.watabou.noosa; package com.watabou.noosa;
import com.badlogic.gdx.Gdx;
import com.watabou.input.KeyEvent; import com.watabou.input.KeyEvent;
import com.watabou.utils.Signal; import com.watabou.utils.Signal;

View File

@ -21,12 +21,14 @@
package com.watabou.utils; package com.watabou.utils;
import com.badlogic.gdx.utils.TimeUtils;
public class SystemTime { public class SystemTime {
public static long now; public static long now;
public static void tick() { public static void tick() {
now = System.currentTimeMillis(); now = TimeUtils.millis();
} }
} }

View File

@ -7,6 +7,7 @@
# mapping file can be found in core/build/outputs/mapping after running a release build # mapping file can be found in core/build/outputs/mapping after running a release build
-keepattributes SourceFile,LineNumberTable -keepattributes SourceFile,LineNumberTable
# LibGDX stuff
-dontwarn android.support.** -dontwarn android.support.**
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
-dontwarn com.badlogic.gdx.utils.GdxBuild -dontwarn com.badlogic.gdx.utils.GdxBuild
@ -14,15 +15,15 @@
-dontwarn com.badlogic.gdx.jnigen.BuildTarget* -dontwarn com.badlogic.gdx.jnigen.BuildTarget*
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* { -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
<init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration); <init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
} }
-keepclassmembers class com.badlogic.gdx.physics.box2d.World { -keepclassmembers class com.badlogic.gdx.physics.box2d.World {
boolean contactFilter(long, long); boolean contactFilter(long, long);
void beginContact(long); void beginContact(long);
void endContact(long); void endContact(long);
void preSolve(long, long); void preSolve(long, long);
void postSolve(long, long); void postSolve(long, long);
boolean reportFixture(long); boolean reportFixture(long);
float reportRayFixture(long, float, float, float, float, float); float reportRayFixture(long, float, float, float, float, float);
} }

View File

@ -21,29 +21,19 @@
package com.shatteredpixel.shatteredpixeldungeon.android; package com.shatteredpixel.shatteredpixeldungeon.android;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.opengl.GLSurfaceView; import android.opengl.GLSurfaceView;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.telephony.PhoneStateListener; import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.view.View;
import android.view.WindowManager;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.noosa.audio.Music; import com.watabou.noosa.audio.Music;
import com.watabou.utils.DeviceCompat;
public class AndroidLauncher extends AndroidApplication { public class AndroidLauncher extends AndroidApplication {