[iortcw] 428/497: All: Fix a couple of warnings when compiling for OpenGLES

Simon McVittie smcv at debian.org
Fri Sep 8 10:37:41 UTC 2017


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 bb2014fca9cc3a6cd7650c2a261c07586eacd512
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Sat Nov 14 23:50:41 2015 -0500

    All: Fix a couple of warnings when compiling for OpenGLES
---
 MP/code/sdl/sdl_glimp.c | 21 +++++++--------------
 SP/code/sdl/sdl_glimp.c | 21 +++++++--------------
 2 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index 879f720..3b54036 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -429,13 +429,16 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
 		else
 			perChannelColorBits = 4;
 
-#ifndef USE_OPENGLES
 #ifdef __sgi /* Fix for SGIs grabbing too many bits of color */
 		if (perChannelColorBits == 4)
 			perChannelColorBits = 0; /* Use minimum size for 16-bit color */
 
 		/* Need alpha or else SGIs choose 36+ bit RGB mode */
-		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1);
+		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
+#endif
+
+#ifdef USE_OPENGLES
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 1 );
 #endif
 
 		SDL_GL_SetAttribute( SDL_GL_RED_SIZE, perChannelColorBits );
@@ -450,12 +453,12 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
 		if(r_stereoEnabled->integer)
 		{
 			glConfig.stereoEnabled = qtrue;
-			SDL_GL_SetAttribute(SDL_GL_STEREO, 1);
+			SDL_GL_SetAttribute( SDL_GL_STEREO, 1 );
 		}
 		else
 		{
 			glConfig.stereoEnabled = qfalse;
-			SDL_GL_SetAttribute(SDL_GL_STEREO, 0);
+			SDL_GL_SetAttribute( SDL_GL_STEREO, 0 );
 		}
 		
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
@@ -522,16 +525,6 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
 				continue;
 			}
 		}
-#else
-		SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
-
-		if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
-			glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-		{
-			ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-			continue;
-		}
-#endif // USE_OPENGLES
 
 		SDL_SetWindowIcon( SDL_window, icon );
 
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index 879f720..3b54036 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -429,13 +429,16 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
 		else
 			perChannelColorBits = 4;
 
-#ifndef USE_OPENGLES
 #ifdef __sgi /* Fix for SGIs grabbing too many bits of color */
 		if (perChannelColorBits == 4)
 			perChannelColorBits = 0; /* Use minimum size for 16-bit color */
 
 		/* Need alpha or else SGIs choose 36+ bit RGB mode */
-		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1);
+		SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
+#endif
+
+#ifdef USE_OPENGLES
+		SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 1 );
 #endif
 
 		SDL_GL_SetAttribute( SDL_GL_RED_SIZE, perChannelColorBits );
@@ -450,12 +453,12 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
 		if(r_stereoEnabled->integer)
 		{
 			glConfig.stereoEnabled = qtrue;
-			SDL_GL_SetAttribute(SDL_GL_STEREO, 1);
+			SDL_GL_SetAttribute( SDL_GL_STEREO, 1 );
 		}
 		else
 		{
 			glConfig.stereoEnabled = qfalse;
-			SDL_GL_SetAttribute(SDL_GL_STEREO, 0);
+			SDL_GL_SetAttribute( SDL_GL_STEREO, 0 );
 		}
 		
 		SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
@@ -522,16 +525,6 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)
 				continue;
 			}
 		}
-#else
-		SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
-
-		if( ( SDL_window = SDL_CreateWindow( CLIENT_WINDOW_TITLE, x, y,
-			glConfig.vidWidth, glConfig.vidHeight, flags ) ) == NULL )
-		{
-			ri.Printf( PRINT_DEVELOPER, "SDL_CreateWindow failed: %s\n", SDL_GetError( ) );
-			continue;
-		}
-#endif // USE_OPENGLES
 
 		SDL_SetWindowIcon( SDL_window, icon );
 

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



More information about the Pkg-games-commits mailing list