get the "pref dir", which is where game output files are stored. the pref dir is ~/PREF_DIR_ROOT/PREF_DIR_GAME_NAME
| 241 | // get the "pref dir", which is where game output files are stored. the pref |
| 242 | // dir is ~/PREF_DIR_ROOT/PREF_DIR_GAME_NAME |
| 243 | static const char* GetPrefDir() |
| 244 | { |
| 245 | if (sgPrefDirInitialized) |
| 246 | return sgPrefDir; |
| 247 | |
| 248 | if (sUseRedirect) |
| 249 | { |
| 250 | const char *home = getenv("HOME"); |
| 251 | AssertFatal(home, "HOME environment variable must be set"); |
| 252 | |
| 253 | dSprintf(sgPrefDir, MaxPath, "%s/%s/%s", |
| 254 | home, PREF_DIR_ROOT, PREF_DIR_GAME_NAME); |
| 255 | } |
| 256 | else |
| 257 | { |
| 258 | getcwd(sgPrefDir, MaxPath); |
| 259 | } |
| 260 | |
| 261 | sgPrefDirInitialized = true; |
| 262 | return sgPrefDir; |
| 263 | } |
| 264 | |
| 265 | //----------------------------------------------------------------------------- |
| 266 | // Returns true if the pathname exists, false otherwise. If isFile is true, |
no test coverage detected