Ticket #8275: win_cfg_progdir.diff
File win_cfg_progdir.diff, 875 bytes (added by , 21 years ago) |
---|
-
main.cpp
165 165 #else 166 166 char scummhome[256]; 167 167 #if defined (WIN32) && !defined(_WIN32_WCE) 168 GetWindowsDirectory(scummhome, 256); 169 strcat(scummhome, "\\"); 168 // Quietust - try looking for INI file in program directory first 169 GetModuleFileName(NULL, scummhome, 256); 170 int i = strlen(scummhome) - 1; 171 while (scummhome[i] != '\\') 172 scummhome[i--] = 0; 170 173 strcat(scummhome, DEFAULT_CONFIG_FILE); 174 if (GetFileAttributes(scummhome) == 0xFFFFFFFF) { 175 // does not exist in program directory, default to Windows directory 176 GetWindowsDirectory(scummhome, 256); 177 strcat(scummhome, "\\"); 178 strcat(scummhome, DEFAULT_CONFIG_FILE); 179 } 171 180 #elif defined(__PALM_OS__) 172 181 strcpy(scummhome,"/PALM/Programs/ScummVM/"); 173 182 strcat(scummhome, DEFAULT_CONFIG_FILE);