don't use vector for GetPluginOptions (usable with other languages now)
This commit is contained in:
@@ -40,12 +40,16 @@ namespace PluginConfig
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<ConfigOptionBase*> GetConfigOptionVec(std::vector<PluginConfigOption> &in)
|
||||
std::vector<ConfigOptionBase*> GetConfigOptionVec(PluginConfigArray &in)
|
||||
{
|
||||
std::vector<ConfigOptionBase*> outvec;
|
||||
for (PluginConfigOption &opt : in)
|
||||
for (int i = 0; i < in.len; i++)
|
||||
{
|
||||
outvec.push_back(GetConfigOption(opt));
|
||||
// basic check for validity
|
||||
if (in.options[i].data == nullptr)
|
||||
break;
|
||||
|
||||
outvec.push_back(GetConfigOption(in.options[i]));
|
||||
}
|
||||
return outvec;
|
||||
}
|
||||
|
||||
@@ -144,4 +144,10 @@ namespace PluginConfig
|
||||
ConfigType cfgType;
|
||||
void* data;
|
||||
};
|
||||
|
||||
struct PluginConfigArray
|
||||
{
|
||||
int len;
|
||||
PluginConfigOption* options;
|
||||
};
|
||||
}
|
||||
@@ -303,7 +303,7 @@ std::vector<PluginInfo> LoadPlugins()
|
||||
|
||||
auto nameFunc = (LPCWSTR(*)())GetProcAddress(thisplugin.handle, "GetPluginName");
|
||||
auto descFunc = (LPCWSTR(*)())GetProcAddress(thisplugin.handle, "GetPluginDescription");
|
||||
auto optsFunc = (std::vector<PluginConfig::PluginConfigOption>(*)())GetProcAddress(thisplugin.handle, "GetPluginOptions");
|
||||
auto optsFunc = (PluginConfig::PluginConfigArray(*)())GetProcAddress(thisplugin.handle, "GetPluginOptions");
|
||||
|
||||
if (nameFunc != NULL)
|
||||
thisplugin.name = nameFunc();
|
||||
|
||||
Reference in New Issue
Block a user