2525import net .lax1dude .eaglercraft .v1_8 .PointerInputAbstraction ;
2626import net .lax1dude .eaglercraft .v1_8 .Touch ;
2727import net .lax1dude .eaglercraft .v1_8 .cookie .ServerCookieDataStore ;
28- import net .lax1dude .eaglercraft .v1_8 .internal .PlatformInput ;
2928
3029import org .apache .commons .lang3 .Validate ;
3130
@@ -228,7 +227,7 @@ public class Minecraft implements IThreadListener {
228227 private static Minecraft theMinecraft ;
229228 public PlayerControllerMP playerController ;
230229 private boolean fullscreen ;
231- private boolean enableGLErrorChecking = true ;
230+ private boolean enableGLErrorChecking = false ;
232231 private boolean hasCrashed ;
233232 private CrashReport crashReporter ;
234233 public int displayWidth ;
@@ -271,7 +270,7 @@ public class Minecraft implements IThreadListener {
271270 long systemTime = getSystemTime ();
272271 private int joinPlayerCounter ;
273272 public final FrameTimer field_181542_y = new FrameTimer ();
274- long field_181543_z = System .nanoTime ();
273+ long field_181543_z = EagRuntime .nanoTime ();
275274 private final boolean jvm64bit ;
276275 private EaglercraftNetworkManager myNetworkManager ;
277276 private boolean integratedServerIsRunning ;
@@ -347,6 +346,7 @@ public Minecraft(GameConfiguration gameConfig) {
347346 this .tempDisplayHeight = gameConfig .displayInfo .height ;
348347 this .fullscreen = gameConfig .displayInfo .fullscreen ;
349348 this .jvm64bit = isJvm64bit ();
349+ this .enableGLErrorChecking = EagRuntime .getConfiguration ().isCheckGLErrors ();
350350 String serverToJoin = EagRuntime .getConfiguration ().getServerToJoin ();
351351 if (serverToJoin != null ) {
352352 ServerAddress addr = AddressResolver .resolveAddressFromURI (serverToJoin );
@@ -795,14 +795,14 @@ public void shutdownMinecraftApplet() {
795795 if (SingleplayerServerController .isWorldRunning ()) {
796796 SingleplayerServerController .shutdownEaglercraftServer ();
797797 while (SingleplayerServerController .getStatusState () == IntegratedServerState .WORLD_UNLOADING ) {
798- EagUtils .sleep (50l );
798+ EagUtils .sleep (50 );
799799 SingleplayerServerController .runTick ();
800800 }
801801 }
802802 if (SingleplayerServerController .isIntegratedServerWorkerAlive ()
803803 && SingleplayerServerController .canKillWorker ()) {
804804 SingleplayerServerController .killWorker ();
805- EagUtils .sleep (50l );
805+ EagUtils .sleep (50 );
806806 }
807807 } finally {
808808 EagRuntime .destroy ();
@@ -817,7 +817,7 @@ public void shutdownMinecraftApplet() {
817817 * Called repeatedly from run()
818818 */
819819 private void runGameLoop () throws IOException {
820- long i = System .nanoTime ();
820+ long i = EagRuntime .nanoTime ();
821821 if (Display .isCloseRequested ()) {
822822 this .shutdown ();
823823 }
@@ -839,26 +839,16 @@ private void runGameLoop() throws IOException {
839839 }
840840 }
841841
842- long l = System .nanoTime ();
842+ long l = EagRuntime .nanoTime ();
843843
844- if (this .timer .elapsedTicks > 1 ) {
845- long watchdog = EagRuntime .steadyTimeMillis ();
846- for (int j = 0 ; j < this .timer .elapsedTicks ; ++j ) {
847- this .runTick ();
848- if (j < this .timer .elapsedTicks - 1 ) {
849- PointerInputAbstraction .runGameLoop ();
850- }
851- long millis = EagRuntime .steadyTimeMillis ();
852- if (millis - watchdog > 50l ) {
853- watchdog = millis ;
854- EagRuntime .immediateContinue ();
855- }
856- }
857- } else if (this .timer .elapsedTicks == 1 ) {
844+ for (int j = 0 ; j < this .timer .elapsedTicks ; ++j ) {
858845 this .runTick ();
846+ if (j < this .timer .elapsedTicks - 1 ) {
847+ PointerInputAbstraction .runGameLoop ();
848+ }
859849 }
860850
861- long i1 = System .nanoTime () - l ;
851+ long i1 = EagRuntime .nanoTime () - l ;
862852 this .checkGLError ("Pre render" );
863853 this .mcSoundHandler .setListener (this .thePlayer , this .timer .renderPartialTicks );
864854
@@ -887,7 +877,7 @@ private void runGameLoop() throws IOException {
887877 this .checkGLError ("Post render" );
888878
889879 ++this .fpsCounter ;
890- long k = System .nanoTime ();
880+ long k = EagRuntime .nanoTime ();
891881 this .field_181542_y .func_181747_a (k - this .field_181543_z );
892882 this .field_181543_z = k ;
893883
@@ -906,9 +896,9 @@ private void runGameLoop() throws IOException {
906896 this .fpsCounter = 0 ;
907897 }
908898
909- if (this .isFramerateLimitBelowMax ()) {
910- Display .sync (this .getLimitFramerate ());
911- }
899+ // if (this.isFramerateLimitBelowMax()) {
900+ // Display.sync(this.getLimitFramerate());
901+ // }
912902
913903 Mouse .tickCursorShape ();
914904 }
@@ -919,7 +909,11 @@ public void updateDisplay() {
919909 } else {
920910 this .gameSettings .enableVsync = false ;
921911 }
922- Display .update ();
912+ if (!this .gameSettings .enableVsync && this .isFramerateLimitBelowMax ()) {
913+ Display .update (this .getLimitFramerate ());
914+ } else {
915+ Display .update (0 );
916+ }
923917 this .checkWindowResize ();
924918 }
925919
@@ -1388,7 +1382,7 @@ public String call() throws Exception {
13881382
13891383 while (Keyboard .next ()) {
13901384 int k = Keyboard .getEventKey () == 0 ? Keyboard .getEventCharacter () + 256 : Keyboard .getEventKey ();
1391- if (k == 0x1D && (areKeysLocked () || isFullScreen ())) {
1385+ if (k == 0x1D && (Keyboard . areKeysLocked () || isFullScreen ())) {
13921386 KeyBinding .setKeyBindState (gameSettings .keyBindSprint .getKeyCode (), Keyboard .getEventKeyState ());
13931387 }
13941388 KeyBinding .setKeyBindState (k , Keyboard .getEventKeyState ());
@@ -2413,10 +2407,6 @@ public static int getGLMaximumTextureSize() {
24132407 return EaglercraftGPU .glGetInteger (GL_MAX_TEXTURE_SIZE );
24142408 }
24152409
2416- public boolean areKeysLocked () {
2417- return PlatformInput .lockKeys ;
2418- }
2419-
24202410 public ModelManager getModelManager () {
24212411 return modelManager ;
24222412 }
0 commit comments