This commit is contained in:
Christian Semmler 2025-07-12 19:13:01 -07:00
parent 57ab9cfc02
commit e6ae70385f
4 changed files with 11 additions and 3 deletions

View File

@ -1121,8 +1121,9 @@ bool IsleApp::LoadConfig()
for (const char* key : Extensions::availableExtensions) {
if (iniparser_getboolean(dict, key, 0)) {
std::vector<const char*> extensionKeys;
extensionKeys.resize(iniparser_getsecnkeys(dict, key));
iniparser_getseckeys(dict, key, extensionKeys.data());
const char* section = SDL_strchr(key, ':') + 1;
extensionKeys.resize(iniparser_getsecnkeys(dict, section));
iniparser_getseckeys(dict, section, extensionKeys.data());
std::map<std::string, std::string> extensionDict;
for (const char* key : extensionKeys) {

View File

@ -3,6 +3,7 @@
#include "extensions/extensions.h"
#include "legotextureinfo.h"
#include <array>
#include <map>
namespace Extensions

View File

@ -11,6 +11,7 @@ void Extensions::Enable(const char* p_key, std::map<std::string, std::string> p_
if (!SDL_strcasecmp(p_key, "extensions:texture loader")) {
TextureLoader::options = std::move(p_options);
TextureLoader::enabled = true;
TextureLoader::Initialize();
}
SDL_Log("Enabled extension: %s", p_key);

View File

@ -4,7 +4,7 @@ using namespace Extensions;
std::map<std::string, std::string> TextureLoader::options;
bool TextureLoader::enabled = false;
#include <SDL3/SDL_log.h>
void TextureLoader::Initialize()
{
for (const auto& option : defaults) {
@ -12,6 +12,11 @@ void TextureLoader::Initialize()
options[option.first.data()] = option.second;
}
}
for (const auto& x : options) {
SDL_Log(x.first.c_str());
SDL_Log(x.second.c_str());
}
}
bool TextureLoader::PatchTexture(LegoTextureInfo* p_textureInfo)