That's right -- but not that the plane offsets are 32-bit words (Long in VB), not 16-bit words (Integer in VB).Boeing747 wrote:Thanks! The (unfinished) keen file format doc is better to understand.
I'll make a module with Type declarations.
But one question:
PlaneOffsets(0 to 2) As Integer is the same as:?Code: Select all
Type PlaneOffsets PlaneOffS1 As Integer PlaneOffS2 As Integer PlaneOffS3 As Integer End Type
You don't need to worry about it -- see below.How can I make this bug similar in VB6?
...
But VB6 doesn't see this String as an 0 to 7 array.
The bug is a buffer overflow: the C code actually tells the program to start writing bytes out, beginning with "T" in "TED5v1.0", and stopping when it reaches a byte equal to &H0 (null). This could be almost anywhere later in memory, so you could get zero or many junk bytes. But it doesn't matter a bit -- you should write "TED5v1.0" at the beginning of the file when saving GameMaps, and you should read it just to be sure that it's a valid file, but to work out where the map data is you need to read the maphead information from the maphead file or the (unlzexed) .exe file.What are those "ABC-Words" in gamemaps?
and in this TED5 file, i could not see any junkbytes.
So remove the "Junk() As Byte" and you've got what you need there.Public Type GAMEMAPS_HEAD
Signature As String * 8 ' Always set to "TED5v1.0"
Junk() As Byte ' ???
End Type