aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/lwjgl/image
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-21 17:50:43 +0700
committerGitHub <noreply@github.com>2022-05-21 12:50:43 +0200
commitba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77 (patch)
treea052e7ac963be0f64980fc3faa664ebf20a52b34 /src/main/java/cc/polyfrost/oneconfig/lwjgl/image
parent1abe65dc3875df5a490d8c900399e61a378ae901 (diff)
downloadOneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.tar.gz
OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.tar.bz2
OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.zip
vigilance compat (#15)
* vigilance compat reorganize ASM * remove non-RenderManager nanovg usage wherever possible fix build generalize utils * setupGradle task * migrate to kotlin gradle use essential gradle toolkit shade new gson * Small changes * Update .gitignore * fix natives * Fix all problems * null Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/lwjgl/image')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java
index 128ae48..fb436dd 100644
--- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java
+++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java
@@ -15,7 +15,7 @@ import java.util.HashMap;
public class ImageLoader {
private final HashMap<String, Integer> imageHashMap = new HashMap<>();
- private final HashMap<String, Integer> SVGHashMap = new HashMap<>();
+ private final HashMap<String, Integer> svgHashMap = new HashMap<>();
public static ImageLoader INSTANCE = new ImageLoader();
public boolean loadImage(long vg, String fileName) {
@@ -42,7 +42,7 @@ public class ImageLoader {
public boolean loadSVG(long vg, String fileName, float SVGWidth, float SVGHeight) {
String name = fileName + "-" + SVGWidth + "-" + SVGHeight;
- if (!SVGHashMap.containsKey(name)) {
+ if (!svgHashMap.containsKey(name)) {
try {
InputStream inputStream = this.getClass().getResourceAsStream(fileName);
if (inputStream == null) return false;
@@ -70,7 +70,7 @@ public class ImageLoader {
NanoSVG.nsvgDeleteRasterizer(rasterizer);
NanoSVG.nsvgDelete(svg);
- SVGHashMap.put(name, NanoVG.nvgCreateImageRGBA(vg, w, h, NanoVG.NVG_IMAGE_REPEATX | NanoVG.NVG_IMAGE_REPEATY | NanoVG.NVG_IMAGE_GENERATE_MIPMAPS, image));
+ svgHashMap.put(name, NanoVG.nvgCreateImageRGBA(vg, w, h, NanoVG.NVG_IMAGE_REPEATX | NanoVG.NVG_IMAGE_REPEATY | NanoVG.NVG_IMAGE_GENERATE_MIPMAPS, image));
return true;
} catch (Exception e) {
System.err.println("Failed to parse SVG file");
@@ -100,20 +100,20 @@ public class ImageLoader {
public int getSVG( String fileName, float width, float height) {
String name = fileName + "-" + width + "-" + height;
- return SVGHashMap.get(name);
+ return svgHashMap.get(name);
}
public void removeSVG(long vg, String fileName, float width, float height) {
String name = fileName + "-" + width + "-" + height;
NanoVG.nvgDeleteImage(vg, imageHashMap.get(name));
- SVGHashMap.remove(name);
+ svgHashMap.remove(name);
}
public void clearSVGs(long vg) {
- HashMap<String, Integer> temp = new HashMap<>(SVGHashMap);
+ HashMap<String, Integer> temp = new HashMap<>(svgHashMap);
for (String image : temp.keySet()) {
- NanoVG.nvgDeleteImage(vg, SVGHashMap.get(image));
- SVGHashMap.remove(image);
+ NanoVG.nvgDeleteImage(vg, svgHashMap.get(image));
+ svgHashMap.remove(image);
}
}
}