Browse Source

Framework to load pixel data

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
6638fdcaff
  1. 19
      src/engine/InterestManagement/HeightMap.java

19
src/engine/InterestManagement/HeightMap.java

@ -315,10 +315,21 @@ public class HeightMap { @@ -315,10 +315,21 @@ public class HeightMap {
// Load pixel data
try (Stream<Path> paths = Files.walk(Paths.get("mb.data/heightmaps/TARGA/"))) {
paths
.filter(Files::isRegularFile)
.forEach(System.out::println);
try (Stream<Path> 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);
}

Loading…
Cancel
Save