Fallback atlas / Bugfixes / Cleanup

This commit is contained in:
Anuken
2020-06-11 15:25:46 -04:00
parent 1e954dc2be
commit ce9f515543
22 changed files with 19361 additions and 2346 deletions
+7 -1
View File
@@ -40,6 +40,11 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
Vars.platform = this;
beginTime = Time.millis();
//debug GL information
Log.info("[GL] Version: @", graphics.getGLVersion());
Log.info("[GL] Max texture size: @", Gl.getInt(Gl.maxTextureSize));
Log.info("[GL] OpenGL 3.0 context: @", gl30 != null);
Time.setDeltaProvider(() -> {
float result = Core.graphics.getDeltaTime() * 60f;
return (Float.isNaN(result) || Float.isInfinite(result)) ? 1f : Mathf.clamp(result, 0.0001f, 60f / 10f);
@@ -65,7 +70,8 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
Fonts.loadDefaultFont();
assets.load(new AssetDescriptor<>("sprites/sprites.atlas", TextureAtlas.class)).loaded = t -> {
//load fallback atlas if max texture size is below 4096
assets.load(new AssetDescriptor<>(Gl.getInt(Gl.maxTextureSize) >= 4096 ? "sprites/sprites.atlas" : "sprites/fallback/sprites.atlas", TextureAtlas.class)).loaded = t -> {
atlas = (TextureAtlas)t;
Fonts.mergeFontAtlas(atlas);
};