From a4108f2caf2952245f74385790c62d94e2be02de Mon Sep 17 00:00:00 2001 From: MightyPork Date: Sun, 27 Jul 2014 00:02:54 +0200 Subject: [PATCH] cleanup and refactoring, package reorganization --- src/junk/AppInitOptions.java | 8 +- src/junk/BaseApp.java | 4 +- .../{resources => }/audio/AudioModule.java | 10 +- .../{resources => }/audio/DeferredAudio.java | 2 +- .../{resources => }/audio/IAudio.java | 2 +- .../{resources => }/audio/JointVolume.java | 2 +- .../{resources => }/audio/SoundRegistry.java | 6 +- .../{resources => }/audio/Volume.java | 2 +- .../audio/players/BaseAudioPlayer.java | 6 +- .../audio/players/EffectPlayer.java | 6 +- .../audio/players/LoopPlayer.java | 6 +- .../lwjgl}/BufferHelper.java | 2 +- .../lwjgl/InitTaskRedirectSlickLog.java | 6 +- .../lwjgl/LwjglBackend.java | 14 ++- .../lwjgl/SlickLogRedirector.java | 4 +- .../lwjgl/audio}/SlickAudio.java | 4 +- .../lwjgl/audio}/SlickAudioModule.java | 8 +- .../lwjgl/graphics}/AwtScreenshot.java | 4 +- .../lwjgl/graphics}/LwjglGraphicsModule.java | 10 +- .../lwjgl/graphics}/SlickTexture.java | 6 +- .../graphics/font/DeferredLwjglFont.java} | 104 ++---------------- .../font/DeferredLwjglFontFromSystem.java | 37 +++++++ .../font/LwjglTextureBackedFont.java} | 12 +- src/mightypork/gamecore/core/App.java | 22 ++-- .../Backend.java => core/AppBackend.java} | 25 ++++- .../core/{plugins => }/AppPlugin.java | 16 ++- .../{backend => core}/BackendModule.java | 2 +- .../gamecore/core/{init => }/InitTask.java | 22 ++-- src/mightypork/gamecore/core/MainLoop.java | 2 +- .../gamecore/core/OptionalInitTask.java | 19 ++++ .../gamecore/core/config/InitTaskConfig.java | 2 +- .../init/{impl => }/InitTaskCrashHandler.java | 4 +- .../core/init/{impl => }/InitTaskDisplay.java | 6 +- .../init/{impl => }/InitTaskIonizables.java | 4 +- .../core/init/{impl => }/InitTaskLog.java | 4 +- .../init/{impl => }/InitTaskLogHeader.java | 6 +- .../core/init/{impl => }/InitTaskWorkdir.java | 4 +- .../screenshot/InitTaskPluginScreenshot.java | 2 +- .../plugins/screenshot/ScreenshotPlugin.java | 2 +- .../screenshot/TaskTakeScreenshot.java | 2 +- .../FullscreenToggleRequest.java | 2 +- .../{render => graphics}/GraphicsModule.java | 8 +- .../{render => graphics}/Renderable.java | 2 +- .../{render => graphics}/Screenshot.java | 2 +- .../gamecore/graphics/fonts/DeferredFont.java | 98 +++++++++++++++++ .../fonts/FontRegistry.java | 10 +- .../fonts/FontRenderer.java | 2 +- .../{resources => graphics}/fonts/Glyphs.java | 2 +- .../{resources => graphics}/fonts/IFont.java | 2 +- .../textures/DeferredTexture.java | 4 +- .../textures/FilterMode.java | 2 +- .../textures/ITexture.java | 2 +- .../textures/QuadGrid.java | 2 +- .../textures/TextureRegistry.java | 4 +- .../textures/TxQuad.java | 2 +- .../textures/TxSheet.java | 2 +- .../textures/WrapMode.java | 2 +- .../gui/components/BaseComponent.java | 2 +- .../gui/components/PluggableRenderable.java | 2 +- .../gui/components/input/TextButton.java | 2 +- .../gui/components/painters/ImagePainter.java | 2 +- .../gui/components/painters/TextPainter.java | 4 +- .../gamecore/gui/screens/Overlay.java | 2 +- .../gamecore/gui/screens/Screen.java | 2 +- .../gamecore/gui/screens/ScreenRegistry.java | 2 +- src/mightypork/gamecore/resources/Res.java | 18 +-- .../gamecore/resources/ResourceSetup.java | 6 +- .../resources/fonts/impl/LazyFontNative.java | 40 ------- .../{ => loading}/AsyncResourceLoader.java | 3 +- .../MustLoadInRenderingContext.java | 2 +- .../{ => loading}/ResourceLoadRequest.java | 3 +- .../{ => loading}/ResourceLoader.java | 4 +- src/mightypork/rogue/RogueApp.java | 6 +- src/mightypork/rogue/RogueResources.java | 27 ++--- src/mightypork/rogue/screens/FpsOverlay.java | 2 +- .../rogue/screens/game/HeartBar.java | 2 +- .../rogue/screens/game/IngameNav.java | 2 +- .../rogue/screens/game/InvSlot.java | 2 +- .../rogue/screens/game/LayerAskSave.java | 2 +- .../rogue/screens/game/LayerDeath.java | 2 +- .../rogue/screens/game/LayerWin.java | 2 +- .../rogue/screens/game/NavButton.java | 2 +- .../rogue/screens/menu/ScreenMainMenu.java | 2 +- .../rogue/screens/select_world/WorldSlot.java | 2 +- src/mightypork/rogue/world/WorldRenderer.java | 2 +- .../entity/render/EntityRendererMobLR.java | 4 +- .../rogue/world/gui/WorldConsoleRenderer.java | 2 +- .../world/item/render/QuadItemRenderer.java | 2 +- .../rogue/world/tile/TileRenderer.java | 4 +- .../rogue/world/tile/impl/TileBaseDoor.java | 2 +- .../rogue/world/tile/impl/TileBaseFloor.java | 2 +- .../world/tile/impl/TileBasePassage.java | 2 +- .../world/tile/impl/TileBaseSecretDoor.java | 2 +- .../rogue/world/tile/impl/TileBaseWall.java | 2 +- .../world/tile/render/BasicTileRenderer.java | 2 +- .../world/tile/render/ChestRenderer.java | 2 +- .../world/tile/render/DoorTileRenderer.java | 2 +- .../tile/render/OneFrameTileRenderer.java | 2 +- .../tile/render/TwoHighTileRenderer.java | 2 +- 99 files changed, 402 insertions(+), 336 deletions(-) rename src/mightypork/gamecore/{resources => }/audio/AudioModule.java (93%) rename src/mightypork/gamecore/{resources => }/audio/DeferredAudio.java (95%) rename src/mightypork/gamecore/{resources => }/audio/IAudio.java (97%) rename src/mightypork/gamecore/{resources => }/audio/JointVolume.java (94%) rename src/mightypork/gamecore/{resources => }/audio/SoundRegistry.java (91%) rename src/mightypork/gamecore/{resources => }/audio/Volume.java (89%) rename src/mightypork/gamecore/{resources => }/audio/players/BaseAudioPlayer.java (91%) rename src/mightypork/gamecore/{resources => }/audio/players/EffectPlayer.java (87%) rename src/mightypork/gamecore/{resources => }/audio/players/LoopPlayer.java (94%) rename src/mightypork/gamecore/{util => backends/lwjgl}/BufferHelper.java (95%) rename src/mightypork/gamecore/{backend => backends}/lwjgl/InitTaskRedirectSlickLog.java (79%) rename src/mightypork/gamecore/{backend => backends}/lwjgl/LwjglBackend.java (51%) rename src/mightypork/gamecore/{backend => backends}/lwjgl/SlickLogRedirector.java (88%) rename src/mightypork/gamecore/{backend/lwjgl => backends/lwjgl/audio}/SlickAudio.java (96%) rename src/mightypork/gamecore/{backend/lwjgl => backends/lwjgl/audio}/SlickAudioModule.java (89%) rename src/mightypork/gamecore/{backend/lwjgl => backends/lwjgl/graphics}/AwtScreenshot.java (94%) rename src/mightypork/gamecore/{backend/lwjgl => backends/lwjgl/graphics}/LwjglGraphicsModule.java (97%) rename src/mightypork/gamecore/{backend/lwjgl => backends/lwjgl/graphics}/SlickTexture.java (95%) rename src/mightypork/gamecore/{resources/fonts/impl/LazyFont.java => backends/lwjgl/graphics/font/DeferredLwjglFont.java} (52%) create mode 100644 src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFontFromSystem.java rename src/mightypork/gamecore/{resources/fonts/impl/TextureBackedFont.java => backends/lwjgl/graphics/font/LwjglTextureBackedFont.java} (96%) rename src/mightypork/gamecore/{backend/Backend.java => core/AppBackend.java} (63%) rename src/mightypork/gamecore/core/{plugins => }/AppPlugin.java (78%) rename src/mightypork/gamecore/{backend => core}/BackendModule.java (90%) rename src/mightypork/gamecore/core/{init => }/InitTask.java (89%) create mode 100644 src/mightypork/gamecore/core/OptionalInitTask.java rename src/mightypork/gamecore/core/init/{impl => }/InitTaskCrashHandler.java (89%) rename src/mightypork/gamecore/core/init/{impl => }/InitTaskDisplay.java (91%) rename src/mightypork/gamecore/core/init/{impl => }/InitTaskIonizables.java (93%) rename src/mightypork/gamecore/core/init/{impl => }/InitTaskLog.java (96%) rename src/mightypork/gamecore/core/init/{impl => }/InitTaskLogHeader.java (87%) rename src/mightypork/gamecore/core/init/{impl => }/InitTaskWorkdir.java (96%) rename src/mightypork/gamecore/{render => graphics}/FullscreenToggleRequest.java (88%) rename src/mightypork/gamecore/{render => graphics}/GraphicsModule.java (97%) rename src/mightypork/gamecore/{render => graphics}/Renderable.java (80%) rename src/mightypork/gamecore/{render => graphics}/Screenshot.java (95%) create mode 100644 src/mightypork/gamecore/graphics/fonts/DeferredFont.java rename src/mightypork/gamecore/{resources => graphics}/fonts/FontRegistry.java (82%) rename src/mightypork/gamecore/{resources => graphics}/fonts/FontRenderer.java (98%) rename src/mightypork/gamecore/{resources => graphics}/fonts/Glyphs.java (95%) rename src/mightypork/gamecore/{resources => graphics}/fonts/IFont.java (96%) rename src/mightypork/gamecore/{resources => graphics}/textures/DeferredTexture.java (89%) rename src/mightypork/gamecore/{resources => graphics}/textures/FilterMode.java (72%) rename src/mightypork/gamecore/{resources => graphics}/textures/ITexture.java (95%) rename src/mightypork/gamecore/{resources => graphics}/textures/QuadGrid.java (97%) rename src/mightypork/gamecore/{resources => graphics}/textures/TextureRegistry.java (96%) rename src/mightypork/gamecore/{resources => graphics}/textures/TxQuad.java (98%) rename src/mightypork/gamecore/{resources => graphics}/textures/TxSheet.java (97%) rename src/mightypork/gamecore/{resources => graphics}/textures/WrapMode.java (70%) delete mode 100644 src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java rename src/mightypork/gamecore/resources/{ => loading}/AsyncResourceLoader.java (96%) rename src/mightypork/gamecore/resources/{ => loading}/MustLoadInRenderingContext.java (87%) rename src/mightypork/gamecore/resources/{ => loading}/ResourceLoadRequest.java (85%) rename src/mightypork/gamecore/resources/{ => loading}/ResourceLoader.java (80%) diff --git a/src/junk/AppInitOptions.java b/src/junk/AppInitOptions.java index 25a6412..3066eb1 100644 --- a/src/junk/AppInitOptions.java +++ b/src/junk/AppInitOptions.java @@ -6,10 +6,10 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import mightypork.gamecore.backend.Backend; -import mightypork.gamecore.resources.AsyncResourceLoader; -import mightypork.gamecore.resources.ResourceLoader; +import mightypork.gamecore.core.AppBackend; import mightypork.gamecore.resources.ResourceSetup; +import mightypork.gamecore.resources.loading.AsyncResourceLoader; +import mightypork.gamecore.resources.loading.ResourceLoader; /** @@ -62,7 +62,7 @@ public class AppInitOptions { } - public void setBackend(Backend backend) + public void setBackend(AppBackend backend) { this.backend = backend; } diff --git a/src/junk/BaseApp.java b/src/junk/BaseApp.java index 1eb055f..d64c01d 100644 --- a/src/junk/BaseApp.java +++ b/src/junk/BaseApp.java @@ -3,8 +3,8 @@ package junk; import java.lang.Thread.UncaughtExceptionHandler; -import mightypork.gamecore.backend.Backend; import mightypork.gamecore.core.App; +import mightypork.gamecore.core.AppBackend; import mightypork.gamecore.core.MainLoop; import mightypork.gamecore.core.WorkDir; import mightypork.gamecore.core.config.Config; @@ -50,7 +50,7 @@ public abstract class BaseApp extends App implements UncaughtExceptionHandler { } - public BaseApp(Backend backend) { + public BaseApp(AppBackend backend) { super(backend); } diff --git a/src/mightypork/gamecore/resources/audio/AudioModule.java b/src/mightypork/gamecore/audio/AudioModule.java similarity index 93% rename from src/mightypork/gamecore/resources/audio/AudioModule.java rename to src/mightypork/gamecore/audio/AudioModule.java index c3420d8..9112fd3 100644 --- a/src/mightypork/gamecore/resources/audio/AudioModule.java +++ b/src/mightypork/gamecore/audio/AudioModule.java @@ -1,14 +1,14 @@ -package mightypork.gamecore.resources.audio; +package mightypork.gamecore.audio; import java.util.ArrayList; import java.util.List; -import mightypork.gamecore.backend.BackendModule; +import mightypork.gamecore.audio.players.EffectPlayer; +import mightypork.gamecore.audio.players.LoopPlayer; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.ResourceLoadRequest; -import mightypork.gamecore.resources.audio.players.EffectPlayer; -import mightypork.gamecore.resources.audio.players.LoopPlayer; +import mightypork.gamecore.core.BackendModule; +import mightypork.gamecore.resources.loading.ResourceLoadRequest; import mightypork.utils.interfaces.Updateable; import mightypork.utils.math.constraints.vect.Vect; diff --git a/src/mightypork/gamecore/resources/audio/DeferredAudio.java b/src/mightypork/gamecore/audio/DeferredAudio.java similarity index 95% rename from src/mightypork/gamecore/resources/audio/DeferredAudio.java rename to src/mightypork/gamecore/audio/DeferredAudio.java index 6d7031c..8dd72c1 100644 --- a/src/mightypork/gamecore/resources/audio/DeferredAudio.java +++ b/src/mightypork/gamecore/audio/DeferredAudio.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.audio; +package mightypork.gamecore.audio; import mightypork.gamecore.core.App; diff --git a/src/mightypork/gamecore/resources/audio/IAudio.java b/src/mightypork/gamecore/audio/IAudio.java similarity index 97% rename from src/mightypork/gamecore/resources/audio/IAudio.java rename to src/mightypork/gamecore/audio/IAudio.java index 08db207..a89d2c1 100644 --- a/src/mightypork/gamecore/resources/audio/IAudio.java +++ b/src/mightypork/gamecore/audio/IAudio.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.audio; +package mightypork.gamecore.audio; import mightypork.utils.interfaces.Destroyable; diff --git a/src/mightypork/gamecore/resources/audio/JointVolume.java b/src/mightypork/gamecore/audio/JointVolume.java similarity index 94% rename from src/mightypork/gamecore/resources/audio/JointVolume.java rename to src/mightypork/gamecore/audio/JointVolume.java index 52c92f3..ab186ac 100644 --- a/src/mightypork/gamecore/resources/audio/JointVolume.java +++ b/src/mightypork/gamecore/audio/JointVolume.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.audio; +package mightypork.gamecore.audio; import mightypork.utils.math.Calc; diff --git a/src/mightypork/gamecore/resources/audio/SoundRegistry.java b/src/mightypork/gamecore/audio/SoundRegistry.java similarity index 91% rename from src/mightypork/gamecore/resources/audio/SoundRegistry.java rename to src/mightypork/gamecore/audio/SoundRegistry.java index 0003e8f..1aaf03d 100644 --- a/src/mightypork/gamecore/resources/audio/SoundRegistry.java +++ b/src/mightypork/gamecore/audio/SoundRegistry.java @@ -1,12 +1,12 @@ -package mightypork.gamecore.resources.audio; +package mightypork.gamecore.audio; import java.util.HashMap; import java.util.Map; +import mightypork.gamecore.audio.players.EffectPlayer; +import mightypork.gamecore.audio.players.LoopPlayer; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.audio.players.EffectPlayer; -import mightypork.gamecore.resources.audio.players.LoopPlayer; /** diff --git a/src/mightypork/gamecore/resources/audio/Volume.java b/src/mightypork/gamecore/audio/Volume.java similarity index 89% rename from src/mightypork/gamecore/resources/audio/Volume.java rename to src/mightypork/gamecore/audio/Volume.java index 49b36f2..3e8a55d 100644 --- a/src/mightypork/gamecore/resources/audio/Volume.java +++ b/src/mightypork/gamecore/audio/Volume.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.audio; +package mightypork.gamecore.audio; import mightypork.utils.math.Calc; diff --git a/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java b/src/mightypork/gamecore/audio/players/BaseAudioPlayer.java similarity index 91% rename from src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java rename to src/mightypork/gamecore/audio/players/BaseAudioPlayer.java index bafc50a..78a240e 100644 --- a/src/mightypork/gamecore/resources/audio/players/BaseAudioPlayer.java +++ b/src/mightypork/gamecore/audio/players/BaseAudioPlayer.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.resources.audio.players; +package mightypork.gamecore.audio.players; -import mightypork.gamecore.resources.audio.DeferredAudio; -import mightypork.gamecore.resources.audio.Volume; +import mightypork.gamecore.audio.DeferredAudio; +import mightypork.gamecore.audio.Volume; import mightypork.utils.interfaces.Destroyable; diff --git a/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java b/src/mightypork/gamecore/audio/players/EffectPlayer.java similarity index 87% rename from src/mightypork/gamecore/resources/audio/players/EffectPlayer.java rename to src/mightypork/gamecore/audio/players/EffectPlayer.java index 600aa7f..624ffde 100644 --- a/src/mightypork/gamecore/resources/audio/players/EffectPlayer.java +++ b/src/mightypork/gamecore/audio/players/EffectPlayer.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.resources.audio.players; +package mightypork.gamecore.audio.players; -import mightypork.gamecore.resources.audio.DeferredAudio; -import mightypork.gamecore.resources.audio.Volume; +import mightypork.gamecore.audio.DeferredAudio; +import mightypork.gamecore.audio.Volume; import mightypork.utils.math.constraints.vect.Vect; diff --git a/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java b/src/mightypork/gamecore/audio/players/LoopPlayer.java similarity index 94% rename from src/mightypork/gamecore/resources/audio/players/LoopPlayer.java rename to src/mightypork/gamecore/audio/players/LoopPlayer.java index 9892b8b..714a6c9 100644 --- a/src/mightypork/gamecore/resources/audio/players/LoopPlayer.java +++ b/src/mightypork/gamecore/audio/players/LoopPlayer.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.resources.audio.players; +package mightypork.gamecore.audio.players; -import mightypork.gamecore.resources.audio.DeferredAudio; -import mightypork.gamecore.resources.audio.Volume; +import mightypork.gamecore.audio.DeferredAudio; +import mightypork.gamecore.audio.Volume; import mightypork.utils.interfaces.Pauseable; import mightypork.utils.interfaces.Updateable; import mightypork.utils.math.animation.NumAnimated; diff --git a/src/mightypork/gamecore/util/BufferHelper.java b/src/mightypork/gamecore/backends/lwjgl/BufferHelper.java similarity index 95% rename from src/mightypork/gamecore/util/BufferHelper.java rename to src/mightypork/gamecore/backends/lwjgl/BufferHelper.java index 3e1a001..3e38b3b 100644 --- a/src/mightypork/gamecore/util/BufferHelper.java +++ b/src/mightypork/gamecore/backends/lwjgl/BufferHelper.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.util; +package mightypork.gamecore.backends.lwjgl; import java.nio.FloatBuffer; diff --git a/src/mightypork/gamecore/backend/lwjgl/InitTaskRedirectSlickLog.java b/src/mightypork/gamecore/backends/lwjgl/InitTaskRedirectSlickLog.java similarity index 79% rename from src/mightypork/gamecore/backend/lwjgl/InitTaskRedirectSlickLog.java rename to src/mightypork/gamecore/backends/lwjgl/InitTaskRedirectSlickLog.java index 83446c3..a951141 100644 --- a/src/mightypork/gamecore/backend/lwjgl/InitTaskRedirectSlickLog.java +++ b/src/mightypork/gamecore/backends/lwjgl/InitTaskRedirectSlickLog.java @@ -1,7 +1,8 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl; -import mightypork.gamecore.core.init.InitTask; +import mightypork.gamecore.core.InitTask; +import mightypork.gamecore.core.OptionalInitTask; import mightypork.utils.logging.writers.LogWriter; @@ -10,6 +11,7 @@ import mightypork.utils.logging.writers.LogWriter; * * @author Ondřej Hruška (MightyPork) */ +@OptionalInitTask public class InitTaskRedirectSlickLog extends InitTask { @Override diff --git a/src/mightypork/gamecore/backend/lwjgl/LwjglBackend.java b/src/mightypork/gamecore/backends/lwjgl/LwjglBackend.java similarity index 51% rename from src/mightypork/gamecore/backend/lwjgl/LwjglBackend.java rename to src/mightypork/gamecore/backends/lwjgl/LwjglBackend.java index 8a2abd6..00d59d7 100644 --- a/src/mightypork/gamecore/backend/lwjgl/LwjglBackend.java +++ b/src/mightypork/gamecore/backends/lwjgl/LwjglBackend.java @@ -1,9 +1,11 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl; -import mightypork.gamecore.backend.Backend; -import mightypork.gamecore.render.GraphicsModule; -import mightypork.gamecore.resources.audio.AudioModule; +import mightypork.gamecore.audio.AudioModule; +import mightypork.gamecore.backends.lwjgl.audio.SlickAudioModule; +import mightypork.gamecore.backends.lwjgl.graphics.LwjglGraphicsModule; +import mightypork.gamecore.core.AppBackend; +import mightypork.gamecore.graphics.GraphicsModule; /** @@ -11,7 +13,7 @@ import mightypork.gamecore.resources.audio.AudioModule; * * @author MightyPork */ -public class LwjglBackend extends Backend { +public class LwjglBackend extends AppBackend { private LwjglGraphicsModule graphics; private SlickAudioModule audio; @@ -22,6 +24,8 @@ public class LwjglBackend extends Backend { { addChildClient(graphics = new LwjglGraphicsModule()); addChildClient(audio = new SlickAudioModule()); + + app.addInitTask(new InitTaskRedirectSlickLog()); } diff --git a/src/mightypork/gamecore/backend/lwjgl/SlickLogRedirector.java b/src/mightypork/gamecore/backends/lwjgl/SlickLogRedirector.java similarity index 88% rename from src/mightypork/gamecore/backend/lwjgl/SlickLogRedirector.java rename to src/mightypork/gamecore/backends/lwjgl/SlickLogRedirector.java index 43d0757..3aec98f 100644 --- a/src/mightypork/gamecore/backend/lwjgl/SlickLogRedirector.java +++ b/src/mightypork/gamecore/backends/lwjgl/SlickLogRedirector.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl; import java.util.logging.Level; @@ -11,7 +11,7 @@ import mightypork.utils.logging.writers.LogWriter; * * @author Ondřej Hruška (MightyPork) */ -public class SlickLogRedirector implements org.newdawn.slick.util.LogSystem { +class SlickLogRedirector implements org.newdawn.slick.util.LogSystem { LogWriter writer; diff --git a/src/mightypork/gamecore/backend/lwjgl/SlickAudio.java b/src/mightypork/gamecore/backends/lwjgl/audio/SlickAudio.java similarity index 96% rename from src/mightypork/gamecore/backend/lwjgl/SlickAudio.java rename to src/mightypork/gamecore/backends/lwjgl/audio/SlickAudio.java index 4677c7e..2928712 100644 --- a/src/mightypork/gamecore/backend/lwjgl/SlickAudio.java +++ b/src/mightypork/gamecore/backends/lwjgl/audio/SlickAudio.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl.audio; import java.io.IOException; import java.io.InputStream; -import mightypork.gamecore.resources.audio.DeferredAudio; +import mightypork.gamecore.audio.DeferredAudio; import mightypork.utils.files.FileUtil; import org.lwjgl.openal.AL10; diff --git a/src/mightypork/gamecore/backend/lwjgl/SlickAudioModule.java b/src/mightypork/gamecore/backends/lwjgl/audio/SlickAudioModule.java similarity index 89% rename from src/mightypork/gamecore/backend/lwjgl/SlickAudioModule.java rename to src/mightypork/gamecore/backends/lwjgl/audio/SlickAudioModule.java index c5148f2..30d379d 100644 --- a/src/mightypork/gamecore/backend/lwjgl/SlickAudioModule.java +++ b/src/mightypork/gamecore/backends/lwjgl/audio/SlickAudioModule.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl.audio; import java.nio.FloatBuffer; -import mightypork.gamecore.resources.audio.AudioModule; -import mightypork.gamecore.resources.audio.DeferredAudio; -import mightypork.gamecore.util.BufferHelper; +import mightypork.gamecore.audio.AudioModule; +import mightypork.gamecore.audio.DeferredAudio; +import mightypork.gamecore.backends.lwjgl.BufferHelper; import mightypork.utils.logging.Log; import mightypork.utils.math.constraints.vect.Vect; import mightypork.utils.math.constraints.vect.var.VectVar; diff --git a/src/mightypork/gamecore/backend/lwjgl/AwtScreenshot.java b/src/mightypork/gamecore/backends/lwjgl/graphics/AwtScreenshot.java similarity index 94% rename from src/mightypork/gamecore/backend/lwjgl/AwtScreenshot.java rename to src/mightypork/gamecore/backends/lwjgl/graphics/AwtScreenshot.java index 5a3ced1..fa11ce7 100644 --- a/src/mightypork/gamecore/backend/lwjgl/AwtScreenshot.java +++ b/src/mightypork/gamecore/backends/lwjgl/graphics/AwtScreenshot.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl.graphics; import java.awt.image.BufferedImage; @@ -8,7 +8,7 @@ import java.nio.ByteBuffer; import javax.imageio.ImageIO; -import mightypork.gamecore.render.Screenshot; +import mightypork.gamecore.graphics.Screenshot; /** diff --git a/src/mightypork/gamecore/backend/lwjgl/LwjglGraphicsModule.java b/src/mightypork/gamecore/backends/lwjgl/graphics/LwjglGraphicsModule.java similarity index 97% rename from src/mightypork/gamecore/backend/lwjgl/LwjglGraphicsModule.java rename to src/mightypork/gamecore/backends/lwjgl/graphics/LwjglGraphicsModule.java index 6a01cd4..dccc72e 100644 --- a/src/mightypork/gamecore/backend/lwjgl/LwjglGraphicsModule.java +++ b/src/mightypork/gamecore/backends/lwjgl/graphics/LwjglGraphicsModule.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl.graphics; import static org.lwjgl.opengl.GL11.*; @@ -7,11 +7,11 @@ import java.nio.ByteBuffer; import java.util.Stack; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.GraphicsModule; +import mightypork.gamecore.graphics.Screenshot; +import mightypork.gamecore.graphics.textures.DeferredTexture; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.gui.events.ViewportChangeEvent; -import mightypork.gamecore.render.GraphicsModule; -import mightypork.gamecore.render.Screenshot; -import mightypork.gamecore.resources.textures.DeferredTexture; -import mightypork.gamecore.resources.textures.TxQuad; import mightypork.utils.logging.Log; import mightypork.utils.math.color.Color; import mightypork.utils.math.color.Grad; diff --git a/src/mightypork/gamecore/backend/lwjgl/SlickTexture.java b/src/mightypork/gamecore/backends/lwjgl/graphics/SlickTexture.java similarity index 95% rename from src/mightypork/gamecore/backend/lwjgl/SlickTexture.java rename to src/mightypork/gamecore/backends/lwjgl/graphics/SlickTexture.java index 4e8b3ba..2498c4b 100644 --- a/src/mightypork/gamecore/backend/lwjgl/SlickTexture.java +++ b/src/mightypork/gamecore/backends/lwjgl/graphics/SlickTexture.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.backend.lwjgl; +package mightypork.gamecore.backends.lwjgl.graphics; import java.io.IOException; -import mightypork.gamecore.resources.MustLoadInRenderingContext; -import mightypork.gamecore.resources.textures.DeferredTexture; +import mightypork.gamecore.graphics.textures.DeferredTexture; +import mightypork.gamecore.resources.loading.MustLoadInRenderingContext; import mightypork.utils.annotations.Alias; import mightypork.utils.exceptions.IllegalValueException; import mightypork.utils.files.FileUtil; diff --git a/src/mightypork/gamecore/resources/fonts/impl/LazyFont.java b/src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFont.java similarity index 52% rename from src/mightypork/gamecore/resources/fonts/impl/LazyFont.java rename to src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFont.java index e3f6a20..af9e25d 100644 --- a/src/mightypork/gamecore/resources/fonts/impl/LazyFont.java +++ b/src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFont.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.fonts.impl; +package mightypork.gamecore.backends.lwjgl.graphics.font; import java.awt.Font; @@ -6,10 +6,9 @@ import java.awt.FontFormatException; import java.io.IOException; import java.io.InputStream; -import mightypork.gamecore.resources.BaseDeferredResource; -import mightypork.gamecore.resources.MustLoadInRenderingContext; -import mightypork.gamecore.resources.fonts.IFont; -import mightypork.gamecore.resources.textures.FilterMode; +import mightypork.gamecore.graphics.fonts.DeferredFont; +import mightypork.gamecore.graphics.fonts.IFont; +import mightypork.gamecore.resources.loading.MustLoadInRenderingContext; import mightypork.utils.annotations.Alias; import mightypork.utils.files.FileUtil; import mightypork.utils.math.color.Color; @@ -23,42 +22,11 @@ import mightypork.utils.math.constraints.vect.Vect; */ @MustLoadInRenderingContext @Alias(name = "Font") -public class LazyFont extends BaseDeferredResource implements IFont { - - public static enum FontStyle - { - PLAIN(Font.PLAIN), BOLD(Font.BOLD), ITALIC(Font.ITALIC), BOLD_ITALIC(Font.BOLD + Font.ITALIC); - - int numval; - - - private FontStyle(int style) { - this.numval = style; - } - } +public class DeferredLwjglFont extends DeferredFont { private IFont font = null; - private double size; - private FontStyle style; - private String chars; - private FilterMode filter; - private boolean antialias; - private double discardTop; - private double discardBottom; - /** - * A font from resource; setters shall be used to specify parameters in - * greater detail. - * - * @param resourcePath resource to load - * @param chars chars to load; null to load basic chars only - * @param size size (px) - */ - public LazyFont(String resourcePath, String chars, double size) { - this(resourcePath, chars, size, FontStyle.PLAIN, false, FilterMode.NEAREST); - } - /** * A font from resource @@ -66,47 +34,11 @@ public class LazyFont extends BaseDeferredResource implements IFont { * @param resourcePath resource to load * @param chars chars to load; null to load basic chars only * @param size size (px) - * @param style font style - * @param antialias use antialiasing for caching texture - * @param filter gl filtering mode */ - public LazyFont(String resourcePath, String chars, double size, FontStyle style, boolean antialias, FilterMode filter) { + public DeferredLwjglFont(String resourcePath, String chars, double size) { super(resourcePath); this.size = size; - this.style = style; this.chars = chars; - this.filter = filter; - this.antialias = antialias; - } - - - public synchronized void setSize(double size) - { - this.size = size; - } - - - public synchronized void setStyle(FontStyle style) - { - this.style = style; - } - - - public synchronized void setChars(String chars) - { - this.chars = chars; - } - - - public synchronized void setFilter(FilterMode filter) - { - this.filter = filter; - } - - - public synchronized void setAntialias(boolean antialias) - { - this.antialias = antialias; } @@ -115,7 +47,7 @@ public class LazyFont extends BaseDeferredResource implements IFont { { final Font awtFont = getAwtFont(path, (float) size, style.numval); - font = new TextureBackedFont(awtFont, antialias, filter, chars); + font = new LwjglTextureBackedFont(awtFont, antialias, filter, chars); font.setDiscardRatio(discardTop, discardBottom); } @@ -209,26 +141,4 @@ public class LazyFont extends BaseDeferredResource implements IFont { // this will have to suffice font = null; } - - - @Override - public void setDiscardRatio(double top, double bottom) - { - discardTop = top; - discardBottom = bottom; - } - - - @Override - public double getTopDiscardRatio() - { - return discardTop; - } - - - @Override - public double getBottomDiscardRatio() - { - return discardBottom; - } } diff --git a/src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFontFromSystem.java b/src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFontFromSystem.java new file mode 100644 index 0000000..6899e19 --- /dev/null +++ b/src/mightypork/gamecore/backends/lwjgl/graphics/font/DeferredLwjglFontFromSystem.java @@ -0,0 +1,37 @@ +package mightypork.gamecore.backends.lwjgl.graphics.font; + + +import java.awt.Font; +import java.io.IOException; + +import mightypork.gamecore.graphics.textures.FilterMode; +import mightypork.utils.annotations.Alias; + + +/** + * Font obtained from the OS + * + * @author Ondřej Hruška (MightyPork) + */ +@Alias(name = "FontNative") +public class DeferredLwjglFontFromSystem extends DeferredLwjglFont { + + /** + * A font from OS, found by name + * + * @param fontName font family name + * @param chars chars to load; null to load basic chars only + * @param size size (pt) + */ + public DeferredLwjglFontFromSystem(String fontName, String chars, double size) { + super(fontName, chars, size); + } + + + @Override + protected Font getAwtFont(String resource, float size, int style) throws IOException + { + return new Font(resource, style, (int) size); + } + +} diff --git a/src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java b/src/mightypork/gamecore/backends/lwjgl/graphics/font/LwjglTextureBackedFont.java similarity index 96% rename from src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java rename to src/mightypork/gamecore/backends/lwjgl/graphics/font/LwjglTextureBackedFont.java index 82821fa..6042349 100644 --- a/src/mightypork/gamecore/resources/fonts/impl/TextureBackedFont.java +++ b/src/mightypork/gamecore/backends/lwjgl/graphics/font/LwjglTextureBackedFont.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.fonts.impl; +package mightypork.gamecore.backends.lwjgl.graphics.font; import static org.lwjgl.opengl.GL11.*; @@ -18,8 +18,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import mightypork.gamecore.resources.fonts.IFont; -import mightypork.gamecore.resources.textures.FilterMode; +import mightypork.gamecore.graphics.fonts.IFont; +import mightypork.gamecore.graphics.textures.FilterMode; import mightypork.utils.exceptions.IllegalValueException; import mightypork.utils.logging.Log; import mightypork.utils.math.color.Color; @@ -41,7 +41,7 @@ import org.newdawn.slick.opengl.GLUtils; * @author David Aaron Muhar (bobjob) * @author Ondřej Hruška (MightyPork) */ -public class TextureBackedFont implements IFont { +public class LwjglTextureBackedFont implements IFont { private class CharTile { @@ -90,7 +90,7 @@ public class TextureBackedFont implements IFont { * @param filter used Gl filter * @param chars chars to load */ - public TextureBackedFont(java.awt.Font font, boolean antialias, FilterMode filter, String chars) { + public LwjglTextureBackedFont(java.awt.Font font, boolean antialias, FilterMode filter, String chars) { this(font, antialias, filter, (" " + chars).toCharArray()); } @@ -103,7 +103,7 @@ public class TextureBackedFont implements IFont { * @param filter used Gl filter * @param chars chars to load */ - public TextureBackedFont(java.awt.Font font, boolean antialias, FilterMode filter, char[] chars) { + public LwjglTextureBackedFont(java.awt.Font font, boolean antialias, FilterMode filter, char[] chars) { GLUtils.checkGLContext(); this.font = font; diff --git a/src/mightypork/gamecore/core/App.java b/src/mightypork/gamecore/core/App.java index 1b49383..bdd3a3a 100644 --- a/src/mightypork/gamecore/core/App.java +++ b/src/mightypork/gamecore/core/App.java @@ -6,12 +6,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import mightypork.gamecore.backend.Backend; +import mightypork.gamecore.audio.AudioModule; import mightypork.gamecore.core.config.Config; -import mightypork.gamecore.core.init.InitTask; -import mightypork.gamecore.core.plugins.AppPlugin; -import mightypork.gamecore.render.GraphicsModule; -import mightypork.gamecore.resources.audio.AudioModule; +import mightypork.gamecore.core.init.InitTaskCrashHandler; +import mightypork.gamecore.core.init.InitTaskIonizables; +import mightypork.gamecore.core.init.InitTaskLog; +import mightypork.gamecore.core.init.InitTaskLogHeader; +import mightypork.gamecore.graphics.GraphicsModule; import mightypork.utils.annotations.Stub; import mightypork.utils.eventbus.EventBus; import mightypork.utils.eventbus.clients.BusNode; @@ -29,7 +30,7 @@ public class App extends BusNode { private static App instance; - private final Backend backend; + private final AppBackend backend; private final EventBus eventBus = new EventBus(); private boolean started = false; @@ -42,7 +43,7 @@ public class App extends BusNode { * * @param backend */ - public App(Backend backend) { + public App(AppBackend backend) { if (App.instance != null) { throw new IllegalStateException("App already initialized"); } @@ -59,6 +60,7 @@ public class App extends BusNode { // initialize and use backend this.backend = backend; this.eventBus.subscribe(backend); + this.backend.bind(this); this.backend.initialize(); } @@ -75,8 +77,10 @@ public class App extends BusNode { throw new IllegalStateException("App already started, cannot add plugins."); } - plugin.initialize(this); + // attach to event bus plugins.add(plugin); + plugin.bind(this); + plugin.initialize(); } @@ -100,7 +104,7 @@ public class App extends BusNode { * * @return the backend */ - public Backend getBackend() + public AppBackend getBackend() { return backend; } diff --git a/src/mightypork/gamecore/backend/Backend.java b/src/mightypork/gamecore/core/AppBackend.java similarity index 63% rename from src/mightypork/gamecore/backend/Backend.java rename to src/mightypork/gamecore/core/AppBackend.java index a286d38..814f872 100644 --- a/src/mightypork/gamecore/backend/Backend.java +++ b/src/mightypork/gamecore/core/AppBackend.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.backend; +package mightypork.gamecore.core; -import mightypork.gamecore.render.GraphicsModule; -import mightypork.gamecore.resources.audio.AudioModule; +import mightypork.gamecore.audio.AudioModule; +import mightypork.gamecore.graphics.GraphicsModule; import mightypork.utils.eventbus.clients.BusNode; @@ -14,7 +14,24 @@ import mightypork.utils.eventbus.clients.BusNode; * * @author MightyPork */ -public abstract class Backend extends BusNode { +public abstract class AppBackend extends BusNode { + + protected App app; + + + /** + * Assign an app instance. + * + * @param app app + */ + public void bind(App app) + { + if (this.app != null) { + throw new IllegalStateException("App already set."); + } + this.app = app; + } + /** * Initialize backend modules, add them to event bus. diff --git a/src/mightypork/gamecore/core/plugins/AppPlugin.java b/src/mightypork/gamecore/core/AppPlugin.java similarity index 78% rename from src/mightypork/gamecore/core/plugins/AppPlugin.java rename to src/mightypork/gamecore/core/AppPlugin.java index ceb008e..ff9783a 100644 --- a/src/mightypork/gamecore/core/plugins/AppPlugin.java +++ b/src/mightypork/gamecore/core/AppPlugin.java @@ -1,7 +1,6 @@ -package mightypork.gamecore.core.plugins; +package mightypork.gamecore.core; -import mightypork.gamecore.core.App; import mightypork.utils.annotations.Stub; import mightypork.utils.eventbus.clients.BusNode; @@ -15,14 +14,21 @@ import mightypork.utils.eventbus.clients.BusNode; */ public class AppPlugin extends BusNode { + protected App app; + + + void bind(App app) + { + this.app = app; + } + + /** * Initialize the plugin for the given App.
* The plugin is already attached to the event bus. - * - * @param app */ @Stub - public void initialize(App app) + public void initialize() { } } diff --git a/src/mightypork/gamecore/backend/BackendModule.java b/src/mightypork/gamecore/core/BackendModule.java similarity index 90% rename from src/mightypork/gamecore/backend/BackendModule.java rename to src/mightypork/gamecore/core/BackendModule.java index 38a2436..c70e1f5 100644 --- a/src/mightypork/gamecore/backend/BackendModule.java +++ b/src/mightypork/gamecore/core/BackendModule.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.backend; +package mightypork.gamecore.core; import mightypork.utils.annotations.Stub; diff --git a/src/mightypork/gamecore/core/init/InitTask.java b/src/mightypork/gamecore/core/InitTask.java similarity index 89% rename from src/mightypork/gamecore/core/init/InitTask.java rename to src/mightypork/gamecore/core/InitTask.java index a2f939b..69c2552 100644 --- a/src/mightypork/gamecore/core/init/InitTask.java +++ b/src/mightypork/gamecore/core/InitTask.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.core.init; +package mightypork.gamecore.core; import java.util.ArrayList; @@ -7,7 +7,7 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import mightypork.gamecore.core.App; +import mightypork.utils.Reflect; import mightypork.utils.annotations.Stub; import mightypork.utils.logging.Log; @@ -28,13 +28,8 @@ public abstract class InitTask { * Assign the initialized app instance to a protected "app" field. * * @param app app - */ - public void bind(App app) - { - if (this.app != null) { - throw new IllegalStateException("App instance is already set."); - } - + */ + void bind(App app) { this.app = app; } @@ -122,7 +117,14 @@ public abstract class InitTask { if (remaining.size() > 0) { // build error message for each bad task + int badInitializers = 0; for (InitTask task : remaining) { + if (Reflect.hasAnnotation(task.getClass(), OptionalInitTask.class)) { + continue; + } + + badInitializers++; + String notSatisfied = ""; for (String d : task.getDependencies()) { @@ -139,7 +141,7 @@ public abstract class InitTask { Log.w("InitTask \"" + task.getName() + "\" - missing dependencies: " + notSatisfied); } - throw new RuntimeException("Some InitTask dependencies could not be satisfied."); + if (badInitializers > 0) throw new RuntimeException("Some InitTask dependencies could not be satisfied."); } return ordered; diff --git a/src/mightypork/gamecore/core/MainLoop.java b/src/mightypork/gamecore/core/MainLoop.java index 7653ceb..b215045 100644 --- a/src/mightypork/gamecore/core/MainLoop.java +++ b/src/mightypork/gamecore/core/MainLoop.java @@ -4,8 +4,8 @@ package mightypork.gamecore.core; import java.util.Deque; import java.util.concurrent.ConcurrentLinkedDeque; +import mightypork.gamecore.graphics.Renderable; import mightypork.gamecore.gui.screens.ScreenRegistry; -import mightypork.gamecore.render.Renderable; import mightypork.utils.annotations.Stub; import mightypork.utils.eventbus.clients.BusNode; import mightypork.utils.eventbus.events.UpdateEvent; diff --git a/src/mightypork/gamecore/core/OptionalInitTask.java b/src/mightypork/gamecore/core/OptionalInitTask.java new file mode 100644 index 0000000..39a47d0 --- /dev/null +++ b/src/mightypork/gamecore/core/OptionalInitTask.java @@ -0,0 +1,19 @@ +package mightypork.gamecore.core; + + +import java.lang.annotation.*; + + +/** + * Indicates that an {@link InitTask} can safely be ignored if it's dependencies + * are not satisfied. + * + * @author Ondřej Hruška (MightyPork) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +@Inherited +public @interface OptionalInitTask { + +} diff --git a/src/mightypork/gamecore/core/config/InitTaskConfig.java b/src/mightypork/gamecore/core/config/InitTaskConfig.java index c877f29..87bf139 100644 --- a/src/mightypork/gamecore/core/config/InitTaskConfig.java +++ b/src/mightypork/gamecore/core/config/InitTaskConfig.java @@ -1,7 +1,7 @@ package mightypork.gamecore.core.config; -import mightypork.gamecore.core.init.InitTask; +import mightypork.gamecore.core.InitTask; import mightypork.utils.annotations.Stub; import mightypork.utils.exceptions.IllegalValueException; diff --git a/src/mightypork/gamecore/core/init/impl/InitTaskCrashHandler.java b/src/mightypork/gamecore/core/init/InitTaskCrashHandler.java similarity index 89% rename from src/mightypork/gamecore/core/init/impl/InitTaskCrashHandler.java rename to src/mightypork/gamecore/core/init/InitTaskCrashHandler.java index 20c23fe..dcf8122 100644 --- a/src/mightypork/gamecore/core/init/impl/InitTaskCrashHandler.java +++ b/src/mightypork/gamecore/core/init/InitTaskCrashHandler.java @@ -1,10 +1,10 @@ -package mightypork.gamecore.core.init.impl; +package mightypork.gamecore.core.init; import java.lang.Thread.UncaughtExceptionHandler; import mightypork.gamecore.core.App; -import mightypork.gamecore.core.init.InitTask; +import mightypork.gamecore.core.InitTask; import mightypork.utils.annotations.Stub; import mightypork.utils.logging.Log; diff --git a/src/mightypork/gamecore/core/init/impl/InitTaskDisplay.java b/src/mightypork/gamecore/core/init/InitTaskDisplay.java similarity index 91% rename from src/mightypork/gamecore/core/init/impl/InitTaskDisplay.java rename to src/mightypork/gamecore/core/init/InitTaskDisplay.java index 7eed42d..f84526c 100644 --- a/src/mightypork/gamecore/core/init/impl/InitTaskDisplay.java +++ b/src/mightypork/gamecore/core/init/InitTaskDisplay.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.core.init.impl; +package mightypork.gamecore.core.init; -import mightypork.gamecore.core.init.InitTask; -import mightypork.gamecore.render.GraphicsModule; +import mightypork.gamecore.core.InitTask; +import mightypork.gamecore.graphics.GraphicsModule; /** diff --git a/src/mightypork/gamecore/core/init/impl/InitTaskIonizables.java b/src/mightypork/gamecore/core/init/InitTaskIonizables.java similarity index 93% rename from src/mightypork/gamecore/core/init/impl/InitTaskIonizables.java rename to src/mightypork/gamecore/core/init/InitTaskIonizables.java index 20977f8..f686da0 100644 --- a/src/mightypork/gamecore/core/init/impl/InitTaskIonizables.java +++ b/src/mightypork/gamecore/core/init/InitTaskIonizables.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.core.init.impl; +package mightypork.gamecore.core.init; import java.io.IOException; -import mightypork.gamecore.core.init.InitTask; +import mightypork.gamecore.core.InitTask; import mightypork.utils.ion.Ion; import mightypork.utils.ion.IonInput; import mightypork.utils.ion.IonOutput; diff --git a/src/mightypork/gamecore/core/init/impl/InitTaskLog.java b/src/mightypork/gamecore/core/init/InitTaskLog.java similarity index 96% rename from src/mightypork/gamecore/core/init/impl/InitTaskLog.java rename to src/mightypork/gamecore/core/init/InitTaskLog.java index d386d81..4b34e1a 100644 --- a/src/mightypork/gamecore/core/init/impl/InitTaskLog.java +++ b/src/mightypork/gamecore/core/init/InitTaskLog.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.core.init.impl; +package mightypork.gamecore.core.init; import java.io.File; import java.util.logging.Level; +import mightypork.gamecore.core.InitTask; import mightypork.gamecore.core.WorkDir; -import mightypork.gamecore.core.init.InitTask; import mightypork.utils.logging.Log; import mightypork.utils.logging.writers.LogWriter; import mightypork.utils.string.StringUtil; diff --git a/src/mightypork/gamecore/core/init/impl/InitTaskLogHeader.java b/src/mightypork/gamecore/core/init/InitTaskLogHeader.java similarity index 87% rename from src/mightypork/gamecore/core/init/impl/InitTaskLogHeader.java rename to src/mightypork/gamecore/core/init/InitTaskLogHeader.java index 2de6266..96a9788 100644 --- a/src/mightypork/gamecore/core/init/impl/InitTaskLogHeader.java +++ b/src/mightypork/gamecore/core/init/InitTaskLogHeader.java @@ -1,10 +1,11 @@ -package mightypork.gamecore.core.init.impl; +package mightypork.gamecore.core.init; import java.io.IOException; +import mightypork.gamecore.core.InitTask; +import mightypork.gamecore.core.OptionalInitTask; import mightypork.gamecore.core.WorkDir; -import mightypork.gamecore.core.init.InitTask; import mightypork.utils.logging.Log; @@ -14,6 +15,7 @@ import mightypork.utils.logging.Log; * * @author Ondřej Hruška (MightyPork) */ +@OptionalInitTask public class InitTaskLogHeader extends InitTask { @Override diff --git a/src/mightypork/gamecore/core/init/impl/InitTaskWorkdir.java b/src/mightypork/gamecore/core/init/InitTaskWorkdir.java similarity index 96% rename from src/mightypork/gamecore/core/init/impl/InitTaskWorkdir.java rename to src/mightypork/gamecore/core/init/InitTaskWorkdir.java index c54c54b..6f986fa 100644 --- a/src/mightypork/gamecore/core/init/impl/InitTaskWorkdir.java +++ b/src/mightypork/gamecore/core/init/InitTaskWorkdir.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.core.init.impl; +package mightypork.gamecore.core.init; import java.io.File; @@ -9,8 +9,8 @@ import java.util.Map.Entry; import javax.swing.JOptionPane; import mightypork.gamecore.core.App; +import mightypork.gamecore.core.InitTask; import mightypork.gamecore.core.WorkDir; -import mightypork.gamecore.core.init.InitTask; import mightypork.utils.annotations.Stub; import mightypork.utils.files.InstanceLock; import mightypork.utils.logging.Log; diff --git a/src/mightypork/gamecore/core/plugins/screenshot/InitTaskPluginScreenshot.java b/src/mightypork/gamecore/core/plugins/screenshot/InitTaskPluginScreenshot.java index 010b402..76363da 100644 --- a/src/mightypork/gamecore/core/plugins/screenshot/InitTaskPluginScreenshot.java +++ b/src/mightypork/gamecore/core/plugins/screenshot/InitTaskPluginScreenshot.java @@ -1,8 +1,8 @@ package mightypork.gamecore.core.plugins.screenshot; +import mightypork.gamecore.core.InitTask; import mightypork.gamecore.core.WorkDir; -import mightypork.gamecore.core.init.InitTask; /** diff --git a/src/mightypork/gamecore/core/plugins/screenshot/ScreenshotPlugin.java b/src/mightypork/gamecore/core/plugins/screenshot/ScreenshotPlugin.java index bace456..fb4307f 100644 --- a/src/mightypork/gamecore/core/plugins/screenshot/ScreenshotPlugin.java +++ b/src/mightypork/gamecore/core/plugins/screenshot/ScreenshotPlugin.java @@ -2,8 +2,8 @@ package mightypork.gamecore.core.plugins.screenshot; import mightypork.gamecore.core.App; +import mightypork.gamecore.core.AppPlugin; import mightypork.gamecore.core.events.MainLoopRequest; -import mightypork.gamecore.core.plugins.AppPlugin; import mightypork.utils.Support; diff --git a/src/mightypork/gamecore/core/plugins/screenshot/TaskTakeScreenshot.java b/src/mightypork/gamecore/core/plugins/screenshot/TaskTakeScreenshot.java index dd52551..d1e095c 100644 --- a/src/mightypork/gamecore/core/plugins/screenshot/TaskTakeScreenshot.java +++ b/src/mightypork/gamecore/core/plugins/screenshot/TaskTakeScreenshot.java @@ -6,7 +6,7 @@ import java.io.IOException; import mightypork.gamecore.core.App; import mightypork.gamecore.core.WorkDir; -import mightypork.gamecore.render.Screenshot; +import mightypork.gamecore.graphics.Screenshot; import mightypork.utils.Support; import mightypork.utils.logging.Log; diff --git a/src/mightypork/gamecore/render/FullscreenToggleRequest.java b/src/mightypork/gamecore/graphics/FullscreenToggleRequest.java similarity index 88% rename from src/mightypork/gamecore/render/FullscreenToggleRequest.java rename to src/mightypork/gamecore/graphics/FullscreenToggleRequest.java index 65c034a..eeff3b8 100644 --- a/src/mightypork/gamecore/render/FullscreenToggleRequest.java +++ b/src/mightypork/gamecore/graphics/FullscreenToggleRequest.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render; +package mightypork.gamecore.graphics; import mightypork.utils.eventbus.BusEvent; diff --git a/src/mightypork/gamecore/render/GraphicsModule.java b/src/mightypork/gamecore/graphics/GraphicsModule.java similarity index 97% rename from src/mightypork/gamecore/render/GraphicsModule.java rename to src/mightypork/gamecore/graphics/GraphicsModule.java index 0dec204..5209c40 100644 --- a/src/mightypork/gamecore/render/GraphicsModule.java +++ b/src/mightypork/gamecore/graphics/GraphicsModule.java @@ -1,9 +1,9 @@ -package mightypork.gamecore.render; +package mightypork.gamecore.graphics; -import mightypork.gamecore.backend.BackendModule; -import mightypork.gamecore.resources.textures.DeferredTexture; -import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.core.BackendModule; +import mightypork.gamecore.graphics.textures.DeferredTexture; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.utils.math.color.Color; import mightypork.utils.math.color.Grad; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/gamecore/render/Renderable.java b/src/mightypork/gamecore/graphics/Renderable.java similarity index 80% rename from src/mightypork/gamecore/render/Renderable.java rename to src/mightypork/gamecore/graphics/Renderable.java index dec0e7a..6c6a236 100644 --- a/src/mightypork/gamecore/render/Renderable.java +++ b/src/mightypork/gamecore/graphics/Renderable.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render; +package mightypork.gamecore.graphics; /** diff --git a/src/mightypork/gamecore/render/Screenshot.java b/src/mightypork/gamecore/graphics/Screenshot.java similarity index 95% rename from src/mightypork/gamecore/render/Screenshot.java rename to src/mightypork/gamecore/graphics/Screenshot.java index 67f386a..00c2a5c 100644 --- a/src/mightypork/gamecore/render/Screenshot.java +++ b/src/mightypork/gamecore/graphics/Screenshot.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.render; +package mightypork.gamecore.graphics; import java.io.File; diff --git a/src/mightypork/gamecore/graphics/fonts/DeferredFont.java b/src/mightypork/gamecore/graphics/fonts/DeferredFont.java new file mode 100644 index 0000000..659ec50 --- /dev/null +++ b/src/mightypork/gamecore/graphics/fonts/DeferredFont.java @@ -0,0 +1,98 @@ +package mightypork.gamecore.graphics.fonts; + + +import mightypork.gamecore.graphics.textures.FilterMode; +import mightypork.gamecore.resources.BaseDeferredResource; + + +/** + * Abstract deferred font stub. + * + * @author Ondřej Hruška (MightyPork) + */ +public abstract class DeferredFont extends BaseDeferredResource implements IFont { + + public static enum FontStyle + { + PLAIN(0), BOLD(1), ITALIC(2), BOLD_ITALIC(3); + + public int numval; + + + /** + * Font style + * + * @param style style index as in awt Font. Not using constants to be + * independent on awt. + */ + private FontStyle(int style) { + this.numval = style; + } + } + + protected double size = 12; + protected FontStyle style = FontStyle.PLAIN; + protected String chars = Glyphs.basic; + protected FilterMode filter = FilterMode.NEAREST; + protected boolean antialias = false; + protected double discardTop = 0; + protected double discardBottom = 0; + + + public DeferredFont(String resource) { + super(resource); + } + + + public void setSize(double size) + { + this.size = size; + } + + + public void setStyle(FontStyle style) + { + this.style = style; + } + + + public void setChars(String chars) + { + this.chars = chars; + } + + + public void setFilter(FilterMode filter) + { + this.filter = filter; + } + + + public void setAntialias(boolean antialias) + { + this.antialias = antialias; + } + + + @Override + public void setDiscardRatio(double top, double bottom) + { + discardTop = top; + discardBottom = bottom; + } + + + @Override + public double getTopDiscardRatio() + { + return discardTop; + } + + + @Override + public double getBottomDiscardRatio() + { + return discardBottom; + } + +} diff --git a/src/mightypork/gamecore/resources/fonts/FontRegistry.java b/src/mightypork/gamecore/graphics/fonts/FontRegistry.java similarity index 82% rename from src/mightypork/gamecore/resources/fonts/FontRegistry.java rename to src/mightypork/gamecore/graphics/fonts/FontRegistry.java index 8d197dd..26c2c60 100644 --- a/src/mightypork/gamecore/resources/fonts/FontRegistry.java +++ b/src/mightypork/gamecore/graphics/fonts/FontRegistry.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.resources.fonts; +package mightypork.gamecore.graphics.fonts; import java.util.HashMap; +import mightypork.gamecore.backends.lwjgl.graphics.font.DeferredLwjglFont; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.ResourceLoadRequest; -import mightypork.gamecore.resources.fonts.impl.LazyFont; +import mightypork.gamecore.resources.loading.ResourceLoadRequest; import mightypork.utils.eventbus.clients.BusNode; import org.newdawn.slick.opengl.Texture; @@ -23,12 +23,12 @@ public class FontRegistry extends BusNode { /** - * Load a {@link LazyFont} + * Load a {@link DeferredLwjglFont} * * @param key font key * @param font font instance */ - public void addFont(String key, LazyFont font) + public void addFont(String key, DeferredFont font) { App.bus().send(new ResourceLoadRequest(font)); diff --git a/src/mightypork/gamecore/resources/fonts/FontRenderer.java b/src/mightypork/gamecore/graphics/fonts/FontRenderer.java similarity index 98% rename from src/mightypork/gamecore/resources/fonts/FontRenderer.java rename to src/mightypork/gamecore/graphics/fonts/FontRenderer.java index 773f956..4e3886b 100644 --- a/src/mightypork/gamecore/resources/fonts/FontRenderer.java +++ b/src/mightypork/gamecore/graphics/fonts/FontRenderer.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.fonts; +package mightypork.gamecore.graphics.fonts; import mightypork.gamecore.core.App; diff --git a/src/mightypork/gamecore/resources/fonts/Glyphs.java b/src/mightypork/gamecore/graphics/fonts/Glyphs.java similarity index 95% rename from src/mightypork/gamecore/resources/fonts/Glyphs.java rename to src/mightypork/gamecore/graphics/fonts/Glyphs.java index 5c93a69..0b9b7a8 100644 --- a/src/mightypork/gamecore/resources/fonts/Glyphs.java +++ b/src/mightypork/gamecore/graphics/fonts/Glyphs.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.fonts; +package mightypork.gamecore.graphics.fonts; /** diff --git a/src/mightypork/gamecore/resources/fonts/IFont.java b/src/mightypork/gamecore/graphics/fonts/IFont.java similarity index 96% rename from src/mightypork/gamecore/resources/fonts/IFont.java rename to src/mightypork/gamecore/graphics/fonts/IFont.java index 8168dd1..ef08b1a 100644 --- a/src/mightypork/gamecore/resources/fonts/IFont.java +++ b/src/mightypork/gamecore/graphics/fonts/IFont.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.fonts; +package mightypork.gamecore.graphics.fonts; import mightypork.utils.math.color.Color; diff --git a/src/mightypork/gamecore/resources/textures/DeferredTexture.java b/src/mightypork/gamecore/graphics/textures/DeferredTexture.java similarity index 89% rename from src/mightypork/gamecore/resources/textures/DeferredTexture.java rename to src/mightypork/gamecore/graphics/textures/DeferredTexture.java index 94254f4..27bd0a7 100644 --- a/src/mightypork/gamecore/resources/textures/DeferredTexture.java +++ b/src/mightypork/gamecore/graphics/textures/DeferredTexture.java @@ -1,8 +1,8 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; import mightypork.gamecore.resources.BaseDeferredResource; -import mightypork.gamecore.resources.MustLoadInRenderingContext; +import mightypork.gamecore.resources.loading.MustLoadInRenderingContext; import mightypork.utils.annotations.Alias; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/gamecore/resources/textures/FilterMode.java b/src/mightypork/gamecore/graphics/textures/FilterMode.java similarity index 72% rename from src/mightypork/gamecore/resources/textures/FilterMode.java rename to src/mightypork/gamecore/graphics/textures/FilterMode.java index d6ca8da..cd9c510 100644 --- a/src/mightypork/gamecore/resources/textures/FilterMode.java +++ b/src/mightypork/gamecore/graphics/textures/FilterMode.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; /** diff --git a/src/mightypork/gamecore/resources/textures/ITexture.java b/src/mightypork/gamecore/graphics/textures/ITexture.java similarity index 95% rename from src/mightypork/gamecore/resources/textures/ITexture.java rename to src/mightypork/gamecore/graphics/textures/ITexture.java index 6271169..17a8856 100644 --- a/src/mightypork/gamecore/resources/textures/ITexture.java +++ b/src/mightypork/gamecore/graphics/textures/ITexture.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; import mightypork.utils.interfaces.Destroyable; diff --git a/src/mightypork/gamecore/resources/textures/QuadGrid.java b/src/mightypork/gamecore/graphics/textures/QuadGrid.java similarity index 97% rename from src/mightypork/gamecore/resources/textures/QuadGrid.java rename to src/mightypork/gamecore/graphics/textures/QuadGrid.java index afa05a4..e63eeec 100644 --- a/src/mightypork/gamecore/resources/textures/QuadGrid.java +++ b/src/mightypork/gamecore/graphics/textures/QuadGrid.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/gamecore/resources/textures/TextureRegistry.java b/src/mightypork/gamecore/graphics/textures/TextureRegistry.java similarity index 96% rename from src/mightypork/gamecore/resources/textures/TextureRegistry.java rename to src/mightypork/gamecore/graphics/textures/TextureRegistry.java index b961932..1d3408b 100644 --- a/src/mightypork/gamecore/resources/textures/TextureRegistry.java +++ b/src/mightypork/gamecore/graphics/textures/TextureRegistry.java @@ -1,11 +1,11 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; import java.util.HashMap; import java.util.Map; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.ResourceLoadRequest; +import mightypork.gamecore.resources.loading.ResourceLoadRequest; import mightypork.utils.exceptions.KeyAlreadyExistsException; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/gamecore/resources/textures/TxQuad.java b/src/mightypork/gamecore/graphics/textures/TxQuad.java similarity index 98% rename from src/mightypork/gamecore/resources/textures/TxQuad.java rename to src/mightypork/gamecore/graphics/textures/TxQuad.java index 34ca4d2..bc3efd7 100644 --- a/src/mightypork/gamecore/resources/textures/TxQuad.java +++ b/src/mightypork/gamecore/graphics/textures/TxQuad.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/gamecore/resources/textures/TxSheet.java b/src/mightypork/gamecore/graphics/textures/TxSheet.java similarity index 97% rename from src/mightypork/gamecore/resources/textures/TxSheet.java rename to src/mightypork/gamecore/graphics/textures/TxSheet.java index 3ace5a0..b29e873 100644 --- a/src/mightypork/gamecore/resources/textures/TxSheet.java +++ b/src/mightypork/gamecore/graphics/textures/TxSheet.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; import java.util.Random; diff --git a/src/mightypork/gamecore/resources/textures/WrapMode.java b/src/mightypork/gamecore/graphics/textures/WrapMode.java similarity index 70% rename from src/mightypork/gamecore/resources/textures/WrapMode.java rename to src/mightypork/gamecore/graphics/textures/WrapMode.java index 63ef5bb..bd6ce41 100644 --- a/src/mightypork/gamecore/resources/textures/WrapMode.java +++ b/src/mightypork/gamecore/graphics/textures/WrapMode.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources.textures; +package mightypork.gamecore.graphics.textures; /** diff --git a/src/mightypork/gamecore/gui/components/BaseComponent.java b/src/mightypork/gamecore/gui/components/BaseComponent.java index a4210c8..a863efb 100644 --- a/src/mightypork/gamecore/gui/components/BaseComponent.java +++ b/src/mightypork/gamecore/gui/components/BaseComponent.java @@ -1,10 +1,10 @@ package mightypork.gamecore.gui.components; +import mightypork.gamecore.graphics.Renderable; import mightypork.gamecore.gui.events.LayoutChangeEvent; import mightypork.gamecore.gui.events.LayoutChangeListener; import mightypork.gamecore.input.InputSystem; -import mightypork.gamecore.render.Renderable; import mightypork.utils.Support; import mightypork.utils.annotations.Stub; import mightypork.utils.interfaces.Enableable; diff --git a/src/mightypork/gamecore/gui/components/PluggableRenderable.java b/src/mightypork/gamecore/gui/components/PluggableRenderable.java index 90674fb..e53c245 100644 --- a/src/mightypork/gamecore/gui/components/PluggableRenderable.java +++ b/src/mightypork/gamecore/gui/components/PluggableRenderable.java @@ -1,7 +1,7 @@ package mightypork.gamecore.gui.components; -import mightypork.gamecore.render.Renderable; +import mightypork.gamecore.graphics.Renderable; import mightypork.utils.math.constraints.rect.PluggableRectBound; import mightypork.utils.math.constraints.rect.Rect; import mightypork.utils.math.constraints.rect.RectBound; diff --git a/src/mightypork/gamecore/gui/components/input/TextButton.java b/src/mightypork/gamecore/gui/components/input/TextButton.java index e991055..f9d64c6 100644 --- a/src/mightypork/gamecore/gui/components/input/TextButton.java +++ b/src/mightypork/gamecore/gui/components/input/TextButton.java @@ -1,10 +1,10 @@ package mightypork.gamecore.gui.components.input; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.components.DynamicWidthComponent; import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.input.InputSystem; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.utils.math.AlignX; import mightypork.utils.math.color.Color; import mightypork.utils.math.color.pal.RGB; diff --git a/src/mightypork/gamecore/gui/components/painters/ImagePainter.java b/src/mightypork/gamecore/gui/components/painters/ImagePainter.java index 95d106f..f51b639 100644 --- a/src/mightypork/gamecore/gui/components/painters/ImagePainter.java +++ b/src/mightypork/gamecore/gui/components/painters/ImagePainter.java @@ -2,9 +2,9 @@ package mightypork.gamecore.gui.components.painters; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.gui.components.BaseComponent; import mightypork.gamecore.gui.components.DynamicWidthComponent; -import mightypork.gamecore.resources.textures.TxQuad; /** diff --git a/src/mightypork/gamecore/gui/components/painters/TextPainter.java b/src/mightypork/gamecore/gui/components/painters/TextPainter.java index 645f322..59b5c65 100644 --- a/src/mightypork/gamecore/gui/components/painters/TextPainter.java +++ b/src/mightypork/gamecore/gui/components/painters/TextPainter.java @@ -2,10 +2,10 @@ package mightypork.gamecore.gui.components.painters; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.fonts.FontRenderer; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.components.BaseComponent; import mightypork.gamecore.gui.components.DynamicWidthComponent; -import mightypork.gamecore.resources.fonts.FontRenderer; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.utils.math.AlignX; import mightypork.utils.math.color.Color; import mightypork.utils.math.color.pal.RGB; diff --git a/src/mightypork/gamecore/gui/screens/Overlay.java b/src/mightypork/gamecore/gui/screens/Overlay.java index 95dca29..5f28f2f 100644 --- a/src/mightypork/gamecore/gui/screens/Overlay.java +++ b/src/mightypork/gamecore/gui/screens/Overlay.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Collection; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.Renderable; import mightypork.gamecore.gui.components.layout.ConstraintLayout; import mightypork.gamecore.gui.events.LayoutChangeListener; import mightypork.gamecore.input.Edge; @@ -12,7 +13,6 @@ import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.input.KeyBinder; import mightypork.gamecore.input.KeyBindingPool; import mightypork.gamecore.input.KeyStroke; -import mightypork.gamecore.render.Renderable; import mightypork.utils.annotations.Stub; import mightypork.utils.eventbus.clients.BusNode; import mightypork.utils.interfaces.Enableable; diff --git a/src/mightypork/gamecore/gui/screens/Screen.java b/src/mightypork/gamecore/gui/screens/Screen.java index 1672dbe..bc16f5c 100644 --- a/src/mightypork/gamecore/gui/screens/Screen.java +++ b/src/mightypork/gamecore/gui/screens/Screen.java @@ -2,13 +2,13 @@ package mightypork.gamecore.gui.screens; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.Renderable; import mightypork.gamecore.gui.events.LayoutChangeEvent; import mightypork.gamecore.gui.events.LayoutChangeListener; import mightypork.gamecore.input.Edge; import mightypork.gamecore.input.KeyBinder; import mightypork.gamecore.input.KeyBindingPool; import mightypork.gamecore.input.KeyStroke; -import mightypork.gamecore.render.Renderable; import mightypork.utils.annotations.Stub; import mightypork.utils.eventbus.clients.BusNode; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/gamecore/gui/screens/ScreenRegistry.java b/src/mightypork/gamecore/gui/screens/ScreenRegistry.java index 5ce069a..80b3ac7 100644 --- a/src/mightypork/gamecore/gui/screens/ScreenRegistry.java +++ b/src/mightypork/gamecore/gui/screens/ScreenRegistry.java @@ -7,11 +7,11 @@ import java.util.Map; import java.util.TreeSet; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.Renderable; import mightypork.gamecore.gui.events.LayoutChangeEvent; import mightypork.gamecore.gui.events.ScreenRequestListener; import mightypork.gamecore.gui.events.ViewportChangeEvent; import mightypork.gamecore.gui.events.ViewportChangeListener; -import mightypork.gamecore.render.Renderable; import mightypork.utils.eventbus.clients.BusNode; import mightypork.utils.logging.Log; diff --git a/src/mightypork/gamecore/resources/Res.java b/src/mightypork/gamecore/resources/Res.java index a51d5a0..523be6a 100644 --- a/src/mightypork/gamecore/resources/Res.java +++ b/src/mightypork/gamecore/resources/Res.java @@ -1,15 +1,15 @@ package mightypork.gamecore.resources; -import mightypork.gamecore.resources.audio.SoundRegistry; -import mightypork.gamecore.resources.audio.players.EffectPlayer; -import mightypork.gamecore.resources.audio.players.LoopPlayer; -import mightypork.gamecore.resources.fonts.FontRegistry; -import mightypork.gamecore.resources.fonts.IFont; -import mightypork.gamecore.resources.textures.ITexture; -import mightypork.gamecore.resources.textures.TextureRegistry; -import mightypork.gamecore.resources.textures.TxQuad; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.audio.SoundRegistry; +import mightypork.gamecore.audio.players.EffectPlayer; +import mightypork.gamecore.audio.players.LoopPlayer; +import mightypork.gamecore.graphics.fonts.FontRegistry; +import mightypork.gamecore.graphics.fonts.IFont; +import mightypork.gamecore.graphics.textures.ITexture; +import mightypork.gamecore.graphics.textures.TextureRegistry; +import mightypork.gamecore.graphics.textures.TxQuad; +import mightypork.gamecore.graphics.textures.TxSheet; /** diff --git a/src/mightypork/gamecore/resources/ResourceSetup.java b/src/mightypork/gamecore/resources/ResourceSetup.java index ecb41d7..5e7682f 100644 --- a/src/mightypork/gamecore/resources/ResourceSetup.java +++ b/src/mightypork/gamecore/resources/ResourceSetup.java @@ -1,9 +1,9 @@ package mightypork.gamecore.resources; -import mightypork.gamecore.resources.audio.SoundRegistry; -import mightypork.gamecore.resources.fonts.FontRegistry; -import mightypork.gamecore.resources.textures.TextureRegistry; +import mightypork.gamecore.audio.SoundRegistry; +import mightypork.gamecore.graphics.fonts.FontRegistry; +import mightypork.gamecore.graphics.textures.TextureRegistry; /** diff --git a/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java b/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java deleted file mode 100644 index 7bf55f3..0000000 --- a/src/mightypork/gamecore/resources/fonts/impl/LazyFontNative.java +++ /dev/null @@ -1,40 +0,0 @@ -package mightypork.gamecore.resources.fonts.impl; - - -import java.awt.Font; -import java.io.IOException; - -import mightypork.gamecore.resources.textures.FilterMode; -import mightypork.utils.annotations.Alias; - - -/** - * Font obtained from the OS - * - * @author Ondřej Hruška (MightyPork) - */ -@Alias(name = "FontNative") -public class LazyFontNative extends LazyFont { - - /** - * A font from OS, found by name - * - * @param fontName font family name - * @param extraChars extra chars (0-255 loaded by default) - * @param size size (pt) - * @param style font style - * @param antialias use antialiasing when drawn on the cache texture - * @param filter GL filtering mode - */ - public LazyFontNative(String fontName, String extraChars, double size, FontStyle style, boolean antialias, FilterMode filter) { - super(fontName, extraChars, size, style, antialias, filter); - } - - - @Override - protected Font getAwtFont(String resource, float size, int style) throws IOException - { - return new Font(resource, style, (int) size); - } - -} diff --git a/src/mightypork/gamecore/resources/AsyncResourceLoader.java b/src/mightypork/gamecore/resources/loading/AsyncResourceLoader.java similarity index 96% rename from src/mightypork/gamecore/resources/AsyncResourceLoader.java rename to src/mightypork/gamecore/resources/loading/AsyncResourceLoader.java index b017063..efd5410 100644 --- a/src/mightypork/gamecore/resources/AsyncResourceLoader.java +++ b/src/mightypork/gamecore/resources/loading/AsyncResourceLoader.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources; +package mightypork.gamecore.resources.loading; import java.util.concurrent.ExecutorService; @@ -7,6 +7,7 @@ import java.util.concurrent.LinkedBlockingQueue; import mightypork.gamecore.core.App; import mightypork.gamecore.core.events.MainLoopRequest; +import mightypork.gamecore.resources.DeferredResource; import mightypork.utils.Reflect; import mightypork.utils.Support; import mightypork.utils.interfaces.Destroyable; diff --git a/src/mightypork/gamecore/resources/MustLoadInRenderingContext.java b/src/mightypork/gamecore/resources/loading/MustLoadInRenderingContext.java similarity index 87% rename from src/mightypork/gamecore/resources/MustLoadInRenderingContext.java rename to src/mightypork/gamecore/resources/loading/MustLoadInRenderingContext.java index 851a0c7..64497a7 100644 --- a/src/mightypork/gamecore/resources/MustLoadInRenderingContext.java +++ b/src/mightypork/gamecore/resources/loading/MustLoadInRenderingContext.java @@ -1,4 +1,4 @@ -package mightypork.gamecore.resources; +package mightypork.gamecore.resources.loading; import java.lang.annotation.*; diff --git a/src/mightypork/gamecore/resources/ResourceLoadRequest.java b/src/mightypork/gamecore/resources/loading/ResourceLoadRequest.java similarity index 85% rename from src/mightypork/gamecore/resources/ResourceLoadRequest.java rename to src/mightypork/gamecore/resources/loading/ResourceLoadRequest.java index 13ea9f9..a940adc 100644 --- a/src/mightypork/gamecore/resources/ResourceLoadRequest.java +++ b/src/mightypork/gamecore/resources/loading/ResourceLoadRequest.java @@ -1,6 +1,7 @@ -package mightypork.gamecore.resources; +package mightypork.gamecore.resources.loading; +import mightypork.gamecore.resources.DeferredResource; import mightypork.utils.eventbus.BusEvent; import mightypork.utils.eventbus.events.flags.SingleReceiverEvent; diff --git a/src/mightypork/gamecore/resources/ResourceLoader.java b/src/mightypork/gamecore/resources/loading/ResourceLoader.java similarity index 80% rename from src/mightypork/gamecore/resources/ResourceLoader.java rename to src/mightypork/gamecore/resources/loading/ResourceLoader.java index 3da9475..24047a2 100644 --- a/src/mightypork/gamecore/resources/ResourceLoader.java +++ b/src/mightypork/gamecore/resources/loading/ResourceLoader.java @@ -1,4 +1,6 @@ -package mightypork.gamecore.resources; +package mightypork.gamecore.resources.loading; + +import mightypork.gamecore.resources.DeferredResource; /** diff --git a/src/mightypork/rogue/RogueApp.java b/src/mightypork/rogue/RogueApp.java index 9501205..bc8dcf0 100644 --- a/src/mightypork/rogue/RogueApp.java +++ b/src/mightypork/rogue/RogueApp.java @@ -3,19 +3,19 @@ package mightypork.rogue; import junk.AppInitOptions; import junk.BaseApp; -import mightypork.gamecore.backend.lwjgl.LwjglBackend; +import mightypork.gamecore.backends.lwjgl.LwjglBackend; import mightypork.gamecore.core.config.Config; import mightypork.gamecore.core.events.MainLoopRequest; import mightypork.gamecore.core.events.ShudownRequest; import mightypork.gamecore.core.events.UserQuitRequest; import mightypork.gamecore.core.plugins.screenshot.ScreenshotRequest; +import mightypork.gamecore.graphics.FullscreenToggleRequest; +import mightypork.gamecore.graphics.GraphicsModule; import mightypork.gamecore.gui.events.ViewportChangeEvent; import mightypork.gamecore.gui.events.ViewportChangeListener; import mightypork.gamecore.gui.screens.ScreenRegistry; import mightypork.gamecore.input.Edge; import mightypork.gamecore.input.InputSystem; -import mightypork.gamecore.render.FullscreenToggleRequest; -import mightypork.gamecore.render.GraphicsModule; import mightypork.gamecore.resources.Res; import mightypork.rogue.RogueStateManager.RogueState; import mightypork.rogue.events.RogueStateRequest; diff --git a/src/mightypork/rogue/RogueResources.java b/src/mightypork/rogue/RogueResources.java index f2fce52..2c78b3d 100644 --- a/src/mightypork/rogue/RogueResources.java +++ b/src/mightypork/rogue/RogueResources.java @@ -1,16 +1,17 @@ package mightypork.rogue; +import mightypork.gamecore.audio.SoundRegistry; +import mightypork.gamecore.backends.lwjgl.graphics.font.DeferredLwjglFont; +import mightypork.gamecore.graphics.fonts.DeferredFont; +import mightypork.gamecore.graphics.fonts.FontRegistry; +import mightypork.gamecore.graphics.fonts.Glyphs; +import mightypork.gamecore.graphics.textures.FilterMode; +import mightypork.gamecore.graphics.textures.ITexture; +import mightypork.gamecore.graphics.textures.QuadGrid; +import mightypork.gamecore.graphics.textures.TextureRegistry; +import mightypork.gamecore.graphics.textures.WrapMode; import mightypork.gamecore.resources.ResourceSetup; -import mightypork.gamecore.resources.audio.SoundRegistry; -import mightypork.gamecore.resources.fonts.FontRegistry; -import mightypork.gamecore.resources.fonts.Glyphs; -import mightypork.gamecore.resources.fonts.impl.LazyFont; -import mightypork.gamecore.resources.textures.FilterMode; -import mightypork.gamecore.resources.textures.ITexture; -import mightypork.gamecore.resources.textures.QuadGrid; -import mightypork.gamecore.resources.textures.TextureRegistry; -import mightypork.gamecore.resources.textures.WrapMode; import mightypork.utils.math.constraints.rect.Rect; @@ -19,15 +20,15 @@ public class RogueResources implements ResourceSetup { @Override public void addFonts(FontRegistry fonts) { - LazyFont font; + DeferredFont font; //fonts.loadFont("polygon_pixel", new DeferredFont("/res/font/PolygonPixel5x7Standard.ttf", Glyphs.basic, 16)); - fonts.addFont("press_start", font = new LazyFont("/res/font/PressStart2P.ttf", Glyphs.basic, 16)); + fonts.addFont("press_start", font = new DeferredLwjglFont("/res/font/PressStart2P.ttf", Glyphs.basic, 16)); - fonts.addFont("battlenet", font = new LazyFont("/res/font/battlenet.ttf", Glyphs.basic, 16)); + fonts.addFont("battlenet", font = new DeferredLwjglFont("/res/font/battlenet.ttf", Glyphs.basic, 16)); font.setDiscardRatio(3 / 16D, 2 / 16D); - fonts.addFont("tinyutf", font = new LazyFont("/res/font/TinyUnicode2.ttf", Glyphs.basic, 16)); + fonts.addFont("tinyutf", font = new DeferredLwjglFont("/res/font/TinyUnicode2.ttf", Glyphs.basic, 16)); font.setDiscardRatio(5 / 16D, 3 / 16D); // aliases diff --git a/src/mightypork/rogue/screens/FpsOverlay.java b/src/mightypork/rogue/screens/FpsOverlay.java index e00a98d..7fcb007 100644 --- a/src/mightypork/rogue/screens/FpsOverlay.java +++ b/src/mightypork/rogue/screens/FpsOverlay.java @@ -3,12 +3,12 @@ package mightypork.rogue.screens; import mightypork.gamecore.core.App; import mightypork.gamecore.core.config.Config; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.Overlay; import mightypork.gamecore.input.Edge; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.utils.math.AlignX; import mightypork.utils.math.color.pal.RGB; import mightypork.utils.math.constraints.num.Num; diff --git a/src/mightypork/rogue/screens/game/HeartBar.java b/src/mightypork/rogue/screens/game/HeartBar.java index abe79a6..acb6649 100644 --- a/src/mightypork/rogue/screens/game/HeartBar.java +++ b/src/mightypork/rogue/screens/game/HeartBar.java @@ -2,8 +2,8 @@ package mightypork.rogue.screens.game; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.gui.components.BaseComponent; -import mightypork.gamecore.resources.textures.TxQuad; import mightypork.utils.math.AlignX; import mightypork.utils.math.constraints.num.Num; import mightypork.utils.math.constraints.num.var.NumVar; diff --git a/src/mightypork/rogue/screens/game/IngameNav.java b/src/mightypork/rogue/screens/game/IngameNav.java index 34ecaa7..020860b 100644 --- a/src/mightypork/rogue/screens/game/IngameNav.java +++ b/src/mightypork/rogue/screens/game/IngameNav.java @@ -2,10 +2,10 @@ package mightypork.rogue.screens.game; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.gui.components.LayoutComponent; import mightypork.gamecore.gui.components.layout.FlowColumnLayout; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.textures.TxQuad; import mightypork.utils.math.AlignX; import mightypork.utils.math.constraints.rect.Rect; import mightypork.utils.math.constraints.rect.RectBound; diff --git a/src/mightypork/rogue/screens/game/InvSlot.java b/src/mightypork/rogue/screens/game/InvSlot.java index d18d117..71c83b9 100644 --- a/src/mightypork/rogue/screens/game/InvSlot.java +++ b/src/mightypork/rogue/screens/game/InvSlot.java @@ -2,11 +2,11 @@ package mightypork.rogue.screens.game; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.input.ClickableComponent; import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.textures.TxQuad; import mightypork.rogue.world.PlayerFacade; import mightypork.rogue.world.WorldProvider; import mightypork.rogue.world.item.Item; diff --git a/src/mightypork/rogue/screens/game/LayerAskSave.java b/src/mightypork/rogue/screens/game/LayerAskSave.java index e16e6c3..bc9d3e0 100644 --- a/src/mightypork/rogue/screens/game/LayerAskSave.java +++ b/src/mightypork/rogue/screens/game/LayerAskSave.java @@ -4,6 +4,7 @@ package mightypork.rogue.screens.game; import java.io.IOException; import mightypork.gamecore.core.config.Config; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.input.TextButton; import mightypork.gamecore.gui.components.layout.RowLayout; @@ -13,7 +14,6 @@ import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.impl.FadingLayer; import mightypork.gamecore.input.Edge; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.rogue.screens.game.ScreenGame.GScrState; import mightypork.rogue.world.WorldProvider; import mightypork.utils.logging.Log; diff --git a/src/mightypork/rogue/screens/game/LayerDeath.java b/src/mightypork/rogue/screens/game/LayerDeath.java index 6c236a9..deaef42 100644 --- a/src/mightypork/rogue/screens/game/LayerDeath.java +++ b/src/mightypork/rogue/screens/game/LayerDeath.java @@ -4,6 +4,7 @@ package mightypork.rogue.screens.game; import java.io.IOException; import mightypork.gamecore.core.config.Config; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.input.TextButton; import mightypork.gamecore.gui.components.layout.RowLayout; @@ -15,7 +16,6 @@ import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.impl.FadingLayer; import mightypork.gamecore.input.Edge; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.rogue.RogueStateManager.RogueState; import mightypork.rogue.events.RogueStateRequest; import mightypork.rogue.screens.game.ScreenGame.GScrState; diff --git a/src/mightypork/rogue/screens/game/LayerWin.java b/src/mightypork/rogue/screens/game/LayerWin.java index 1393536..331d2c5 100644 --- a/src/mightypork/rogue/screens/game/LayerWin.java +++ b/src/mightypork/rogue/screens/game/LayerWin.java @@ -4,6 +4,7 @@ package mightypork.rogue.screens.game; import java.io.File; import mightypork.gamecore.core.config.Config; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.input.TextButton; import mightypork.gamecore.gui.components.layout.RowLayout; @@ -14,7 +15,6 @@ import mightypork.gamecore.gui.components.painters.TextPainter; import mightypork.gamecore.gui.screens.impl.FadingLayer; import mightypork.gamecore.input.Edge; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.rogue.RogueStateManager.RogueState; import mightypork.rogue.events.RogueStateRequest; import mightypork.rogue.world.WorldProvider; diff --git a/src/mightypork/rogue/screens/game/NavButton.java b/src/mightypork/rogue/screens/game/NavButton.java index 149f1d5..3332254 100644 --- a/src/mightypork/rogue/screens/game/NavButton.java +++ b/src/mightypork/rogue/screens/game/NavButton.java @@ -2,9 +2,9 @@ package mightypork.rogue.screens.game; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.gui.components.input.ClickableComponent; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.textures.TxQuad; /** diff --git a/src/mightypork/rogue/screens/menu/ScreenMainMenu.java b/src/mightypork/rogue/screens/menu/ScreenMainMenu.java index d496d51..1717067 100644 --- a/src/mightypork/rogue/screens/menu/ScreenMainMenu.java +++ b/src/mightypork/rogue/screens/menu/ScreenMainMenu.java @@ -3,6 +3,7 @@ package mightypork.rogue.screens.menu; import mightypork.gamecore.core.config.Config; import mightypork.gamecore.core.events.UserQuitRequest; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.input.TextButton; import mightypork.gamecore.gui.components.layout.RowLayout; @@ -13,7 +14,6 @@ import mightypork.gamecore.gui.screens.Screen; import mightypork.gamecore.gui.screens.ScreenLayer; import mightypork.gamecore.input.Edge; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.rogue.RogueStateManager.RogueState; import mightypork.rogue.events.RogueStateRequest; import mightypork.rogue.screens.RogueScreen; diff --git a/src/mightypork/rogue/screens/select_world/WorldSlot.java b/src/mightypork/rogue/screens/select_world/WorldSlot.java index 9618a17..6393611 100644 --- a/src/mightypork/rogue/screens/select_world/WorldSlot.java +++ b/src/mightypork/rogue/screens/select_world/WorldSlot.java @@ -3,6 +3,7 @@ package mightypork.rogue.screens.select_world; import java.io.File; +import mightypork.gamecore.graphics.fonts.IFont; import mightypork.gamecore.gui.Action; import mightypork.gamecore.gui.components.input.TextButton; import mightypork.gamecore.gui.components.layout.ConstraintLayout; @@ -10,7 +11,6 @@ import mightypork.gamecore.gui.components.layout.GridLayout; import mightypork.gamecore.gui.components.painters.QuadPainter; import mightypork.gamecore.gui.events.ScreenRequest; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.IFont; import mightypork.rogue.events.LoadingOverlayRequest; import mightypork.rogue.world.World; import mightypork.rogue.world.WorldProvider; diff --git a/src/mightypork/rogue/world/WorldRenderer.java b/src/mightypork/rogue/world/WorldRenderer.java index 8345d2b..4a10bf4 100644 --- a/src/mightypork/rogue/world/WorldRenderer.java +++ b/src/mightypork/rogue/world/WorldRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world; import mightypork.gamecore.core.App; -import mightypork.gamecore.render.GraphicsModule; +import mightypork.gamecore.graphics.GraphicsModule; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.level.Level; import mightypork.rogue.world.level.render.TileRenderContext; diff --git a/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java b/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java index d6bad57..85a069a 100644 --- a/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java +++ b/src/mightypork/rogue/world/entity/render/EntityRendererMobLR.java @@ -2,9 +2,9 @@ package mightypork.rogue.world.entity.render; import mightypork.gamecore.core.App; +import mightypork.gamecore.graphics.textures.TxQuad; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.textures.TxQuad; -import mightypork.gamecore.resources.textures.TxSheet; import mightypork.rogue.world.entity.Entity; import mightypork.rogue.world.entity.EntityRenderer; import mightypork.rogue.world.level.render.MapRenderContext; diff --git a/src/mightypork/rogue/world/gui/WorldConsoleRenderer.java b/src/mightypork/rogue/world/gui/WorldConsoleRenderer.java index b1eba50..af16e1a 100644 --- a/src/mightypork/rogue/world/gui/WorldConsoleRenderer.java +++ b/src/mightypork/rogue/world/gui/WorldConsoleRenderer.java @@ -4,9 +4,9 @@ package mightypork.rogue.world.gui; import java.util.Collection; import java.util.ConcurrentModificationException; +import mightypork.gamecore.graphics.fonts.FontRenderer; import mightypork.gamecore.gui.components.BaseComponent; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.fonts.FontRenderer; import mightypork.rogue.world.WorldConsole; import mightypork.rogue.world.WorldProvider; import mightypork.utils.logging.Log; diff --git a/src/mightypork/rogue/world/item/render/QuadItemRenderer.java b/src/mightypork/rogue/world/item/render/QuadItemRenderer.java index 42979ec..8996943 100644 --- a/src/mightypork/rogue/world/item/render/QuadItemRenderer.java +++ b/src/mightypork/rogue/world/item/render/QuadItemRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world.item.render; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.rogue.world.item.Item; import mightypork.rogue.world.item.ItemRenderer; import mightypork.utils.math.constraints.rect.Rect; diff --git a/src/mightypork/rogue/world/tile/TileRenderer.java b/src/mightypork/rogue/world/tile/TileRenderer.java index b08b132..8dd1932 100644 --- a/src/mightypork/rogue/world/tile/TileRenderer.java +++ b/src/mightypork/rogue/world/tile/TileRenderer.java @@ -2,9 +2,9 @@ package mightypork.rogue.world.tile; import mightypork.gamecore.core.App; -import mightypork.gamecore.render.GraphicsModule; +import mightypork.gamecore.graphics.GraphicsModule; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.gamecore.resources.Res; -import mightypork.gamecore.resources.textures.TxQuad; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.render.NullTileRenderer; import mightypork.utils.annotations.Stub; diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java b/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java index 83cdd2d..0d4cf84 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseDoor.java @@ -3,7 +3,7 @@ package mightypork.rogue.world.tile.impl; import java.io.IOException; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileRenderer; import mightypork.rogue.world.tile.TileType; diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseFloor.java b/src/mightypork/rogue/world/tile/impl/TileBaseFloor.java index a71446e..0ca4083 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseFloor.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseFloor.java @@ -1,7 +1,7 @@ package mightypork.rogue.world.tile.impl; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileRenderer; import mightypork.rogue.world.tile.TileType; diff --git a/src/mightypork/rogue/world/tile/impl/TileBasePassage.java b/src/mightypork/rogue/world/tile/impl/TileBasePassage.java index 56ae2d1..6f33542 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBasePassage.java +++ b/src/mightypork/rogue/world/tile/impl/TileBasePassage.java @@ -1,7 +1,7 @@ package mightypork.rogue.world.tile.impl; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileRenderer; import mightypork.rogue.world.tile.TileType; diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java b/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java index 0f6f7d3..560d8d9 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseSecretDoor.java @@ -3,7 +3,7 @@ package mightypork.rogue.world.tile.impl; import java.io.IOException; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.tile.TileColors; import mightypork.rogue.world.tile.TileModel; import mightypork.utils.ion.IonInput; diff --git a/src/mightypork/rogue/world/tile/impl/TileBaseWall.java b/src/mightypork/rogue/world/tile/impl/TileBaseWall.java index ab316cd..5975352 100644 --- a/src/mightypork/rogue/world/tile/impl/TileBaseWall.java +++ b/src/mightypork/rogue/world/tile/impl/TileBaseWall.java @@ -1,7 +1,7 @@ package mightypork.rogue.world.tile.impl; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.tile.TileModel; import mightypork.rogue.world.tile.TileType; import mightypork.rogue.world.tile.render.BasicTileRenderer; diff --git a/src/mightypork/rogue/world/tile/render/BasicTileRenderer.java b/src/mightypork/rogue/world/tile/render/BasicTileRenderer.java index 865b643..c64afa3 100644 --- a/src/mightypork/rogue/world/tile/render/BasicTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/BasicTileRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world.tile.render; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileRenderer; diff --git a/src/mightypork/rogue/world/tile/render/ChestRenderer.java b/src/mightypork/rogue/world/tile/render/ChestRenderer.java index 6991db9..2ef6b91 100644 --- a/src/mightypork/rogue/world/tile/render/ChestRenderer.java +++ b/src/mightypork/rogue/world/tile/render/ChestRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world.tile.render; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.TileRenderer; import mightypork.rogue.world.tile.impl.TileBaseChest; diff --git a/src/mightypork/rogue/world/tile/render/DoorTileRenderer.java b/src/mightypork/rogue/world/tile/render/DoorTileRenderer.java index 271f808..a99bcd6 100644 --- a/src/mightypork/rogue/world/tile/render/DoorTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/DoorTileRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world.tile.render; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.textures.TxSheet; +import mightypork.gamecore.graphics.textures.TxSheet; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.TileRenderer; import mightypork.rogue.world.tile.impl.TileBaseDoor; diff --git a/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java b/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java index 22edff5..db07558 100644 --- a/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/OneFrameTileRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world.tile.render; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileRenderer; diff --git a/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java b/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java index d79bf4a..5583e6c 100644 --- a/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java +++ b/src/mightypork/rogue/world/tile/render/TwoHighTileRenderer.java @@ -2,7 +2,7 @@ package mightypork.rogue.world.tile.render; import mightypork.gamecore.core.App; -import mightypork.gamecore.resources.textures.TxQuad; +import mightypork.gamecore.graphics.textures.TxQuad; import mightypork.rogue.world.level.render.TileRenderContext; import mightypork.rogue.world.tile.Tile; import mightypork.rogue.world.tile.TileRenderer;