Rev 552 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 552 | Rev 554 | ||
---|---|---|---|
Line 91... | Line 91... | ||
91 | if (0 == (res = readfile_afs_pff(sfr))) { |
91 | if (0 == (res = readfile_afs_pff(sfr))) { |
92 | gdata->obfusc = false; |
92 | gdata->obfusc = false; |
93 | parm_reset(true, false, true, false); |
93 | parm_reset(true, false, true, false); |
94 | return 0; |
94 | return 0; |
95 | } |
95 | } |
- | 96 | if (!fileHasExtension(sfr, TEXT(".afs")) && !fileHasExtension(sfr, TEXT(".pff"))) { |
|
- | 97 | // If .afs and .pff files have an invalid signature, then it is a hard error. |
|
- | 98 | // If any other file has no "%RGB1.0" signature, then it is OK and |
|
- | 99 | // we will return MSG_LOADFILE_UNKNOWN_FORMAT_ID and continue with trying other formats |
|
- | 100 | if (res == MSG_INVALID_FILE_SIGNATURE_ID) res = MSG_LOADFILE_UNKNOWN_FORMAT_ID; |
|
- | 101 | } |
|
96 | } |
102 | } |
97 | 103 | ||
98 | // Try to read the file as FFL file |
104 | // Try to read the file as FFL file |
99 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
105 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
100 | if (0 == (res = readfile_ffl(sfr))) { |
106 | if (0 == (res = readfile_ffl(sfr))) { |
101 | gdata->obfusc = false; |
107 | gdata->obfusc = false; |
102 | parm_reset(true, true, true, true); |
108 | parm_reset(true, true, true, true); |
103 | return 0; |
109 | return 0; |
104 | } |
110 | } |
- | 111 | if (!fileHasExtension(sfr, TEXT(".ffl"))) { |
|
- | 112 | // If .ffl files have an invalid signature, then it is a hard error. |
|
- | 113 | // If any other file has no "FFL1.0" signature, then it is OK and |
|
- | 114 | // we will return MSG_LOADFILE_UNKNOWN_FORMAT_ID and continue with trying other formats |
|
- | 115 | if (res == MSG_INVALID_FILE_SIGNATURE_ID) res = MSG_LOADFILE_UNKNOWN_FORMAT_ID; |
|
- | 116 | } |
|
- | 117 | } |
|
- | 118 | ||
- | 119 | // Is it a "Filters Unlimited" FFX filter? (Only partially compatible with Filter Factory!!!) |
|
- | 120 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
|
- | 121 | if (0 == (res = readfile_ffx(sfr))) { |
|
- | 122 | return 0; |
|
- | 123 | } |
|
- | 124 | if (!fileHasExtension(sfr, TEXT(".ffx"))) { |
|
- | 125 | // If .ffx files have an invalid signature, then it is a hard error. |
|
- | 126 | // If any other file has no "FFX1.0", "FFX1.1", or "FFX1.2" signature, then it is OK and |
|
- | 127 | // we will return MSG_LOADFILE_UNKNOWN_FORMAT_ID and continue with trying other formats |
|
- | 128 | if (res == MSG_INVALID_FILE_SIGNATURE_ID) res = MSG_LOADFILE_UNKNOWN_FORMAT_ID; |
|
- | 129 | } |
|
105 | } |
130 | } |
106 | 131 | ||
107 | // If that didn't work, try to load as Windows image file (Resource API for 8BF/PRM files) |
132 | // If that didn't work, try to load as Windows image file (Resource API for 8BF/PRM files) |
108 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
133 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
109 | if (hm = LoadLibraryEx(sfr->sfFile.szName, NULL, LOAD_LIBRARY_AS_DATAFILE)) { |
134 | if (hm = LoadLibraryEx(sfr->sfFile.szName, NULL, LOAD_LIBRARY_AS_DATAFILE)) { |
Line 120... | Line 145... | ||
120 | } |
145 | } |
121 | FreeLibrary(hm); |
146 | FreeLibrary(hm); |
122 | } |
147 | } |
123 | } |
148 | } |
124 | 149 | ||
125 | // Is it a "Filters Unlimited" FFX filter? (Only partially compatible with Filter Factory!!!) |
- | |
126 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
- | |
127 | if (0 == (res = readfile_ffx(sfr))) { |
- | |
128 | return 0; |
- | |
129 | } |
- | |
130 | } |
- | |
131 | - | ||
132 | // Is it a "Filters Unlimited" TXT filter? (Only partially compatible with Filter Factory!!!) |
150 | // Is it a "Filters Unlimited" TXT filter? (Only partially compatible with Filter Factory!!!) |
133 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
151 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
- | 152 | if (fileHasExtension(sfr, TEXT(".txt"))) { |
|
134 | if (0 == (res = readfile_picotxt_or_ffdecomp(sfr))) { |
153 | if (0 == (res = readfile_picotxt_or_ffdecomp(sfr))) { |
135 | return 0; |
154 | return 0; |
136 | } |
155 | } |
137 | } |
156 | } |
- | 157 | } |
|
138 | 158 | ||
139 | // Is it a "GIMP UserFilter (GUF)" file? (Only partially compatible with Filter Factory!!!) |
159 | // Is it a "GIMP UserFilter (GUF)" file? (Only partially compatible with Filter Factory!!!) |
140 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
160 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
- | 161 | if (fileHasExtension(sfr, TEXT(".guf"))) { |
|
141 | if (0 == (res = readfile_guf(sfr))) { |
162 | if (0 == (res = readfile_guf(sfr))) { |
142 | return 0; |
163 | return 0; |
143 | } |
164 | } |
144 | } |
165 | } |
- | 166 | } |
|
145 | 167 | ||
146 | // If nothing worked, we will try to find a PARM resource (MacOS plugin, or 64 bit 8BF on Win32 OS) |
168 | // If nothing worked, we will try to find a PARM resource (MacOS plugin, or 64 bit 8BF on Win32 OS) |
147 | // Note that we cannot detect obfuscated filters here! |
169 | // Note that we cannot detect obfuscated filters here! |
148 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
170 | if (res == MSG_LOADFILE_UNKNOWN_FORMAT_ID) { |
149 | if (0 == (res = readfile_8bf(sfr))) { |
171 | if (0 == (res = readfile_8bf(sfr))) { |