aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/lwjgl
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-04-25 13:12:22 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-04-25 13:12:22 +0100
commit89d6576a7777a2949e04b2c6c8d2eb015a733529 (patch)
tree1a6906f9c71591aacbcbf5a32a1a1ed582b95fcb /src/main/java/io/polyfrost/oneconfig/lwjgl
parent29156d83c4213e319149fa5e0a926dd913404528 (diff)
downloadOneConfig-89d6576a7777a2949e04b2c6c8d2eb015a733529.tar.gz
OneConfig-89d6576a7777a2949e04b2c6c8d2eb015a733529.tar.bz2
OneConfig-89d6576a7777a2949e04b2c6c8d2eb015a733529.zip
add size, do some config element stuff, fixes for cards, finish mods page and performance page, cleanup and some more
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/lwjgl')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/IOUtil.java5
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/Lwjgl2FunctionProvider.java2
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java5
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/image/Image.java1
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/image/ImageLoader.java5
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/ClassTransformer.java2
-rw-r--r--src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java2
7 files changed, 10 insertions, 12 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/IOUtil.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/IOUtil.java
index f5105fb..2127251 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/IOUtil.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/IOUtil.java
@@ -7,6 +7,7 @@ import java.net.URL;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import java.nio.file.Files;
public final class IOUtil {
@@ -15,7 +16,7 @@ public final class IOUtil {
/**
* Taken from legui under MIT License
- * https://github.com/SpinyOwl/legui/blob/develop/LICENSE
+ * <a href="https://github.com/SpinyOwl/legui/blob/develop/LICENSE">https://github.com/SpinyOwl/legui/blob/develop/LICENSE</a>
*/
@SuppressWarnings("RedundantCast")
public static ByteBuffer resourceToByteBuffer(String path) throws IOException {
@@ -27,7 +28,7 @@ public final class IOUtil {
InputStream stream;
File file = new File(path);
if (file.exists() && file.isFile()) {
- stream = new FileInputStream(file);
+ stream = Files.newInputStream(file.toPath());
} else {
stream = IOUtil.class.getResourceAsStream(path);
}
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/Lwjgl2FunctionProvider.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/Lwjgl2FunctionProvider.java
index ea1a44b..6c77108 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/Lwjgl2FunctionProvider.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/Lwjgl2FunctionProvider.java
@@ -8,7 +8,7 @@ import java.nio.ByteBuffer;
/**
* Taken from LWJGLTwoPointFive under The Unlicense
- * https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/
+ * <a href="https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/">https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/</a>
*/
public class Lwjgl2FunctionProvider implements FunctionProvider {
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java
index 3855162..87e3d03 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/RenderManager.java
@@ -88,8 +88,7 @@ public final class RenderManager {
nvgRoundedRect(vg, x, y, width, height, radius);
NVGColor nvgColor = color(vg, color);
NVGColor nvgColor2 = color(vg, color2);
- nvgFillPaint(vg, nvgLinearGradient(vg, x, y + height, x + width, y, nvgColor, nvgColor2, bg)); // like the gradient is blocky
- nvgFillPaint(vg, bg);
+ nvgFillPaint(vg, nvgLinearGradient(vg, x, y + height, x + width, y, nvgColor, nvgColor2, bg));
nvgFill(vg);
nvgColor.free();
nvgColor2.free();
@@ -101,7 +100,7 @@ public final class RenderManager {
nvgRect(vg, x, y, width, height);
NVGColor nvgColor = color(vg, color);
NVGColor nvgColor2 = color(vg, color2);
- nvgFillPaint(vg, nvgLinearGradient(vg, x, y + height, x + width, y, nvgColor, nvgColor2, bg)); // like the gradient is blocky
+ nvgFillPaint(vg, nvgLinearGradient(vg, x, y + height, x + width, y, nvgColor, nvgColor2, bg));
nvgFillPaint(vg, bg);
nvgFill(vg);
nvgColor.free();
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/image/Image.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/image/Image.java
index 2ed7276..b304624 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/image/Image.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/image/Image.java
@@ -5,6 +5,7 @@ import java.nio.ByteBuffer;
public class Image {
private final int reference;
private final ByteBuffer buffer;
+
public Image(int reference, ByteBuffer buffer) {
this.reference = reference;
this.buffer = buffer;
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/image/ImageLoader.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/image/ImageLoader.java
index 4a35959..3415ea9 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/image/ImageLoader.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/image/ImageLoader.java
@@ -7,14 +7,11 @@ import org.lwjgl.nanovg.NSVGImage;
import org.lwjgl.nanovg.NanoSVG;
import org.lwjgl.nanovg.NanoVG;
import org.lwjgl.stb.STBImage;
-import org.lwjgl.system.MemoryStack;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.StandardCharsets;
import java.util.HashMap;
public class ImageLoader {
@@ -45,7 +42,7 @@ public class ImageLoader {
}
public boolean loadSVGImage(String fileName) {
- if(!NSVGImageHashMap.containsKey(fileName)) {
+ if (!NSVGImageHashMap.containsKey(fileName)) {
try {
InputStream inputStream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("oneconfig", fileName)).getInputStream();
StringBuilder resultStringBuilder = new StringBuilder();
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/ClassTransformer.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/ClassTransformer.java
index 066677b..7dc0d49 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/ClassTransformer.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/ClassTransformer.java
@@ -8,7 +8,7 @@ import org.objectweb.asm.tree.*;
/**
* Taken from LWJGLTwoPointFive under The Unlicense
- * https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/
+ * <a href="https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/">https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/</a>
*/
public class ClassTransformer implements IClassTransformer {
@Override
diff --git a/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java b/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
index 1f48135..b269a2a 100644
--- a/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
+++ b/src/main/java/io/polyfrost/oneconfig/lwjgl/plugin/LoadingPlugin.java
@@ -10,7 +10,7 @@ import java.util.Set;
/**
* Taken from LWJGLTwoPointFive under The Unlicense
- * https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/
+ * <a href="https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/">https://github.com/DJtheRedstoner/LWJGLTwoPointFive/blob/master/LICENSE/</a>
*/
public class LoadingPlugin implements IFMLLoadingPlugin {