IFILE_READ problem? | developer.brewmp.com IFILE_READ problem? | developer.brewmp.com

Developer

IFILE_READ problem?

Forums:

Any idea why the width and height in dbgprintf is 0 ?

GLubyte width = 0, height = 0;

GLubyte headerLength = 0;
GLubyte imageType = 0;
GLubyte bits = 0;
int format= 0;
int lineWidth = 0;

IFILE_Read( pFile, &headerLength, sizeof(GLubyte));

IFILE_Seek(pFile, _SEEK_CURRENT,0);

IFILE_Read( pFile, &imageType, sizeof(GLubyte));

IFILE_Seek(pFile, _SEEK_CURRENT,9);

IFILE_Read( pFile, &width, sizeof(GLubyte));

IFILE_Read( pFile, &height, sizeof(GLubyte));

IFILE_Read( pFile, &bits, sizeof(GLubyte));

DBGPRINTF("=== %d ===%d", width, height);

IFILE_Seek(pFile, _SEEK_CURRENT,headerLength + 1);

Try to check the results, specially of seek functions... :)
I don't remember which one, but I've seen some weird stuff where using one of _SEEK_START or _SEEK_CURRENT wouldn't work as expected and any read afterwards returned 0....

Try to check the results, specially of seek functions... :)
I don't remember which one, but I've seen some weird stuff where using one of _SEEK_START or _SEEK_CURRENT wouldn't work as expected and any read afterwards returned 0....