isle-portable/extensions/include/extensions/textureloader.h
Christian Semmler 232ef07b51
Allow extensions to define options (#590)
* Allow extensions to define their own options

* Fixes

* Remove logging
2025-07-13 02:30:29 +00:00

33 lines
732 B
C++

#pragma once
#include "extensions/extensions.h"
#include "legotextureinfo.h"
#include <array>
#include <map>
namespace Extensions
{
class TextureLoader {
public:
static void Initialize();
static bool PatchTexture(LegoTextureInfo* p_textureInfo);
static std::map<std::string, std::string> options;
static bool enabled;
static constexpr std::array<std::pair<std::string_view, std::string_view>, 1> defaults = {
{{"texture loader:texture path", "/textures/"}}
};
private:
static SDL_Surface* FindTexture(const char* p_name);
};
#ifdef EXTENSIONS
constexpr auto PatchTexture = &TextureLoader::PatchTexture;
#else
constexpr decltype(&TextureLoader::PatchTexture) PatchTexture = nullptr;
#endif
}; // namespace Extensions