Add support for standard file paths on Windows.

- If the current user does not have write permissions for the directory
  zdoom.exe is located in, use standard folder paths located in their home
  directory instead. This is a common scenario when people put ZDoom into
  Program Files. (Ironically, zdoom.ini used to be in AppData, buth then
  people complained when it wasn't in the same directory as zdoom.exe, so
  it got turned into zdoom-<user>.ini so at least it could retain some
  multi-user support. I'm not sure when the AppData support was removed,
  though, since it should have still been kept around for migrating
  configs to the new name.)
This commit is contained in:
Randy Heit 2013-09-14 23:07:59 -05:00
commit 0645053431
4 changed files with 202 additions and 49 deletions

View file

@ -646,8 +646,9 @@ void M_ScreenShot (const char *filename)
if (dirlen == 0)
{
autoname = M_GetScreenshotsPath();
dirlen = autoname.Len();
}
else if (dirlen > 0)
if (dirlen > 0)
{
if (autoname[dirlen-1] != '/' && autoname[dirlen-1] != '\\')
{