diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | src/subconscious/graphics/GameWindow.java | 4 |
2 files changed, 7 insertions, 3 deletions
@@ -2,6 +2,9 @@ MAINCLASS := subconscious.Subconscious SOURCES := $(shell find src -iname '*.java') +# debug or release mode +DEBUG=1 + # java compiler configuraton JAVAC := javac JAVAC_ARGS := -Xlint:all \ @@ -19,6 +22,9 @@ JAVA_ARGS := -cp ../lib/gson-2.6.2.jar:. -Xmx2G ifeq ($(USE_JDB),1) JAVA_ARGS += -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 endif +ifeq ($(DEBUG),1) + JAVA_ARGS += -enableassertions +endif # recipes diff --git a/src/subconscious/graphics/GameWindow.java b/src/subconscious/graphics/GameWindow.java index f444a6a..eb360f5 100644 --- a/src/subconscious/graphics/GameWindow.java +++ b/src/subconscious/graphics/GameWindow.java @@ -150,9 +150,7 @@ public class GameWindow extends Frame implements WindowListener { this.root.getLayout().removeLayoutComponent(this.scene); this.root.remove(this.scene); - if (this.loadedScenes.empty()) { - throw new IllegalStateException(); - } + assert !this.loadedScenes.empty(); // load the last scene SimpleEntry<Scene, Thread> sceneEntry = this.loadedScenes.pop(); |