Пример #1
0
// Internal function to get the header and check it.
ILboolean iIsValidPcx()
{
	PCXHEAD Head;

	if (!iGetPcxHead(&Head))
		return IL_FALSE;
	iseek(-(ILint)sizeof(PCXHEAD), IL_SEEK_CUR);

	return iCheckPcx(&Head);
}
Пример #2
0
// Check whether given file has a valid .pcx header
ILboolean iIsValidPcx(SIO* io)
{
	PCXHEAD Head;
	ILint read = iGetPcxHead(io, &Head);
	io->seek(io->handle, -read, IL_SEEK_CUR);

	if (read == sizeof(Head))
		return iCheckPcx(&Head);
	else
		return IL_FALSE;
}
Пример #3
0
// Internal function used to load the .pcx.
ILboolean iLoadPcxInternal()
{
	PCXHEAD	Header;
	ILboolean bPcx = IL_FALSE;

	if (iCurImage == NULL) {
		ilSetError(IL_ILLEGAL_OPERATION);
		return bPcx;
	}

	if (!iGetPcxHead(&Header))
		return IL_FALSE;
	if (!iCheckPcx(&Header)) {
		ilSetError(IL_INVALID_FILE_HEADER);
		return IL_FALSE;
	}

	bPcx = iUncompressPcx(&Header);

	ilFixImage();

	return bPcx;
}