The four bytes in the example are 32,2,0,0. That appears to be in little endian format. So the length would be 32 + 2*256 +0*256*256 + 0*256*256*256 = 544.
You would read these with a single ReadInt. But you have to be careful because BlitzMax is multi-platform. A PC would read this correctly. But the Mac defaults to big endian.
When you open the stream (or incbin ) you should specify which format it uses. Instead of "yourfile.3ds" use "littleendian::yourfile.3ds" and it will read correctly on all machines.
This is going to be a recurring problem as people post file handling code that works only for PC, or only for Mac.
And, while I'm thinking of cross platform problems, be careful of case sensitivity in file names. Windows is case insensitive so yourfile and YourFile are the same. But on the Mac file names may or may not be case sensitive, depending on how the file system is set up.
You would read these with a single ReadInt. But you have to be careful because BlitzMax is multi-platform. A PC would read this correctly. But the Mac defaults to big endian.
When you open the stream (or incbin ) you should specify which format it uses. Instead of "yourfile.3ds" use "littleendian::yourfile.3ds" and it will read correctly on all machines.
This is going to be a recurring problem as people post file handling code that works only for PC, or only for Mac.
And, while I'm thinking of cross platform problems, be careful of case sensitivity in file names. Windows is case insensitive so yourfile and YourFile are the same. But on the Mac file names may or may not be case sensitive, depending on how the file system is set up.