v1.3.0: updated libGDX to 1.11.0
This commit is contained in:
@@ -33,20 +33,15 @@
|
||||
android:fullBackupOnly="true"
|
||||
android:backupAgent=".AndroidBackupHandler">
|
||||
<activity
|
||||
android:label="${appName}"
|
||||
android:name=".AndroidLauncher"
|
||||
android:name=".AndroidGame"
|
||||
android:screenOrientation="nosensor"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:label="${appName}"
|
||||
android:name=".AndroidGame"
|
||||
android:screenOrientation="nosensor"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize">
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
@@ -24,15 +24,20 @@ package com.shatteredpixel.shatteredpixeldungeon.android;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.badlogic.gdx.Files;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
import com.badlogic.gdx.backends.android.AndroidAudio;
|
||||
import com.badlogic.gdx.backends.android.AsynchronousAndroidAudio;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeType;
|
||||
import com.badlogic.gdx.utils.GdxNativesLoader;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.news.News;
|
||||
@@ -53,6 +58,24 @@ public class AndroidGame extends AndroidApplication {
|
||||
protected void onCreate (Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
try {
|
||||
GdxNativesLoader.load();
|
||||
FreeType.initFreeType();
|
||||
} catch (Exception e){
|
||||
TextView text = new TextView(this);
|
||||
text.setText("Shattered Pixel Dungeon cannot start because some of its code is missing!\n\n" +
|
||||
"This usually happens when the Google Play version of the game is installed from somewhere outside of Google Play.\n\n" +
|
||||
"If you're unsure of how to fix this, please email the developer (Evan@ShatteredPixel.com), and include this error message:\n\n" +
|
||||
e.getMessage());
|
||||
text.setTextSize(16);
|
||||
text.setTextColor(0xFFFFFFFF);
|
||||
text.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/pixel_font.ttf"));
|
||||
text.setGravity(Gravity.CENTER_VERTICAL);
|
||||
text.setPadding(10, 10, 10, 10);
|
||||
setContentView(text);
|
||||
return;
|
||||
}
|
||||
|
||||
//there are some things we only need to set up on first launch
|
||||
if (instance == null) {
|
||||
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2022 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.android;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeType;
|
||||
import com.badlogic.gdx.utils.GdxNativesLoader;
|
||||
|
||||
public class AndroidLauncher extends Activity {
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
try {
|
||||
GdxNativesLoader.load();
|
||||
FreeType.initFreeType();
|
||||
|
||||
Intent intent = new Intent(this, AndroidGame.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
} catch (Exception e){
|
||||
TextView text = new TextView(this);
|
||||
text.setText("Shattered Pixel Dungeon cannot start because some of its code is missing!\n\n" +
|
||||
"This usually happens when the Google Play version of the game is installed from somewhere outside of Google Play.\n\n" +
|
||||
"If you're unsure of how to fix this, please email the developer (Evan@ShatteredPixel.com), and include this error message:\n\n" +
|
||||
e.getMessage());
|
||||
text.setTextSize(16);
|
||||
text.setTextColor(0xFFFFFFFF);
|
||||
text.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/pixel_font.ttf"));
|
||||
text.setGravity(Gravity.CENTER_VERTICAL);
|
||||
text.setPadding(10, 10, 10, 10);
|
||||
setContentView(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ allprojects {
|
||||
appAndroidMinSDK = 14
|
||||
appAndroidTargetSDK = 31
|
||||
|
||||
gdxVersion = '1.10.0'
|
||||
gdxVersion = '1.11.0'
|
||||
gdxControllersVersion = '2.2.1'
|
||||
robovmVersion = '2.3.16'
|
||||
}
|
||||
|
||||
@@ -122,10 +122,10 @@ dependencies {
|
||||
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
|
||||
|
||||
//we use LWJGL tinyFD directly to display crash messages and (for now) single-line text input
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-windows"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-macos"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.2.3:natives-linux"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.3.1"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.3.1:natives-windows"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.3.1:natives-macos"
|
||||
implementation "org.lwjgl:lwjgl-tinyfd:3.3.1:natives-linux"
|
||||
|
||||
implementation project(':services:updates:githubUpdates')
|
||||
implementation project(':services:news:shatteredNews')
|
||||
|
||||
@@ -89,13 +89,13 @@ public class DesktopLauncher {
|
||||
|
||||
if (exceptionMsg.contains("Couldn't create window")){
|
||||
TinyFileDialogs.tinyfd_messageBox(title + " Has Crashed!",
|
||||
title + " wasn't able to initialize it's graphics display, sorry about that!\n\n" +
|
||||
"This usually happens when a computer's graphics card does not support OpenGL 2.0+, or has misconfigured graphics drivers.\n\n" +
|
||||
"If you're certain the game should be working on your computer, feel free to message the developer (Evan@ShatteredPixel.com)\n\n" +
|
||||
title + " was not able to initialize its graphics display, sorry about that!\n\n" +
|
||||
"This usually happens when your graphics card does not support OpenGL 2.0+, or has misconfigured graphics drivers.\n\n" +
|
||||
"If you are certain the game should be working on your computer, feel free to message the developer (Evan@ShatteredPixel.com)\n\n" +
|
||||
"version: " + Game.version, "ok", "error", false);
|
||||
} else {
|
||||
TinyFileDialogs.tinyfd_messageBox(title + " Has Crashed!",
|
||||
title + " has run into an error it can't recover from and has crashed, sorry about that!\n\n" +
|
||||
title + " has run into an error it cannot recover from and has crashed, sorry about that!\n\n" +
|
||||
"If you could, please email this error message to the developer (Evan@ShatteredPixel.com):\n\n" +
|
||||
"version: " + Game.version + "\n" +
|
||||
exceptionMsg,
|
||||
|
||||
@@ -77,33 +77,6 @@ public class DesktopPlatformSupport extends PlatformSupport {
|
||||
return true; //no easy way to check this in desktop, just assume user doesn't care
|
||||
}
|
||||
|
||||
//TODO backported openURI fix from libGDX-1.10.1-SNAPSHOT, remove when updating libGDX
|
||||
public boolean openURI( String uri ){
|
||||
if (SharedLibraryLoader.isMac) {
|
||||
try {
|
||||
(new ProcessBuilder("open", (new URI(uri).toString()))).start();
|
||||
return true;
|
||||
} catch (Throwable t) {
|
||||
return false;
|
||||
}
|
||||
} else if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI(uri));
|
||||
return true;
|
||||
} catch (Throwable t) {
|
||||
return false;
|
||||
}
|
||||
} else if (SharedLibraryLoader.isLinux) {
|
||||
try {
|
||||
(new ProcessBuilder("xdg-open", (new URI(uri).toString()))).start();
|
||||
return true;
|
||||
} catch (Throwable t) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* FONT SUPPORT */
|
||||
|
||||
//custom pixel font, for use with Latin and Cyrillic languages
|
||||
|
||||
Reference in New Issue
Block a user