diff --git a/hooklib/config.c b/hooklib/config.c new file mode 100644 index 00000000..ed69146e --- /dev/null +++ b/hooklib/config.c @@ -0,0 +1,17 @@ +#include + +#include +#include +#include + +#include "hooklib/config.h" + +void gfx_config_load(struct gfx_config *cfg, const wchar_t *filename) +{ + assert(cfg != NULL); + assert(filename != NULL); + + cfg->enable = GetPrivateProfileIntW(L"gfx", L"enable", 1, filename); + cfg->windowed = GetPrivateProfileIntW(L"gfx", L"windowed", 0, filename); + cfg->framed = GetPrivateProfileIntW(L"gfx", L"framed", 1, filename); +} diff --git a/hooklib/config.h b/hooklib/config.h new file mode 100644 index 00000000..ebdb6b15 --- /dev/null +++ b/hooklib/config.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include + +struct gfx_config { + bool enable; + bool windowed; + bool framed; +}; + +void gfx_config_load(struct gfx_config *cfg, const wchar_t *filename); diff --git a/hooklib/meson.build b/hooklib/meson.build index 3f490656..80abf6e0 100644 --- a/hooklib/meson.build +++ b/hooklib/meson.build @@ -7,6 +7,8 @@ hooklib_lib = static_library( capnhook.get_variable('hook_dep'), ], sources : [ + 'config.c', + 'config.h', 'dll.c', 'dll.h', 'dns.c',