From 6638fdcaff1f6d7b4b3eb870f7c7edd3bd282238 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 20 Sep 2023 13:06:18 -0400 Subject: [PATCH] Framework to load pixel data --- src/engine/InterestManagement/HeightMap.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/engine/InterestManagement/HeightMap.java b/src/engine/InterestManagement/HeightMap.java index 8dffdcda..b399c912 100644 --- a/src/engine/InterestManagement/HeightMap.java +++ b/src/engine/InterestManagement/HeightMap.java @@ -315,10 +315,21 @@ public class HeightMap { // Load pixel data - try (Stream paths = Files.walk(Paths.get("mb.data/heightmaps/TARGA/"))) { - paths - .filter(Files::isRegularFile) - .forEach(System.out::println); + try (Stream filePathStream = Files.walk(Paths.get(ConfigManager.DEFAULT_DATA_DIR + "heightmaps/TARGA/"))) { + filePathStream.forEach(filePath -> { + + if (Files.isRegularFile(filePath)) { + File imageFile = filePath.toFile(); + + try { + BufferedImage heightmapImage = ImageIO.read(imageFile); + } catch (IOException e) { + throw new RuntimeException(e); + } + + + } + }); } catch (IOException e) { Logger.error(e); }