mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Add error traps to main render and resize functions
This commit is contained in:
@@ -123,15 +123,22 @@ public class Forge implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void setCurrentScreen(FScreen screen0) {
|
private static void setCurrentScreen(FScreen screen0) {
|
||||||
|
try {
|
||||||
Animation.endAll(); //end all active animations before switching screens
|
Animation.endAll(); //end all active animations before switching screens
|
||||||
|
|
||||||
currentScreen = screen0;
|
currentScreen = screen0;
|
||||||
currentScreen.setSize(screenWidth, screenHeight);
|
currentScreen.setSize(screenWidth, screenHeight);
|
||||||
currentScreen.onActivate();
|
currentScreen.onActivate();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
batch.end();
|
||||||
|
BugReporter.reportException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
|
try {
|
||||||
Animation.advanceAll();
|
Animation.advanceAll();
|
||||||
|
|
||||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Clear the screen.
|
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Clear the screen.
|
||||||
@@ -153,9 +160,15 @@ public class Forge implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
batch.end();
|
batch.end();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
batch.end();
|
||||||
|
BugReporter.reportException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resize(int width, int height) {
|
public void resize(int width, int height) {
|
||||||
|
try {
|
||||||
screenWidth = width;
|
screenWidth = width;
|
||||||
screenHeight = height;
|
screenHeight = height;
|
||||||
if (currentScreen != null) {
|
if (currentScreen != null) {
|
||||||
@@ -165,6 +178,11 @@ public class Forge implements ApplicationListener {
|
|||||||
splashScreen.setSize(width, height);
|
splashScreen.setSize(width, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
batch.end();
|
||||||
|
BugReporter.reportException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pause() {
|
public void pause() {
|
||||||
|
|||||||
Reference in New Issue
Block a user