diff --git a/src/projectzombie/display/DisplayLighting.java b/src/projectzombie/display/DisplayLighting.java index 41c06d9..eef2798 100755 --- a/src/projectzombie/display/DisplayLighting.java +++ b/src/projectzombie/display/DisplayLighting.java @@ -242,7 +242,7 @@ public class DisplayLighting Vec2i tpos = new Vec2i(x + lighting.x * 16, y + lighting.y * 16); // Store light level data from the image - layer.setLightLevel(lighting.p[i3+1], tpos); + layer.setLightLevel(lighting.p[i3+0], tpos); // Store temperature and humidity data lighting.p[i3+1] = (float)layer.getTemperature(new Vec2i(x + lighting.x * 16, y + lighting.y * 16)); diff --git a/src/projectzombie/init/Models.java b/src/projectzombie/init/Models.java index 703b19b..b5316c2 100755 --- a/src/projectzombie/init/Models.java +++ b/src/projectzombie/init/Models.java @@ -4,6 +4,7 @@ import gl_engine.vec.Vec2d; import projectzombie.model.Model; import projectzombie.model.ModelBox; import projectzombie.model.ModelCactus; +import projectzombie.model.ModelChunkBorder; import projectzombie.model.ModelCross; import projectzombie.model.ModelEmpty; import projectzombie.model.ModelGrass; @@ -217,4 +218,6 @@ public class Models public static final Model ENTITY_ZOMBIE_F = new ModelVertical(Resources.ATLAS.get("/entity/zombie_front_moving.png"), 4, 10); public static final Model ENTITY_ZOMBIE_B_ARMORED = new ModelVertical(Resources.ATLAS.get("/entity/armored_zombie_back_moving.png"), 4, 10); public static final Model ENTITY_ZOMBIE_F_ARMORED = new ModelVertical(Resources.ATLAS.get("/entity/armored_zombie_front_moving.png"), 4, 10); + + public static final ModelChunkBorder CHUNK_BORDER = new ModelChunkBorder(); } diff --git a/src/projectzombie/model/ModelChunkBorder.java b/src/projectzombie/model/ModelChunkBorder.java new file mode 100644 index 0000000..4c64bf7 --- /dev/null +++ b/src/projectzombie/model/ModelChunkBorder.java @@ -0,0 +1,91 @@ +package projectzombie.model; + +import gl_engine.texture.TextureRef3D; +import gl_engine.vec.Vec2d; +import projectzombie.init.Resources; + +public class ModelChunkBorder extends Model +{ + private static final TextureRef3D ref = Resources.ATLAS.get("/gui/pixel_white.png"); + + @Override + public int getSize() { + return 16; + } + + @Override + public int getIndexSize() { + return 24; + } + + @Override + public float[] getVerticies() + { + float w = 16; + float h = 0.0625f; + float f = 0b10; + float c = 0b000000111111111111; + float o = 0.5f; + + return new float[] + { + 0-o, 0, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, 0, 0-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, h, 0-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + 0-o, h, 0-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + + 0-o, 0, w-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, 0, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, h, w-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + 0-o, h, w-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + + 0-o, 0, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + 0-o, 0, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + 0-o, h, w-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + 0-o, h, 0-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + + w-o, 0, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, 0, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, h, w-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + w-o, h, 0-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f, + }; + } + + @Override + public int[] getIndicies() { + return new int[] { + 0, 1, 2, + 2, 3, 0, + + 4, 5, 6, + 6, 7, 4, + + 8, 9, 10, + 10, 11, 8, + + 12, 13, 14, + 14, 15, 12, + }; + } + + @Override + public TextureRef3D[] getTextures() + { + return new TextureRef3D[] { + ref, ref, ref, ref, + ref, ref, ref, ref, + ref, ref, ref, ref, + ref, ref, ref, ref, + }; + } + + @Override + public double getHeight() { + return 1; + } + + @Override + public double getWidth() { + return 16; + } +} diff --git a/src/projectzombie/settings/Environment.java b/src/projectzombie/settings/Environment.java index 8e802c4..06ae9b9 100755 --- a/src/projectzombie/settings/Environment.java +++ b/src/projectzombie/settings/Environment.java @@ -4,7 +4,7 @@ import projectzombie.world.chunk.Chunk; public class Environment { - public static String gdir = "./"; + public static String gdir = "./run/"; public static void init(String args[]) { diff --git a/src/projectzombie/world/chunk/Chunk.java b/src/projectzombie/world/chunk/Chunk.java index 9c7db1c..3a1e991 100755 --- a/src/projectzombie/world/chunk/Chunk.java +++ b/src/projectzombie/world/chunk/Chunk.java @@ -26,10 +26,12 @@ import projectzombie.entity.EntityParticle; import projectzombie.entity.EntityParticlePart; import projectzombie.entity.particle.ParticleBreak; import projectzombie.entity.tileentity.TileEntity; +import projectzombie.init.Models; import projectzombie.init.Tiles; import projectzombie.model.IModel; import projectzombie.model.Model; import projectzombie.model.ModelChunk; +import projectzombie.model.ModelChunkBorder; import projectzombie.tiles.Tile; import projectzombie.util.math.random.RandomHelpers; import projectzombie.world.layer.Layer; @@ -428,6 +430,10 @@ public class Chunk implements ClassBdf model.setModel(Matrix4.translate(c_pos.x * 16 - Camera.camera.x, 0, c_pos.y * 16 - Camera.camera.y)); model.render(); + if(SHOW_CHUNKS) { + Models.CHUNK_BORDER.render(); + } + return renderEntities(entities.toArray(), particle_pool, upto); } diff --git a/src/resources/texture/item/rock_copper.png b/src/resources/texture/item/rock_copper.png new file mode 100644 index 0000000..d6ae3dc Binary files /dev/null and b/src/resources/texture/item/rock_copper.png differ diff --git a/src/resources/texture/item/rock_gold.png b/src/resources/texture/item/rock_gold.png new file mode 100644 index 0000000..d5bd34b Binary files /dev/null and b/src/resources/texture/item/rock_gold.png differ diff --git a/src/resources/texture/item/rock_iron.png b/src/resources/texture/item/rock_iron.png index 2efb2f7..f01a8ab 100644 Binary files a/src/resources/texture/item/rock_iron.png and b/src/resources/texture/item/rock_iron.png differ diff --git a/src/resources/texture/item/rock_tin.png b/src/resources/texture/item/rock_tin.png new file mode 100644 index 0000000..c4689ed Binary files /dev/null and b/src/resources/texture/item/rock_tin.png differ diff --git a/src/resources/texture/item/rock_uranium.png b/src/resources/texture/item/rock_uranium.png new file mode 100644 index 0000000..985c529 Binary files /dev/null and b/src/resources/texture/item/rock_uranium.png differ diff --git a/src/resources/texture/list.txt b/src/resources/texture/list.txt index 16da499..dbd6e72 100644 --- a/src/resources/texture/list.txt +++ b/src/resources/texture/list.txt @@ -55,18 +55,23 @@ ./tile/rock_sandstone.png ./tile/sapling2.png ./list.txt +./item/rock_gold.png ./item/log.png ./item/rock.png ./item/stone_shovel.png ./item/coal.png +./item/rock_copper.png ./item/acorn.png ./item/clay.png ./item/stone_pick.png +./item/rock_tin.png ./item/ammo_box.png ./item/plant_fibre.png ./item/torch_lit.png +./item/rock_iron.png ./item/stone_hatchet.png ./item/flint_hatchet.png +./item/rock_uranium.png ./item/hemp_seed.png ./item/shield_upgrade.png ./item/grappling_hook.png