mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-24 13:11:30 +00:00
* Windows home directory support (tjw)
This commit is contained in:
parent
13b119a40c
commit
635e8bc326
2 changed files with 21 additions and 1 deletions
|
@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include <dsound.h>
|
||||
#include <winsock.h>
|
||||
#include <wsipx.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
void IN_MouseEvent (int mstate);
|
||||
|
||||
|
|
|
@ -285,7 +285,26 @@ char *Sys_GetCurrentUser( void )
|
|||
}
|
||||
|
||||
char *Sys_DefaultHomePath(void) {
|
||||
TCHAR szPath[MAX_PATH];
|
||||
static char path[MAX_OSPATH];
|
||||
|
||||
if( !SUCCEEDED( SHGetFolderPath( NULL, CSIDL_LOCAL_APPDATA,
|
||||
NULL, 0, szPath ) ) )
|
||||
{
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Q_strncpyz( path, szPath, sizeof(path) );
|
||||
Q_strcat( path, sizeof(path), "\\Quake3" );
|
||||
if( CreateDirectory( path, NULL ) )
|
||||
{
|
||||
if( GetLastError() != ERROR_ALREADY_EXISTS )
|
||||
{
|
||||
Com_Printf("Unable to create directory \"%s\"\n", path);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
char *Sys_DefaultInstallPath(void)
|
||||
|
|
Loading…
Reference in a new issue