Daid
Member
Traced back the not loading of clonk to the failure of loading the bmp images. What traced back to this function:
In this class:
If I add this debug line:
in the IsValid function, then I get this:
Window/Linux, x86: 0 -14 14 40
Linux, GP2x: 0 -16 16 40
And thus, it doesn't pack the Head structure correctly.
Traced back to this code:
Any ideas?
Code:
BOOL CBitmap256Info::Valid()
{
if (Head.bfType != *((WORD*)"BM") ) return FALSE;
if ((Info.biBitCount!=8) || (Info.biCompression!=0)) return FALSE;
return TRUE;
}
Code:
#pragma pack(1)
class CBitmap256Info
{
public:
CBitmap256Info();
public:
BITMAPFILEHEADER Head;
BITMAPINFOHEADER Info;
RGBQUAD Colors[256];
public:
void Default();
void Set(int iWdt, int iHgt, BYTE *bypPalette);
BOOL Valid();
int FileBitsOffset();
};
#pragma pack()
If I add this debug line:
Code:
printf("%i %i %i %i\n", (int)this - (int)&Head, (int)this - (int)&Info, sizeof(Head), sizeof(Info));
Window/Linux, x86: 0 -14 14 40
Linux, GP2x: 0 -16 16 40
And thus, it doesn't pack the Head structure correctly.
Traced back to this code:
Code:
#pragma pack(2)
typedef struct tagBITMAPFILEHEADER {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER,*LPBITMAPFILEHEADER,*PBITMAPFILEHEADER;
#pragma pack()
Any ideas?