hooklib/config.c: Add struct gfx_config

This commit is contained in:
Tau 2019-10-19 17:03:17 -04:00
parent dfcf3d8bd1
commit 871b82a8ad
3 changed files with 31 additions and 0 deletions

17
hooklib/config.c Normal file
View File

@ -0,0 +1,17 @@
#include <windows.h>
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#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);
}

12
hooklib/config.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
struct gfx_config {
bool enable;
bool windowed;
bool framed;
};
void gfx_config_load(struct gfx_config *cfg, const wchar_t *filename);

View File

@ -7,6 +7,8 @@ hooklib_lib = static_library(
capnhook.get_variable('hook_dep'),
],
sources : [
'config.c',
'config.h',
'dll.c',
'dll.h',
'dns.c',