diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-06-05 15:27:36 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-05 10:27:36 +0200 |
commit | 44dfbbb419f1736530c04c02a651f7757cf83f3d (patch) | |
tree | 1e8171573680b9415cecf199d479d49f7ad1f48a /src/main/java/cc/polyfrost/oneconfig/lwjgl/image | |
parent | 494d4f0bd0856e8e8d373003c82729ca722c6ccf (diff) | |
download | OneConfig-44dfbbb419f1736530c04c02a651f7757cf83f3d.tar.gz OneConfig-44dfbbb419f1736530c04c02a651f7757cf83f3d.tar.bz2 OneConfig-44dfbbb419f1736530c04c02a651f7757cf83f3d.zip |
rewrite command manager, stop using essential relocate, and reformat code (#34)
* reformat code
* reformat code
rewrite command manager
stop using essential relocate
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/lwjgl/image')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java | 23 |
1 files changed, 12 insertions, 11 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 289ab03..a0bb93c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/image/ImageLoader.java @@ -21,16 +21,18 @@ import java.util.HashMap; * @see SVGs */ public final class ImageLoader { + public static ImageLoader INSTANCE = new ImageLoader(); + private final HashMap<String, Integer> imageHashMap = new HashMap<>(); + private final HashMap<String, Integer> svgHashMap = new HashMap<>(); + private ImageLoader() { } - private final HashMap<String, Integer> imageHashMap = new HashMap<>(); - private final HashMap<String, Integer> svgHashMap = new HashMap<>(); - public static ImageLoader INSTANCE = new ImageLoader(); /** * Loads an image from resources. - * @param vg The NanoVG context. + * + * @param vg The NanoVG context. * @param fileName The name of the file to load. * @return Whether the image was loaded successfully. */ @@ -58,10 +60,11 @@ public final class ImageLoader { /** * Loads an SVG from resources. - * @param vg The NanoVG context. + * + * @param vg The NanoVG context. * @param fileName The name of the file to load. - * @param width The width of the SVG. - * @param height The height of the SVG. + * @param width The width of the SVG. + * @param height The height of the SVG. * @return Whether the SVG was loaded successfully. */ public boolean loadSVG(long vg, String fileName, float width, float height) { @@ -121,9 +124,8 @@ public final class ImageLoader { * Remove an image from the cache, allowing the image to be garbage collected. * Should be used when the GUI rendering the image is closed. * - * @param vg The NanoVG context. + * @param vg The NanoVG context. * @param fileName The name of the file to remove. - * * @see ImageLoader#loadImage(long, String) */ public void removeImage(long vg, String fileName) { @@ -162,9 +164,8 @@ public final class ImageLoader { * Remove a SVG from the cache, allowing the SVG to be garbage collected. * Should be used when the GUI rendering the SVG is closed. * - * @param vg The NanoVG context. + * @param vg The NanoVG context. * @param fileName The name of the file to remove. - * * @see ImageLoader#loadSVG(long, String, float, float) */ public void removeSVG(long vg, String fileName, float width, float height) { |