Hello
If I write a file in DBPro with WORD's (16 bit int) and read them as Short in AppGameKit, every second spot is empty.
This is how I store the file in DBPro
`save obstacle map
for x = 1 to obstacle_map_info(1)
for y = 1 to obstacle_map_info(2)
write byte 1,compiled_obstacle_map(x,y,1)
write word 1,compiled_obstacle_map(x,y,2)
write word 1,compiled_obstacle_map(x,y,3)
next y
next x
And this is how I read it in AGK
Dim obstacle_map[obstacle_map_info[1],obstacle_map_info[2],3]
for x = 1 to obstacle_map_info[1]
for y = 1 to obstacle_map_info[2]
obstacle_map[x,y,1] = GetMemblockByte(2,n)
inc n
obstacle_map[x,y,2] = GetMemblockShort(2,n)
inc n,2
obstacle_map[x,y,3] = GetMemblockShort(2,n)
inc n,2
next y
next x
I have come as far as finding that if I read them as bytes instead of shorts, then everything is fine. But I will need values bigger than a 256 byte at some point. I also found that I store them 32 bit ints, read them as ints and inc N by 4, only every fourth spot is read right.
EDIT: At first I thought it could have something to do with little/big endian, but as far I understand both AppGameKit and DBPro uses little endian.
The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...