I just went over the OpenZone code. First, make sure you're treating the texture coordinates as unsigned values. Second, check to see if the .WLD is an old-format or new-format file. In new-format files the texture coordinates are 32 bits instead of 16 bits. However, you're probably already getting that right or you probably wouldn't be able to read the .WLD file.
I suspect that the 256 multiplier might have to do with the texture size. When I wrote OpenZone all textures were 256x256, but I'm not sure what would happen if the texture was 512x512 instead, for instance. You *might* have to divide by 512 then, but I'm not sure. My gut tells me that it's a signed vs. unsigned problem.
|