Assertion failure when using the MapSplitter

jonaso

04-01-2008 19:27:10

Hi,

after an hour or two of work I got the PLSM to compile on Mac OS X. I can't, however, run the demos because the MapSplitter always fails with the following error:


Assertion failed: (Heightdata[i] * divider <= 65535), function SplitAndSpaceHeightData, file [...]/MapSplitter.cpp, line 205


This error is mentioned a few times in various topics, but apparently there were bugs in the program in all these cases.

Thanks in advance

Jonas

tibobe

19-03-2008 21:51:33

I have the same problem...
..if you want to have some fun, try to comment assert(...) line 205 in MapSplitter.cpp, recompile MapSplitter..and it will generate you.... black pictures ! That's not what we want, but I tried it, and I hope someone can help us, because it's not very funny to split your map with a Gimp or other one..

Thanks...

P51D_Ace

20-10-2008 06:27:11

I am also getting the same assertion error. Could someone please explain the following code?


const double divider = (1.0 / MapUtil::getSingleton().getMaxTheoHeight()) * 65535;


and


assert (Heightdata[i] * divider <= 65535);


So 2^16 is 65536, so why are we scaling to 65535? I don't quite understand what the purpose of scaling the height by the divider. I understand the byte shifting after it though.

I am trying to do this with a texture jpg compressed 16385x16385 and a RAW 16bit heightmap that is also 16385x16385, The image is (2^14)+1 in width and height. I was able to get this to work with a scaled down version of the data, so I am puzzled why I can't get this to work here.