This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit df0af0310d78513b56128e5171582d82aa20e642
Author: MAN-AT-ARMS <m4n4t4...@gmail.com>
Date:   Sun Jul 26 12:31:58 2015 -0400

    All: Merge a bunch of SDL PR's by Pan7
---
 MP/code/sdl/sdl_gamma.c |  5 ++++-
 MP/code/sdl/sdl_glimp.c | 15 ++++++++++-----
 MP/code/sdl/sdl_input.c |  8 ++++----
 SP/code/sdl/sdl_gamma.c |  5 ++++-
 SP/code/sdl/sdl_glimp.c | 15 ++++++++++-----
 SP/code/sdl/sdl_input.c |  8 ++++----
 6 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/MP/code/sdl/sdl_gamma.c b/MP/code/sdl/sdl_gamma.c
index 40adb1a..c0e9492 100644
--- a/MP/code/sdl/sdl_gamma.c
+++ b/MP/code/sdl/sdl_gamma.c
@@ -88,6 +88,9 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char 
green[256], unsigned
                }
        }
 
-       SDL_SetWindowGammaRamp(SDL_window, table[0], table[1], table[2]);
+       if (SDL_SetWindowGammaRamp(SDL_window, table[0], table[1], table[2]) < 
0)
+       {
+               ri.Printf( PRINT_DEVELOPER, "SDL_SetWindowGammaRamp() failed: 
%s\n", SDL_GetError() );
+       }
 }
 
diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index ba1f8f0..67184ff 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -163,11 +163,16 @@ static void GLimp_DetectAvailableModes(void)
 
        SDL_DisplayMode windowMode;
        int display = SDL_GetWindowDisplayIndex( SDL_window );
+       if( display < 0 )
+       {
+               ri.Printf( PRINT_WARNING, "Couldn't get window display index, 
no resolutions detected: %s\n", SDL_GetError() );
+               return;
+       }
        numSDLModes = SDL_GetNumDisplayModes( display );
 
        if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || 
numSDLModes <= 0 )
        {
-               ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no 
resolutions detected\n" );
+               ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no 
resolutions detected: %s\n", SDL_GetError() );
                return;
        }
 
@@ -464,7 +469,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                if( r_centerWindow->integer && !fullscreen )
                {
                        if( ( SDL_window = SDL_CreateWindow( 
CLIENT_WINDOW_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
-                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == 0 )
+                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == NULL )
                        {
                                ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow 
failed: %s\n", SDL_GetError( ) );
                                continue;
@@ -473,7 +478,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                else if ( ( r_windowPosx->integer || r_windowPosy->integer ) && 
!fullscreen )
                {
                        if( ( SDL_window = SDL_CreateWindow( 
CLIENT_WINDOW_TITLE, r_windowPosx->integer, r_windowPosy->integer,
-                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == 0 )
+                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == NULL )
                        {
                                ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow 
failed: %s\n", SDL_GetError( ) );
                                continue;
@@ -482,7 +487,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                else
                {
                        if( ( SDL_window = SDL_CreateWindow( 
CLIENT_WINDOW_TITLE, x, y,
-                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == 0 )
+                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == NULL )
                        {
                                ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow 
failed: %s\n", SDL_GetError( ) );
                                continue;
@@ -515,7 +520,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
 
                if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
-                       glConfig.vidWidth, glConfig.vidHeight, flags ) ) == 0 )
+                       glConfig.vidWidth, glConfig.vidHeight, flags ) ) == 
NULL )
                {
                        ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: 
%s\n", SDL_GetError( ) );
                        continue;
diff --git a/MP/code/sdl/sdl_input.c b/MP/code/sdl/sdl_input.c
index a20dbd3..754c750 100644
--- a/MP/code/sdl/sdl_input.c
+++ b/MP/code/sdl/sdl_input.c
@@ -327,7 +327,7 @@ static void IN_ActivateMouse( void )
        if( !mouseActive )
        {
                SDL_SetRelativeMouseMode( SDL_TRUE );
-               SDL_SetWindowGrab( SDL_window, 1 );
+               SDL_SetWindowGrab( SDL_window, SDL_TRUE );
 
                IN_GobbleMotionEvents( );
        }
@@ -338,9 +338,9 @@ static void IN_ActivateMouse( void )
                if( in_nograb->modified || !mouseActive )
                {
                        if( in_nograb->integer )
-                               SDL_SetWindowGrab( SDL_window, 0 );
+                               SDL_SetWindowGrab( SDL_window, SDL_FALSE );
                        else
-                               SDL_SetWindowGrab( SDL_window, 1 );
+                               SDL_SetWindowGrab( SDL_window, SDL_TRUE );
 
                        in_nograb->modified = qfalse;
                }
@@ -371,7 +371,7 @@ static void IN_DeactivateMouse( void )
        {
                IN_GobbleMotionEvents( );
 
-               SDL_SetWindowGrab( SDL_window, 0 );
+               SDL_SetWindowGrab( SDL_window, SDL_FALSE );
                SDL_SetRelativeMouseMode( SDL_FALSE );
 
                // Don't warp the mouse unless the cursor is within the window
diff --git a/SP/code/sdl/sdl_gamma.c b/SP/code/sdl/sdl_gamma.c
index 40adb1a..c0e9492 100644
--- a/SP/code/sdl/sdl_gamma.c
+++ b/SP/code/sdl/sdl_gamma.c
@@ -88,6 +88,9 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char 
green[256], unsigned
                }
        }
 
-       SDL_SetWindowGammaRamp(SDL_window, table[0], table[1], table[2]);
+       if (SDL_SetWindowGammaRamp(SDL_window, table[0], table[1], table[2]) < 
0)
+       {
+               ri.Printf( PRINT_DEVELOPER, "SDL_SetWindowGammaRamp() failed: 
%s\n", SDL_GetError() );
+       }
 }
 
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index ba1f8f0..67184ff 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -163,11 +163,16 @@ static void GLimp_DetectAvailableModes(void)
 
        SDL_DisplayMode windowMode;
        int display = SDL_GetWindowDisplayIndex( SDL_window );
+       if( display < 0 )
+       {
+               ri.Printf( PRINT_WARNING, "Couldn't get window display index, 
no resolutions detected: %s\n", SDL_GetError() );
+               return;
+       }
        numSDLModes = SDL_GetNumDisplayModes( display );
 
        if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || 
numSDLModes <= 0 )
        {
-               ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no 
resolutions detected\n" );
+               ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no 
resolutions detected: %s\n", SDL_GetError() );
                return;
        }
 
@@ -464,7 +469,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                if( r_centerWindow->integer && !fullscreen )
                {
                        if( ( SDL_window = SDL_CreateWindow( 
CLIENT_WINDOW_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
-                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == 0 )
+                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == NULL )
                        {
                                ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow 
failed: %s\n", SDL_GetError( ) );
                                continue;
@@ -473,7 +478,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                else if ( ( r_windowPosx->integer || r_windowPosy->integer ) && 
!fullscreen )
                {
                        if( ( SDL_window = SDL_CreateWindow( 
CLIENT_WINDOW_TITLE, r_windowPosx->integer, r_windowPosy->integer,
-                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == 0 )
+                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == NULL )
                        {
                                ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow 
failed: %s\n", SDL_GetError( ) );
                                continue;
@@ -482,7 +487,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                else
                {
                        if( ( SDL_window = SDL_CreateWindow( 
CLIENT_WINDOW_TITLE, x, y,
-                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == 0 )
+                                       glConfig.vidWidth, glConfig.vidHeight, 
flags ) ) == NULL )
                        {
                                ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow 
failed: %s\n", SDL_GetError( ) );
                                continue;
@@ -515,7 +520,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, 
qboolean noborder)
                SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
 
                if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
-                       glConfig.vidWidth, glConfig.vidHeight, flags ) ) == 0 )
+                       glConfig.vidWidth, glConfig.vidHeight, flags ) ) == 
NULL )
                {
                        ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: 
%s\n", SDL_GetError( ) );
                        continue;
diff --git a/SP/code/sdl/sdl_input.c b/SP/code/sdl/sdl_input.c
index a20dbd3..754c750 100644
--- a/SP/code/sdl/sdl_input.c
+++ b/SP/code/sdl/sdl_input.c
@@ -327,7 +327,7 @@ static void IN_ActivateMouse( void )
        if( !mouseActive )
        {
                SDL_SetRelativeMouseMode( SDL_TRUE );
-               SDL_SetWindowGrab( SDL_window, 1 );
+               SDL_SetWindowGrab( SDL_window, SDL_TRUE );
 
                IN_GobbleMotionEvents( );
        }
@@ -338,9 +338,9 @@ static void IN_ActivateMouse( void )
                if( in_nograb->modified || !mouseActive )
                {
                        if( in_nograb->integer )
-                               SDL_SetWindowGrab( SDL_window, 0 );
+                               SDL_SetWindowGrab( SDL_window, SDL_FALSE );
                        else
-                               SDL_SetWindowGrab( SDL_window, 1 );
+                               SDL_SetWindowGrab( SDL_window, SDL_TRUE );
 
                        in_nograb->modified = qfalse;
                }
@@ -371,7 +371,7 @@ static void IN_DeactivateMouse( void )
        {
                IN_GobbleMotionEvents( );
 
-               SDL_SetWindowGrab( SDL_window, 0 );
+               SDL_SetWindowGrab( SDL_window, SDL_FALSE );
                SDL_SetRelativeMouseMode( SDL_FALSE );
 
                // Don't warp the mouse unless the cursor is within the window

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to