Browse Source

Testing image reader

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
2dfd2a53c2
  1. 16
      src/engine/InterestManagement/HeightMap.java

16
src/engine/InterestManagement/HeightMap.java

@ -20,15 +20,17 @@ import engine.objects.Zone;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException; 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.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.stream.Stream;
import static java.lang.Math.abs; import static java.lang.Math.abs;
@ -313,13 +315,7 @@ public class HeightMap {
// Load pixel data // Load pixel data
Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName("TGA"); try (Stream<Path> filePathStream = Files.walk(Paths.get(ConfigManager.DEFAULT_DATA_DIR + "heightmaps/TARGA/"))) {
while (readers.hasNext()) {
System.out.println("reader: " + readers.next());
}
/* try (Stream<Path> filePathStream = Files.walk(Paths.get(ConfigManager.DEFAULT_DATA_DIR + "heightmaps/TARGA/"))) {
filePathStream.forEach(filePath -> { filePathStream.forEach(filePath -> {
if (Files.isRegularFile(filePath)) { if (Files.isRegularFile(filePath)) {
@ -338,7 +334,7 @@ public class HeightMap {
} catch (IOException e) { } catch (IOException e) {
Logger.error(e); Logger.error(e);
} }
*/
} }
public static boolean isLocUnderwater(Vector3fImmutable currentLoc) { public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {

Loading…
Cancel
Save