Moved general purpose stuff into util, renamed utils->util

v5stable
ondra 11 years ago
parent e58156b7ee
commit 6843e746bc
  1. 8
      src/mightypork/gamecore/audio/DeferredAudio.java
  2. 2
      src/mightypork/gamecore/audio/JointVolume.java
  3. 4
      src/mightypork/gamecore/audio/NullAudio.java
  4. 2
      src/mightypork/gamecore/audio/SoundBank.java
  5. 12
      src/mightypork/gamecore/audio/SoundSystem.java
  6. 4
      src/mightypork/gamecore/audio/Volume.java
  7. 2
      src/mightypork/gamecore/audio/players/BaseAudioPlayer.java
  8. 2
      src/mightypork/gamecore/audio/players/EffectPlayer.java
  9. 6
      src/mightypork/gamecore/audio/players/LoopPlayer.java
  10. 2
      src/mightypork/gamecore/control/AppAccess.java
  11. 2
      src/mightypork/gamecore/control/AppAdapter.java
  12. 2
      src/mightypork/gamecore/control/AppModule.java
  13. 6
      src/mightypork/gamecore/control/AppSubModule.java
  14. 17
      src/mightypork/gamecore/control/BaseApp.java
  15. 8
      src/mightypork/gamecore/control/GameLoop.java
  16. 2
      src/mightypork/gamecore/control/SlickLogRedirector.java
  17. 7
      src/mightypork/gamecore/control/events/DestroyEvent.java
  18. 4
      src/mightypork/gamecore/control/events/KeyEvent.java
  19. 6
      src/mightypork/gamecore/control/events/LayoutChangeEvent.java
  20. 5
      src/mightypork/gamecore/control/events/MainLoopTaskRequest.java
  21. 7
      src/mightypork/gamecore/control/events/MouseButtonEvent.java
  22. 9
      src/mightypork/gamecore/control/events/MouseMotionEvent.java
  23. 5
      src/mightypork/gamecore/control/events/ResourceLoadRequest.java
  24. 5
      src/mightypork/gamecore/control/events/ScreenChangeEvent.java
  25. 5
      src/mightypork/gamecore/control/events/ScreenRequestEvent.java
  26. 9
      src/mightypork/gamecore/control/events/UpdateEvent.java
  27. 3
      src/mightypork/gamecore/gui/AlignX.java
  28. 3
      src/mightypork/gamecore/gui/AlignY.java
  29. 2
      src/mightypork/gamecore/gui/components/ClickableComponent.java
  30. 4
      src/mightypork/gamecore/gui/components/Component.java
  31. 14
      src/mightypork/gamecore/gui/components/InputComponent.java
  32. 8
      src/mightypork/gamecore/gui/components/LayoutComponent.java
  33. 6
      src/mightypork/gamecore/gui/components/PluggableRenderable.java
  34. 12
      src/mightypork/gamecore/gui/components/VisualComponent.java
  35. 6
      src/mightypork/gamecore/gui/components/layout/ColumnHolder.java
  36. 4
      src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java
  37. 8
      src/mightypork/gamecore/gui/components/layout/HorizontalFixedFlowLayout.java
  38. 6
      src/mightypork/gamecore/gui/components/layout/RowHolder.java
  39. 8
      src/mightypork/gamecore/gui/components/layout/VerticalFixedFlowLayout.java
  40. 4
      src/mightypork/gamecore/gui/components/painters/QuadPainter.java
  41. 10
      src/mightypork/gamecore/gui/components/painters/TextPainter.java
  42. 2
      src/mightypork/gamecore/gui/screens/LayeredScreen.java
  43. 12
      src/mightypork/gamecore/gui/screens/Screen.java
  44. 6
      src/mightypork/gamecore/gui/screens/ScreenLayer.java
  45. 6
      src/mightypork/gamecore/gui/screens/ScreenRegistry.java
  46. 17
      src/mightypork/gamecore/input/InputSystem.java
  47. 2
      src/mightypork/gamecore/input/KeyBinder.java
  48. 2
      src/mightypork/gamecore/input/KeyBinding.java
  49. 4
      src/mightypork/gamecore/input/KeyBindingPool.java
  50. 12
      src/mightypork/gamecore/loading/AsyncResourceLoader.java
  51. 8
      src/mightypork/gamecore/loading/DeferredResource.java
  52. 12
      src/mightypork/gamecore/render/DisplaySystem.java
  53. 14
      src/mightypork/gamecore/render/Render.java
  54. 11
      src/mightypork/gamecore/render/fonts/FontBank.java
  55. 6
      src/mightypork/gamecore/render/fonts/FontRenderer.java
  56. 4
      src/mightypork/gamecore/render/fonts/GLFont.java
  57. 14
      src/mightypork/gamecore/render/fonts/impl/CachedFont.java
  58. 12
      src/mightypork/gamecore/render/fonts/impl/DeferredFont.java
  59. 4
      src/mightypork/gamecore/render/fonts/impl/DeferredFontNative.java
  60. 6
      src/mightypork/gamecore/render/textures/DeferredTexture.java
  61. 4
      src/mightypork/gamecore/render/textures/TextureBank.java
  62. 2
      src/mightypork/gamecore/render/textures/TxQuad.java
  63. 6
      src/mightypork/rogue/App.java
  64. 4
      src/mightypork/rogue/Config.java
  65. 4
      src/mightypork/rogue/MainLoop.java
  66. 2
      src/mightypork/rogue/Paths.java
  67. 2
      src/mightypork/rogue/Res.java
  68. 4
      src/mightypork/rogue/events/ActionRequest.java
  69. 14
      src/mightypork/rogue/screens/LayerFps.java
  70. 4
      src/mightypork/rogue/screens/main_menu/MenuButton.java
  71. 27
      src/mightypork/rogue/screens/main_menu/MenuLayer.java
  72. 14
      src/mightypork/rogue/screens/test_bouncyboxes/BouncyBox.java
  73. 6
      src/mightypork/rogue/screens/test_bouncyboxes/LayerBouncyBoxes.java
  74. 2
      src/mightypork/rogue/screens/test_bouncyboxes/ScreenTestBouncy.java
  75. 8
      src/mightypork/rogue/screens/test_cat_sound/LayerColor.java
  76. 21
      src/mightypork/rogue/screens/test_cat_sound/LayerFlyingCat.java
  77. 2
      src/mightypork/rogue/screens/test_cat_sound/ScreenTestCat.java
  78. 4
      src/mightypork/rogue/screens/test_render/LayerTestGradient.java
  79. 1
      src/mightypork/rogue/screens/test_render/ScreenTestRender.java
  80. 6
      src/mightypork/test/TestConstCaching.java
  81. 14
      src/mightypork/test/TestConstr.java
  82. 2
      src/mightypork/test/TestConvert.java
  83. 8
      src/mightypork/test/TestCoords.java
  84. 6
      src/mightypork/test/TestTiled.java
  85. 6
      src/mightypork/test/TestVec.java
  86. 2
      src/mightypork/util/annotations/DefaultImpl.java
  87. 2
      src/mightypork/util/annotations/FactoryMethod.java
  88. 12
      src/mightypork/util/config/PropertyManager.java
  89. 6
      src/mightypork/util/config/SimpleConfig.java
  90. 2
      src/mightypork/util/config/SortedProperties.java
  91. 5
      src/mightypork/util/control/Action.java
  92. 2
      src/mightypork/util/control/ActionTrigger.java
  93. 2
      src/mightypork/util/control/Destroyable.java
  94. 2
      src/mightypork/util/control/Enableable.java
  95. 2
      src/mightypork/util/control/eventbus/BufferedHashSet.java
  96. 2
      src/mightypork/util/control/eventbus/BusAccess.java
  97. 20
      src/mightypork/util/control/eventbus/EventBus.java
  98. 12
      src/mightypork/util/control/eventbus/EventChannel.java
  99. 6
      src/mightypork/util/control/eventbus/clients/BusNode.java
  100. 4
      src/mightypork/util/control/eventbus/clients/ClientHub.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -4,9 +4,9 @@ package mightypork.gamecore.audio;
import java.io.IOException;
import mightypork.gamecore.loading.DeferredResource;
import mightypork.utils.annotations.Alias;
import mightypork.utils.files.FileUtils;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.files.FileUtils;
import mightypork.util.logging.LogAlias;
import mightypork.util.math.constraints.vect.Vect;
import org.newdawn.slick.openal.Audio;
import org.newdawn.slick.openal.SoundStore;
@ -17,7 +17,7 @@ import org.newdawn.slick.openal.SoundStore;
*
* @author MightyPork
*/
@Alias(name = "Audio")
@LogAlias(name = "Audio")
public class DeferredAudio extends DeferredResource {
private enum PlayMode

@ -1,7 +1,7 @@
package mightypork.gamecore.audio;
import mightypork.utils.math.Calc;
import mightypork.util.math.Calc;
/**

@ -2,7 +2,7 @@ package mightypork.gamecore.audio;
import mightypork.gamecore.loading.NullResource;
import mightypork.utils.annotations.Alias;
import mightypork.util.logging.LogAlias;
/**
@ -11,7 +11,7 @@ import mightypork.utils.annotations.Alias;
*
* @author MightyPork
*/
@Alias(name = "NullAudio")
@LogAlias(name = "NullAudio")
public class NullAudio extends DeferredAudio implements NullResource {
/**

@ -8,7 +8,7 @@ import mightypork.gamecore.audio.players.EffectPlayer;
import mightypork.gamecore.audio.players.LoopPlayer;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppAdapter;
import mightypork.utils.logging.Log;
import mightypork.util.logging.Log;
/**

@ -8,12 +8,12 @@ import java.util.Set;
import mightypork.gamecore.audio.players.EffectPlayer;
import mightypork.gamecore.audio.players.LoopPlayer;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.bus.clients.RootBusNode;
import mightypork.gamecore.control.bus.events.ResourceLoadRequest;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.utils.math.Calc.Buffers;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.mutable.VectVar;
import mightypork.gamecore.control.events.ResourceLoadRequest;
import mightypork.util.control.eventbus.clients.RootBusNode;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.Calc.Buffers;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.mutable.VectVar;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.AL10;

@ -1,8 +1,8 @@
package mightypork.gamecore.audio;
import mightypork.utils.math.Calc;
import mightypork.utils.objects.Mutable;
import mightypork.util.math.Calc;
import mightypork.util.objects.Mutable;
/**

@ -3,7 +3,7 @@ package mightypork.gamecore.audio.players;
import mightypork.gamecore.audio.DeferredAudio;
import mightypork.gamecore.audio.Volume;
import mightypork.gamecore.control.interf.Destroyable;
import mightypork.util.control.Destroyable;
/**

@ -3,7 +3,7 @@ package mightypork.gamecore.audio.players;
import mightypork.gamecore.audio.DeferredAudio;
import mightypork.gamecore.audio.Volume;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -3,9 +3,9 @@ package mightypork.gamecore.audio.players;
import mightypork.gamecore.audio.DeferredAudio;
import mightypork.gamecore.audio.Volume;
import mightypork.gamecore.control.timing.Pauseable;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.utils.math.constraints.num.mutable.NumAnimated;
import mightypork.util.control.timing.Pauseable;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.constraints.num.mutable.NumAnimated;
import org.lwjgl.openal.AL10;

@ -2,9 +2,9 @@ package mightypork.gamecore.control;
import mightypork.gamecore.audio.SoundSystem;
import mightypork.gamecore.control.bus.BusAccess;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.util.control.eventbus.BusAccess;
/**

@ -2,9 +2,9 @@ package mightypork.gamecore.control;
import mightypork.gamecore.audio.SoundSystem;
import mightypork.gamecore.control.bus.EventBus;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.util.control.eventbus.EventBus;
/**

@ -2,9 +2,9 @@ package mightypork.gamecore.control;
import mightypork.gamecore.audio.SoundSystem;
import mightypork.gamecore.control.bus.clients.RootBusNode;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.util.control.eventbus.clients.RootBusNode;
/**

@ -2,11 +2,11 @@ package mightypork.gamecore.control;
import mightypork.gamecore.audio.SoundSystem;
import mightypork.gamecore.control.bus.clients.BusNode;
import mightypork.gamecore.control.bus.clients.DelegatingClient;
import mightypork.gamecore.control.bus.clients.RootBusNode;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.util.control.eventbus.clients.BusNode;
import mightypork.util.control.eventbus.clients.DelegatingClient;
import mightypork.util.control.eventbus.clients.RootBusNode;
/**

@ -8,18 +8,17 @@ import java.util.logging.Level;
import javax.swing.JOptionPane;
import mightypork.gamecore.audio.SoundSystem;
import mightypork.gamecore.control.bus.EventBus;
import mightypork.gamecore.control.bus.events.*;
import mightypork.gamecore.control.interf.Destroyable;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.gamecore.control.events.*;
import mightypork.gamecore.gui.screens.ScreenRegistry;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.loading.AsyncResourceLoader;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.utils.annotations.DefaultImpl;
import mightypork.utils.files.InstanceLock;
import mightypork.utils.logging.Log;
import mightypork.utils.logging.LogWriter;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.control.Destroyable;
import mightypork.util.control.eventbus.EventBus;
import mightypork.util.control.timing.Updateable;
import mightypork.util.files.InstanceLock;
import mightypork.util.logging.Log;
import mightypork.util.logging.writers.LogWriter;
/**

@ -4,12 +4,12 @@ package mightypork.gamecore.control;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import mightypork.gamecore.control.bus.events.MainLoopTaskRequest;
import mightypork.gamecore.control.bus.events.UpdateEvent;
import mightypork.gamecore.control.timing.TimerDelta;
import mightypork.gamecore.control.events.MainLoopTaskRequest;
import mightypork.gamecore.control.events.UpdateEvent;
import mightypork.gamecore.gui.components.Renderable;
import mightypork.gamecore.gui.screens.ScreenRegistry;
import mightypork.utils.annotations.DefaultImpl;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.control.timing.TimerDelta;
/**

@ -3,7 +3,7 @@ package mightypork.gamecore.control;
import java.util.logging.Level;
import mightypork.utils.logging.LogWriter;
import mightypork.util.logging.writers.LogWriter;
import org.newdawn.slick.util.LogSystem;

@ -1,8 +1,9 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
import mightypork.gamecore.control.interf.Destroyable;
import mightypork.util.control.Destroyable;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
/**

@ -1,6 +1,8 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.util.control.eventbus.events.Event;
import org.lwjgl.input.Keyboard;

@ -1,7 +1,8 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
/**
@ -24,6 +25,7 @@ public class LayoutChangeEvent implements Event<LayoutChangeEvent.Listener> {
}
public interface Listener {
public void onLayoutChanged();
}
}

@ -1,7 +1,8 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
/**

@ -1,8 +1,9 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -1,9 +1,10 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.UnloggedEvent;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
/**

@ -1,8 +1,9 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
import mightypork.gamecore.loading.Deferred;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
/**

@ -1,7 +1,8 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -1,7 +1,8 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
/**

@ -1,9 +1,10 @@
package mightypork.gamecore.control.bus.events;
package mightypork.gamecore.control.events;
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
import mightypork.gamecore.control.bus.events.types.UnloggedEvent;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
import mightypork.util.control.timing.Updateable;
/**

@ -1,5 +1,6 @@
package mightypork.gamecore.gui;
/**
* Horizontal align sides
*
@ -8,4 +9,4 @@ package mightypork.gamecore.gui;
public enum AlignX
{
LEFT, CENTER, RIGHT;
}
}

@ -1,5 +1,6 @@
package mightypork.gamecore.gui;
/**
* Vertical align sides
*
@ -8,4 +9,4 @@ package mightypork.gamecore.gui;
public enum AlignY
{
TOP, CENTER, BOTTOM;
}
}

@ -1,7 +1,7 @@
package mightypork.gamecore.gui.components;
import mightypork.gamecore.control.bus.events.MouseButtonEvent;
import mightypork.gamecore.control.events.MouseButtonEvent;
public abstract class ClickableComponent extends InputComponent {

@ -2,8 +2,8 @@ package mightypork.gamecore.gui.components;
import mightypork.gamecore.gui.Hideable;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -1,10 +1,10 @@
package mightypork.gamecore.gui.components;
import mightypork.gamecore.control.bus.events.MouseButtonEvent;
import mightypork.gamecore.control.interf.Enableable;
import mightypork.gamecore.gui.Action;
import mightypork.gamecore.gui.ActionTrigger;
import mightypork.gamecore.control.events.MouseButtonEvent;
import mightypork.util.control.Action;
import mightypork.util.control.ActionTrigger;
import mightypork.util.control.Enableable;
public abstract class InputComponent extends VisualComponent implements Enableable, ActionTrigger, MouseButtonEvent.Listener {
@ -33,7 +33,9 @@ public abstract class InputComponent extends VisualComponent implements Enableab
return enabled;
}
protected void triggerAction() {
if(action != null) action.run();
protected void triggerAction()
{
if (action != null) action.run();
}
}

@ -7,12 +7,12 @@ import java.util.LinkedList;
import mightypork.gamecore.audio.SoundSystem;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppSubModule;
import mightypork.gamecore.control.bus.EventBus;
import mightypork.gamecore.control.bus.clients.ClientHub;
import mightypork.gamecore.control.interf.Enableable;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.util.control.Enableable;
import mightypork.util.control.eventbus.EventBus;
import mightypork.util.control.eventbus.clients.ClientHub;
import mightypork.util.math.constraints.rect.proxy.RectBound;
public abstract class LayoutComponent extends VisualComponent implements Enableable, ClientHub, AppAccess {

@ -1,9 +1,9 @@
package mightypork.gamecore.gui.components;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.proxy.PluggableRectBound;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.PluggableRectBound;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -1,12 +1,12 @@
package mightypork.gamecore.gui.components;
import mightypork.gamecore.control.bus.events.LayoutChangeEvent;
import mightypork.utils.annotations.DefaultImpl;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.caching.AbstractRectCache;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.utils.math.constraints.rect.proxy.RectBoundAdapter;
import mightypork.gamecore.control.events.LayoutChangeEvent;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.caching.AbstractRectCache;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.rect.proxy.RectBoundAdapter;
/**

@ -2,10 +2,10 @@ package mightypork.gamecore.gui.components.layout;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.gamecore.gui.components.Component;
import mightypork.utils.math.constraints.rect.builders.TiledRect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.math.constraints.rect.builders.TiledRect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -2,9 +2,9 @@ package mightypork.gamecore.gui.components.layout;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.gamecore.gui.components.Component;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -3,11 +3,11 @@ package mightypork.gamecore.gui.components.layout;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.gamecore.gui.components.Component;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -2,10 +2,10 @@ package mightypork.gamecore.gui.components.layout;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.gamecore.gui.components.Component;
import mightypork.utils.math.constraints.rect.builders.TiledRect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.math.constraints.rect.builders.TiledRect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -3,11 +3,11 @@ package mightypork.gamecore.gui.components.layout;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.AlignY;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.gamecore.gui.components.Component;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -3,8 +3,8 @@ package mightypork.gamecore.gui.components.painters;
import mightypork.gamecore.gui.components.VisualComponent;
import mightypork.gamecore.render.Render;
import mightypork.utils.annotations.FactoryMethod;
import mightypork.utils.math.color.Color;
import mightypork.util.annotations.FactoryMethod;
import mightypork.util.math.color.Color;
/**

@ -5,11 +5,11 @@ import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.VisualComponent;
import mightypork.gamecore.render.fonts.FontRenderer;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.string.StringProvider;
import mightypork.utils.string.StringProvider.StringWrapper;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.string.StringProvider;
import mightypork.util.string.StringProvider.StringWrapper;
/**

@ -5,7 +5,7 @@ import java.util.Collection;
import java.util.TreeSet;
import mightypork.gamecore.control.AppAccess;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -3,17 +3,17 @@ package mightypork.gamecore.gui.screens;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppSubModule;
import mightypork.gamecore.control.bus.events.LayoutChangeEvent;
import mightypork.gamecore.control.bus.events.ScreenChangeEvent;
import mightypork.gamecore.control.events.LayoutChangeEvent;
import mightypork.gamecore.control.events.ScreenChangeEvent;
import mightypork.gamecore.gui.components.Renderable;
import mightypork.gamecore.input.KeyBinder;
import mightypork.gamecore.input.KeyBindingPool;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.render.Render;
import mightypork.utils.annotations.DefaultImpl;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -5,15 +5,15 @@ import java.util.Collection;
import java.util.LinkedHashSet;
import mightypork.gamecore.control.AppSubModule;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.gamecore.gui.Hideable;
import mightypork.gamecore.gui.components.Renderable;
import mightypork.gamecore.gui.components.layout.ConstraintLayout;
import mightypork.gamecore.input.KeyBinder;
import mightypork.gamecore.input.KeyBindingPool;
import mightypork.gamecore.input.KeyStroke;
import mightypork.utils.annotations.DefaultImpl;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -5,10 +5,10 @@ import java.util.HashMap;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppModule;
import mightypork.gamecore.control.bus.events.ScreenRequestEvent;
import mightypork.gamecore.control.events.ScreenRequestEvent;
import mightypork.gamecore.gui.components.Renderable;
import mightypork.utils.annotations.DefaultImpl;
import mightypork.utils.logging.Log;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.logging.Log;
/**

@ -2,15 +2,15 @@ package mightypork.gamecore.input;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.bus.clients.RootBusNode;
import mightypork.gamecore.control.bus.events.KeyEvent;
import mightypork.gamecore.control.bus.events.MouseButtonEvent;
import mightypork.gamecore.control.bus.events.MouseMotionEvent;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.gamecore.control.events.KeyEvent;
import mightypork.gamecore.control.events.MouseButtonEvent;
import mightypork.gamecore.control.events.MouseMotionEvent;
import mightypork.rogue.events.ActionRequest;
import mightypork.rogue.events.ActionRequest.RequestType;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.mutable.VectVar;
import mightypork.util.control.eventbus.clients.RootBusNode;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.mutable.VectVar;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
@ -174,7 +174,8 @@ public class InputSystem extends RootBusNode implements Updateable, KeyBinder {
/**
* Get absolute mouse position. This vect is final and views at it can safely be made.
* Get absolute mouse position. This vect is final and views at it can
* safely be made.
*
* @return mouse position
*/

@ -1,7 +1,7 @@
package mightypork.gamecore.input;
import mightypork.gamecore.gui.Action;
import mightypork.util.control.Action;
/**

@ -1,7 +1,7 @@
package mightypork.gamecore.input;
import mightypork.gamecore.control.bus.events.KeyEvent;
import mightypork.gamecore.control.events.KeyEvent;
/**

@ -5,8 +5,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import mightypork.gamecore.control.bus.events.KeyEvent;
import mightypork.utils.logging.Log;
import mightypork.gamecore.control.events.KeyEvent;
import mightypork.util.logging.Log;
/**

@ -5,12 +5,12 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import mightypork.gamecore.control.bus.BusAccess;
import mightypork.gamecore.control.bus.events.MainLoopTaskRequest;
import mightypork.gamecore.control.bus.events.ResourceLoadRequest;
import mightypork.gamecore.control.interf.Destroyable;
import mightypork.utils.annotations.FactoryMethod;
import mightypork.utils.logging.Log;
import mightypork.gamecore.control.events.MainLoopTaskRequest;
import mightypork.gamecore.control.events.ResourceLoadRequest;
import mightypork.util.annotations.FactoryMethod;
import mightypork.util.control.Destroyable;
import mightypork.util.control.eventbus.BusAccess;
import mightypork.util.logging.Log;
/**

@ -1,9 +1,9 @@
package mightypork.gamecore.loading;
import mightypork.gamecore.control.interf.Destroyable;
import mightypork.utils.annotations.Alias;
import mightypork.utils.logging.Log;
import mightypork.util.control.Destroyable;
import mightypork.util.logging.Log;
import mightypork.util.logging.LogAlias;
/**
@ -13,7 +13,7 @@ import mightypork.utils.logging.Log;
*
* @author MightyPork
*/
@Alias(name = "Resource")
@LogAlias(name = "Resource")
public abstract class DeferredResource implements Deferred, Destroyable {
private final String resource;

@ -7,12 +7,12 @@ import java.nio.ByteBuffer;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppModule;
import mightypork.gamecore.control.bus.events.ScreenChangeEvent;
import mightypork.gamecore.control.timing.FpsMeter;
import mightypork.utils.logging.Log;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.gamecore.control.events.ScreenChangeEvent;
import mightypork.util.control.timing.FpsMeter;
import mightypork.util.logging.Log;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.vect.Vect;
import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;

@ -6,13 +6,13 @@ import static org.lwjgl.opengl.GL11.*;
import java.io.IOException;
import mightypork.gamecore.render.textures.TxQuad;
import mightypork.utils.files.FileUtils;
import mightypork.utils.logging.Log;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.caching.RectDigest;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
import mightypork.util.files.FileUtils;
import mightypork.util.logging.Log;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.caching.RectDigest;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;

@ -5,7 +5,7 @@ import java.util.HashMap;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppAdapter;
import mightypork.gamecore.control.bus.events.ResourceLoadRequest;
import mightypork.gamecore.control.events.ResourceLoadRequest;
import mightypork.gamecore.render.fonts.impl.DeferredFont;
import org.newdawn.slick.opengl.Texture;
@ -16,7 +16,7 @@ import org.newdawn.slick.opengl.Texture;
*
* @author MightyPork
*/
public class FontBank extends AppAdapter {
public class FontBank extends AppAdapter {
/**
* @param app app access
@ -53,7 +53,8 @@ public class FontBank extends AppAdapter {
{
fonts.put(key, font);
}
/**
* Add a font alias.
*
@ -76,9 +77,9 @@ public class FontBank extends AppAdapter {
{
GLFont f = fonts.get(key);
if(f == null) f = fonts.get(aliases.get(key));
if (f == null) f = fonts.get(aliases.get(key));
if (f == null) {
if (f == null) {
throw new RuntimeException("There's no font called " + key + "!");
}

@ -3,9 +3,9 @@ package mightypork.gamecore.render.fonts;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.render.Render;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -1,8 +1,8 @@
package mightypork.gamecore.render.fonts;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -20,10 +20,10 @@ import java.util.Map;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.gamecore.render.textures.FilterMode;
import mightypork.utils.logging.Log;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
import mightypork.util.logging.Log;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
import org.lwjgl.BufferUtils;
import org.lwjgl.util.glu.GLU;
@ -294,8 +294,7 @@ public class CachedFont implements GLFont {
byteBuffer = ByteBuffer.allocateDirect(width * height * (bpp / 8)).order(ByteOrder.nativeOrder()).put(newI);
} else {
byteBuffer = ByteBuffer.allocateDirect(width * height * (bpp / 8)).order(ByteOrder.nativeOrder())
.put(((DataBufferByte) (bufferedImage.getData().getDataBuffer())).getData());
byteBuffer = ByteBuffer.allocateDirect(width * height * (bpp / 8)).order(ByteOrder.nativeOrder()).put(((DataBufferByte) (bufferedImage.getData().getDataBuffer())).getData());
}
byteBuffer.flip();
@ -413,8 +412,7 @@ public class CachedFont implements GLFont {
chtx = chars.get(charCurrent);
if (chtx != null) {
drawQuad((totalwidth), 0, (totalwidth + chtx.width), (chtx.height), chtx.texPosX, chtx.texPosY, chtx.texPosX + chtx.width, chtx.texPosY
+ chtx.height);
drawQuad((totalwidth), 0, (totalwidth + chtx.width), (chtx.height), chtx.texPosX, chtx.texPosY, chtx.texPosX + chtx.width, chtx.texPosY + chtx.height);
totalwidth += chtx.width;
}
}

@ -10,10 +10,10 @@ import mightypork.gamecore.loading.DeferredResource;
import mightypork.gamecore.loading.MustLoadInMainThread;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.gamecore.render.textures.FilterMode;
import mightypork.utils.annotations.Alias;
import mightypork.utils.files.FileUtils;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.files.FileUtils;
import mightypork.util.logging.LogAlias;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.vect.Vect;
/**
@ -22,7 +22,7 @@ import mightypork.utils.math.constraints.vect.Vect;
* @author MightyPork
*/
@MustLoadInMainThread
@Alias(name = "Font")
@LogAlias(name = "Font")
public class DeferredFont extends DeferredResource implements GLFont {
public static enum FontStyle
@ -129,7 +129,7 @@ public class DeferredFont extends DeferredResource implements GLFont {
*/
protected Font getAwtFont(String resource, float size, int style) throws FontFormatException, IOException
{
try(InputStream in = FileUtils.getResource(resource)) {
try (InputStream in = FileUtils.getResource(resource)) {
Font awtFont = Font.createFont(Font.TRUETYPE_FONT, in);

@ -6,7 +6,7 @@ import java.awt.FontFormatException;
import java.io.IOException;
import mightypork.gamecore.render.textures.FilterMode;
import mightypork.utils.annotations.Alias;
import mightypork.util.logging.LogAlias;
/**
@ -14,7 +14,7 @@ import mightypork.utils.annotations.Alias;
*
* @author MightyPork
*/
@Alias(name = "FontNative")
@LogAlias(name = "FontNative")
public class DeferredFontNative extends DeferredFont {
/**

@ -4,8 +4,8 @@ package mightypork.gamecore.render.textures;
import mightypork.gamecore.loading.DeferredResource;
import mightypork.gamecore.loading.MustLoadInMainThread;
import mightypork.gamecore.render.Render;
import mightypork.utils.annotations.Alias;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.util.logging.LogAlias;
import mightypork.util.math.constraints.rect.Rect;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;
@ -17,7 +17,7 @@ import org.newdawn.slick.opengl.Texture;
* @author MightyPork
*/
@MustLoadInMainThread
@Alias(name = "Texture")
@LogAlias(name = "Texture")
public class DeferredTexture extends DeferredResource implements FilteredTexture {
private Texture backingTexture;

@ -5,8 +5,8 @@ import java.util.HashMap;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppAdapter;
import mightypork.gamecore.control.bus.events.ResourceLoadRequest;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.gamecore.control.events.ResourceLoadRequest;
import mightypork.util.math.constraints.rect.Rect;
import org.newdawn.slick.opengl.Texture;

@ -1,7 +1,7 @@
package mightypork.gamecore.render.textures;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.Rect;
import org.newdawn.slick.opengl.Texture;

@ -6,7 +6,6 @@ import java.util.Locale;
import mightypork.gamecore.control.BaseApp;
import mightypork.gamecore.control.GameLoop;
import mightypork.gamecore.control.bus.EventBus;
import mightypork.gamecore.gui.screens.ScreenRegistry;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.input.KeyStroke;
@ -19,8 +18,9 @@ import mightypork.rogue.screens.main_menu.ScreenMainMenu;
import mightypork.rogue.screens.test_bouncyboxes.ScreenTestBouncy;
import mightypork.rogue.screens.test_cat_sound.ScreenTestCat;
import mightypork.rogue.screens.test_render.ScreenTestRender;
import mightypork.utils.logging.Log;
import mightypork.utils.logging.LogWriter;
import mightypork.util.control.eventbus.EventBus;
import mightypork.util.logging.Log;
import mightypork.util.logging.writers.LogWriter;
/**

@ -1,8 +1,8 @@
package mightypork.rogue;
import mightypork.utils.config.PropertyManager;
import mightypork.utils.logging.Log;
import mightypork.util.config.PropertyManager;
import mightypork.util.logging.Log;
/**

@ -9,12 +9,12 @@ import java.util.Date;
import mightypork.gamecore.control.BaseApp;
import mightypork.gamecore.control.GameLoop;
import mightypork.gamecore.gui.Action;
import mightypork.gamecore.render.Screenshot;
import mightypork.rogue.events.ActionRequest;
import mightypork.rogue.events.ActionRequest.RequestType;
import mightypork.rogue.util.Utils;
import mightypork.utils.logging.Log;
import mightypork.util.control.Action;
import mightypork.util.logging.Log;
public class MainLoop extends GameLoop implements ActionRequest.Listener {

@ -3,7 +3,7 @@ package mightypork.rogue;
import java.io.File;
import mightypork.utils.files.OsUtils;
import mightypork.util.files.OsUtils;
public class Paths {

@ -59,7 +59,7 @@ public class Res {
font = new DeferredFont("/res/font/PolygonPixel5x7Standard.ttf", Glyphs.basic, 16);
fonts.loadFont("polygon_pixel", font);
font = new DeferredFont("/res/font/PressStart2P.ttf", Glyphs.basic, 16);
fonts.loadFont("press_start", font);

@ -1,8 +1,8 @@
package mightypork.rogue.events;
import mightypork.gamecore.control.bus.events.Event;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
/**

@ -1,7 +1,6 @@
package mightypork.rogue.screens;
import mightypork.gamecore.gui.Action;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.painters.TextPainter;
import mightypork.gamecore.gui.screens.Screen;
@ -10,11 +9,11 @@ import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.rogue.Res;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.string.StringProvider;
import mightypork.util.control.Action;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.string.StringProvider;
public class LayerFps extends ScreenLayer {
@ -50,12 +49,13 @@ public class LayerFps extends ScreenLayer {
}
});
tp.setRect(constraint);
tp.setRect(constraint);
tp.setShadow(Color.BLACK, Vect.make(tp.height().div(16)));
root.add(tp);
}
@Override
protected void renderLayer()
{

@ -1,11 +1,12 @@
package mightypork.rogue.screens.main_menu;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.ClickableComponent;
import mightypork.gamecore.gui.components.painters.TextPainter;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.rogue.Res;
import mightypork.utils.math.color.Color;
import mightypork.util.math.color.Color;
class MenuButton extends ClickableComponent {
@ -13,6 +14,7 @@ class MenuButton extends ClickableComponent {
private static GLFont font = Res.getFont("main_menu_button");
private TextPainter painter;
public MenuButton(String text, Color color) {
this.painter = new TextPainter(font, AlignX.CENTER, color, text);
painter.setRect(this.shrink(this.height().perc(5)));

@ -1,35 +1,33 @@
package mightypork.rogue.screens.main_menu;
import java.net.Authenticator.RequestorType;
import mightypork.gamecore.control.bus.events.ScreenRequestEvent;
import mightypork.gamecore.gui.Action;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.control.events.ScreenRequestEvent;
import mightypork.gamecore.gui.AlignY;
import mightypork.gamecore.gui.components.layout.VerticalFixedFlowLayout;
import mightypork.gamecore.gui.components.painters.TextPainter;
import mightypork.gamecore.gui.screens.Screen;
import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.rogue.Res;
import mightypork.rogue.events.ActionRequest;
import mightypork.rogue.events.ActionRequest.RequestType;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.util.control.Action;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
class MenuLayer extends ScreenLayer {
public MenuLayer(Screen screen) {
super(screen);
init();
}
private void init()
{
Rect menuBox = root.shrink(root.height().min(root.width()).mul(0.1));
Rect menuBox = root.shrink(root.height().min(root.width()).mul(0.1));
Num lineHeight = menuBox.height().min(menuBox.width()).mul(0.1);
@ -37,10 +35,10 @@ class MenuLayer extends ScreenLayer {
root.add(layout);
GLFont f = Res.getFont("press_start");
MenuButton b1,b2,b3,b4;
MenuButton b1, b2, b3, b4;
layout.add(b1 = new MenuButton("Render test", Color.WHITE));
layout.add(b2 = new MenuButton("Bouncy Cubes", Color.CYAN));
layout.add(b3 = new MenuButton("Flying Cat",Color.MAGENTA));
layout.add(b3 = new MenuButton("Flying Cat", Color.MAGENTA));
layout.add(b4 = new MenuButton("Bye!", Color.GREEN));
b1.setAction(new Action() {
@ -80,7 +78,8 @@ class MenuLayer extends ScreenLayer {
}
});
}
@Override
public int getPriority()
{

@ -3,15 +3,15 @@ package mightypork.rogue.screens.test_bouncyboxes;
import java.util.Random;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.gamecore.gui.components.VisualComponent;
import mightypork.gamecore.render.Render;
import mightypork.utils.math.Easing;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.num.mutable.NumAnimated;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.caching.RectCache;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.Easing;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.num.mutable.NumAnimated;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.caching.RectCache;
public class BouncyBox extends VisualComponent implements Updateable {

@ -12,9 +12,9 @@ import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys;
import mightypork.rogue.Res;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.vect.Vect;
public class LayerBouncyBoxes extends ScreenLayer {

@ -2,7 +2,7 @@ package mightypork.rogue.screens.test_bouncyboxes;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.bus.events.ScreenRequestEvent;
import mightypork.gamecore.control.events.ScreenRequestEvent;
import mightypork.gamecore.gui.screens.LayeredScreen;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys;

@ -1,19 +1,21 @@
package mightypork.rogue.screens.test_cat_sound;
import mightypork.gamecore.gui.components.painters.QuadPainter;
import mightypork.gamecore.gui.screens.Screen;
import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.utils.math.color.Color;
import mightypork.util.math.color.Color;
public class LayerColor extends ScreenLayer{
public class LayerColor extends ScreenLayer {
public LayerColor(Screen screen, Color color) {
super(screen);
root.add(new QuadPainter(color));
}
@Override
public int getPriority()
{

@ -3,8 +3,7 @@ package mightypork.rogue.screens.test_cat_sound;
import java.util.Random;
import mightypork.gamecore.control.bus.events.MouseButtonEvent;
import mightypork.gamecore.control.timing.Updateable;
import mightypork.gamecore.control.events.MouseButtonEvent;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.painters.ImagePainter;
import mightypork.gamecore.gui.components.painters.QuadPainter;
@ -14,13 +13,12 @@ import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys;
import mightypork.rogue.Res;
import mightypork.utils.math.Easing;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.num.mutable.NumAnimated;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.mutable.VectAnimated;
import mightypork.util.math.Easing;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.mutable.NumAnimated;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.mutable.VectAnimated;
public class LayerFlyingCat extends ScreenLayer implements MouseButtonEvent.Listener {
@ -51,18 +49,17 @@ public class LayerFlyingCat extends ScreenLayer implements MouseButtonEvent.List
QuadPainter cat_frame = QuadPainter.gradV(Color.YELLOW, Color.RED);
cat_frame.setRect(cat.grow(cat.height().mul(0.05)));
cat_frame.enableCaching(false);
// frame shadow
QuadPainter cat_shadow = new QuadPainter(Color.dark(0.4));
cat_shadow.setRect(cat_frame.move(Vect.make(cat.height().mul(0.05))));
cat_shadow.enableCaching(false);
// add to root layout
root.add(cat_shadow);
root.add(cat_frame);
root.add(cat);
// Meow
TextPainter tp = new TextPainter(Res.getFont("press_start"));
tp.setAlign(AlignX.CENTER);

@ -2,7 +2,7 @@ package mightypork.rogue.screens.test_cat_sound;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.bus.events.ScreenRequestEvent;
import mightypork.gamecore.control.events.ScreenRequestEvent;
import mightypork.gamecore.gui.screens.LayeredScreen;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys;

@ -4,8 +4,8 @@ package mightypork.rogue.screens.test_render;
import mightypork.gamecore.gui.screens.Screen;
import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.gamecore.render.Render;
import mightypork.utils.math.color.Color;
import mightypork.utils.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.rect.proxy.RectBound;
public class LayerTestGradient extends ScreenLayer {

@ -4,7 +4,6 @@ package mightypork.rogue.screens.test_render;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.screens.LayeredScreen;
import mightypork.rogue.screens.LayerFps;
import mightypork.rogue.screens.test_cat_sound.LayerFlyingCat;
public class ScreenTestRender extends LayeredScreen {

@ -1,9 +1,9 @@
package mightypork.test;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.caching.VectCache;
import mightypork.utils.math.constraints.vect.mutable.VectVar;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.caching.VectCache;
import mightypork.util.math.constraints.vect.mutable.VectVar;
public class TestConstCaching {

@ -3,13 +3,13 @@ package mightypork.test;
import java.util.Locale;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.num.mutable.NumVar;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.utils.math.constraints.rect.RectConst;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
import mightypork.utils.math.constraints.vect.mutable.VectVar;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.num.mutable.NumVar;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.RectConst;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
import mightypork.util.math.constraints.vect.mutable.VectVar;
public class TestConstr {

@ -3,7 +3,7 @@ package mightypork.test;
import java.util.Locale;
import mightypork.utils.objects.Convert;
import mightypork.util.objects.Convert;
public class TestConvert {

@ -1,10 +1,10 @@
package mightypork.test;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.num.mutable.NumVar;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.mutable.VectVar;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.num.mutable.NumVar;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.mutable.VectVar;
public class TestCoords {

@ -1,9 +1,9 @@
package mightypork.test;
import mightypork.utils.math.constraints.num.Num;
import mightypork.utils.math.constraints.num.mutable.NumVar;
import mightypork.utils.math.constraints.rect.Rect;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.num.mutable.NumVar;
import mightypork.util.math.constraints.rect.Rect;
public class TestTiled {

@ -1,9 +1,9 @@
package mightypork.test;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
import mightypork.utils.math.constraints.vect.mutable.VectVar;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
import mightypork.util.math.constraints.vect.mutable.VectVar;
public class TestVec {

@ -1,4 +1,4 @@
package mightypork.utils.annotations;
package mightypork.util.annotations;
import java.lang.annotation.Documented;

@ -1,4 +1,4 @@
package mightypork.utils.annotations;
package mightypork.util.annotations;
import java.lang.annotation.Documented;

@ -1,4 +1,4 @@
package mightypork.utils.config;
package mightypork.util.config;
import java.io.File;
@ -9,10 +9,10 @@ import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.TreeMap;
import mightypork.utils.math.Range;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
import mightypork.utils.objects.Convert;
import mightypork.util.math.Range;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
import mightypork.util.objects.Convert;
/**
@ -179,7 +179,7 @@ public class PropertyManager {
}
}
try(FileInputStream fis = new FileInputStream(file)) {
try (FileInputStream fis = new FileInputStream(file)) {
props.load(fis);
} catch (final IOException e) {
needsSave = true;

@ -1,4 +1,4 @@
package mightypork.utils.config;
package mightypork.util.config;
import java.io.File;
@ -9,8 +9,8 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import mightypork.utils.files.FileUtils;
import mightypork.utils.logging.Log;
import mightypork.util.files.FileUtils;
import mightypork.util.logging.Log;
/**

@ -1,4 +1,4 @@
package mightypork.utils.config;
package mightypork.util.config;
import java.io.*;

@ -1,7 +1,4 @@
package mightypork.gamecore.gui;
import mightypork.gamecore.control.interf.Enableable;
package mightypork.util.control;
/**

@ -1,4 +1,4 @@
package mightypork.gamecore.gui;
package mightypork.util.control;
/**

@ -1,4 +1,4 @@
package mightypork.gamecore.control.interf;
package mightypork.util.control;
/**

@ -1,4 +1,4 @@
package mightypork.gamecore.control.interf;
package mightypork.util.control;
/**

@ -1,4 +1,4 @@
package mightypork.gamecore.control.bus;
package mightypork.util.control.eventbus;
import java.util.Collection;

@ -1,4 +1,4 @@
package mightypork.gamecore.control.bus;
package mightypork.util.control.eventbus;
/**

@ -1,4 +1,4 @@
package mightypork.gamecore.control.bus;
package mightypork.util.control.eventbus;
import java.util.Collection;
@ -6,15 +6,15 @@ import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
import mightypork.gamecore.control.bus.clients.DelegatingClient;
import mightypork.gamecore.control.bus.events.Event;
import mightypork.gamecore.control.bus.events.types.DelayedEvent;
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
import mightypork.gamecore.control.bus.events.types.UnloggedEvent;
import mightypork.gamecore.control.interf.Destroyable;
import mightypork.utils.annotations.FactoryMethod;
import mightypork.utils.logging.Log;
import mightypork.util.annotations.FactoryMethod;
import mightypork.util.control.Destroyable;
import mightypork.util.control.eventbus.clients.DelegatingClient;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.DelayedEvent;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
import mightypork.util.logging.Log;
/**

@ -1,14 +1,14 @@
package mightypork.gamecore.control.bus;
package mightypork.util.control.eventbus;
import java.util.Collection;
import java.util.HashSet;
import mightypork.gamecore.control.bus.clients.DelegatingClient;
import mightypork.gamecore.control.bus.clients.ToggleableClient;
import mightypork.gamecore.control.bus.events.Event;
import mightypork.gamecore.control.bus.events.types.SingleReceiverEvent;
import mightypork.utils.logging.Log;
import mightypork.util.control.eventbus.clients.DelegatingClient;
import mightypork.util.control.eventbus.clients.ToggleableClient;
import mightypork.util.control.eventbus.events.Event;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.logging.Log;
/**

@ -1,12 +1,12 @@
package mightypork.gamecore.control.bus.clients;
package mightypork.util.control.eventbus.clients;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
import mightypork.gamecore.control.bus.BusAccess;
import mightypork.gamecore.control.bus.EventBus;
import mightypork.util.control.eventbus.BusAccess;
import mightypork.util.control.eventbus.EventBus;
/**

@ -1,9 +1,9 @@
package mightypork.gamecore.control.bus.clients;
package mightypork.util.control.eventbus.clients;
import java.util.Collection;
import mightypork.gamecore.control.bus.EventBus;
import mightypork.util.control.eventbus.EventBus;
/**

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save