summaryrefslogtreecommitdiffstats
path: root/Alc/alcConfig.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-06-04 18:09:21 -0700
committerChris Robinson <[email protected]>2008-06-04 18:09:21 -0700
commit3243f69f217eb24f05631030858b15eaf1a0c4d6 (patch)
tree38527fa961847779c918075eec0d89211d371016 /Alc/alcConfig.c
parent10a87f510c8a4b2f175a06a0b2f731cd68ee227f (diff)
Use %AppData%\alsoft.ini for the config file in Windows
Diffstat (limited to 'Alc/alcConfig.c')
-rw-r--r--Alc/alcConfig.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c
index de69ad87..d5f4fb5e 100644
--- a/Alc/alcConfig.c
+++ b/Alc/alcConfig.c
@@ -27,6 +27,11 @@
#include "alMain.h"
+#ifdef _WIN32
+#define _WIN32_IE 0x400
+#include <shlobj.h>
+#endif
+
typedef struct ConfigEntry {
char *key;
char *value;
@@ -201,6 +206,17 @@ void ReadALConfig(void)
cfgCount = 1;
#ifdef _WIN32
+ if(SHGetSpecialFolderPathA(NULL, buffer, CSIDL_APPDATA, FALSE) != FALSE)
+ {
+ int p = strlen(buffer);
+ snprintf(buffer+p, sizeof(buffer)-p, "\\alsoft.ini");
+ f = fopen(buffer, "rt");
+ if(f)
+ {
+ LoadConfigFromFile(f);
+ fclose(f);
+ }
+ }
#else
f = fopen("/etc/openal/alsoft.conf", "r");
if(!f)