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

Method Load

ogsr_engine/Layers/xrRender/SkeletonCustom.cpp:161–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void CKinematics::Load(const char* N, IReader* data, const u32 dwFlags)
162{
163 // Msg ("skeleton: %s",N);
164 inherited::Load(N, data, dwFlags);
165
166 pUserData = nullptr;
167 m_lod = nullptr;
168 // loading lods
169
170 IReader* LD = data->open_chunk(OGF_S_LODS);
171 if (LD)
172 {
173 // From stream
174 {
175 string_path lod_name;
176 LD->r_string(lod_name, sizeof(lod_name));
177
178 m_lod = smart_cast<dxRender_Visual*>(RImplementation.model_CreateChild(lod_name, nullptr));
179
180 if (CKinematics* lod_kinematics = smart_cast<CKinematics*>(m_lod))
181 {
182 lod_kinematics->m_is_original_lod = true;
183 }
184
185 VERIFY(m_lod, "Cant create LOD model for", N);
186 }
187 LD->close();
188 }
189
190 IReader* UD;
191
192 if (const auto userdata_override_ini = RImplementation.Models->userdata_override_ini;
193 userdata_override_ini && userdata_override_ini->section_exist("data"))
194 {
195 for (const auto& pair : userdata_override_ini->r_section("data").Ordered_Data)
196 {
197 if (!strncmp(N, pair.first.c_str(), strlen(pair.first.c_str())))
198 {
199 UD = FS.r_open(fsgame::game_configs, pair.second.c_str());
200 if (UD)
201 {
202 Msg("Loading user_data [%s] for %s...", pair.second.c_str(), N);
203
204 pUserData = xr_new<CInifile>(UD, FS.get_path(fsgame::game_configs)->m_Path);
205 UD->close();
206 }
207
208 break;
209 }
210 }
211 }
212
213 // try to read custom user data for module from ltx file
214 if (!pUserData)
215 {
216 string_path ini_path;
217 strcpy_s(ini_path, N);
218 if (strext(ini_path))

Callers

nothing calls this directly

Calls 15

LoadFunction · 0.85
MsgFunction · 0.85
strextFunction · 0.85
_strlwrFunction · 0.85
model_CreateChildMethod · 0.80
section_existMethod · 0.80
r_openMethod · 0.80
find_chunkMethod · 0.80
zeroMethod · 0.80
emplaceMethod · 0.80
setXYZiMethod · 0.80
translate_overMethod · 0.80

Tested by

no test coverage detected