| 644 | } |
| 645 | |
| 646 | void CKinematicsAnimated::Load(const char* N, IReader* data, u32 dwFlags) |
| 647 | { |
| 648 | inherited::Load(N, data, dwFlags); |
| 649 | |
| 650 | // Globals |
| 651 | blend_instances = nullptr; |
| 652 | m_Partition = nullptr; |
| 653 | Update_LastTime = 0; |
| 654 | |
| 655 | // Load animation |
| 656 | xr_vector<xr_string> omfs; |
| 657 | |
| 658 | auto add_omf = [&](LPCSTR nm) { |
| 659 | if (strstr(nm, "*.omf")) |
| 660 | { |
| 661 | FS_FileSet fset; |
| 662 | |
| 663 | FS.file_list(fset, fsgame::game_meshes, FS_ListFiles, nm); |
| 664 | // FS.file_list(fset, fsgame::level, FS_ListFiles, nm); |
| 665 | |
| 666 | if (strstr(Core.Params, "-dev_reference_copy")) |
| 667 | { |
| 668 | FS.file_list(fset, fsgame::game_meshes_reference, FS_ListFiles, nm); // FS_FileSet is actually a set ) |
| 669 | } |
| 670 | |
| 671 | omfs.reserve(omfs.size() + fset.size() - 1); |
| 672 | |
| 673 | for (const auto& it : fset) |
| 674 | { |
| 675 | omfs.emplace_back(it.name.c_str()); |
| 676 | } |
| 677 | } |
| 678 | else |
| 679 | { |
| 680 | xr_string s = nm; |
| 681 | if (!strext(nm)) |
| 682 | { |
| 683 | s += ".omf"; |
| 684 | } |
| 685 | omfs.push_back(s); |
| 686 | } |
| 687 | }; |
| 688 | |
| 689 | if (pUserData && pUserData->section_exist("omf_override")) |
| 690 | { |
| 691 | for (const auto& it : pUserData->r_section("omf_override").Ordered_Data) |
| 692 | { |
| 693 | LPCSTR nm = it.first.c_str(); |
| 694 | |
| 695 | add_omf(nm); |
| 696 | } |
| 697 | } |
| 698 | else if (data->find_chunk(OGF_S_MOTION_REFS)) |
| 699 | { |
| 700 | string4096 items_nm; |
| 701 | data->r_stringZ(items_nm, sizeof(items_nm)); |
| 702 | const u32 set_cnt = _GetItemCount(items_nm); |
| 703 | for (u32 k = 0; k < set_cnt; ++k) |
nothing calls this directly
no test coverage detected