@@ -486,52 +486,57 @@ public boolean tick() {
486
486
return false ;
487
487
}
488
488
489
- if (assetTypeManager instanceof AutoReloadAssetTypeManager ) {
490
- try {
491
- ((AutoReloadAssetTypeManager ) assetTypeManager ).reloadChangedAssets ();
492
- } catch (IllegalStateException ignore ) {
493
- // ignore: This can happen if a module environment switch is happening in a different thread.
494
- return true ;
489
+ try {
490
+ if (assetTypeManager instanceof AutoReloadAssetTypeManager ) {
491
+ try {
492
+ ((AutoReloadAssetTypeManager ) assetTypeManager ).reloadChangedAssets ();
493
+ } catch (IllegalStateException ignore ) {
494
+ // ignore: This can happen if a module environment switch is happening in a different thread.
495
+ return true ;
496
+ }
495
497
}
496
- }
497
498
498
- processPendingState ();
499
+ processPendingState ();
499
500
500
- if (currentState == null ) {
501
- shutdown ();
502
- return false ;
503
- }
501
+ if (currentState == null ) {
502
+ shutdown ();
503
+ return false ;
504
+ }
504
505
505
- Iterator <Float > updateCycles = timeSubsystem .getEngineTime ().tick ();
506
- CoreRegistry .setContext (currentState .getContext ());
507
- rootContext .get (NetworkSystem .class ).setContext (currentState .getContext ());
506
+ Iterator <Float > updateCycles = timeSubsystem .getEngineTime ().tick ();
507
+ CoreRegistry .setContext (currentState .getContext ());
508
+ rootContext .get (NetworkSystem .class ).setContext (currentState .getContext ());
508
509
509
- for (EngineSubsystem subsystem : allSubsystems ) {
510
- try (Activity ignored = PerformanceMonitor .startActivity (subsystem .getName () + " PreUpdate" )) {
511
- subsystem .preUpdate (currentState , timeSubsystem .getEngineTime ().getRealDelta ());
510
+ for (EngineSubsystem subsystem : allSubsystems ) {
511
+ try (Activity ignored = PerformanceMonitor .startActivity (subsystem .getName () + " PreUpdate" )) {
512
+ subsystem .preUpdate (currentState , timeSubsystem .getEngineTime ().getRealDelta ());
513
+ }
512
514
}
513
- }
514
515
515
- while (updateCycles .hasNext ()) {
516
- float updateDelta = updateCycles .next (); // gameTime gets updated here!
517
- try (Activity ignored = PerformanceMonitor .startActivity ("Main Update" )) {
518
- currentState .update (updateDelta );
516
+ while (updateCycles .hasNext ()) {
517
+ float updateDelta = updateCycles .next (); // gameTime gets updated here!
518
+ try (Activity ignored = PerformanceMonitor .startActivity ("Main Update" )) {
519
+ currentState .update (updateDelta );
520
+ }
519
521
}
520
- }
521
522
522
- // Waiting processes are set by modules via GameThread.a/synch() methods.
523
- GameThread .processWaitingProcesses ();
523
+ // Waiting processes are set by modules via GameThread.a/synch() methods.
524
+ GameThread .processWaitingProcesses ();
524
525
525
- for (EngineSubsystem subsystem : getSubsystems ()) {
526
- try (Activity ignored = PerformanceMonitor .startActivity (subsystem .getName () + " Subsystem postUpdate" )) {
527
- subsystem .postUpdate (currentState , timeSubsystem .getEngineTime ().getRealDelta ());
526
+ for (EngineSubsystem subsystem : getSubsystems ()) {
527
+ try (Activity ignored = PerformanceMonitor .startActivity (subsystem .getName () + " Subsystem postUpdate" )) {
528
+ subsystem .postUpdate (currentState , timeSubsystem .getEngineTime ().getRealDelta ());
529
+ }
528
530
}
531
+ assetTypeManager .disposedUnusedAssets ();
532
+
533
+ PerformanceMonitor .rollCycle ();
534
+ PerformanceMonitor .startActivity ("Other" );
535
+ return true ;
536
+ } catch (Exception ignore ) {
537
+ ignore .printStackTrace ();
538
+ return true ;
529
539
}
530
- assetTypeManager .disposedUnusedAssets ();
531
-
532
- PerformanceMonitor .rollCycle ();
533
- PerformanceMonitor .startActivity ("Other" );
534
- return true ;
535
540
}
536
541
537
542
public void cleanup () {
0 commit comments