mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
* SiLoader draft * Fixes * Fixes * Fix asset build on Windows * Remove whitespace * Package assets in CI * Disable clang-tidy * Fix NCC * Try this * Disable extensions on Xbox for now * Update bitmap * Update 3rdparty/CMakeLists.txt Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com> * Add DEPFILE for asset command * Use assets.d instead of .d --------- Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
30 lines
730 B
C++
30 lines
730 B
C++
#pragma once
|
|
|
|
#include "lego1_export.h"
|
|
|
|
#include <functional>
|
|
#include <map>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace Extensions
|
|
{
|
|
constexpr const char* availableExtensions[] = {"extensions:texture loader", "extensions:si loader"};
|
|
|
|
LEGO1_EXPORT void Enable(const char* p_key, std::map<std::string, std::string> p_options);
|
|
|
|
template <typename T>
|
|
struct Extension {
|
|
template <typename Function, typename... Args>
|
|
static auto Call(Function&& function, Args&&... args) -> std::optional<std::invoke_result_t<Function, Args...>>
|
|
{
|
|
#ifdef EXTENSIONS
|
|
if (T::enabled) {
|
|
return std::invoke(std::forward<Function>(function), std::forward<Args>(args)...);
|
|
}
|
|
#endif
|
|
return std::nullopt;
|
|
}
|
|
};
|
|
}; // namespace Extensions
|