This commit is contained in:
Ziver Koc 2009-05-19 17:26:58 +00:00
parent f210865cd4
commit 7e2c3dcf1e
4 changed files with 8 additions and 5 deletions

View file

@ -108,7 +108,9 @@ public class LWJGLGameWindow {
// 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.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthFunc(GL11.GL_LEQUAL);
// disable lights (we do not nead them)
GL11.glDisable(GL11.GL_LIGHTING);
// Black Background
@ -129,7 +131,7 @@ public class LWJGLGameWindow {
//Reset The Projection Matrix
GL11.glLoadIdentity();
//turn on 2D mode
GL11.glOrtho(0.0f, width, height, 0, -1, 1);
GL11.glOrtho(0.0f, width, height, 0, -100, 100);
// Select The Modelview Matrix (controls model orientation)
GL11.glMatrixMode(GL11.GL_MODELVIEW);

View file

@ -73,7 +73,7 @@ public abstract class Entity {
* @param l The location of the entity
*/
public void setLocation(Vector2f l) {
location = new Vector3f(l.getX(),l.getY(),getLocation().getZ());
location = new Vector3f(l.getX(),l.getY(), location.getZ());
}
/**

View file

@ -196,7 +196,8 @@ public class TextureLoader {
* @param texture The texture to store the data into
* @return A buffer containing the data
*/
private ByteBuffer convertImageData(BufferedImage bufferedImage,Texture texture) {
@SuppressWarnings("unchecked")
private ByteBuffer convertImageData(BufferedImage bufferedImage,Texture texture) {
ByteBuffer imageBuffer = null;
WritableRaster raster;
BufferedImage texImage;

View file

@ -76,7 +76,7 @@ public class Map implements TileMap, TileSet, PathFinderCallback{
for(int i=0; i<width ;i++){
for(int j=0; j<hight ;j++){
Sprite s = new Sprite("MapPos("+i+","+j+")","data/map/sand.jpg");
s.setLocation(new Vector3f(i*POS_SIZE,j*POS_SIZE,0));
s.setLocation(new Vector3f(i*POS_SIZE,j*POS_SIZE, 0));
s.setSize(new Vector2f(POS_SIZE,POS_SIZE));
mapNode.add(s);
}