mirror of
https://github.com/love2d/love.git
synced 2026-08-13 00:50:51 +02:00
Add internal module type enum value for use with out-of-tree third party modules.
https://bitbucket.org/rude/love/pull-requests/79/add-pluggable-modules-to-the-build-system/
This commit is contained in:
@@ -113,15 +113,18 @@ void Module::registerInstance(Module *instance)
|
||||
|
||||
registry.insert(make_pair(name, instance));
|
||||
|
||||
ModuleType moduletype = instance->getModuleType();
|
||||
ModuleType mtype = instance->getModuleType();
|
||||
|
||||
if (instances[moduletype] != nullptr)
|
||||
if (mtype != M_UNKNOWN)
|
||||
{
|
||||
printf("Warning: overwriting module instance %s with new instance %s\n",
|
||||
instances[moduletype]->getName(), instance->getName());
|
||||
}
|
||||
if (instances[mtype] != nullptr)
|
||||
{
|
||||
printf("Warning: overwriting module instance %s with new instance %s\n",
|
||||
instances[mtype]->getName(), instance->getName());
|
||||
}
|
||||
|
||||
instances[moduletype] = instance;
|
||||
instances[mtype] = instance;
|
||||
}
|
||||
}
|
||||
|
||||
Module *Module::getInstance(const std::string &name)
|
||||
|
||||
Reference in New Issue
Block a user