Fixed crash with font loading too early in fullscreen on start

v5stable v5c
Ondřej Hruška 11 years ago
parent b3a0277034
commit 70283ae34d
  1. 6
      src/mightypork/gamecore/gui/screens/ScreenRegistry.java
  2. 8
      src/mightypork/gamecore/resources/BaseLazyResource.java
  3. 1
      src/mightypork/gamecore/resources/fonts/GLFont.java
  4. 1
      src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java
  5. 2
      src/mightypork/rogue/RogueApp.java

@ -6,6 +6,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;
import org.newdawn.slick.opengl.GLUtils;
import mightypork.gamecore.core.modules.AppAccess;
import mightypork.gamecore.core.modules.AppModule;
import mightypork.gamecore.gui.events.LayoutChangeEvent;
@ -83,6 +85,8 @@ public class ScreenRegistry extends AppModule implements ScreenRequestListener,
toShow.setActive(true);
active = toShow;
fireLayoutUpdateEvent();
}
@ -110,7 +114,7 @@ public class ScreenRegistry extends AppModule implements ScreenRequestListener,
@Override
public void onViewportChanged(ViewportChangeEvent event)
{
fireLayoutUpdateEvent();
if(active != null) fireLayoutUpdateEvent();
}

@ -36,8 +36,12 @@ public abstract class BaseLazyResource implements LazyResource, Destroyable {
@Override
public synchronized final void load()
{
if (loadFailed) return;
if (loadAttempted) return;
if (!loadFailed && loadAttempted) return;
//
// if (loadFailed) return;
// if (loadAttempted) return;
//
loadAttempted = true;
loadFailed = false;

@ -1,6 +1,7 @@
package mightypork.gamecore.resources.fonts;
import mightypork.gamecore.resources.TextureBasedResource;
import mightypork.gamecore.util.math.color.Color;
import mightypork.gamecore.util.math.constraints.vect.Vect;

@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map;
import mightypork.gamecore.logging.Log;
import mightypork.gamecore.resources.TextureBasedResource;
import mightypork.gamecore.resources.fonts.GLFont;
import mightypork.gamecore.resources.textures.FilterMode;
import mightypork.gamecore.resources.textures.LazyTexture;

@ -139,7 +139,7 @@ public final class RogueApp extends BaseApp implements ViewportChangeListener, S
getEventBus().send(new RogueStateRequest(RogueState.MAIN_MENU, true));
}
}
}, true));
}, false));
}

Loading…
Cancel
Save