Re: Compiler wierdness -
23-09-2005
(If I'm reading right...possible not considering I don't have my glasses on, am tired, and hungry) - I ran across a similar problem documented by Epic (for loading of their psk and psa files). For msvc at any rate, pragma was used, as by default it packs structs to 4byte sizes (i.e it'll pad data in the struct to the closest 4bytes). Not sure on what gcc does.
Another method I've used to ensure padding doesn't affect it is a little long-winded, but works. Simply read it all in a byte array, and use a few array offsets & memcpy. Takes a tad longer, more code, more complex, etc, but gives more precise control.
|