MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Load

Method Load

ogsr_engine/Layers/xrRender/SkeletonAnimated.cpp:646–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646void 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)

Callers

nothing calls this directly

Calls 15

LoadFunction · 0.85
strextFunction · 0.85
_GetItemCountFunction · 0.85
_GetItemFunction · 0.85
MsgFunction · 0.85
file_listMethod · 0.80
section_existMethod · 0.80
find_chunkMethod · 0.80
existMethod · 0.80
hasMethod · 0.80
r_openMethod · 0.80
r_closeMethod · 0.80

Tested by

no test coverage detected