bananatools/ferrumio/config.c

32 lines
1.7 KiB
C

#include <windows.h>
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include "ferrumio/config.h"
void ferrum_io_najv4_config_load(struct ferrum_najv4_config *cfg, const wchar_t *filename)
{
cfg->test = GetPrivateProfileIntW(L"najv4", L"test", VK_HOME, filename);
cfg->service = GetPrivateProfileIntW(L"najv4", L"service", VK_DELETE, filename);
cfg->coin = GetPrivateProfileIntW(L"najv4", L"coin", VK_INSERT, filename);
cfg->up = GetPrivateProfileIntW(L"najv4", L"up", VK_UP, filename);
cfg->down = GetPrivateProfileIntW(L"najv4", L"down", VK_DOWN, filename);
cfg->enter = GetPrivateProfileIntW(L"najv4", L"enter", VK_RETURN, filename);
}
void ferrum_io_gamepad_config_load(struct ferrum_gamepad_config *cfg, const wchar_t *filename)
{
cfg->dpad_up = GetPrivateProfileIntW(L"gamepad", L"dpad_up", 'W', filename);
cfg->dpad_down = GetPrivateProfileIntW(L"gamepad", L"dpad_down", 'S', filename);
cfg->dpad_left = GetPrivateProfileIntW(L"gamepad", L"dpad_left", 'A', filename);
cfg->dpad_right = GetPrivateProfileIntW(L"gamepad", L"dpad_right", 'D', filename);
cfg->btn_a = GetPrivateProfileIntW(L"gamepad", L"button_a", 'O', filename);
cfg->btn_b = GetPrivateProfileIntW(L"gamepad", L"button_b", 'K', filename);
cfg->btn_x = GetPrivateProfileIntW(L"gamepad", L"button_x", 'I', filename);
cfg->btn_y = GetPrivateProfileIntW(L"gamepad", L"button_y", 'J', filename);
cfg->trigger_l = GetPrivateProfileIntW(L"gamepad", L"trigger_l", 'Q', filename);
cfg->trigger_r = GetPrivateProfileIntW(L"gamepad", L"trigger_r", 'E', filename);
cfg->btn_start = GetPrivateProfileIntW(L"gamepad", L"button_start", VK_LSHIFT, filename);
}