From il_register.c, IL_LOADFUNC should return IL_NO_ERROR if no error occured.
But in documentation, IL_LOADFUNC returns IL_TRUE if no error. And many file loading functions in DevIL 1.6.5 source codes do this wrong thing.
Codes from il_register.c :
ILboolean iRegisterLoad(const ILstring FileName) { ...
Error = TempNode->Load(FileName); if (Error == IL_NO_ERROR || Error == 0) { // 0 and IL_NO_ERROR are both valid. return IL_TRUE; } else { ilSetError(Error); return IL_FALSE; } } TempNode = TempNode->Next; } ... }
============== should it be :
if ( Error == IL_NO_ERROR || Error == IL_TRUE ) { ... }
There are several inconsistencies like this. I would just recommend using whatever works for you. It's not about to be changed on you.
Log in to post a comment.
From il_register.c, IL_LOADFUNC should return IL_NO_ERROR if no error occured.
But in documentation, IL_LOADFUNC returns IL_TRUE if no error. And many file loading functions in DevIL 1.6.5 source codes do this wrong thing.
Codes from il_register.c :
ILboolean iRegisterLoad(const ILstring FileName)
{
...
Error = TempNode->Load(FileName);
if (Error == IL_NO_ERROR || Error == 0) { // 0 and IL_NO_ERROR are both valid.
return IL_TRUE;
}
else {
ilSetError(Error);
return IL_FALSE;
}
}
TempNode = TempNode->Next;
}
...
}
==============
should it be :
if ( Error == IL_NO_ERROR || Error == IL_TRUE )
{
...
}
There are several inconsistencies like this. I would just recommend using whatever works for you. It's not about to be changed on you.