| 87 | //=========================================================================== |
| 88 | |
| 89 | static int FindGFXFile(FString & fn) |
| 90 | { |
| 91 | int lump = fileSystem.CheckNumForFullName(fn.GetChars()); // if we find something that matches the name plus the extension, return it and do not enter the substitution logic below. |
| 92 | if (lump != -1) return lump; |
| 93 | |
| 94 | int best = -1; |
| 95 | auto dot = fn.LastIndexOf('.'); |
| 96 | auto slash = fn.LastIndexOf('/'); |
| 97 | if (dot > slash) fn.Truncate(dot); |
| 98 | |
| 99 | static const char * extensions[] = { ".png", ".jpg", ".tga", ".pcx", nullptr }; |
| 100 | |
| 101 | for (const char ** extp=extensions; *extp; extp++) |
| 102 | { |
| 103 | lump = fileSystem.CheckNumForFullName((fn + *extp).GetChars()); |
| 104 | if (lump >= best) best = lump; |
| 105 | } |
| 106 | return best; |
| 107 | } |
| 108 | |
| 109 | |
| 110 | //=========================================================================== |
no test coverage detected