| 628 | } |
| 629 | |
| 630 | static bool GetProjectFile(int argc, char *argv[], char* resources_path, char* project_file, uint32_t project_file_size) |
| 631 | { |
| 632 | if (argc > 1 && argv[argc-1][0] != '-') |
| 633 | { |
| 634 | dmStrlCpy(project_file, argv[argc-1], project_file_size); |
| 635 | return true; |
| 636 | } |
| 637 | else |
| 638 | { |
| 639 | char p1[DMPATH_MAX_PATH]; |
| 640 | char p2[DMPATH_MAX_PATH]; |
| 641 | char p3[DMPATH_MAX_PATH]; |
| 642 | char* paths[3]; |
| 643 | uint32_t count = 0; |
| 644 | |
| 645 | const char* mountstr = ""; |
| 646 | #if defined(__NX__) |
| 647 | mountstr = "data:/"; |
| 648 | #endif |
| 649 | // there's no way to check for a named mount, and it will assert |
| 650 | // So we'll only enter here if it's set on this platform |
| 651 | if (dmSys::GetEnv("DM_HOSTFS") != 0) |
| 652 | mountstr = dmSys::GetEnv("DM_HOSTFS"); |
| 653 | |
| 654 | dmSnPrintf(p1, sizeof(p1), "%sgame.projectc", mountstr); |
| 655 | dmSnPrintf(p2, sizeof(p2), "%sbuild/default/game.projectc", mountstr); |
| 656 | paths[count++] = p1; |
| 657 | paths[count++] = p2; |
| 658 | |
| 659 | if (resources_path) |
| 660 | { |
| 661 | dmPath::Concat(resources_path, "game.projectc", p3, sizeof(p3)); |
| 662 | paths[count++] = p3; |
| 663 | } |
| 664 | |
| 665 | for (uint32_t i = 0; i < count; ++i) |
| 666 | { |
| 667 | if (dmSys::ResourceExists(paths[i])) |
| 668 | { |
| 669 | dmStrlCpy(project_file, paths[i], project_file_size); |
| 670 | return true; |
| 671 | } |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | return false; |
| 676 | } |
| 677 | |
| 678 | static bool LoadAndSetSslKeys(const char* ssl_keys_path) |
| 679 | { |
no test coverage detected