cleanup, util packages reorganized, removed some sysouts

v5stable
Ondřej Hruška 11 years ago
parent 34e1f3c797
commit 289145a9aa
  1. 2
      src/mightypork/gamecore/audio/DeferredAudio.java
  2. 6
      src/mightypork/gamecore/audio/SoundSystem.java
  3. 2
      src/mightypork/gamecore/audio/players/EffectPlayer.java
  4. 6
      src/mightypork/gamecore/audio/players/LoopPlayer.java
  5. 2
      src/mightypork/gamecore/control/GameLoop.java
  6. 4
      src/mightypork/gamecore/control/events/core/DestroyEvent.java
  7. 11
      src/mightypork/gamecore/control/events/core/UpdateEvent.java
  8. 7
      src/mightypork/gamecore/control/events/gui/LayoutChangeEvent.java
  9. 3
      src/mightypork/gamecore/control/events/gui/LayoutChangeListener.java
  10. 7
      src/mightypork/gamecore/control/events/gui/ViewportChangeEvent.java
  11. 3
      src/mightypork/gamecore/control/events/gui/ViewportChangeListener.java
  12. 4
      src/mightypork/gamecore/control/events/input/KeyEvent.java
  13. 3
      src/mightypork/gamecore/control/events/input/KeyListener.java
  14. 9
      src/mightypork/gamecore/control/events/input/MouseButtonEvent.java
  15. 3
      src/mightypork/gamecore/control/events/input/MouseButtonListener.java
  16. 9
      src/mightypork/gamecore/control/events/input/MouseMotionEvent.java
  17. 3
      src/mightypork/gamecore/control/events/input/MouseMotionListener.java
  18. 5
      src/mightypork/gamecore/control/events/requests/MainLoopRequest.java
  19. 3
      src/mightypork/gamecore/control/events/requests/MainLoopRequestListener.java
  20. 5
      src/mightypork/gamecore/control/events/requests/ResourceLoadRequest.java
  21. 4
      src/mightypork/gamecore/control/events/requests/ResourceLoadRequestListener.java
  22. 5
      src/mightypork/gamecore/control/events/requests/ScreenRequestEvent.java
  23. 3
      src/mightypork/gamecore/control/events/requests/ScreenRequestListener.java
  24. 4
      src/mightypork/gamecore/gui/components/Component.java
  25. 2
      src/mightypork/gamecore/gui/components/LayoutComponent.java
  26. 6
      src/mightypork/gamecore/gui/components/PluggableRenderable.java
  27. 8
      src/mightypork/gamecore/gui/components/VisualComponent.java
  28. 4
      src/mightypork/gamecore/gui/components/layout/ColumnHolder.java
  29. 2
      src/mightypork/gamecore/gui/components/layout/ConstraintLayout.java
  30. 4
      src/mightypork/gamecore/gui/components/layout/GridLayout.java
  31. 6
      src/mightypork/gamecore/gui/components/layout/HorizontalFixedFlowLayout.java
  32. 4
      src/mightypork/gamecore/gui/components/layout/RowHolder.java
  33. 6
      src/mightypork/gamecore/gui/components/layout/VerticalFixedFlowLayout.java
  34. 4
      src/mightypork/gamecore/gui/components/painters/TextPainter.java
  35. 2
      src/mightypork/gamecore/gui/screens/BaseScreen.java
  36. 9
      src/mightypork/gamecore/gui/screens/LayeredScreen.java
  37. 8
      src/mightypork/gamecore/gui/screens/Overlay.java
  38. 2
      src/mightypork/gamecore/gui/screens/Screen.java
  39. 10
      src/mightypork/gamecore/input/InputSystem.java
  40. 8
      src/mightypork/gamecore/render/DisplaySystem.java
  41. 9
      src/mightypork/gamecore/render/Render.java
  42. 4
      src/mightypork/gamecore/render/fonts/FontRenderer.java
  43. 2
      src/mightypork/gamecore/render/fonts/GLFont.java
  44. 4
      src/mightypork/gamecore/render/fonts/impl/CachedFont.java
  45. 2
      src/mightypork/gamecore/render/fonts/impl/DeferredFont.java
  46. 2
      src/mightypork/gamecore/render/textures/DeferredTexture.java
  47. 2
      src/mightypork/gamecore/render/textures/GLTexture.java
  48. 2
      src/mightypork/gamecore/render/textures/QuadGrid.java
  49. 2
      src/mightypork/gamecore/render/textures/TextureBank.java
  50. 4
      src/mightypork/gamecore/render/textures/TxQuad.java
  51. 2
      src/mightypork/rogue/App.java
  52. 2
      src/mightypork/rogue/Config.java
  53. 2
      src/mightypork/rogue/events/ActionRequest.java
  54. 4
      src/mightypork/rogue/screens/CrossfadeOverlay.java
  55. 6
      src/mightypork/rogue/screens/FpsOverlay.java
  56. 4
      src/mightypork/rogue/screens/gamescreen/HudLayer.java
  57. 7
      src/mightypork/rogue/screens/gamescreen/ScreenGame.java
  58. 10
      src/mightypork/rogue/screens/gamescreen/WorldLayer.java
  59. 6
      src/mightypork/rogue/screens/gamescreen/gui/HeartBar.java
  60. 12
      src/mightypork/rogue/screens/gamescreen/gui/NavItemSlot.java
  61. 2
      src/mightypork/rogue/screens/gamescreen/world/MIPKeyWalk.java
  62. 12
      src/mightypork/rogue/screens/gamescreen/world/MIPMouseWalk.java
  63. 2
      src/mightypork/rogue/screens/gamescreen/world/MapInteractionPlugin.java
  64. 15
      src/mightypork/rogue/screens/gamescreen/world/MapView.java
  65. 6
      src/mightypork/rogue/screens/main_menu/MenuButton.java
  66. 4
      src/mightypork/rogue/screens/main_menu/MenuLayer.java
  67. 10
      src/mightypork/rogue/screens/test_bouncyboxes/BouncyBox.java
  68. 4
      src/mightypork/rogue/screens/test_bouncyboxes/LayerBouncyBoxes.java
  69. 8
      src/mightypork/rogue/screens/test_cat_sound/LayerFlyingCat.java
  70. 2
      src/mightypork/rogue/screens/test_render/LayerTestGradient.java
  71. 6
      src/mightypork/rogue/world/PathStep.java
  72. 3
      src/mightypork/rogue/world/PlayerControl.java
  73. 4
      src/mightypork/rogue/world/PlayerInfo.java
  74. 10
      src/mightypork/rogue/world/World.java
  75. 10
      src/mightypork/rogue/world/WorldPos.java
  76. 53
      src/mightypork/rogue/world/WorldRenderer.java
  77. 12
      src/mightypork/rogue/world/entity/Entity.java
  78. 2
      src/mightypork/rogue/world/entity/renderers/PlayerRenderer.java
  79. 8
      src/mightypork/rogue/world/item/Item.java
  80. 2
      src/mightypork/rogue/world/item/ItemModel.java
  81. 14
      src/mightypork/rogue/world/level/Level.java
  82. 2
      src/mightypork/rogue/world/level/render/EntityRenderContext.java
  83. 13
      src/mightypork/rogue/world/level/render/MapRenderContext.java
  84. 4
      src/mightypork/rogue/world/level/render/TileRenderContext.java
  85. 8
      src/mightypork/rogue/world/tile/DroppedItemRenderer.java
  86. 8
      src/mightypork/rogue/world/tile/Tile.java
  87. 2
      src/mightypork/rogue/world/tile/renderers/BasicTileRenderer.java
  88. 11
      src/mightypork/util/control/eventbus/BusEvent.java
  89. 9
      src/mightypork/util/control/eventbus/EventBus.java
  90. 1
      src/mightypork/util/control/eventbus/EventChannel.java
  91. 2
      src/mightypork/util/control/eventbus/event_flags/DelayedEvent.java
  92. 2
      src/mightypork/util/control/eventbus/event_flags/ImmediateEvent.java
  93. 3
      src/mightypork/util/control/eventbus/event_flags/NonConsumableEvent.java
  94. 2
      src/mightypork/util/control/eventbus/event_flags/SingleReceiverEvent.java
  95. 2
      src/mightypork/util/control/eventbus/event_flags/UnloggedEvent.java
  96. 6
      src/mightypork/util/files/config/PropertyManager.java
  97. 2
      src/mightypork/util/files/config/SimpleConfig.java
  98. 2
      src/mightypork/util/files/config/SortedProperties.java
  99. 4
      src/mightypork/util/files/ion/Ion.java
  100. 2
      src/mightypork/util/files/ion/IonBinary.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.util.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;

@ -9,11 +9,11 @@ import mightypork.gamecore.audio.players.EffectPlayer;
import mightypork.gamecore.audio.players.LoopPlayer;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.events.requests.ResourceLoadRequest;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.mutable.VectVar;
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 mightypork.util.timing.Updateable;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.AL10;

@ -3,7 +3,7 @@ package mightypork.gamecore.audio.players;
import mightypork.gamecore.audio.DeferredAudio;
import mightypork.gamecore.audio.Volume;
import mightypork.util.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.util.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 mightypork.util.timing.Pauseable;
import mightypork.util.timing.Updateable;
import org.lwjgl.openal.AL10;

@ -9,7 +9,7 @@ import mightypork.gamecore.control.events.requests.MainLoopRequestListener;
import mightypork.gamecore.gui.screens.ScreenRegistry;
import mightypork.gamecore.render.Renderable;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.control.timing.TimerDelta;
import mightypork.util.timing.TimerDelta;
/**

@ -3,8 +3,8 @@ package mightypork.gamecore.control.events.core;
import mightypork.util.control.Destroyable;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
import mightypork.util.control.eventbus.events.flags.NonConsumableEvent;
import mightypork.util.control.eventbus.event_flags.ImmediateEvent;
import mightypork.util.control.eventbus.event_flags.NonConsumableEvent;
/**

@ -2,10 +2,10 @@ package mightypork.gamecore.control.events.core;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
import mightypork.util.control.eventbus.events.flags.NonConsumableEvent;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
import mightypork.util.control.timing.Updateable;
import mightypork.util.control.eventbus.event_flags.ImmediateEvent;
import mightypork.util.control.eventbus.event_flags.NonConsumableEvent;
import mightypork.util.control.eventbus.event_flags.UnloggedEvent;
import mightypork.util.timing.Updateable;
/**
@ -24,7 +24,8 @@ public class UpdateEvent extends BusEvent<Updateable> {
/**
* @param deltaTime time since last update (sec)
*/
public UpdateEvent(double deltaTime) {
public UpdateEvent(double deltaTime)
{
this.deltaTime = deltaTime;
}

@ -2,8 +2,8 @@ package mightypork.gamecore.control.events.gui;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
import mightypork.util.control.eventbus.events.flags.NonConsumableEvent;
import mightypork.util.control.eventbus.event_flags.ImmediateEvent;
import mightypork.util.control.eventbus.event_flags.NonConsumableEvent;
/**
@ -16,7 +16,8 @@ import mightypork.util.control.eventbus.events.flags.NonConsumableEvent;
@NonConsumableEvent
public class LayoutChangeEvent extends BusEvent<LayoutChangeListener> {
public LayoutChangeEvent() {
public LayoutChangeEvent()
{
}

@ -1,6 +1,7 @@
package mightypork.gamecore.control.events.gui;
public interface LayoutChangeListener {
public void onLayoutChanged();
}
}

@ -1,9 +1,9 @@
package mightypork.gamecore.control.events.gui;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.NonConsumableEvent;
import mightypork.util.control.eventbus.event_flags.NonConsumableEvent;
import mightypork.util.math.constraints.vect.Vect;
/**
@ -24,7 +24,8 @@ public class ViewportChangeEvent extends BusEvent<ViewportChangeListener> {
* @param fullscreen is now fullscreen
* @param size new screen size
*/
public ViewportChangeEvent(boolean fsChanged, boolean fullscreen, Vect size) {
public ViewportChangeEvent(boolean fsChanged, boolean fullscreen, Vect size)
{
this.fullscreen = fullscreen;
this.screenSize = size;
this.fsChanged = fsChanged;

@ -1,5 +1,6 @@
package mightypork.gamecore.control.events.gui;
/**
* {@link ViewportChangeEvent} listener
*
@ -13,4 +14,4 @@ public interface ViewportChangeListener {
* @param event
*/
void onViewportChanged(ViewportChangeEvent event);
}
}

@ -23,7 +23,8 @@ public class KeyEvent extends BusEvent<KeyListener> {
* @param c typed char (can be zero char)
* @param down true = pressed, false = released.
*/
public KeyEvent(int key, char c, boolean down) {
public KeyEvent(int key, char c, boolean down)
{
this.key = key;
this.c = c;
this.down = down;
@ -72,6 +73,7 @@ public class KeyEvent extends BusEvent<KeyListener> {
keh.receive(this);
}
@Override
public String toString()
{

@ -1,5 +1,6 @@
package mightypork.gamecore.control.events.input;
/**
* {@link KeyEvent} listener
*
@ -13,4 +14,4 @@ public interface KeyListener {
* @param event event
*/
void receive(KeyEvent event);
}
}

@ -1,10 +1,10 @@
package mightypork.gamecore.control.events.input;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.VectConst;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
/**
@ -32,7 +32,8 @@ public class MouseButtonEvent extends BusEvent<MouseButtonListener> {
* @param down button pressed
* @param wheeld wheel change
*/
public MouseButtonEvent(Vect pos, int button, boolean down, int wheeld) {
public MouseButtonEvent(Vect pos, int button, boolean down, int wheeld)
{
this.button = button;
this.down = down;
this.pos = pos.freeze();

@ -1,5 +1,6 @@
package mightypork.gamecore.control.events.input;
/**
* {@link MouseButtonEvent} listener
*
@ -13,4 +14,4 @@ public interface MouseButtonListener {
* @param event event
*/
void receive(MouseButtonEvent event);
}
}

@ -1,10 +1,10 @@
package mightypork.gamecore.control.events.input;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.VectConst;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
import mightypork.util.control.eventbus.event_flags.UnloggedEvent;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
/**
@ -23,7 +23,8 @@ public class MouseMotionEvent extends BusEvent<MouseMotionListener> {
* @param pos end pos
* @param move move vector
*/
public MouseMotionEvent(Vect pos, Vect move) {
public MouseMotionEvent(Vect pos, Vect move)
{
this.move = move.freeze();
this.pos = pos.freeze();
}

@ -1,5 +1,6 @@
package mightypork.gamecore.control.events.input;
/**
* {@link MouseMotionEvent} listener
*
@ -13,4 +14,4 @@ public interface MouseMotionListener {
* @param event event
*/
void receive(MouseMotionEvent event);
}
}

@ -2,7 +2,7 @@ package mightypork.gamecore.control.events.requests;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent;
/**
@ -19,7 +19,8 @@ public class MainLoopRequest extends BusEvent<MainLoopRequestListener> {
/**
* @param task task to run on main thread in rendering context
*/
public MainLoopRequest(Runnable task) {
public MainLoopRequest(Runnable task)
{
this.task = task;
}

@ -1,5 +1,6 @@
package mightypork.gamecore.control.events.requests;
/**
* {@link MainLoopRequest} listener
*
@ -13,4 +14,4 @@ public interface MainLoopRequestListener {
* @param request
*/
void queueTask(Runnable request);
}
}

@ -3,7 +3,7 @@ package mightypork.gamecore.control.events.requests;
import mightypork.gamecore.loading.Deferred;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent;
/**
@ -20,7 +20,8 @@ public class ResourceLoadRequest extends BusEvent<ResourceLoadRequestListener> {
/**
* @param resource resource to load
*/
public ResourceLoadRequest(Deferred resource) {
public ResourceLoadRequest(Deferred resource)
{
this.resource = resource;
}

@ -1,7 +1,9 @@
package mightypork.gamecore.control.events.requests;
import mightypork.gamecore.loading.Deferred;
/**
* {@link ResourceLoadRequest} listener
*
@ -15,4 +17,4 @@ public interface ResourceLoadRequestListener {
* @param resource
*/
void loadResource(Deferred resource);
}
}

@ -2,7 +2,7 @@ package mightypork.gamecore.control.events.requests;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent;
/**
@ -19,7 +19,8 @@ public class ScreenRequestEvent extends BusEvent<ScreenRequestListener> {
/**
* @param screenKey screen name
*/
public ScreenRequestEvent(String screenKey) {
public ScreenRequestEvent(String screenKey)
{
scrName = screenKey;
}

@ -1,5 +1,6 @@
package mightypork.gamecore.control.events.requests;
/**
* {@link ScreenRequestEvent} listener
*
@ -11,4 +12,4 @@ public interface ScreenRequestListener {
* @param key screen to show
*/
void showScreen(String key);
}
}

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

@ -9,10 +9,10 @@ import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppSubModule;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.DisplaySystem;
import mightypork.util.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 {

@ -2,9 +2,9 @@ package mightypork.gamecore.gui.components;
import mightypork.gamecore.render.Renderable;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.proxy.PluggableRectBound;
import mightypork.util.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;
/**

@ -6,10 +6,10 @@ import mightypork.gamecore.control.events.gui.LayoutChangeListener;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.render.Renderable;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.caching.AbstractRectCache;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.constraints.rect.proxy.RectBoundAdapter;
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;
/**

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

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

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

@ -5,9 +5,9 @@ import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.Component;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

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

@ -5,9 +5,9 @@ import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.gui.AlignY;
import mightypork.gamecore.gui.components.Component;
import mightypork.gamecore.gui.components.LayoutComponent;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -5,9 +5,9 @@ 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.util.constraints.rect.Rect;
import mightypork.util.constraints.vect.Vect;
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;

@ -10,7 +10,7 @@ import mightypork.gamecore.input.KeyBindingPool;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.render.Render;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.Rect;
/**

@ -7,7 +7,6 @@ import java.util.TreeSet;
import mightypork.gamecore.control.AppAccess;
import mightypork.util.control.eventbus.clients.DelegatingClient;
import mightypork.util.control.eventbus.clients.RootBusNode;
/**
@ -18,14 +17,15 @@ import mightypork.util.control.eventbus.clients.RootBusNode;
public abstract class LayeredScreen extends BaseScreen {
private class LayersClient implements DelegatingClient {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public Collection getChildClients()
{
return layersByEventPriority;
}
@Override
public boolean doesDelegate()
{
@ -60,7 +60,8 @@ public abstract class LayeredScreen extends BaseScreen {
/**
* @param app app access
*/
public LayeredScreen(AppAccess app) {
public LayeredScreen(AppAccess app)
{
super(app);
addChildClient(layersClient);
}

@ -14,8 +14,8 @@ import mightypork.gamecore.input.KeyBindingPool;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.render.Renderable;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.timing.Updateable;
/**
@ -42,7 +42,8 @@ public abstract class Overlay extends AppSubModule implements Comparable<Overlay
protected final Collection<Updateable> updated = new LinkedHashSet<>();
public Overlay(AppAccess app) {
public Overlay(AppAccess app)
{
super(app);
this.mouse = getInput().getMousePos();
@ -123,6 +124,7 @@ public abstract class Overlay extends AppSubModule implements Comparable<Overlay
}
}
@Override
public int compareTo(Overlay o)
{

@ -3,7 +3,7 @@ package mightypork.gamecore.gui.screens;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.render.Renderable;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.rect.proxy.RectBound;
/**

@ -7,10 +7,10 @@ import mightypork.gamecore.control.events.input.MouseButtonEvent;
import mightypork.gamecore.control.events.input.MouseMotionEvent;
import mightypork.rogue.events.ActionRequest;
import mightypork.rogue.events.ActionRequest.RequestType;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.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 mightypork.util.timing.Updateable;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
@ -210,8 +210,8 @@ public class InputSystem extends RootBusNode implements Updateable, KeyBinder {
{
return Keyboard.isKeyDown(key);
}
public static boolean isMouseButtonDown(int button)
{
return Mouse.isButtonDown(button);

@ -8,11 +8,11 @@ import java.nio.ByteBuffer;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppModule;
import mightypork.gamecore.control.events.gui.ViewportChangeEvent;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.constraints.vect.Vect;
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 mightypork.util.timing.FpsMeter;
import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;

@ -8,13 +8,13 @@ import java.io.IOException;
import mightypork.gamecore.render.textures.FilterMode;
import mightypork.gamecore.render.textures.GLTexture;
import mightypork.gamecore.render.textures.TxQuad;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.caching.RectDigest;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.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;
@ -452,7 +452,6 @@ public class Render {
setColor(tint);
}
final RectDigest q = quad.digest();
final RectDigest u = txquad.uvs.digest();

@ -3,9 +3,9 @@ package mightypork.gamecore.render.fonts;
import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.render.Render;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.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.util.constraints.vect.Vect;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.vect.Vect;
/**

@ -21,10 +21,10 @@ import java.util.Map;
import mightypork.gamecore.render.fonts.GLFont;
import mightypork.gamecore.render.textures.DeferredTexture;
import mightypork.gamecore.render.textures.FilterMode;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.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;

@ -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.util.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;
/**

@ -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.util.constraints.rect.Rect;
import mightypork.util.logging.LogAlias;
import mightypork.util.math.constraints.rect.Rect;
import org.lwjgl.opengl.GL11;

@ -1,8 +1,8 @@
package mightypork.gamecore.render.textures;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.control.Destroyable;
import mightypork.util.math.constraints.rect.Rect;
/**

@ -1,7 +1,7 @@
package mightypork.gamecore.render.textures;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.Rect;
/**

@ -7,8 +7,8 @@ import java.util.Map;
import mightypork.gamecore.control.AppAccess;
import mightypork.gamecore.control.AppAdapter;
import mightypork.gamecore.control.events.requests.ResourceLoadRequest;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.error.KeyAlreadyExistsException;
import mightypork.util.math.constraints.rect.Rect;
/**

@ -1,8 +1,8 @@
package mightypork.gamecore.render.textures;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.RectConst;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.RectConst;
/**

@ -28,7 +28,7 @@ import mightypork.rogue.world.level.Level;
import mightypork.rogue.world.tile.Tile;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.EventBus;
import mightypork.util.ion.Ion;
import mightypork.util.files.ion.Ion;
import mightypork.util.logging.Log;
import mightypork.util.logging.writers.LogWriter;

@ -1,7 +1,7 @@
package mightypork.rogue;
import mightypork.util.config.PropertyManager;
import mightypork.util.files.config.PropertyManager;
import mightypork.util.logging.Log;

@ -2,7 +2,7 @@ package mightypork.rogue.events;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent;
/**

@ -7,10 +7,10 @@ import mightypork.gamecore.gui.components.painters.QuadPainter;
import mightypork.gamecore.gui.screens.Overlay;
import mightypork.rogue.events.ActionRequest;
import mightypork.rogue.events.ActionRequest.RequestType;
import mightypork.util.constraints.num.mutable.NumAnimated;
import mightypork.util.control.timing.TimedTask;
import mightypork.util.math.Easing;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.mutable.NumAnimated;
import mightypork.util.timing.TimedTask;
public class CrossfadeOverlay extends Overlay implements CrossfadeRequest.Listener {

@ -9,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.util.constraints.num.Num;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.control.Action;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.string.StringProvider;

@ -9,8 +9,8 @@ import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.rogue.Res;
import mightypork.rogue.screens.gamescreen.gui.HeartBar;
import mightypork.rogue.screens.gamescreen.gui.NavItemSlot;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
public class HudLayer extends ScreenLayer {

@ -10,12 +10,13 @@ import mightypork.gamecore.gui.screens.LayeredScreen;
import mightypork.rogue.Paths;
import mightypork.rogue.world.MapGenerator;
import mightypork.rogue.world.World;
import mightypork.util.ion.Ion;
import mightypork.util.files.ion.Ion;
public class ScreenGame extends LayeredScreen {
public ScreenGame(AppAccess app) {
public ScreenGame(AppAccess app)
{
super(app);
addLayer(new WorldLayer(this, obtainWorld())); //TODO with provided world
@ -33,7 +34,7 @@ public class ScreenGame extends LayeredScreen {
// SAVE
World world = MapGenerator.createWorld(rand.nextLong());
final World world = MapGenerator.createWorld(rand.nextLong());
addChildClient(world);
try {

@ -7,16 +7,17 @@ import mightypork.rogue.screens.gamescreen.world.MIPKeyWalk;
import mightypork.rogue.screens.gamescreen.world.MIPMouseWalk;
import mightypork.rogue.screens.gamescreen.world.MapView;
import mightypork.rogue.world.World;
import mightypork.util.constraints.num.Num;
import mightypork.util.math.constraints.num.Num;
public class WorldLayer extends ScreenLayer {
private MapView worldView;
private final MapView worldView;
public WorldLayer(Screen screen, World world) {
super(screen);
public WorldLayer(Screen screen, World world)
{
super(screen);
// render component
@ -26,7 +27,6 @@ public class WorldLayer extends ScreenLayer {
worldView.addPlugin(new MIPKeyWalk());
worldView.addPlugin(new MIPMouseWalk());
// size of lower navbar
final Num lownav = root.width().min(root.height()).max(700).perc(7);
worldView.setRect(root.shrinkBottom(lownav));

@ -5,9 +5,9 @@ import mightypork.gamecore.gui.AlignX;
import mightypork.gamecore.gui.components.VisualComponent;
import mightypork.gamecore.render.Render;
import mightypork.gamecore.render.textures.TxQuad;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.num.mutable.NumVar;
import mightypork.util.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 HeartBar extends VisualComponent {

@ -7,13 +7,13 @@ import mightypork.gamecore.gui.components.ClickableComponent;
import mightypork.gamecore.render.Render;
import mightypork.gamecore.render.textures.TxQuad;
import mightypork.rogue.Res;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.num.mutable.NumAnimated;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.caching.RectCache;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.control.timing.Updateable;
import mightypork.util.math.Easing;
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;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.timing.Updateable;
public class NavItemSlot extends ClickableComponent implements MouseMotionListener, Updateable {

@ -4,7 +4,7 @@ package mightypork.rogue.screens.gamescreen.world;
import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.input.Keys;
import mightypork.rogue.world.PlayerControl;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.Vect;
public class MIPKeyWalk implements MapInteractionPlugin {

@ -4,9 +4,9 @@ package mightypork.rogue.screens.gamescreen.world;
import mightypork.gamecore.input.InputSystem;
import mightypork.rogue.world.PlayerControl;
import mightypork.rogue.world.WorldPos;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.math.Polar;
import mightypork.util.math.Calc.Deg;
import mightypork.util.math.Polar;
import mightypork.util.math.constraints.vect.Vect;
public class MIPMouseWalk implements MapInteractionPlugin {
@ -24,12 +24,12 @@ public class MIPMouseWalk implements MapInteractionPlugin {
@Override
public void onClick(MapView wv, PlayerControl player, Vect mouse)
{
WorldPos plpos = player.getPos();
WorldPos clicked = wv.toWorldPos(mouse);
final WorldPos plpos = player.getPos();
final WorldPos clicked = wv.toWorldPos(mouse);
Polar p = Polar.fromCoord(clicked.x - plpos.x, clicked.y - plpos.y);
final Polar p = Polar.fromCoord(clicked.x - plpos.x, clicked.y - plpos.y);
int dir = Deg.round90(p.getAngleDeg()) / 90;
final int dir = Deg.round90(p.getAngleDeg()) / 90;
switch (dir) {
case 0:

@ -2,7 +2,7 @@ package mightypork.rogue.screens.gamescreen.world;
import mightypork.rogue.world.PlayerControl;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.Vect;
public interface MapInteractionPlugin {

@ -16,7 +16,7 @@ import mightypork.rogue.world.WorldRenderer;
import mightypork.rogue.world.entity.Entity;
import mightypork.rogue.world.entity.models.EntityMoveListener;
import mightypork.rogue.world.level.Level;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.Vect;
public class MapView extends InputComponent implements KeyListener, MouseButtonListener, EntityMoveListener {
@ -28,7 +28,8 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL
private final Set<MapInteractionPlugin> plugins = new HashSet<>();
public MapView(World world) {
public MapView(World world)
{
this.world = world;
this.worldRenderer = new WorldRenderer(world, this, 8, 6, 72);
pc = world.getPlayerControl();
@ -65,7 +66,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL
@Override
public void onStepFinished(Entity entity, World world, Level level)
{
for (MapInteractionPlugin p : plugins) {
for (final MapInteractionPlugin p : plugins) {
p.onStepEnd(this, pc);
}
}
@ -74,7 +75,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL
@Override
public void onPathFinished(Entity entity, World world, Level level)
{
for (MapInteractionPlugin p : plugins) {
for (final MapInteractionPlugin p : plugins) {
p.onStepEnd(this, pc);
}
}
@ -83,7 +84,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL
@Override
public void onPathInterrupted(Entity entity, World world, Level level)
{
for (MapInteractionPlugin p : plugins) {
for (final MapInteractionPlugin p : plugins) {
p.onStepEnd(this, pc);
}
}
@ -96,7 +97,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL
if (!event.isUp()) return; // only btn-release evt
for (MapInteractionPlugin p : plugins) {
for (final MapInteractionPlugin p : plugins) {
p.onClick(this, pc, event.getPos());
}
@ -109,7 +110,7 @@ public class MapView extends InputComponent implements KeyListener, MouseButtonL
{
if (!event.isDown()) return;
for (MapInteractionPlugin p : plugins) {
for (final MapInteractionPlugin p : plugins) {
p.onKey(this, pc, event.getKey());
}

@ -6,10 +6,10 @@ 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.util.constraints.num.Num;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.mutable.VectVar;
import mightypork.util.math.color.Color;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.mutable.VectVar;
class MenuButton extends ClickableComponent {

@ -9,11 +9,11 @@ import mightypork.gamecore.gui.screens.BaseScreen;
import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.rogue.Res;
import mightypork.rogue.screens.CrossfadeRequest;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.control.Action;
import mightypork.util.math.color.COMMODORE;
import mightypork.util.math.color.PAL16;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.rect.Rect;
class MenuLayer extends ScreenLayer {

@ -5,13 +5,13 @@ import java.util.Random;
import mightypork.gamecore.gui.components.VisualComponent;
import mightypork.gamecore.render.Render;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.num.mutable.NumAnimated;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.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;
import mightypork.util.timing.Updateable;
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.util.constraints.num.Num;
import mightypork.util.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 {

@ -14,12 +14,12 @@ import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys;
import mightypork.rogue.Res;
import mightypork.util.constraints.num.mutable.NumAnimated;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.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 MouseButtonListener {

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

@ -3,9 +3,9 @@ package mightypork.rogue.world;
import java.io.IOException;
import mightypork.util.ion.IonBinary;
import mightypork.util.ion.IonInput;
import mightypork.util.ion.IonOutput;
import mightypork.util.files.ion.IonBinary;
import mightypork.util.files.ion.IonInput;
import mightypork.util.files.ion.IonOutput;
public class PathStep implements IonBinary {

@ -10,7 +10,8 @@ public class PlayerControl {
private final World world;
public PlayerControl(World w) {
public PlayerControl(World w)
{
this.world = w;
}

@ -3,8 +3,8 @@ package mightypork.rogue.world;
import java.io.IOException;
import mightypork.util.ion.IonBundle;
import mightypork.util.ion.IonBundled;
import mightypork.util.files.ion.IonBundle;
import mightypork.util.files.ion.IonBundled;
public class PlayerInfo implements IonBundled {

@ -7,9 +7,9 @@ import java.util.ArrayList;
import mightypork.rogue.world.entity.Entities;
import mightypork.rogue.world.entity.Entity;
import mightypork.rogue.world.level.Level;
import mightypork.util.control.timing.Updateable;
import mightypork.util.ion.IonBundle;
import mightypork.util.ion.IonBundled;
import mightypork.util.files.ion.IonBundle;
import mightypork.util.files.ion.IonBundled;
import mightypork.util.timing.Updateable;
/**
@ -114,8 +114,8 @@ public class World implements IonBundled, Updateable {
{
return control;
}
public Entity getPlayerEntity()
{
return playerEntity;

@ -3,12 +3,12 @@ package mightypork.rogue.world;
import java.io.IOException;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.mutable.VectAnimated;
import mightypork.util.control.timing.Updateable;
import mightypork.util.ion.IonBundle;
import mightypork.util.ion.IonBundled;
import mightypork.util.files.ion.IonBundle;
import mightypork.util.files.ion.IonBundled;
import mightypork.util.math.Easing;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.mutable.VectAnimated;
import mightypork.util.timing.Updateable;
/**

@ -6,17 +6,15 @@ import mightypork.rogue.Res;
import mightypork.rogue.world.entity.Entity;
import mightypork.rogue.world.level.Level;
import mightypork.rogue.world.level.render.TileRenderContext;
import mightypork.util.constraints.Pollable;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.num.caching.NumCache;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.RectConst;
import mightypork.util.constraints.rect.caching.RectCache;
import mightypork.util.constraints.rect.proxy.RectProxy;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.VectConst;
import mightypork.util.constraints.vect.caching.VectCache;
import mightypork.util.math.color.RGB;
import mightypork.util.math.constraints.Pollable;
import mightypork.util.math.constraints.num.Num;
import mightypork.util.math.constraints.num.caching.NumCache;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.caching.RectCache;
import mightypork.util.math.constraints.rect.proxy.RectProxy;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.caching.VectCache;
/**
@ -46,7 +44,8 @@ public class WorldRenderer extends RectProxy implements Pollable {
private TileRenderContext trc;
public WorldRenderer(World world, Rect viewport, int xTiles, int yTiles, int minTileSize) {
public WorldRenderer(World world, Rect viewport, int xTiles, int yTiles, int minTileSize)
{
super(viewport);
this.world = world;
@ -71,7 +70,7 @@ public class WorldRenderer extends RectProxy implements Pollable {
private void rebuildTiles()
{
Level level = world.getCurrentLevel();
final Level level = world.getCurrentLevel();
if (activeLevel == level) return;
activeLevel = level;
@ -84,18 +83,18 @@ public class WorldRenderer extends RectProxy implements Pollable {
private Vect getOffset()
{
WorldPos pos = player.getPosition();
final WorldPos pos = player.getPosition();
final double playerX = pos.getVisualX();
final double playerY = pos.getVisualY();
double ts = tileSize.value();
final double ts = tileSize.value();
return Vect.make((-ts * playerX), (-ts * playerY));
}
public void render()
{
{
Render.pushMatrix();
Render.setColor(RGB.WHITE);
Render.translate(getOffset());
@ -106,10 +105,13 @@ public class WorldRenderer extends RectProxy implements Pollable {
final double h = height().value();
final double ts = tileSize.value();
final int x1 = (int) Math.floor(pos.x - (w / (ts*2)));
final int y1 = (int) Math.floor(pos.y - (h / (ts*2)));
final int x2 = (int) Math.ceil(pos.x + (w / (ts*2)));
final int y2 = (int) Math.ceil(pos.y + (h / (ts*2)))+1;
final int xtilesh = (int) (w / (ts * 2)) + 1;
final int ytilesh = (int) (h / (ts * 2)) + 1;
final int x1 = pos.x - xtilesh;
final int y1 = pos.y - ytilesh;
final int x2 = pos.x + xtilesh;
final int y2 = pos.y + ytilesh;
// === TILES ===
@ -118,16 +120,11 @@ public class WorldRenderer extends RectProxy implements Pollable {
Render.enterBatchTexturedQuadMode(Res.getTexture("tiles16"));
}
Render.setColor(RGB.WHITE);
int c = 0;
for (trc.y = y1; trc.y <= y2; trc.y++) {
for (trc.x = x1; trc.x <= x2; trc.x++) {
trc.renderTile();
c++;
}
}
System.out.println(c);
if (USE_BATCH_RENDERING) {
Render.leaveBatchTexturedQuadMode();
@ -146,8 +143,8 @@ public class WorldRenderer extends RectProxy implements Pollable {
for (final Entity e : activeLevel.getEntities()) {
// avoid entities out of view rect
int x = (int) Math.round(e.getPosition().getVisualX());
int y = (int) Math.round(e.getPosition().getVisualY());
final int x = (int) Math.round(e.getPosition().getVisualX());
final int y = (int) Math.round(e.getPosition().getVisualY());
if (x < x1 - ts || x > x2 + ts) continue;
if (y < y1 - ts || y > y2 + ts) continue;
@ -169,8 +166,8 @@ public class WorldRenderer extends RectProxy implements Pollable {
public WorldPos getClickedTile(Vect clickPos)
{
Vect v = clickPos.sub(mapRect.origin().add(getOffset()));
int ts = (int) tileSize.value();
final Vect v = clickPos.sub(mapRect.origin().add(getOffset()));
final int ts = (int) tileSize.value();
return new WorldPos(v.xi() / ts, v.yi() / ts);
}

@ -14,11 +14,11 @@ import mightypork.rogue.world.entity.models.EntityModel;
import mightypork.rogue.world.entity.models.EntityMoveListener;
import mightypork.rogue.world.level.Level;
import mightypork.rogue.world.level.render.MapRenderContext;
import mightypork.util.ion.IonBinary;
import mightypork.util.ion.IonBundle;
import mightypork.util.ion.IonBundled;
import mightypork.util.ion.IonInput;
import mightypork.util.ion.IonOutput;
import mightypork.util.files.ion.IonBinary;
import mightypork.util.files.ion.IonBundle;
import mightypork.util.files.ion.IonBundled;
import mightypork.util.files.ion.IonInput;
import mightypork.util.files.ion.IonOutput;
/**
@ -188,7 +188,7 @@ public final class Entity implements IonBinary, IonBundled, EntityMoveListener {
walking = true;
PathStep step = path.poll();
final PathStep step = path.poll();
final int projX = position.x + step.x, projY = position.y + step.y;

@ -8,8 +8,8 @@ import mightypork.rogue.Res;
import mightypork.rogue.world.WorldPos;
import mightypork.rogue.world.entity.Entity;
import mightypork.rogue.world.level.render.MapRenderContext;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.math.Calc;
import mightypork.util.math.constraints.rect.Rect;
public class PlayerRenderer extends EntityRenderer {

@ -3,10 +3,10 @@ package mightypork.rogue.world.item;
import java.io.IOException;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.ion.IonBinary;
import mightypork.util.ion.IonInput;
import mightypork.util.ion.IonOutput;
import mightypork.util.files.ion.IonBinary;
import mightypork.util.files.ion.IonInput;
import mightypork.util.files.ion.IonOutput;
import mightypork.util.math.constraints.rect.proxy.RectBound;
public class Item implements IonBinary {

@ -2,7 +2,7 @@ package mightypork.rogue.world.item;
import mightypork.util.annotations.DefaultImpl;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.rect.proxy.RectBound;
public abstract class ItemModel {

@ -13,10 +13,10 @@ import mightypork.rogue.world.entity.Entity;
import mightypork.rogue.world.tile.Tile;
import mightypork.rogue.world.tile.Tiles;
import mightypork.rogue.world.tile.models.TileModel;
import mightypork.util.ion.IonBinary;
import mightypork.util.ion.IonBundle;
import mightypork.util.ion.IonInput;
import mightypork.util.ion.IonOutput;
import mightypork.util.files.ion.IonBinary;
import mightypork.util.files.ion.IonBundle;
import mightypork.util.files.ion.IonInput;
import mightypork.util.files.ion.IonOutput;
import mightypork.util.math.noise.NoiseGen;
@ -43,11 +43,13 @@ public class Level implements MapAccess, IonBinary {
private transient NoiseGen noiseGen;
public Level() {
public Level()
{
}
public Level(int width, int height) {
public Level(int width, int height)
{
this.width = width;
this.height = height;
buildArray();

@ -2,7 +2,7 @@ package mightypork.rogue.world.level.render;
import mightypork.rogue.world.level.MapAccess;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.Rect;
public class EntityRenderContext extends MapRenderContext {

@ -2,8 +2,8 @@ package mightypork.rogue.world.level.render;
import mightypork.rogue.world.level.MapAccess;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.builders.TiledRect;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.builders.TiledRect;
public abstract class MapRenderContext {
@ -13,14 +13,15 @@ public abstract class MapRenderContext {
private final Rect mapRect;
public MapRenderContext(MapAccess map, Rect drawArea) {
this.map = map;
public MapRenderContext(MapAccess map, Rect drawArea)
{
this.map = map;
this.tiler = drawArea.tiles(map.getWidth(), map.getHeight());
this.mapRect = drawArea;
}
public Rect getRectForTile(int x, int y)
{
return tiler.tile(x, y);

@ -3,8 +3,8 @@ package mightypork.rogue.world.level.render;
import mightypork.rogue.world.level.MapAccess;
import mightypork.rogue.world.tile.Tile;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.proxy.RectBound;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBound;
import mightypork.util.math.noise.NoiseGen;

@ -3,11 +3,11 @@ package mightypork.rogue.world.tile;
import mightypork.rogue.world.item.Item;
import mightypork.rogue.world.level.render.TileRenderContext;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.constraints.rect.proxy.RectBoundAdapter;
import mightypork.util.control.timing.Animator;
import mightypork.util.control.timing.AnimatorBounce;
import mightypork.util.math.Easing;
import mightypork.util.math.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.proxy.RectBoundAdapter;
import mightypork.util.timing.Animator;
import mightypork.util.timing.AnimatorBounce;
public class DroppedItemRenderer {

@ -9,10 +9,10 @@ import mightypork.rogue.world.level.Level;
import mightypork.rogue.world.level.render.TileRenderContext;
import mightypork.rogue.world.tile.models.TileModel;
import mightypork.rogue.world.tile.renderers.TileRenderer;
import mightypork.util.ion.IonBinary;
import mightypork.util.ion.IonBundle;
import mightypork.util.ion.IonInput;
import mightypork.util.ion.IonOutput;
import mightypork.util.files.ion.IonBinary;
import mightypork.util.files.ion.IonBundle;
import mightypork.util.files.ion.IonInput;
import mightypork.util.files.ion.IonOutput;
/**

@ -7,7 +7,7 @@ import mightypork.gamecore.render.textures.TxSheet;
import mightypork.rogue.Res;
import mightypork.rogue.world.level.render.TileRenderContext;
import mightypork.rogue.world.tile.Tile;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.math.constraints.rect.Rect;
public class BasicTileRenderer extends TileRenderer {

@ -1,11 +1,11 @@
package mightypork.util.control.eventbus;
import mightypork.util.control.eventbus.events.flags.DelayedEvent;
import mightypork.util.control.eventbus.events.flags.ImmediateEvent;
import mightypork.util.control.eventbus.events.flags.NonConsumableEvent;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
import mightypork.util.control.eventbus.event_flags.DelayedEvent;
import mightypork.util.control.eventbus.event_flags.ImmediateEvent;
import mightypork.util.control.eventbus.event_flags.NonConsumableEvent;
import mightypork.util.control.eventbus.event_flags.SingleReceiverEvent;
import mightypork.util.control.eventbus.event_flags.UnloggedEvent;
/**
@ -52,7 +52,6 @@ public abstract class BusEvent<HANDLER> {
*/
public final void consume()
{
System.out.println("consume "+getClass());
if (consumed) throw new IllegalStateException("Already consumed.");
if (getClass().isAnnotationPresent(NonConsumableEvent.class)) {

@ -10,10 +10,9 @@ import java.util.concurrent.TimeUnit;
import mightypork.util.control.Destroyable;
import mightypork.util.control.eventbus.clients.DelegatingClient;
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.control.eventbus.event_flags.DelayedEvent;
import mightypork.util.control.eventbus.event_flags.ImmediateEvent;
import mightypork.util.control.eventbus.event_flags.UnloggedEvent;
import mightypork.util.logging.Log;
@ -107,7 +106,7 @@ final public class EventBus implements Destroyable {
// BEHOLD, MAGIC!
final Type evtc = event.getClass().getGenericSuperclass();
if (evtc instanceof ParameterizedType) {
if (((ParameterizedType) evtc).getRawType() == BusEvent.class) {
final Type[] types = ((ParameterizedType) evtc).getActualTypeArguments();

@ -6,7 +6,6 @@ import java.util.HashSet;
import mightypork.util.control.eventbus.clients.DelegatingClient;
import mightypork.util.control.eventbus.clients.ToggleableClient;
import mightypork.util.control.eventbus.events.flags.SingleReceiverEvent;
import mightypork.util.logging.Log;

@ -1,4 +1,4 @@
package mightypork.util.control.eventbus.events.flags;
package mightypork.util.control.eventbus.event_flags;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package mightypork.util.control.eventbus.events.flags;
package mightypork.util.control.eventbus.event_flags;
import java.lang.annotation.*;

@ -1,4 +1,5 @@
package mightypork.util.control.eventbus.events.flags;
package mightypork.util.control.eventbus.event_flags;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

@ -1,4 +1,4 @@
package mightypork.util.control.eventbus.events.flags;
package mightypork.util.control.eventbus.event_flags;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package mightypork.util.control.eventbus.events.flags;
package mightypork.util.control.eventbus.event_flags;
import java.lang.annotation.*;

@ -1,4 +1,4 @@
package mightypork.util.config;
package mightypork.util.files.config;
import java.io.File;
@ -9,9 +9,9 @@ import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.TreeMap;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.VectConst;
import mightypork.util.math.Range;
import mightypork.util.math.constraints.vect.Vect;
import mightypork.util.math.constraints.vect.VectConst;
import mightypork.util.objects.Convert;

@ -1,4 +1,4 @@
package mightypork.util.config;
package mightypork.util.files.config;
import java.io.File;

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

@ -1,4 +1,4 @@
package mightypork.util.ion;
package mightypork.util.files.ion;
import java.io.*;
@ -212,7 +212,7 @@ public class Ion {
*/
public static <T extends IonBundled> T fromStream(InputStream in, Class<? extends T> objClass) throws IOException
{
return unwrap((IonBundle)new IonInput(in).readObject(), objClass);
return unwrap((IonBundle) new IonInput(in).readObject(), objClass);
}

@ -1,4 +1,4 @@
package mightypork.util.ion;
package mightypork.util.files.ion;
import java.io.IOException;

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

Loading…
Cancel
Save