MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetRawResourceManager

Method GetRawResourceManager

BG3Extender/GameDefinitions/EntitySystem.cpp:1685–1706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1683}
1684
1685resource::GuidResourceBankBase* EntitySystemHelpersBase::GetRawResourceManager(ExtResourceManagerType type)
1686{
1687 auto index = staticDataIndices_[(unsigned)type];
1688 if (index == resource::UndefinedStaticDataType || (unsigned)type >= std::size(staticDataIndices_)) {
1689 OsiError("No resource manager index mapping registered for " << type);
1690 return {};
1691 }
1692
1693 auto defns = GetStaticSymbols().eoc__gGuidResourceManager;
1694 if (!defns || !*defns) {
1695 OsiError("Resource definition manager not available yet!");
1696 return {};
1697 }
1698
1699 auto res = (*defns)->Definitions.try_get(index);
1700 if (!res) {
1701 OsiError("Resource manager missing for " << type);
1702 return {};
1703 }
1704
1705 return *res;
1706}
1707
1708bool EntitySystemHelpersBase::SetSystemUpdateHook(SystemTypeIndex systemType, std::function<SystemHookProc> preUpdate, std::function<SystemHookProc> postUpdate)
1709{

Callers

nothing calls this directly

Calls 1

try_getMethod · 0.45

Tested by

no test coverage detected