aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/lwjgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/lwjgl')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/lwjgl/OneColor.java8
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java23
2 files changed, 6 insertions, 25 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/OneColor.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/OneColor.java
index e098390..508fc21 100644
--- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/OneColor.java
+++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/OneColor.java
@@ -16,7 +16,7 @@ import java.awt.*;
*/
@SuppressWarnings("unused")
public class OneColor {
- transient private int rgba;
+ transient private Integer rgba = null;
private short[] hsba;
private int chroma = -1;
@@ -134,13 +134,17 @@ public class OneColor {
*/
public int getRGB() {
if (chroma == -1) {
+ // fix for when rgba is not set because of deserializing not calling constructor
+ if (rgba == null) rgba = HSBAtoRGBA(this.hsba[0], this.hsba[1], this.hsba[2], this.hsba[3]);
return rgba;
} else {
return HSBAtoRGBA(System.currentTimeMillis() % chroma / (float) chroma, hsba[1], hsba[2], hsba[3]);
}
}
- /** return the current color without its alpha. Internal method. */
+ /**
+ * return the current color without its alpha. Internal method.
+ */
public int getRGBNoAlpha() {
return 0xff000000 | rgba;
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java
index 0a9ccce..d23f1dd 100644
--- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java
+++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java
@@ -324,29 +324,6 @@ public final class RenderManager {
GL11.glColor4f(f1, f2, f3, f);
}
- public static void drawDottedLine(float sx, float sy, float ex, float ey, int width, int factor, int color) {
- GL11.glPushMatrix();
- GL11.glLineStipple(factor, (short) 0xAAAA);
- GL11.glEnable(GL11.GL_LINE_STIPPLE);
- GL11.glPushMatrix();
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glDisable(GL11.GL_ALPHA);
- GL14.glBlendFuncSeparate(770, 771, 1, 0); // this should never fail because it's a GL14 call, and we import GL31
- glColor(color);
- GL11.glLineWidth(width);
- GL11.glBegin(GL11.GL_LINES);
- GL11.glVertex2d(sx, sy);
- GL11.glVertex2d(ex, ey);
- GL11.glEnd();
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glEnable(GL11.GL_ALPHA);
- GL11.glEnable(GL11.GL_TEXTURE_2D);
- GL11.glPopMatrix();
- GL11.glDisable(GL11.GL_LINE_STIPPLE);
- GL11.glPopMatrix();
- }
-
public static void drawGlRect(int x, int y, int width, int height, int color) {
Gui.drawRect(x, y, x + width, y + height, color);
}