GBA Config: Load config from the correct location on Windows

This commit is contained in:
Jeffrey Pfau 2014-11-11 02:07:50 -08:00
parent 20c5c27bf9
commit e51285a0db
1 changed files with 6 additions and 0 deletions

View File

@ -102,8 +102,14 @@ void GBAConfigDeinit(struct GBAConfig* config) {
bool GBAConfigLoad(struct GBAConfig* config) {
char path[PATH_MAX];
#ifndef _WIN32
char* home = getenv("HOME");
snprintf(path, PATH_MAX, "%s/.config/%s/config.ini", home, BINARY_NAME);
#else
char home[MAX_PATH];
SHGetFolderPath(0, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, home);
snprintf(path, PATH_MAX, "%s/%s/config.ini", home, PROJECT_NAME);
#endif
return ConfigurationRead(&config->configTable, path);
}