aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-09-01 05:09:21 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-09-01 05:09:21 +0000
commite7067a0011612692677189db92a657ab88335721 (patch)
treeb15c7153e5cd7eddd3e309de2cc42c0274c3e679
parent646e87719a78cae865eb3f7522a3b44b1ce07770 (diff)
downloadioquake3-aero-e7067a0011612692677189db92a657ab88335721.tar.gz
ioquake3-aero-e7067a0011612692677189db92a657ab88335721.zip
Screw with (de)initialization code.
This fixes: - Mouse grab being lost after alt-enter goes windowed in the SDL driver. - Joystick ceasing to function on vid_restart in the SDL driver. - Audio failing to work after after snd_restart in the SDL driver. - Probably other things. git-svn-id: svn://svn.icculus.org/quake3/trunk@62 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--code/unix/linux_glimp.c2
-rw-r--r--code/unix/sdl_glimp.c25
-rw-r--r--code/unix/unix_main.c2
3 files changed, 18 insertions, 11 deletions
diff --git a/code/unix/linux_glimp.c b/code/unix/linux_glimp.c
index 0fd5440..08c20bd 100644
--- a/code/unix/linux_glimp.c
+++ b/code/unix/linux_glimp.c
@@ -1408,6 +1408,8 @@ void GLimp_Init( void )
InitSig();
+ IN_Init(); // rcg08312005 moved into glimp.
+
// Hack here so that if the UI
if ( *r_previousglDriver->string )
{
diff --git a/code/unix/sdl_glimp.c b/code/unix/sdl_glimp.c
index 652daa2..d11c42d 100644
--- a/code/unix/sdl_glimp.c
+++ b/code/unix/sdl_glimp.c
@@ -404,7 +404,7 @@ void KBD_Close(void)
void IN_ActivateMouse( void )
{
if (!mouse_avail || !screen)
- return;
+ return;
if (!mouse_active)
{
@@ -452,15 +452,8 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned
*/
void GLimp_Shutdown( void )
{
- IN_DeactivateMouse();
-
- if (stick)
- {
- SDL_JoystickClose(stick);
- stick = NULL;
- }
-
- SDL_Quit();
+ IN_Shutdown();
+ SDL_QuitSubSystem(SDL_INIT_VIDEO);
screen = NULL;
memset( &glConfig, 0, sizeof( glConfig ) );
@@ -886,6 +879,8 @@ void GLimp_Init( void )
InitSig();
+ IN_Init(); // rcg08312005 moved into glimp.
+
// Hack here so that if the UI
if ( *r_previousglDriver->string )
{
@@ -1209,7 +1204,17 @@ void IN_Init(void) {
void IN_Shutdown(void)
{
+ IN_DeactivateMouse();
+
mouse_avail = qfalse;
+
+ if (stick)
+ {
+ SDL_JoystickClose(stick);
+ stick = NULL;
+ }
+
+ SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}
void IN_Frame (void) {
diff --git a/code/unix/unix_main.c b/code/unix/unix_main.c
index ebf4684..91397ac 100644
--- a/code/unix/unix_main.c
+++ b/code/unix/unix_main.c
@@ -399,7 +399,7 @@ void Sys_Init(void)
Cvar_Set( "username", Sys_GetCurrentUser() );
- IN_Init();
+ //IN_Init(); // rcg08312005 moved into glimp.
}