From 2dfd2a53c2b9c37880891565ae394728a1a415a5 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 20 Sep 2023 13:37:43 -0400 Subject: [PATCH] Testing image reader --- src/engine/InterestManagement/HeightMap.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index a7b80545..4132b67e 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -20,15 +20,17 @@ import engine.objects.Zone; import org.pmw.tinylog.Logger; import javax.imageio.ImageIO; -import javax.imageio.ImageReader; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; -import java.util.Iterator; +import java.util.stream.Stream; import static java.lang.Math.abs; @@ -313,13 +315,7 @@ public class HeightMap { // Load pixel data - Iterator readers = ImageIO.getImageReadersByFormatName("TGA"); - - while (readers.hasNext()) { - System.out.println("reader: " + readers.next()); - } - - /* try (Stream filePathStream = Files.walk(Paths.get(ConfigManager.DEFAULT_DATA_DIR + "heightmaps/TARGA/"))) { + try (Stream filePathStream = Files.walk(Paths.get(ConfigManager.DEFAULT_DATA_DIR + "heightmaps/TARGA/"))) { filePathStream.forEach(filePath -> { if (Files.isRegularFile(filePath)) { @@ -338,7 +334,7 @@ public class HeightMap { } catch (IOException e) { Logger.error(e); } -*/ + } public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {