Subversion Repositories filter_foundry

Compare Revisions

Regard whitespace Rev 553 → Rev 554

/trunk/load_win.c
93,7 → 93,13
parm_reset(true, false, true, false);
return 0;
}
if (!fileHasExtension(sfr, TEXT(".afs")) && !fileHasExtension(sfr, TEXT(".pff"))) {
// If .afs and .pff files have an invalid signature, then it is a hard error.
// If any other file has no "%RGB1.0" signature, then it is OK and
// we will return MSG_LOADFILE_UNKNOWN_FORMAT_ID and continue with trying other formats
if (res == MSG_INVALID_FILE_SIGNATURE_ID) res = MSG_LOADFILE_UNKNOWN_FORMAT_ID;
}
}
 
// Try to read the file as FFL file
if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) {
102,8 → 108,27
parm_reset(true, true, true, true);
return 0;
}
if (!fileHasExtension(sfr, TEXT(".ffl"))) {
// If .ffl files have an invalid signature, then it is a hard error.
// If any other file has no "FFL1.0" signature, then it is OK and
// we will return MSG_LOADFILE_UNKNOWN_FORMAT_ID and continue with trying other formats
if (res == MSG_INVALID_FILE_SIGNATURE_ID) res = MSG_LOADFILE_UNKNOWN_FORMAT_ID;
}
}
 
// Is it a "Filters Unlimited" FFX filter? (Only partially compatible with Filter Factory!!!)
if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) {
if (0 == (res = readfile_ffx(sfr))) {
return 0;
}
if (!fileHasExtension(sfr, TEXT(".ffx"))) {
// If .ffx files have an invalid signature, then it is a hard error.
// If any other file has no "FFX1.0", "FFX1.1", or "FFX1.2" signature, then it is OK and
// we will return MSG_LOADFILE_UNKNOWN_FORMAT_ID and continue with trying other formats
if (res == MSG_INVALID_FILE_SIGNATURE_ID) res = MSG_LOADFILE_UNKNOWN_FORMAT_ID;
}
}
 
// If that didn't work, try to load as Windows image file (Resource API for 8BF/PRM files)
if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) {
if (hm = LoadLibraryEx(sfr->sfFile.szName, NULL, LOAD_LIBRARY_AS_DATAFILE)) {
122,26 → 147,23
}
}
 
// Is it a "Filters Unlimited" FFX filter? (Only partially compatible with Filter Factory!!!)
if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) {
if (0 == (res = readfile_ffx(sfr))) {
return 0;
}
}
 
// Is it a "Filters Unlimited" TXT filter? (Only partially compatible with Filter Factory!!!)
if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) {
if (fileHasExtension(sfr, TEXT(".txt"))) {
if (0 == (res = readfile_picotxt_or_ffdecomp(sfr))) {
return 0;
}
}
}
 
// Is it a "GIMP UserFilter (GUF)" file? (Only partially compatible with Filter Factory!!!)
if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) {
if (fileHasExtension(sfr, TEXT(".guf"))) {
if (0 == (res = readfile_guf(sfr))) {
return 0;
}
}
}
 
// If nothing worked, we will try to find a PARM resource (MacOS plugin, or 64 bit 8BF on Win32 OS)
// Note that we cannot detect obfuscated filters here!