I’ve been trying to import a heightfield from FalloutNV into TerrainTest.java. I changed the lines from [java]heightmap = new ImageBasedHeightMap(heightMapImage.getImage(), 1f);
heightmap.load();[/java] to [java]heightmap = new RawHeightMap(“Q1.raw”, 1024, RawHeightMap.FORMAT_16BITBE, false);
heightmap.load();
[/java], but this reported an error (in actuality, an IOException ‘stream closed’ that was swallowed by RawHeightMap). It turns out that there are two calls to RawHeightMap.load() - one in the constructor, and another in TerrainTest.java… but the stream is closed in between those calls, giving this error.
Incidentally, while I was reading the source…
-
Why catch a specific exception (FileNotFoundException in the constructor), and then rethrow it as an Exception?
-
Why swallow the exception in load() and instead log a warning? Why not let the exception fall up to the user’s code?
-
Uh… where’s the forum message preview?