diff options
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/win_glimp.c | 4 | ||||
-rw-r--r-- | src/win32/win_local.h | 1 | ||||
-rw-r--r-- | src/win32/win_shared.c | 21 |
3 files changed, 23 insertions, 3 deletions
diff --git a/src/win32/win_glimp.c b/src/win32/win_glimp.c index 22e98e5f..ef8651dd 100644 --- a/src/win32/win_glimp.c +++ b/src/win32/win_glimp.c @@ -1562,13 +1562,13 @@ void *GLimp_RendererSleep( void ) { wglErrors++; } - ResetEvent( renderActiveEvent ); - // after this, the front end can exit GLimp_FrontEndSleep SetEvent( renderCompletedEvent ); WaitForSingleObject( renderCommandsEvent, INFINITE ); + ResetEvent( renderActiveEvent ); + if ( !qwglMakeCurrent( glw_state.hDC, glw_state.hGLRC ) ) { wglErrors++; } diff --git a/src/win32/win_local.h b/src/win32/win_local.h index b0e85a15..9d599730 100644 --- a/src/win32/win_local.h +++ b/src/win32/win_local.h @@ -38,6 +38,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); diff --git a/src/win32/win_shared.c b/src/win32/win_shared.c index 318d9418..003254d9 100644 --- a/src/win32/win_shared.c +++ b/src/win32/win_shared.c @@ -286,7 +286,26 @@ char *Sys_GetCurrentUser( void ) } char *Sys_DefaultHomePath(void) { - return NULL; + 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) |