From 046d92a87a16fde0929f14dd8a22a7dcd532a4b3 Mon Sep 17 00:00:00 2001 From: hYdos Date: Sat, 29 Feb 2020 10:41:32 +1000 Subject: [PATCH] qsdwfegrhtjyukil; --- .../java/com/github/halotroop/litecraft/Litecraft.java | 1 - .../java/com/github/hydos/ginger/engine/api/Ginger.java | 2 +- .../java/com/github/hydos/ginger/engine/io/Window.java | 9 +++------ src/main/resources/shaders/entityVertexShader.glsl | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/halotroop/litecraft/Litecraft.java b/src/main/java/com/github/halotroop/litecraft/Litecraft.java index 317d2db..0ba1640 100644 --- a/src/main/java/com/github/halotroop/litecraft/Litecraft.java +++ b/src/main/java/com/github/halotroop/litecraft/Litecraft.java @@ -50,7 +50,6 @@ public class Litecraft extends Game this.setupWindow(); Blocks.setup(); // make sure blocks are initialised GingerUtils.init(); // set up ginger utilities - Window.setBackgroundColour(0.2f, 0.2f, 0.6f); // set the window refresh colour // set up Ginger3D stuff this.setupGinger(); this.oldWindowWidth = Window.width; diff --git a/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java b/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java index 7c0fab8..1855f17 100644 --- a/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java +++ b/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java @@ -122,7 +122,7 @@ public class Ginger while (!Window.closed()) { Litecraft.getInstance().ups++; - if (Window.isUpdating()) + if (Window.shouldRender()) { timer.tick(); gingerRegister.game.render(); diff --git a/src/main/java/com/github/hydos/ginger/engine/io/Window.java b/src/main/java/com/github/hydos/ginger/engine/io/Window.java index b9406dd..ab88c74 100644 --- a/src/main/java/com/github/hydos/ginger/engine/io/Window.java +++ b/src/main/java/com/github/hydos/ginger/engine/io/Window.java @@ -18,7 +18,7 @@ public class Window public static int height; private static String title; public static long window; - private static Vector3f backgroundColour = new Vector3f(0.2f, 0.2f, 0.2f); + private static Vector3f backgroundColour = new Vector3f(118f, 215f, 234f); private static boolean[] mouseButtons = new boolean[GLFW.GLFW_MOUSE_BUTTON_LAST]; private static GLFWImage.Buffer iconBuffer = null; private static double fpsCap, time, processedTime = 0; @@ -127,7 +127,7 @@ public class Window public static boolean isMouseReleased(int keyCode) { return !isMouseDown(keyCode) && mouseButtons[keyCode]; } - public static boolean isUpdating() + public static boolean shouldRender() { double nextTime = getTime(); double passedTime = nextTime - time; @@ -144,9 +144,6 @@ public class Window public static void lockMouse() { GLFW.glfwSetInputMode(window, GLFW.GLFW_CURSOR, GLFW.GLFW_CURSOR_DISABLED); } - public static void setBackgroundColour(float r, float g, float b) - { backgroundColour = new Vector3f(r, g, b); } - private static void setIcon() { Image icon = Image.createImage("/icon.png"); @@ -180,7 +177,7 @@ public class Window width = widthBuffer.get(0); height = heightBuffer.get(0); GL11.glViewport(0, 0, width, height); - GL11.glClearColor(backgroundColour.x, backgroundColour.y, backgroundColour.z, 1.0f); + GL11.glClearColor(backgroundColour.x/255, backgroundColour.y/255, backgroundColour.z/255, 1.0f); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GLFW.glfwPollEvents(); newX = Window.getMouseX(); diff --git a/src/main/resources/shaders/entityVertexShader.glsl b/src/main/resources/shaders/entityVertexShader.glsl index ab4ed28..c34c2f7 100644 --- a/src/main/resources/shaders/entityVertexShader.glsl +++ b/src/main/resources/shaders/entityVertexShader.glsl @@ -20,8 +20,8 @@ const vec4 plane = vec4(0, -1, 0, 15); uniform float useFakeLighting; -const float density = 0.025; -const float gradient = 1.0; +const float density = 0.0025; +const float gradient = 10.0; void main(void){