From 871b82a8adc0afb0de6a78c6eabc51cef9e5ffbd Mon Sep 17 00:00:00 2001 From: Tau Date: Sat, 19 Oct 2019 17:03:17 -0400 Subject: [PATCH] hooklib/config.c: Add struct gfx_config --- hooklib/config.c | 17 +++++++++++++++++ hooklib/config.h | 12 ++++++++++++ hooklib/meson.build | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 hooklib/config.c create mode 100644 hooklib/config.h diff --git a/hooklib/config.c b/hooklib/config.c new file mode 100644 index 0000000..ed69146 --- /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 0000000..ebdb6b1 --- /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 3f49065..80abf6e 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',