diff --git a/src/projectzombie/entity/player/EntityPlayer.java b/src/projectzombie/entity/player/EntityPlayer.java index c0aec59..21348b3 100755 --- a/src/projectzombie/entity/player/EntityPlayer.java +++ b/src/projectzombie/entity/player/EntityPlayer.java @@ -136,7 +136,7 @@ public class EntityPlayer extends Entity implements EntityAlive, EntityInventory { chunk = layer.getChunk(pos); - if(chunk != null && (last_chunk == null || !chunk.c_pos.equal(last_chunk))) { + if(chunk != null && chunk.c_pos != null && (last_chunk == null || !chunk.c_pos.equal(last_chunk))) { last_chunk = chunk.c_pos; TileLighting.setDirty(); } diff --git a/src/projectzombie/menu/gui/Label.java b/src/projectzombie/menu/gui/Label.java index 532bfc0..f4cac29 100755 --- a/src/projectzombie/menu/gui/Label.java +++ b/src/projectzombie/menu/gui/Label.java @@ -1,7 +1,9 @@ package projectzombie.menu.gui; +import gl_engine.matrix.Matrix4; import gl_engine.vec.Vec2d; import gl_engine.vec.Vec3d; +import projectzombie.text.Text; public class Label implements GUIComponent { @@ -32,7 +34,27 @@ public class Label implements GUIComponent } @Override - public void render(Vec2d mousePos) { + public void render(Vec2d mousePos) + { + double off = 0; + + switch(alignment) + { + case LEFT: + off = size.x * text.length(); + break; + case CENTRE: + off = size.x * text.length() / 2; + break; + default: + break; + } + + Matrix4 matrix = Matrix4.identity(); + matrix = Matrix4.multiply(matrix, Matrix4.scale(new Vec3d(size, 1))); + matrix = Matrix4.multiply(matrix, Matrix4.translate(pos.x - off, pos.y, 1)); + + Text.render(text, matrix); } @Override diff --git a/src/projectzombie/world/layer/layergen/LayerGenLavaCaves.java b/src/projectzombie/world/layer/layergen/LayerGenLavaCaves.java index 311c1f3..48f1b9d 100755 --- a/src/projectzombie/world/layer/layergen/LayerGenLavaCaves.java +++ b/src/projectzombie/world/layer/layergen/LayerGenLavaCaves.java @@ -145,7 +145,7 @@ public class LayerGenLavaCaves extends LayerGen @Override public ColorRange getLightLevel() { - return new ColorRange(new Vec3d(0, 0, 0), new Vec3d(0.06, 0, 0)); + return new ColorRange(new Vec3d(0, 0, 0), new Vec3d(0, 0, 0)); } } diff --git a/src/resources/shader/environmentRenderer.vsh b/src/resources/shader/environmentRenderer.vsh index e30aad2..936b80e 100644 --- a/src/resources/shader/environmentRenderer.vsh +++ b/src/resources/shader/environmentRenderer.vsh @@ -19,8 +19,6 @@ uniform int time; uniform vec3 lighting_day_low; uniform vec3 lighting_day_high; -uniform vec3 lighting_src_low; -uniform vec3 lighting_src_high; uniform vec2 lightmap_offset; uniform vec2 lightmap_size; @@ -86,7 +84,7 @@ void main() map(floor(pos.z), lightmap_offset.y, lightmap_offset.y + lightmap_size.y, 0, 1))); vec3 light_day = mapVec(light.r, 0, 1, lighting_day_low, lighting_day_high); - vec3 light_src = mapVec(light.g, 0, 1, lighting_src_low, lighting_src_high); + vec3 light_src = vec3(1, 1, 1) * light.g; pLighting = biggest(light_day, light_src); } \ No newline at end of file