diff --git a/src/mightypork/gamecore/app/MainLoop.java b/src/mightypork/gamecore/app/MainLoop.java index 5df5902..787f4da 100644 --- a/src/mightypork/gamecore/app/MainLoop.java +++ b/src/mightypork/gamecore/app/MainLoop.java @@ -55,7 +55,7 @@ public abstract class MainLoop extends AppModule implements MainLoopRequestListe while (running) { getDisplay().beginFrame(); - getEventBus().send(new UpdateEvent(timer.getDelta())); + getEventBus().sendDirect(new UpdateEvent(timer.getDelta())); Runnable r; while ((r = taskQueue.poll()) != null) { diff --git a/src/mightypork/rogue/Const.java b/src/mightypork/rogue/Const.java index f6806f9..2f994d5 100644 --- a/src/mightypork/rogue/Const.java +++ b/src/mightypork/rogue/Const.java @@ -18,6 +18,6 @@ public final class Const { public static final int FPS_RENDER = 120; // max // INITIAL WINDOW SIZE - public static final int WINDOW_W = 800; - public static final int WINDOW_H = 600; + public static final int WINDOW_W = 1024; + public static final int WINDOW_H = 768; } diff --git a/src/mightypork/rogue/screens/game/ScreenGame.java b/src/mightypork/rogue/screens/game/ScreenGame.java index cc95994..d172029 100644 --- a/src/mightypork/rogue/screens/game/ScreenGame.java +++ b/src/mightypork/rogue/screens/game/ScreenGame.java @@ -92,9 +92,6 @@ public class ScreenGame extends LayeredScreen { { if (this.state == nstate) return; - - System.out.println("Goto: "+nstate); - if (nstate != GScrState.WORLD) { // leaving world. getEventBus().send(new WorldPauseRequest(PauseAction.PAUSE)); diff --git a/src/mightypork/rogue/screens/game/WorldConsoleRenderer.java b/src/mightypork/rogue/screens/game/WorldConsoleRenderer.java index d5a0a09..14eada2 100644 --- a/src/mightypork/rogue/screens/game/WorldConsoleRenderer.java +++ b/src/mightypork/rogue/screens/game/WorldConsoleRenderer.java @@ -2,9 +2,13 @@ package mightypork.rogue.screens.game; import java.util.Collection; +import java.util.ConcurrentModificationException; +import java.util.LinkedList; +import java.util.List; import mightypork.gamecore.gui.AlignX; import mightypork.gamecore.gui.components.BaseComponent; +import mightypork.gamecore.logging.Log; import mightypork.gamecore.resources.fonts.FontRenderer; import mightypork.gamecore.util.math.color.Color; import mightypork.gamecore.util.math.color.pal.RGB; @@ -23,7 +27,8 @@ public class WorldConsoleRenderer extends BaseComponent { private final FontRenderer fr; - public WorldConsoleRenderer(Num rowHeight) { + public WorldConsoleRenderer(Num rowHeight) + { this.rowHeight = rowHeight; this.fr = new FontRenderer(Res.getFont("tiny")); } @@ -36,23 +41,30 @@ public class WorldConsoleRenderer extends BaseComponent { Rect lowRow = bottomEdge().growUp(rowHeight); - Collection entries = WorldProvider.get().getWorld().getConsole().getEntries(); + Collection entries = WorldProvider.get().getWorld().getConsole().getEntries(); + int cnt = 0; NumVar alph = Num.makeVar(); Color.pushAlpha(alph); - for (WorldConsole.Entry entry : entries) { - - alph.setTo(entry.getAlpha()); - - Rect rrr = lowRow.moveY(-rh * cnt); + try { - fr.draw(entry.getMessage(), rrr.move(rh / 12, rh / 12), AlignX.LEFT, RGB.BLACK_60); - fr.draw(entry.getMessage(), rrr, AlignX.LEFT, RGB.WHITE); + for (WorldConsole.Entry entry : entries) { + + alph.setTo(entry.getAlpha()); + + Rect rrr = lowRow.moveY(-rh * cnt); + + fr.draw(entry.getMessage(), rrr.move(rh / 12, rh / 12), AlignX.LEFT, RGB.BLACK_60); + fr.draw(entry.getMessage(), rrr, AlignX.LEFT, RGB.WHITE); + + cnt++; + } - cnt++; + } catch (ConcurrentModificationException e) { + Log.e(e); // this should not happen anymore } Color.popAlpha(); diff --git a/src/mightypork/rogue/world/World.java b/src/mightypork/rogue/world/World.java index ac4a6e0..f4259c2 100644 --- a/src/mightypork/rogue/world/World.java +++ b/src/mightypork/rogue/world/World.java @@ -254,7 +254,11 @@ public class World implements DelegatingClient, BusAccess, IonObjBundled, Pausea } } - msgNoMoreFood(); + if(getHealth() entries = new LinkedList<>(); + private final Deque entries = new LinkedBlockingDeque<>(); @Override diff --git a/src/mightypork/rogue/world/gui/MapView.java b/src/mightypork/rogue/world/gui/MapView.java index bb7c00f..6ccabf3 100644 --- a/src/mightypork/rogue/world/gui/MapView.java +++ b/src/mightypork/rogue/world/gui/MapView.java @@ -94,7 +94,7 @@ public class MapView extends InputComponent implements DelegatingClient, MouseBu public MapView() { - this.tileSize = height().min(width()).div(10).max(32).mul(Num.make(1).sub(zoom.mul(0.5))); + this.tileSize = height().min(width()).div(9).max(32).mul(Num.make(1).sub(zoom.mul(0.5))); this.worldRenderer = new WorldRenderer(this, tileSize); plc = WorldProvider.get().getPlayerControl();