|
@@ -3349,25 +3349,29 @@ void OpenRaider::loadPakFolderRecursive(const char *dir) {
|
3349
|
3349
|
delete tmp;
|
3350
|
3350
|
}
|
3351
|
3351
|
} else {
|
3352
|
|
- /*!
|
3353
|
|
- * \fixme Currently just tries to validate every file
|
3354
|
|
- * in the pak folders. Should check the exstension to
|
3355
|
|
- * see if it could be a level pak...
|
3356
|
|
- */
|
3357
|
|
-
|
3358
|
3352
|
char *fullPathMap = bufferString("%s%s", dir, ep->d_name);
|
3359
|
3353
|
|
3360
|
|
- if (m_tombraider.checkMime(fullPathMap) == 0) {
|
3361
|
|
- // printf("Validated pak: '%s'\n", fullPathMap);
|
3362
|
|
- delete [] fullPathMap;
|
|
3354
|
+ char *lowerPath = bufferString("%s", fullPathMap);
|
|
3355
|
+ for (char *p = lowerPath; *p; ++p) *p = (char)tolower(*p);
|
|
3356
|
+
|
|
3357
|
+ // Check for valid extension
|
|
3358
|
+ if (stringEndsWith(lowerPath, ".phd")
|
|
3359
|
+ || stringEndsWith(lowerPath, ".tr2")
|
|
3360
|
+ || stringEndsWith(lowerPath, ".tr4")
|
|
3361
|
+ || stringEndsWith(lowerPath, ".trc")) {
|
|
3362
|
+ if (m_tombraider.checkMime(fullPathMap) == 0) {
|
|
3363
|
+ // printf("Validated pak: '%s'\n", fullPathMap);
|
3363
|
3364
|
|
3364
|
|
- // Just load relative filename
|
3365
|
|
- mMapList.pushBack(bufferString("%s", (fullPathMap + strlen(m_pakDir))));
|
3366
|
|
- } else {
|
3367
|
|
- printf("ERROR: pak file '%s' not found or invalid\n", fullPathMap);
|
|
3365
|
+ // Just load relative filename
|
|
3366
|
+ mMapList.pushBack(bufferString("%s", (fullPathMap + strlen(m_pakDir))));
|
|
3367
|
+ } else {
|
|
3368
|
+ printf("ERROR: pak file '%s' not found or invalid\n", fullPathMap);
|
3368
|
3369
|
|
3369
|
|
- delete [] fullPathMap;
|
|
3370
|
+ delete [] fullPathMap;
|
|
3371
|
+ }
|
3370
|
3372
|
}
|
|
3373
|
+
|
|
3374
|
+ delete [] lowerPath;
|
3371
|
3375
|
}
|
3372
|
3376
|
}
|
3373
|
3377
|
closedir(pakDir);
|