diff --git a/log.txt b/log.txt index 55982b4..8f13d32 100644 --- a/log.txt +++ b/log.txt @@ -1,6 +1,6 @@ -2007-03-21 19:59:45:093 # Loading texture: data/units/tank.png -2007-03-21 19:59:46:203 # Loading texture: data/particle.bmp -2007-03-21 19:59:46:421 # Loading sound: data/sounds/test.wav -2007-03-21 19:59:46:484 # Sound sources: quantity=0 -2007-03-21 19:59:46:484 # Stoping sound: source=0 -2007-03-21 19:59:46:484 # Playing sound: source=0 buffer=261490744 +2007-03-21 22:49:30:390 # Loading texture: data/units/tank.png +2007-03-21 22:49:31:187 # Loading texture: data/particle.bmp +2007-03-21 22:49:31:421 # Loading sound: data/sounds/test.wav +2007-03-21 22:49:31:437 # Sound sources: quantity=0 +2007-03-21 22:49:31:437 # Stoping sound: source=0 +2007-03-21 22:49:31:437 # Playing sound: source=0 buffer=261490744 diff --git a/raw/media/units/ei_pansarterreng.max b/raw/media/units/ei_pansarterreng.max new file mode 100644 index 0000000..07295f7 Binary files /dev/null and b/raw/media/units/ei_pansarterreng.max differ diff --git a/src/ei/engine/LWJGLGameWindow.java b/src/ei/engine/LWJGLGameWindow.java index d463d23..c4fcb65 100644 --- a/src/ei/engine/LWJGLGameWindow.java +++ b/src/ei/engine/LWJGLGameWindow.java @@ -61,6 +61,15 @@ public class LWJGLGameWindow { // 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); + // Black Background + GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); + // Depth Buffer Setup + GL11.glClearDepth(1.0f); + //Select The Projection Matrix GL11.glMatrixMode(GL11.GL_PROJECTION); //Reset The Projection Matrix @@ -72,14 +81,13 @@ public class LWJGLGameWindow { GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); // disable the OpenGL depth test since we're rendering 2D graphics - GL11.glDisable(GL11.GL_DEPTH_TEST); - // enable textures since we're going to use these for our sprites - GL11.glEnable(GL11.GL_TEXTURE_2D); - - //Type Of Blending To Perform - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_DEPTH_TEST); + //Enable Blending GL11.glEnable(GL11.GL_BLEND); + //Type Of Blending To Perform + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + // Enable vsync if we can (due to how OpenGL works, it cannot be guarenteed to always work) Display.setVSyncEnabled(true); diff --git a/src/ei/engine/effects/CopyOfLesson19.java b/src/ei/engine/effects/Lesson19.java similarity index 90% rename from src/ei/engine/effects/CopyOfLesson19.java rename to src/ei/engine/effects/Lesson19.java index 8f0ea27..2c4f469 100644 --- a/src/ei/engine/effects/CopyOfLesson19.java +++ b/src/ei/engine/effects/Lesson19.java @@ -1,5 +1,4 @@ package ei.engine.effects; - /* * This Code Was Created By Jeff Molofee and GB Schmick 2000 * A HUGE Thanks To Fredric Echols For Cleaning Up @@ -8,6 +7,10 @@ package ei.engine.effects; * Visit Our Sites At www.tiptup.com and nehe.gamedev.net */ +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.IntBuffer; + import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; @@ -34,7 +37,7 @@ import ei.engine.util.MultiPrintStream; * 2004-12-19: Updated to version 0.94alpha of LWJGL and to use * DevIL for image loading. */ -public class CopyOfLesson19 { +public class Lesson19 { private boolean done = false; private boolean fullscreen = false; private final String windowTitle = "NeHe's OpenGL Lesson 19 for LWJGL (Particle Engine Using Triangle Strips)"; @@ -50,7 +53,7 @@ public class CopyOfLesson19 { float slowdown = 2.0f; // Slow Down Particles float xspeed; // Base X Speed (To Allow Keyboard Direction Of Tail) float yspeed; // Base Y Speed (To Allow Keyboard Direction Of Tail) - float zoom = -40.0f; // Used To Zoom Out + float zoom = -20.0f; // Used To Zoom Out int col; // Current Color Selection int delay; // Rainbow Effect Delay @@ -72,7 +75,7 @@ public class CopyOfLesson19 { } } - CopyOfLesson19 l19 = new CopyOfLesson19(); + Lesson19 l19 = new Lesson19(); l19.run(fullscreen); } public void run(boolean fullscreen) { @@ -186,7 +189,12 @@ public class CopyOfLesson19 { texture = loadTexture("data/particle.bmp"); } private void initGL() { // All Setup For OpenGL Goes Here - + GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping + GL11.glShadeModel(GL11.GL_SMOOTH); // Enable Smooth Shading + GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background + GL11.glClearDepth(1.0f); // Depth Buffer Setup + // Really Nice Perspective Calculations + GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST); GL11.glMatrixMode(GL11.GL_PROJECTION); // Select The Projection Matrix GL11.glLoadIdentity(); // Reset The Projection Matrix @@ -197,12 +205,10 @@ public class CopyOfLesson19 { 0.1f,100.0f); GL11.glMatrixMode(GL11.GL_MODELVIEW); // Select The Modelview Matrix - //GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); // Type Of Blending To Perform GL11.glEnable(GL11.GL_BLEND); // Enable Blending - - for (int i=0;i 25)) { delay = 0; // Reset The Rainbow Color Cycling Delay col++; // Change The Particle Color - if(col > 11) { + if(col >= colors.length) { col = 0; // If Color Is Too High Reset It } } delay++; // Increase Rainbow Mode Color Cycling Delay Counter } - - - private void setExplotion() { + + private void init() { for (int i=0;i