#109150 - Cthulhu - Wed Nov 15, 2006 4:52 pm
Don't know where to post it, so if this is the wrong place, please feel free to move or delete this post :)
I have some structures in a binary file that i want to read, the structures are like this:
In a win32 test that i did all worked fine and the data was loaded without problems, but trying to read it from the DS gives "corrupted" data, the first (and ONLY the first) cell (cell[0][0]) gets the correct data, but the other cells won't.
The code i use to read:
The compiler throws this warning:
Any ideas? :S
I have some structures in a binary file that i want to read, the structures are like this:
Code: |
#pragma pack(push, 1) struct MulCell { u16 TileID; u8 Z; }; struct MulBlock { MulCell cells[8][8]; }; #pragma pack |
In a win32 test that i did all worked fine and the data was loaded without problems, but trying to read it from the DS gives "corrupted" data, the first (and ONLY the first) cell (cell[0][0]) gets the correct data, but the other cells won't.
The code i use to read:
Code: |
x %= width; y %= height; u32 blockID = (x / 8) * (height / 8) + (y / 8); u32 offset = blockID * 192; fseek(fmap, offset, SEEK_SET); fread(&block->cells, sizeof(MulCell), 64, fmap); |
The compiler throws this warning:
Quote: |
warning: #pragma pack(push[, id], <n>) is not supported on this target |
Any ideas? :S