Okay, so What I have is
(((b4*256)+b3)*256+b2)*256+b1
with a minimum value of
&h00000000
and a maximum of
&hFFFF803F
. Any value above that stops the terrain editor working
Private Sub CmdMakeTerrain_Click()
pixelheightchange = maxheight / 513
maxheight = 1062273023
r1 = maxheight / 16777216
b4 = CByte(Int(r1))
midheight = maxheight - (Int(r1) * 16777216)
r2 = midheight / 65536
b3 = CByte(Int(r2))
midheight2 = midheight - (Int(r2) * 65536)
r3 = midheight2 / 256
b2 = CByte(Int(r3))
b1 = (r3 - Int(r3)) * 256
End Sub
I'll not bore people with the obvious reverse process.
Thanks all for your help.