| 475 | } |
| 476 | |
| 477 | bool validatePath() |
| 478 | { |
| 479 | if (!TFE_Paths::hasPath(PATH_SOURCE_DATA)) { return false; } |
| 480 | |
| 481 | char testFile[TFE_MAX_PATH]; |
| 482 | // if (game->id == Game_Dark_Forces) |
| 483 | { |
| 484 | // Does DARK.GOB exist? |
| 485 | sprintf(testFile, "%s%s", TFE_Paths::getPath(PATH_SOURCE_DATA), "DARK.GOB"); |
| 486 | if (!FileUtil::exists(testFile)) |
| 487 | { |
| 488 | TFE_System::logWrite(LOG_ERROR, "Main", "Invalid game source path: '%s' - '%s' does not exist.", TFE_Paths::getPath(PATH_SOURCE_DATA), testFile); |
| 489 | TFE_Paths::setPath(PATH_SOURCE_DATA, ""); |
| 490 | } |
| 491 | else if (!GobArchive::validate(testFile, 130)) |
| 492 | { |
| 493 | TFE_System::logWrite(LOG_ERROR, "Main", "Invalid game source path: '%s' - '%s' GOB is invalid, too few files.", TFE_Paths::getPath(PATH_SOURCE_DATA), testFile); |
| 494 | TFE_Paths::setPath(PATH_SOURCE_DATA, ""); |
| 495 | } |
| 496 | } |
| 497 | return TFE_Paths::hasPath(PATH_SOURCE_DATA); |
| 498 | } |
| 499 | |
| 500 | int main(int argc, char* argv[]) |
| 501 | { |