diff --git a/src/data/map/asfalt.png b/src/data/map/asfalt.png index 720fcf6..aacad62 100644 Binary files a/src/data/map/asfalt.png and b/src/data/map/asfalt.png differ diff --git a/src/data/map/asfalt_horizontal.png b/src/data/map/asfalt_horizontal.png index 6924f12..554b72f 100644 Binary files a/src/data/map/asfalt_horizontal.png and b/src/data/map/asfalt_horizontal.png differ diff --git a/src/data/map/asfalt_vertical.png b/src/data/map/asfalt_vertical.png index c6fd758..7752fae 100644 Binary files a/src/data/map/asfalt_vertical.png and b/src/data/map/asfalt_vertical.png differ diff --git a/src/data/map/grass.png b/src/data/map/grass.png index 0b7b261..8a8c96d 100644 Binary files a/src/data/map/grass.png and b/src/data/map/grass.png differ diff --git a/src/data/map/redmud.png b/src/data/map/redmud.png index c242752..e418d44 100644 Binary files a/src/data/map/redmud.png and b/src/data/map/redmud.png differ diff --git a/src/data/map/redstone/redstone0000.png b/src/data/map/redstone/redstone0000.png index 62b1194..3bfdab3 100644 Binary files a/src/data/map/redstone/redstone0000.png and b/src/data/map/redstone/redstone0000.png differ diff --git a/src/data/map/redstone/redstone0001.png b/src/data/map/redstone/redstone0001.png index 91af461..aa9cac3 100644 Binary files a/src/data/map/redstone/redstone0001.png and b/src/data/map/redstone/redstone0001.png differ diff --git a/src/data/map/redstone/redstone0002.png b/src/data/map/redstone/redstone0002.png index d3457cc..3c1c5cb 100644 Binary files a/src/data/map/redstone/redstone0002.png and b/src/data/map/redstone/redstone0002.png differ diff --git a/src/data/map/redstone/redstone0003.png b/src/data/map/redstone/redstone0003.png index 6d04466..01987cc 100644 Binary files a/src/data/map/redstone/redstone0003.png and b/src/data/map/redstone/redstone0003.png differ diff --git a/src/data/map/sand.png b/src/data/map/sand.png index 4e19386..1260550 100644 Binary files a/src/data/map/sand.png and b/src/data/map/sand.png differ diff --git a/src/data/map/stone/stone0000.png b/src/data/map/stone/stone0000.png index 245e7d2..4867717 100644 Binary files a/src/data/map/stone/stone0000.png and b/src/data/map/stone/stone0000.png differ diff --git a/src/data/map/stone/stone0001.png b/src/data/map/stone/stone0001.png index 7b21d23..da05517 100644 Binary files a/src/data/map/stone/stone0001.png and b/src/data/map/stone/stone0001.png differ diff --git a/src/data/map/stone/stone0002.png b/src/data/map/stone/stone0002.png index f46581e..e7077dd 100644 Binary files a/src/data/map/stone/stone0002.png and b/src/data/map/stone/stone0002.png differ diff --git a/src/data/map/stone/stone0003.png b/src/data/map/stone/stone0003.png index ccb06f6..41180cd 100644 Binary files a/src/data/map/stone/stone0003.png and b/src/data/map/stone/stone0003.png differ diff --git a/src/data/units/apu/apu0000.png b/src/data/units/apu/apu0000.png index 217c93d..274d203 100644 Binary files a/src/data/units/apu/apu0000.png and b/src/data/units/apu/apu0000.png differ diff --git a/src/data/units/bomber/bomber0000.png b/src/data/units/bomber/bomber0000.png index 284d29c..96fae47 100644 Binary files a/src/data/units/bomber/bomber0000.png and b/src/data/units/bomber/bomber0000.png differ diff --git a/src/data/units/bomber/bomber0001.png b/src/data/units/bomber/bomber0001.png index d745d6d..e477ec4 100644 Binary files a/src/data/units/bomber/bomber0001.png and b/src/data/units/bomber/bomber0001.png differ diff --git a/src/data/units/bomber/bomber0002.png b/src/data/units/bomber/bomber0002.png index 592abf2..f394084 100644 Binary files a/src/data/units/bomber/bomber0002.png and b/src/data/units/bomber/bomber0002.png differ diff --git a/src/data/units/bomber/bomber0003.png b/src/data/units/bomber/bomber0003.png index 825da8a..6efe39e 100644 Binary files a/src/data/units/bomber/bomber0003.png and b/src/data/units/bomber/bomber0003.png differ diff --git a/src/data/units/tank/tank0000.png b/src/data/units/tank/tank0000.png index 6a84e1e..911729c 100644 Binary files a/src/data/units/tank/tank0000.png and b/src/data/units/tank/tank0000.png differ diff --git a/src/ei/engine/LWJGLGameWindow.java b/src/ei/engine/LWJGLGameWindow.java index bba4422..62c2bb3 100644 --- a/src/ei/engine/LWJGLGameWindow.java +++ b/src/ei/engine/LWJGLGameWindow.java @@ -63,25 +63,10 @@ public class LWJGLGameWindow { LWJGLGameWindow.height = height; this.fps = fps; this.title = title; - - MultiPrintStream.makeInstance(new MultiPrintStream("log.txt")); - - try { - DisplayMode dm = new DisplayMode(width, height); - Display.setDisplayMode(dm); - - Display.setTitle(title); - Display.setFullscreen(fullscreen); - - initOpenGl(); - run(); - } catch (Exception e) { - e.printStackTrace(System.err); - Sys.alert(title, "An error occured and the game will exit."); - } finally { - cleanup(); - } - System.exit(0); + + DisplayMode dm = new DisplayMode(width, height); + createWindow(dm, fullscreen); + } public void createWindow(DisplayMode dm, boolean fullscreen){ @@ -94,7 +79,11 @@ public class LWJGLGameWindow { Display.setTitle(title); Display.setFullscreen(fullscreen); - + //Display.setVSyncEnabled(true); + + // Create the display window + Display.create(); + initOpenGl(); run(); } catch (Exception e) { @@ -114,17 +103,12 @@ public class LWJGLGameWindow { // grab the mouse, dont want that hideous cursor when we're playing! Mouse.setGrabbed(false); - // Create the display window - Display.create(); - // enable textures since we're going to use these for our sprites GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Smooth Shading GL11.glShadeModel(GL11.GL_SMOOTH); // disable the OpenGL depth test since we're rendering 2D graphics GL11.glDisable(GL11.GL_DEPTH_TEST); - //GL11.glEnable(GL11.GL_DEPTH_TEST); // Enables Depth Testing - //GL11.glDepthFunc(GL11.GL_LEQUAL); // The Type Of Depth Testing To Do // disable lights (we do not nead them) GL11.glDisable(GL11.GL_LIGHTING); // Black Background @@ -168,9 +152,6 @@ public class LWJGLGameWindow { int frame = 0; while (!exit) { timer.startTimer(); - // Always call Window.update(), all the time - it does some behind the - // scenes work, and also displays the rendered output - Display.update(); // Check for close requests if (Display.isCloseRequested()) { diff --git a/src/ei/engine/test/EngineTest.java b/src/ei/engine/test/EngineTest.java new file mode 100644 index 0000000..4c84152 --- /dev/null +++ b/src/ei/engine/test/EngineTest.java @@ -0,0 +1,38 @@ +package ei.engine.test; + +import ei.engine.LWJGLGameWindow; +import ei.engine.math.Vector2f; +import ei.engine.scene.Box; + +public class EngineTest extends LWJGLGameWindow{ + private Box box; + private float pos; + + public static void main(String[] args){ + new EngineTest(); + } + + public EngineTest() { + super("EngineTest"); + } + + protected void init(){ + box = new Box("lol"); + box.setSize(new Vector2f(100,100)); + pos = 0; + } + + protected void update() { + super.update(); + pos += 0.2f; + box.setLocation(new Vector2f(200+pos,200+pos)); + box.update(); + } + + /** + * this method shid be overriden + */ + protected void render(){ + box.render(); + } +} diff --git a/src/ei/engine/test/GameStateTestState.java b/src/ei/engine/test/GameStateTestState.java index 598326c..d8eb917 100644 --- a/src/ei/engine/test/GameStateTestState.java +++ b/src/ei/engine/test/GameStateTestState.java @@ -25,7 +25,7 @@ public class GameStateTestState extends GameState{ public void init() { rootNode = new Node("InGameNode"); - sprite1 = new Sprite("tank","data/units/tank.png"); + sprite1 = new Sprite("tank","data/units/tank/tank0000.png"); //sprite1.setScale(new Vector2f(0.5f,0.5f)); sprite1.setLocation(new Vector3f(400,300,0.2f)); rootNode.add(sprite1); @@ -43,7 +43,7 @@ public class GameStateTestState extends GameState{ p.getLocation().setZ(0.1f); rootNode.add(p); - sound1 = new Sound("sound","data/sounds/center.wav"); + sound1 = new Sound("sound","data/sounds/ei.ogg"); sound1.loop(); sound1.setLocation(sprite1.getLocation()); rootNode.add(sound1); diff --git a/src/ei/game/EI.java b/src/ei/game/EI.java index aeab89e..c19b63a 100644 --- a/src/ei/game/EI.java +++ b/src/ei/game/EI.java @@ -16,7 +16,7 @@ public class EI extends LWJGLGameWindow{ } public EI() { - super("EI",60,LWJGLPropertiesDialog.SOW_ALWAYS); + super("EI",60,LWJGLPropertiesDialog.SOW_ONCE); } protected void init(){