From b518d47800ced4dd0f0e0250090826b5f0bace44 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Mon, 31 Jan 2022 22:57:57 +0900 Subject: - Fix cursor turning into colored square when it has failed to load cursors from native lib - Fix com.twelvemonkeys.imageio not being shaded properly --- .../java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java | 5 +++-- src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java index 8a1a7950..11a9da51 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/CursorReader.java @@ -21,6 +21,7 @@ package kr.syeyoung.dungeonsguide.utils.cursor; import com.google.common.io.LittleEndianDataInputStream; import com.google.common.io.LittleEndianDataOutputStream; import com.twelvemonkeys.imageio.plugins.bmp.CURImageReader; +import com.twelvemonkeys.imageio.plugins.bmp.CURImageReaderSpi; import com.twelvemonkeys.imageio.plugins.bmp.ICOImageReader; import lombok.Data; @@ -35,6 +36,7 @@ import java.util.List; public class CursorReader { public static List readFromInputStream(InputStream inputStream) throws IOException { + System.out.println(inputStream); LittleEndianDataInputStream dataInputStream = new LittleEndianDataInputStream(new BufferedInputStream(inputStream)); dataInputStream.mark(Integer.MAX_VALUE); @@ -63,8 +65,7 @@ public class CursorReader { dataInputStream.reset(); try (ImageInputStream imageInputStream = ImageIO.createImageInputStream(dataInputStream)) { - Iterator imageReaderIterator = ImageIO.getImageReaders(imageInputStream); - CURImageReader imageReader = (CURImageReader) imageReaderIterator.next(); + CURImageReader imageReader = new CURImageReader(); imageReader.setInput(imageInputStream); for (int i = 0; i < directoryList.size(); i++) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java index 832e3b0a..a3932955 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/cursor/GLCursors.java @@ -73,11 +73,6 @@ public class GLCursors { } } - - static { - setupCursors(); - } - public static void setupCursors() { if (enumCursorCursorMap.size() != 0) return; int platform = LWJGLUtil.getPlatform(); -- cgit