🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
BMFont Binary Loading Help
Hi,
I'm having an issue with loading in the BMFont binary data.
I have set up the structs as described in the documentation.
The first 4 bytes read in fine with the expected results.
However, when reading in the first info block of data I have problems.
- The first block size appears to be wrong (i.e, I get a really high number)
- The first half of the data appears to be wrong, but once it reaches the 'stretchH' section the data is absolutely perfect.
- If I skip an extra byte before reading in the data, the first half will be correct (apart from the blocksize data) and the second half wrong.
Maybe I have missed something out here?
#pragma pack( push, 1 )
struct cFontInfoBlock
{
4 Bytes miBlockSize;
2 Bytes muiFontSize;
Byte muiReserved :4;
Byte muiBold :1;
Byte muiItalic :1;
Byte muiUnicode :1;
Byte muiSmooth :1;
Byte muiCharSet;
2 Bytes muiStretchH;
Byte muiAA;
Byte muiPaddingUp;
Byte muiPaddingRight;
Byte muiPaddingDown;
Byte muiPaddingLeft;
Byte muiSpacingHoriz;
Byte muiSpacingVert;
Byte muiOutline;
Byte macFontName[1];
};
If I place an extra byte in the middle of struct it appears to work properly (exluding the blocksize still) but this just doesn't feel right.
Thanks for your help.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement