MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / loadMeshLibFromVDF

Method loadMeshLibFromVDF

src/components/AnimHandler.cpp:434–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434bool AnimHandler::loadMeshLibFromVDF(const std::string& file, VDFS::FileIndex& idx)
435{
436 ZenLoad::zCModelMeshLib lib;
437
438 // Load heirachy
439 if (idx.hasFile(file + ".MDH"))
440 lib = ZenLoad::zCModelMeshLib(file + ".MDH", idx, 1.0f / 100.0f);
441 else if (idx.hasFile(file + ".MDL")) // Some mobs have .MDL
442 lib = ZenLoad::zCModelMeshLib(file + ".MDL", idx, 1.0f / 100.0f);
443 else if (idx.hasFile(file + ".MDM")) // Some mobs have .MDL
444 lib = ZenLoad::zCModelMeshLib(file + ".MDM", idx, 1.0f / 100.0f);
445
446 if (!lib.isValid())
447 LogWarn() << "Could not load MeshLib for Visual: " << file;
448
449 setMeshLib(lib);
450
451 // Save name of this meshlib loading more animations later
452 m_MeshLibName = file;
453 m_ActiveOverlay = m_MeshLibName;
454
455 // Load animations from MDS-file
456 // TODO: This is different for G2!
457 /*ZenLoad::zCModelPrototype modelPrototype(file + ".MDS", idx);
458
459 for(auto& anim : modelPrototype.getAnimations())
460 {
461 LogInfo() << "Loading animation: " << file + "-" + anim.animationName;
462 addAnimation(file + "-" + anim.animationName, idx, 1.0f / 100.0f);
463 }*/
464
465 return true;
466}
467
468void AnimHandler::setBindPose(bool force)
469{

Callers 2

NPC_SetModelVisualMethod · 0.80
onVisualChangedMethod · 0.80

Calls 2

zCModelMeshLibClass · 0.50
isValidMethod · 0.45

Tested by

no test coverage detected