mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-25 04:11:42 -04:00
load native binaries from mod resources/binaries/<platform/
This commit is contained in:
parent
25dc6eea5b
commit
acd9bd7884
6 changed files with 20 additions and 3 deletions
loader/src
loader
platform
|
@ -403,9 +403,6 @@ void Loader::Impl::loadModGraph(Mod* node, bool early) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (node->getID() == "absolllute.megahack")
|
||||
log::debug("megahack creepypasta");
|
||||
|
||||
for (auto const& dep : node->m_impl->m_dependants) {
|
||||
m_modsToLoad.push_front(dep);
|
||||
}
|
||||
|
|
|
@ -83,6 +83,7 @@ namespace geode {
|
|||
|
||||
void updateModResources(Mod* mod);
|
||||
void addSearchPaths();
|
||||
void addNativeBinariesPath(ghc::filesystem::path const& path);
|
||||
|
||||
Result<> setup();
|
||||
void forceReset();
|
||||
|
|
|
@ -46,8 +46,13 @@ Result<> Mod::Impl::setup() {
|
|||
}
|
||||
if (!m_resourcesLoaded) {
|
||||
auto searchPathRoot = dirs::getModRuntimeDir() / m_metadata.getID() / "resources";
|
||||
// TODO: why is this commented out
|
||||
// CCFileUtils::get()->addSearchPath(searchPathRoot.string().c_str());
|
||||
|
||||
const auto binariesDir = searchPathRoot / m_metadata.getID() / "binaries" / PlatformID::toShortString(GEODE_PLATFORM_TARGET);
|
||||
if (ghc::filesystem::exists(binariesDir))
|
||||
LoaderImpl::get()->addNativeBinariesPath(binariesDir);
|
||||
|
||||
m_resourcesLoaded = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,3 +32,7 @@ std::string Loader::Impl::getGameVersion() {
|
|||
bool Loader::Impl::userTriedToLoadDLLs() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Loader::Impl::addNativeBinariesPath(ghc::filesystem::path const& path) {
|
||||
log::warn("LoaderImpl::addNativeBinariesPath not implement on this platform, not adding path {}", path.string());
|
||||
}
|
||||
|
|
|
@ -135,3 +135,8 @@ void Loader::Impl::setupIPC() {
|
|||
bool Loader::Impl::userTriedToLoadDLLs() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Loader::Impl::addNativeBinariesPath(ghc::filesystem::path const& path) {
|
||||
log::warn("LoaderImpl::addNativeBinariesPath not implement on this platform, not adding path {}", path.string());
|
||||
}
|
||||
|
||||
|
|
|
@ -74,3 +74,8 @@ bool Loader::Impl::userTriedToLoadDLLs() const {
|
|||
|
||||
return triedToLoadDLLs;
|
||||
}
|
||||
|
||||
void Loader::Impl::addNativeBinariesPath(ghc::filesystem::path const& path) {
|
||||
// adds a search directory for native dlls (the name is misleading)
|
||||
SetDllDirectoryW(path.wstring().c_str());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue