This commit is contained in:
Andrea Cavalli 2018-04-01 17:11:56 +02:00
parent 7b71053119
commit 7209e0dca1

View File

@ -19,6 +19,7 @@ public class MarioScreen extends Screen {
private static Skin groundskin; private static Skin groundskin;
private static BinaryFont gpuTest2; private static BinaryFont gpuTest2;
private static BinaryFont gpuTest1; private static BinaryFont gpuTest1;
private static boolean gpuTest12;
private static Skin gpuTest3; private static Skin gpuTest3;
private int gpuTestNum = 0; private int gpuTestNum = 0;
private float gpuTestElapsed = 0; private float gpuTestElapsed = 0;
@ -53,9 +54,15 @@ public class MarioScreen extends Screen {
gpuTest2 = DisplayManager.INSTANCE.engine.loadFont("gputest2"); gpuTest2 = DisplayManager.INSTANCE.engine.loadFont("gputest2");
} catch (Exception ex) {} } catch (Exception ex) {}
if (gpuTest1 == null) if (gpuTest1 == null)
try {
gpuTest1 = DisplayManager.INSTANCE.engine.loadFont("gputest12");
gpuTest12 = true;
} catch (Exception ex) {
gpuTest12 = false;
try { try {
gpuTest1 = DisplayManager.INSTANCE.engine.loadFont("gputest1"); gpuTest1 = DisplayManager.INSTANCE.engine.loadFont("gputest1");
} catch (Exception ex) {} } catch (Exception ex2) {}
}
if (gpuTest3 == null) if (gpuTest3 == null)
try { try {
gpuTest3 = DisplayManager.INSTANCE.engine.loadSkin("font_gputest3.png"); gpuTest3 = DisplayManager.INSTANCE.engine.loadSkin("font_gputest3.png");
@ -152,7 +159,7 @@ public class MarioScreen extends Screen {
// GPU PERFORMANCE TEST // GPU PERFORMANCE TEST
if (gpuTest1 != null) { if (gpuTest1 != null) {
DisplayManager.INSTANCE.renderer.glColor3f(1,1,1); DisplayManager.INSTANCE.renderer.glColor3f(1,1,1);
DisplayManager.INSTANCE.renderer.glFillColor(DisplayManager.INSTANCE.engine.getWidth()-256, DisplayManager.INSTANCE.engine.getHeight() / 2 - 128, 256, 256); DisplayManager.INSTANCE.renderer.glFillColor(DisplayManager.INSTANCE.engine.getWidth()-(gpuTest12 ? 512 : 256), DisplayManager.INSTANCE.engine.getHeight() / 2 - (gpuTest12 ? 256 : 128), gpuTest12 ? 512 : 256, gpuTest12 ? 512 : 256);
gpuTest1.use(DisplayManager.INSTANCE.engine); gpuTest1.use(DisplayManager.INSTANCE.engine);
DisplayManager.INSTANCE.renderer.glColor3f(0, 0, 0); DisplayManager.INSTANCE.renderer.glColor3f(0, 0, 0);
DisplayManager.INSTANCE.renderer.glDrawStringRight(DisplayManager.INSTANCE.engine.getWidth(), DisplayManager.INSTANCE.engine.getHeight() / 2 - 128, gpuCharTest1[gpuCharTest1Num]); DisplayManager.INSTANCE.renderer.glDrawStringRight(DisplayManager.INSTANCE.engine.getWidth(), DisplayManager.INSTANCE.engine.getHeight() / 2 - 128, gpuCharTest1[gpuCharTest1Num]);