Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Formatting cleanups.

  • Loading branch information...
commit 124425a2d20c0f9e98eb84f777f05b679299acfc 1 parent 3aee786
@DerSaidin DerSaidin authored
View
16 src/engine/rendererGL/tr_backend.cpp
@@ -1672,7 +1672,7 @@ static void Render_lightVolume(interaction_t * ia)
vec3_t viewOrigin;
vec3_t lightOrigin;
vec4_t lightColor;
- bool shadowCompare;
+ bool shadowCompare;
GLimp_LogComment("--- Render_lightVolume_omni ---\n");
@@ -8102,7 +8102,7 @@ static void IssueEntityMultiOcclusionQueries(link_t * multiQueue, link_t * indiv
static bool EntityOcclusionResultAvailable(trRefEntity_t *entity)
{
- GLint available;
+ GLint available;
if(entity->occlusionQueryObject > 0)
{
@@ -8118,14 +8118,14 @@ static bool EntityOcclusionResultAvailable(trRefEntity_t *entity)
return available;
}
- return qtrue;
+ return true;
}
static void GetEntityOcclusionQueryResult(trRefEntity_t *entity)
{
- link_t *l, *sentinel;
- int ocSamples;
- GLint available;
+ link_t *l, *sentinel;
+ int ocSamples;
+ GLint available;
GLimp_LogComment("--- GetEntityOcclusionQueryResult ---\n");
@@ -8583,8 +8583,8 @@ static void RB_RenderDebugUtils()
vec4_t lightColor;
vec4_t quadVerts[4];
- vec3_t minSize = {-2, -2, -2};
- vec3_t maxSize = { 2, 2, 2};
+ vec3_t minSize = {-2, -2, -2};
+ vec3_t maxSize = { 2, 2, 2};
gl_genericShader->DisableAlphaTesting();
gl_genericShader->DisablePortalClipping();
View
8 src/engine/rendererGL/tr_fbo.cpp
@@ -158,7 +158,7 @@ void R_CreateFBOColorBuffer(FBO_t * fbo, int format, int index)
#if defined(USE_D3D10)
// TODO
#else
- bool absent;
+ bool absent;
if(index < 0 || index >= glConfig2.maxColorAttachments)
{
@@ -203,7 +203,7 @@ void R_CreateFBODepthBuffer(FBO_t * fbo, int format)
#if defined(USE_D3D10)
// TODO
#else
- bool absent;
+ bool absent;
if(format != GL_DEPTH_COMPONENT &&
format != GL_DEPTH_COMPONENT16_ARB && format != GL_DEPTH_COMPONENT24_ARB && format != GL_DEPTH_COMPONENT32_ARB)
@@ -238,7 +238,7 @@ void R_CreateFBOStencilBuffer(FBO_t * fbo, int format)
#if defined(USE_D3D10)
// TODO
#else
- bool absent;
+ bool absent;
if(format != GL_STENCIL_INDEX &&
//format != GL_STENCIL_INDEX_EXT &&
@@ -276,7 +276,7 @@ void R_CreateFBOPackedDepthStencilBuffer(FBO_t * fbo, int format)
#if defined(USE_D3D10)
// TODO
#else
- bool absent;
+ bool absent;
if(format != GL_DEPTH_STENCIL_EXT && format != GL_DEPTH24_STENCIL8_EXT)
{
View
2  src/engine/rendererGL/tr_flares.cpp
@@ -279,7 +279,7 @@ RB_TestFlare
void RB_TestFlare(flare_t * f)
{
float depth;
- bool visible;
+ bool visible;
float fade;
float screenZ;
View
56 src/engine/rendererGL/tr_image.cpp
@@ -3557,106 +3557,106 @@ void R_CreateBuiltinImages(void)
R_SetColorMappings
===============
*/
-void R_SetColorMappings( void )
+void R_SetColorMappings(void)
{
- int i, j;
- float g;
- int inf;
- int shift;
+ int i, j;
+ float g;
+ int inf;
+ int shift;
tr.mapOverBrightBits = r_mapOverBrightBits->integer;
// setup the overbright lighting
tr.overbrightBits = r_overBrightBits->integer;
- if ( !glConfig.deviceSupportsGamma )
+ if(!glConfig.deviceSupportsGamma)
{
- tr.overbrightBits = 0; // need hardware gamma for overbright
+ tr.overbrightBits = 0; // need hardware gamma for overbright
}
// never overbright in windowed mode
- if ( !glConfig.isFullscreen )
+ if(!glConfig.isFullscreen)
{
tr.overbrightBits = 0;
}
// allow 2 overbright bits in 24 bit, but only 1 in 16 bit
- if ( glConfig.colorBits > 16 )
+ if(glConfig.colorBits > 16)
{
- if ( tr.overbrightBits > 2 )
+ if(tr.overbrightBits > 2)
{
tr.overbrightBits = 2;
}
}
else
{
- if ( tr.overbrightBits > 1 )
+ if(tr.overbrightBits > 1)
{
tr.overbrightBits = 1;
}
}
- if ( tr.overbrightBits < 0 )
+ if(tr.overbrightBits < 0)
{
tr.overbrightBits = 0;
}
- tr.identityLight = 1.0f / ( 1 << tr.overbrightBits );
+ tr.identityLight = 1.0f / (1 << tr.overbrightBits);
- if ( r_intensity->value <= 1 )
+ if(r_intensity->value <= 1)
{
- ri.Cvar_Set( "r_intensity", "1" );
+ ri.Cvar_Set("r_intensity", "1");
}
- if ( r_gamma->value < 0.5f )
+ if(r_gamma->value < 0.5f)
{
- ri.Cvar_Set( "r_gamma", "0.5" );
+ ri.Cvar_Set("r_gamma", "0.5");
}
- else if ( r_gamma->value > 3.0f )
+ else if(r_gamma->value > 3.0f)
{
- ri.Cvar_Set( "r_gamma", "3.0" );
+ ri.Cvar_Set("r_gamma", "3.0");
}
g = r_gamma->value;
shift = tr.overbrightBits;
- for ( i = 0; i < 256; i++ )
+ for(i = 0; i < 256; i++)
{
- if ( g == 1 )
+ if(g == 1)
{
inf = i;
}
else
{
- inf = 255 * pow( i / 255.0f, 1.0f / g ) + 0.5f;
+ inf = 255 * pow(i / 255.0f, 1.0f / g) + 0.5f;
}
inf <<= shift;
- if ( inf < 0 )
+ if(inf < 0)
{
inf = 0;
}
- if ( inf > 255 )
+ if(inf > 255)
{
inf = 255;
}
- s_gammatable[ i ] = inf;
+ s_gammatable[i] = inf;
}
- for ( i = 0; i < 256; i++ )
+ for(i = 0; i < 256; i++)
{
j = i * r_intensity->value;
- if ( j > 255 )
+ if(j > 255)
{
j = 255;
}
- s_intensitytable[ i ] = j;
+ s_intensitytable[i] = j;
}
GLimp_SetGamma( s_gammatable, s_gammatable, s_gammatable );
View
26 src/engine/rendererGL/tr_init.cpp
@@ -493,9 +493,9 @@ void GL_CheckErrors_(const char *fileName, int line)
*/
typedef struct vidmode_s
{
- const char *description;
- int width, height;
- float pixelAspect; // pixel width / height
+ const char *description;
+ int width, height;
+ float pixelAspect; // pixel width / height
} vidmode_t;
static const vidmode_t r_vidModes[] =
@@ -521,9 +521,9 @@ static const vidmode_t r_vidModes[] =
{ "2048x1536", 2048, 1536, 1 },
{ "2560x1600 (16:10)", 2560, 1600, 1 },
};
-static const int s_numVidModes = ( sizeof( r_vidModes ) / sizeof( r_vidModes[ 0 ] ) );
+static const int s_numVidModes = (sizeof(r_vidModes) / sizeof(r_vidModes[0]));
-qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
+qboolean R_GetModeInfo(int *width, int *height, float *windowAspect, int mode)
{
const vidmode_t *vm;
@@ -549,11 +549,11 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
}
else
{
- vm = &r_vidModes[ mode ];
+ vm = &r_vidModes[mode];
*width = vm->width;
*height = vm->height;
- *windowAspect = ( float ) vm->width / ( vm->height * vm->pixelAspect );
+ *windowAspect = (float)vm->width / (vm->height * vm->pixelAspect);
}
return qtrue;
@@ -562,18 +562,18 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
/*
** R_ModeList_f
*/
-static void R_ModeList_f( void )
+static void R_ModeList_f(void)
{
- int i;
+ int i;
- ri.Printf( PRINT_ALL, "\n" );
+ ri.Printf(PRINT_ALL, "\n");
- for ( i = 0; i < s_numVidModes; i++ )
+ for(i = 0; i < s_numVidModes; i++)
{
- ri.Printf( PRINT_ALL, "Mode %-2d: %s\n", i, r_vidModes[ i ].description );
+ ri.Printf(PRINT_ALL, "Mode %-2d: %s\n", i, r_vidModes[i].description);
}
- ri.Printf( PRINT_ALL, "\n" );
+ ri.Printf(PRINT_ALL, "\n");
}
View
2  src/engine/rendererGL/tr_shade.cpp
@@ -3934,7 +3934,7 @@ void Tess_StageIteratorGeneric()
continue;
}
-#if 1
+#if defined(COMPAT_ET)
// Ridah, per stage fogging (detail textures)
if(tess.surfaceShader->noFog && pStage->isFogged)
{
View
113 src/engine/rendererGL/tr_shader.cpp
@@ -1063,34 +1063,35 @@ static genFunc_t NameToGenFunc(const char *funcname)
NameToStencilOp
===============
*/
-static int NameToStencilOp( char *name )
+static int NameToStencilOp(char *name)
{
- if ( !Q_stricmp( name, "keep" ) )
+ if (!Q_stricmp(name, "keep"))
{
return STO_KEEP;
}
- else if ( !Q_stricmp( name, "zero" ) )
+ else if (!Q_stricmp(name, "zero"))
{
return STO_ZERO;
}
- else if ( !Q_stricmp( name, "replace" ) )
+ else if (!Q_stricmp(name, "replace"))
{
return STO_REPLACE;
}
- else if ( !Q_stricmp( name, "invert" ) )
+ else if (!Q_stricmp(name, "invert"))
{
return STO_INVERT;
}
- else if ( !Q_stricmp( name, "incr" ) )
+ else if (!Q_stricmp(name, "incr"))
{
return STO_INCR;
}
- else if ( !Q_stricmp( name, "decr" ) )
+ else if (!Q_stricmp(name, "decr"))
{
return STO_DECR;
}
- else {
- ri.Printf( PRINT_WARNING, "WARNING: invalid stencil op name '%s' in shader '%s'\n", name, shader.name );
+ else
+ {
+ ri.Printf(PRINT_WARNING, "WARNING: invalid stencil op name '%s' in shader '%s'\n", name, shader.name);
return STO_KEEP;
}
}
@@ -1111,13 +1112,13 @@ static void ParseStencil( char **text, stencil_t *stencil )
// [mask <mask>]
token = COM_ParseExt( text, qfalse );
- if ( token[ 0 ] == 0 )
+ if (token[ 0 ] == 0)
{
ri.Printf( PRINT_WARNING, "WARNING: missing stencil ref value in shader '%s'\n", shader.name );
return;
}
- if ( !Q_stricmp( token, "mask" ) ) {
+ if (!Q_stricmp(token, "mask")) {
token = COM_ParseExt( text, qfalse );
if ( token[ 0 ] == 0 )
{
@@ -1129,23 +1130,23 @@ static void ParseStencil( char **text, stencil_t *stencil )
token = COM_ParseExt( text, qfalse );
}
- if ( token[ 0 ] == 0 )
- {
- ri.Printf( PRINT_WARNING, "WARNING: missing stencil ref value in shader '%s'\n", shader.name );
- return;
- }
+ if (token[ 0 ] == 0)
+ {
+ ri.Printf(PRINT_WARNING, "WARNING: missing stencil ref value in shader '%s'\n", shader.name);
+ return;
+ }
- if ( !Q_stricmp( token, "writeMask" ) ) {
- token = COM_ParseExt( text, qfalse );
- if ( token[ 0 ] == 0 )
- {
- ri.Printf( PRINT_WARNING, "WARNING: missing stencil writeMask value in shader '%s'\n", shader.name );
- return;
- }
- stencil->writeMask = atoi(token);
+ if (!Q_stricmp(token, "writeMask")) {
+ token = COM_ParseExt(text, qfalse);
+ if (token[ 0 ] == 0)
+ {
+ ri.Printf(PRINT_WARNING, "WARNING: missing stencil writeMask value in shader '%s'\n", shader.name);
+ return;
+ }
+ stencil->writeMask = atoi(token);
- token = COM_ParseExt( text, qfalse );
- }
+ token = Com_ParseExt( text, qfalse );
+ }
// <ref>
if ( token[ 0 ] == 0 )
@@ -1164,73 +1165,73 @@ static void ParseStencil( char **text, stencil_t *stencil )
ri.Printf( PRINT_WARNING, "WARNING: missing stencil test op in shader '%s'\n", shader.name );
return;
}
- else if ( !Q_stricmp( token, "always" ) )
+ else if (!Q_stricmp( token, "always"))
{
stencil->flags |= STF_ALWAYS;
}
- else if ( !Q_stricmp( token, "never" ) )
+ else if (!Q_stricmp( token, "never"))
{
stencil->flags |= STF_NEVER;
}
- else if ( !Q_stricmp( token, "less" ) )
+ else if (!Q_stricmp( token, "less"))
{
stencil->flags |= STF_LESS;
}
- else if ( !Q_stricmp( token, "lequal" ) )
+ else if (!Q_stricmp( token, "lequal"))
{
stencil->flags |= STF_LEQUAL;
}
- else if ( !Q_stricmp( token, "greater" ) )
+ else if (!Q_stricmp( token, "greater"))
{
stencil->flags |= STF_GREATER;
}
- else if ( !Q_stricmp( token, "gequal" ) )
+ else if (!Q_stricmp( token, "gequal"))
{
stencil->flags |= STF_GEQUAL;
}
- else if ( !Q_stricmp( token, "equal" ) )
+ else if (!Q_stricmp( token, "equal"))
{
stencil->flags |= STF_EQUAL;
}
- else if ( !Q_stricmp( token, "nequal" ) )
+ else if (!Q_stricmp( token, "nequal"))
{
stencil->flags |= STF_NEQUAL;
}
else
{
- ri.Printf( PRINT_WARNING, "WARNING: missing stencil test op in shader '%s'\n", shader.name );
+ ri.Printf(PRINT_WARNING, "WARNING: missing stencil test op in shader '%s'\n", shader.name);
return;
}
// <sfail>
token = COM_ParseExt( text, qfalse );
- if ( token[ 0 ] == 0 )
+ if (token[ 0 ] == 0)
{
- ri.Printf( PRINT_WARNING, "WARNING: missing stencil sfail op in shader '%s'\n", shader.name );
+ ri.Printf(PRINT_WARNING, "WARNING: missing stencil sfail op in shader '%s'\n", shader.name);
return;
}
- stencil->flags |= NameToStencilOp( token ) << STS_SFAIL;
+ stencil->flags |= NameToStencilOp(token) << STS_SFAIL;
// <zfail>
token = COM_ParseExt( text, qfalse );
- if ( token[ 0 ] == 0 )
+ if (token[ 0 ] == 0)
{
- ri.Printf( PRINT_WARNING, "WARNING: missing stencil zfail op in shader '%s'\n", shader.name );
+ ri.Printf(PRINT_WARNING, "WARNING: missing stencil zfail op in shader '%s'\n", shader.name);
return;
}
- stencil->flags |= NameToStencilOp( token ) << STS_ZFAIL;
+ stencil->flags |= NameToStencilOp(token) << STS_ZFAIL;
// <zpass>
token = COM_ParseExt( text, qfalse );
- if ( token[ 0 ] == 0 )
+ if (token[ 0 ] == 0)
{
- ri.Printf( PRINT_WARNING, "WARNING: missing stencil zpass op in shader '%s'\n", shader.name );
+ ri.Printf(PRINT_WARNING, "WARNING: missing stencil zpass op in shader '%s'\n", shader.name);
return;
}
- stencil->flags |= NameToStencilOp( token ) << STS_ZPASS;
+ stencil->flags |= NameToStencilOp(token) << STS_ZPASS;
}
/*
@@ -6559,7 +6560,8 @@ static void ScanAndLoadShaderFiles(void)
}
// build single large buffer
- for(i = 0; i < numShaderFiles; i++) {
+ for(i = 0; i < numShaderFiles; i++)
+ {
Com_sprintf(filename, sizeof(filename), "scripts/%s", shaderFiles[i]);
sum += ri.FS_ReadFile(filename, NULL);
}
@@ -6573,16 +6575,18 @@ static void ScanAndLoadShaderFiles(void)
for ( i = 0; i < numShaderFiles; i++ )
{
#if defined(COMPAT_Q3A) || defined(COMPAT_ET)
- Com_sprintf(filename, sizeof(filename), "scripts/%s", shaderFiles[i] );
+ Com_sprintf(filename, sizeof(filename), "scripts/%s", shaderFiles[i]);
#else
Com_sprintf(filename, sizeof(filename), "materials/%s", shaderFiles[i]);
#endif
- ri.Printf( PRINT_DEVELOPER, "...loading '%s'\n", filename );
- summand = ri.FS_ReadFile( filename, (void **)&buffers[i] );
+ ri.Printf(PRINT_DEVELOPER, "...loading '%s'\n", filename);
+ summand = ri.FS_ReadFile(filename, (void **)&buffers[i]);
- if ( !buffers[i] )
- ri.Error( ERR_DROP, "Couldn't load %s", filename );
+ if(!buffers[i])
+ {
+ ri.Error(ERR_DROP, "Couldn't load %s", filename);
+ }
p = buffers[i];
while(1) {
@@ -6712,10 +6716,11 @@ static void ScanAndLoadShaderFiles(void)
hashMem = (char*)ri.Hunk_Alloc(size * sizeof(char *), h_low);
- for (i = 0; i < MAX_SHADERTEXT_HASH; i++) {
- shaderTextHashTable[i] = (char **) hashMem;
- hashMem = ((char *) hashMem) + ((shaderTextHashTableSizes[i] + 1) * sizeof(char *));
- }
+ for(i = 0; i < MAX_SHADERTEXT_HASH; i++)
+ {
+ shaderTextHashTable[i] = (char **)hashMem;
+ hashMem = ((char *)hashMem) + ((shaderTextHashTableSizes[i] + 1) * sizeof(char *));
+ }
Com_Memset(shaderTextHashTableSizes, 0, sizeof(shaderTextHashTableSizes));
View
20 src/engine/rendererGL/tr_vbo.cpp
@@ -33,8 +33,8 @@ VBO_t *R_CreateVBO(const char *name, byte *vertexes, int vertexesSize,
// TODO
return NULL;
#else
- VBO_t *vbo;
- int glUsage;
+ VBO_t *vbo;
+ int glUsage;
switch (usage)
{
@@ -51,9 +51,9 @@ VBO_t *R_CreateVBO(const char *name, byte *vertexes, int vertexesSize,
Com_Error(ERR_FATAL, "bad vboUsage_t given: %i", usage);
}
- if ( strlen( name ) >= MAX_QPATH )
+ if(strlen(name) >= MAX_QPATH)
{
- ri.Error( ERR_DROP, "R_CreateVBO: \"%s\" is too long\n", name );
+ ri.Error(ERR_DROP, "R_CreateVBO: \"%s\" is too long\n", name);
}
// make sure the render thread is stopped
@@ -462,7 +462,7 @@ R_BindNullVBO
*/
void R_BindNullVBO(void)
{
- GLimp_LogComment( "--- R_BindNullVBO ---\n" );
+ GLimp_LogComment("--- R_BindNullVBO ---\n");
#if defined(USE_D3D10)
// TODO
@@ -516,9 +516,9 @@ void R_BindIBO(IBO_t * ibo)
R_BindNullIBO
============
*/
-void R_BindNullIBO( void )
+void R_BindNullIBO(void)
{
- GLimp_LogComment( "--- R_BindNullIBO ---\n" );
+ GLimp_LogComment("--- R_BindNullIBO ---\n");
#if defined(USE_D3D10)
// TODO
@@ -698,20 +698,20 @@ void R_ShutdownVBOs(void)
{
srfVBOMesh_t *vboSurf;
- vboSurf = ( srfVBOMesh_t * ) Com_GrowListElement( &tr.world->clusterVBOSurfaces[ j ], i );
+ vboSurf = (srfVBOMesh_t *) Com_GrowListElement(&tr.world->clusterVBOSurfaces[j], i);
ibo = vboSurf->ibo;
#if defined(USE_D3D10)
// TODO
#else
- if ( ibo->indexesVBO )
+ if(ibo->indexesVBO)
{
glDeleteBuffers( 1, &ibo->indexesVBO );
}
#endif
}
- Com_DestroyGrowList( &tr.world->clusterVBOSurfaces[ j ] );
+ Com_DestroyGrowList(&tr.world->clusterVBOSurfaces[j]);
}
}
View
334 src/engine/sys/sdl_glimp.cpp
@@ -800,11 +800,13 @@ static int GLimp_SetMode(int mode, int fullscreen, int noborder) {
ri.Printf(PRINT_ALL, "Initializing OpenGL display\n");
- if ( r_allowResize->integer ) {
+ if(r_allowResize->integer)
+ {
flags |= SDL_RESIZABLE;
}
- if ( videoInfo == NULL ) {
+ if(videoInfo == NULL)
+ {
static SDL_VideoInfo sVideoInfo;
static SDL_PixelFormat sPixelFormat;
@@ -1135,21 +1137,28 @@ static void GLimp_XreaLInitExtensions(void) {
ri.Printf(PRINT_ALL, "Initializing OpenGL extensions\n");
// GL_ARB_multitexture
- if(glConfig.driverType != GLDRV_OPENGL3) {
- if(GLEW_ARB_multitexture){
+ if(glConfig.driverType != GLDRV_OPENGL3)
+ {
+ if(GLEW_ARB_multitexture)
+ {
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &glConfig.maxActiveTextures);
- if(glConfig.maxActiveTextures > 1) {
+ if(glConfig.maxActiveTextures > 1)
+ {
good = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_multitexture\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_multitexture\n" );
ri.Error(ERR_FATAL, MSG_ERR_OLD_VIDEO_DRIVER "\nYour GL driver is missing support for: GL_ARB_multitexture, < 2 texture units");
}
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_multitexture\n" );
@@ -1159,11 +1168,14 @@ static void GLimp_XreaLInitExtensions(void) {
// GL_ARB_depth_texture
- if(GLEW_ARB_depth_texture) {
+ if(GLEW_ARB_depth_texture)
+ {
good = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_depth_texture\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_depth_texture\n" );
@@ -1172,12 +1184,15 @@ static void GLimp_XreaLInitExtensions(void) {
// GL_ARB_texture_cube_map
- if(GLEW_ARB_texture_cube_map) {
+ if(GLEW_ARB_texture_cube_map)
+ {
good = qtrue;
glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, &glConfig2.maxCubeMapTextureSize);
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_texture_cube_map\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_texture_cube_map\n" );
@@ -1186,11 +1201,14 @@ static void GLimp_XreaLInitExtensions(void) {
GL_CheckErrors();
// GL_ARB_vertex_program
- if(GLEW_ARB_vertex_program) {
+ if(GLEW_ARB_vertex_program)
+ {
good = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_vertex_program\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_vertex_program\n" );
@@ -1198,11 +1216,14 @@ static void GLimp_XreaLInitExtensions(void) {
}
// GL_ARB_vertex_buffer_object
- if(GLEW_ARB_vertex_buffer_object) {
+ if(GLEW_ARB_vertex_buffer_object)
+ {
good = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_vertex_buffer_object\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_vertex_buffer_object\n" );
@@ -1212,25 +1233,34 @@ static void GLimp_XreaLInitExtensions(void) {
// GL_ARB_occlusion_query
glConfig2.occlusionQueryAvailable = qfalse;
glConfig2.occlusionQueryBits = 0;
- if(GLEW_ARB_occlusion_query) {
- if(r_ext_occlusion_query->value) {
+ if(GLEW_ARB_occlusion_query)
+ {
+ if(r_ext_occlusion_query->value)
+ {
glConfig2.occlusionQueryAvailable = qtrue;
glGetQueryivARB(GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, &glConfig2.occlusionQueryBits);
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_occlusion_query\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_occlusion_query\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_occlusion_query not found\n");
}
GL_CheckErrors();
// GL_ARB_shader_objects
- if(GLEW_ARB_shader_objects) {
+ if(GLEW_ARB_shader_objects)
+ {
good = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_shader_objects\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_shader_objects\n" );
@@ -1238,7 +1268,8 @@ static void GLimp_XreaLInitExtensions(void) {
}
// GL_ARB_vertex_shader
- if(GLEW_ARB_vertex_shader) {
+ if(GLEW_ARB_vertex_shader)
+ {
int reservedComponents;
good = qtrue;
@@ -1264,7 +1295,9 @@ static void GLimp_XreaLInitExtensions(void) {
glConfig2.vboVertexSkinningAvailable = (qboolean)(r_vboVertexSkinning->integer && ((glConfig2.maxVertexSkinningBones >= 12) ? qtrue : qfalse));
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_vertex_shader\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_vertex_shader\n" );
@@ -1273,11 +1306,14 @@ static void GLimp_XreaLInitExtensions(void) {
GL_CheckErrors();
// GL_ARB_fragment_shader
- if(GLEW_ARB_fragment_shader){
+ if(GLEW_ARB_fragment_shader)
+ {
good = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_fragment_shader\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_fragment_shader\n" );
@@ -1285,12 +1321,15 @@ static void GLimp_XreaLInitExtensions(void) {
}
// GL_ARB_shading_language_100
- if(GLEW_ARB_shading_language_100) {
+ if(GLEW_ARB_shading_language_100)
+ {
good = qtrue;
Q_strncpyz(glConfig2.shadingLanguageVersion, (char*)glGetString(GL_SHADING_LANGUAGE_VERSION_ARB), sizeof(glConfig2.shadingLanguageVersion));
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_shading_language_100\n");
- } else {
+ }
+ else
+ {
good = qfalse;
Q_strcat( missingExts, sizeof( missingExts ), "GL_ARB_shading_language_100\n" );
@@ -1300,99 +1339,142 @@ static void GLimp_XreaLInitExtensions(void) {
// GL_ARB_texture_non_power_of_two
glConfig2.textureNPOTAvailable = qfalse;
- if(GLEW_ARB_texture_non_power_of_two) {
- if(r_ext_texture_non_power_of_two->integer) {
+ if(GLEW_ARB_texture_non_power_of_two)
+ {
+ if(r_ext_texture_non_power_of_two->integer)
+ {
glConfig2.textureNPOTAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_texture_non_power_of_two\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_texture_non_power_of_two\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_texture_non_power_of_two not found\n");
}
// GL_ARB_draw_buffers
glConfig2.drawBuffersAvailable = qfalse;
- if(GLEW_ARB_draw_buffers) {
+ if(GLEW_ARB_draw_buffers)
+ {
glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &glConfig2.maxDrawBuffers);
- if(r_ext_draw_buffers->integer) {
+ if(r_ext_draw_buffers->integer)
+ {
glConfig2.drawBuffersAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_draw_buffers\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_draw_buffers\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_draw_buffers not found\n");
}
// GL_ARB_half_float_pixel
glConfig2.textureHalfFloatAvailable = qfalse;
- if(GLEW_ARB_half_float_pixel) {
- if(r_ext_half_float_pixel->integer) {
+ if(GLEW_ARB_half_float_pixel)
+ {
+ if(r_ext_half_float_pixel->integer)
+ {
glConfig2.textureHalfFloatAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_half_float_pixel\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_half_float_pixel\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_half_float_pixel not found\n");
}
// GL_ARB_texture_float
glConfig2.textureFloatAvailable = qfalse;
- if(GLEW_ARB_texture_float) {
- if(r_ext_texture_float->integer) {
+ if(GLEW_ARB_texture_float)
+ {
+ if(r_ext_texture_float->integer)
+ {
glConfig2.textureFloatAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_texture_float\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_texture_float\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_texture_float not found\n");
}
// GL_ARB_texture_compression
glConfig.textureCompression = TC_NONE;
- if(GLEW_ARB_texture_compression) {
- if(r_ext_compressed_textures->integer) {
+ if(GLEW_ARB_texture_compression)
+ {
+ if(r_ext_compressed_textures->integer)
+ {
glConfig2.ARBTextureCompressionAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_texture_compression\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_texture_compression\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_texture_compression not found\n");
}
// GL_ARB_vertex_array_object
glConfig2.vertexArrayObjectAvailable = qfalse;
- if(GLEW_ARB_vertex_array_object) {
- if(r_ext_vertex_array_object->integer) {
+ if(GLEW_ARB_vertex_array_object)
+ {
+ if(r_ext_vertex_array_object->integer)
+ {
glConfig2.vertexArrayObjectAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ARB_vertex_array_object\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ARB_vertex_array_object\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ARB_vertex_array_object not found\n");
}
// GL_EXT_texture_compression_s3tc
- if(GLEW_EXT_texture_compression_s3tc) {
- if(r_ext_compressed_textures->integer) {
+ if(GLEW_EXT_texture_compression_s3tc)
+ {
+ if(r_ext_compressed_textures->integer)
+ {
glConfig.textureCompression = TC_S3TC;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_texture_compression_s3tc\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_texture_compression_s3tc\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_texture_compression_s3tc not found\n");
}
// GL_EXT_texture3D
glConfig2.texture3DAvailable = qfalse;
- if(GLEW_EXT_texture3D) {
+ if(GLEW_EXT_texture3D)
+ {
//if(r_ext_texture3d->value)
{
glConfig2.texture3DAvailable = qtrue;
@@ -1404,101 +1486,145 @@ static void GLimp_XreaLInitExtensions(void) {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_texture3D\n");
}
*/
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_texture3D not found\n");
}
// GL_EXT_stencil_wrap
glConfig2.stencilWrapAvailable = qfalse;
- if(GLEW_EXT_stencil_wrap) {
- if(r_ext_stencil_wrap->value) {
+ if(GLEW_EXT_stencil_wrap)
+ {
+ if(r_ext_stencil_wrap->value)
+ {
glConfig2.stencilWrapAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_stencil_wrap\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_stencil_wrap\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_stencil_wrap not found\n");
}
// GL_EXT_texture_filter_anisotropic
glConfig2.textureAnisotropyAvailable = qfalse;
- if(GLEW_EXT_texture_filter_anisotropic) {
+ if(GLEW_EXT_texture_filter_anisotropic)
+ {
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig2.maxTextureAnisotropy);
- if(r_ext_texture_filter_anisotropic->value) {
+ if(r_ext_texture_filter_anisotropic->value)
+ {
glConfig2.textureAnisotropyAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_texture_filter_anisotropic\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_texture_filter_anisotropic\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not found\n");
}
GL_CheckErrors();
// GL_EXT_stencil_two_side
- if(GLEW_EXT_stencil_two_side) {
- if(r_ext_stencil_two_side->value) {
+ if(GLEW_EXT_stencil_two_side)
+ {
+ if(r_ext_stencil_two_side->value)
+ {
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_stencil_two_side\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_stencil_two_side\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_stencil_two_side not found\n");
}
// GL_EXT_depth_bounds_test
- if(GLEW_EXT_depth_bounds_test) {
- if(r_ext_depth_bounds_test->value) {
+ if(GLEW_EXT_depth_bounds_test)
+ {
+ if(r_ext_depth_bounds_test->value)
+ {
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_depth_bounds_test\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_depth_bounds_test\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_depth_bounds_test not found\n");
}
// GL_EXT_framebuffer_object
glConfig2.framebufferObjectAvailable = qfalse;
- if(GLEW_EXT_framebuffer_object) {
+ if(GLEW_EXT_framebuffer_object)
+ {
glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE_EXT, &glConfig2.maxRenderbufferSize);
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &glConfig2.maxColorAttachments);
- if(r_ext_framebuffer_object->value) {
+ if(r_ext_framebuffer_object->value)
+ {
glConfig2.framebufferObjectAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_framebuffer_object\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_framebuffer_object\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_framebuffer_object not found\n");
}
GL_CheckErrors();
// GL_EXT_packed_depth_stencil
glConfig2.framebufferPackedDepthStencilAvailable = qfalse;
- if(GLEW_EXT_packed_depth_stencil && glConfig.driverType != GLDRV_MESA) {
- if(r_ext_packed_depth_stencil->integer) {
+ if(GLEW_EXT_packed_depth_stencil && glConfig.driverType != GLDRV_MESA)
+ {
+ if(r_ext_packed_depth_stencil->integer)
+ {
glConfig2.framebufferPackedDepthStencilAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_packed_depth_stencil\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_packed_depth_stencil\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_packed_depth_stencil not found\n");
}
// GL_EXT_framebuffer_blit
glConfig2.framebufferBlitAvailable = qfalse;
- if(GLEW_EXT_framebuffer_blit) {
- if(r_ext_framebuffer_blit->integer) {
+ if(GLEW_EXT_framebuffer_blit)
+ {
+ if(r_ext_framebuffer_blit->integer)
+ {
glConfig2.framebufferBlitAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_EXT_framebuffer_blit\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_EXT_framebuffer_blit\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_EXT_framebuffer_blit not found\n");
}
@@ -1524,33 +1650,48 @@ static void GLimp_XreaLInitExtensions(void) {
*/
// GL_ATI_separate_stencil
- if(GLEW_ATI_separate_stencil) {
- if(r_ext_separate_stencil->value) {
+ if(GLEW_ATI_separate_stencil)
+ {
+ if(r_ext_separate_stencil->value)
+ {
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_ATI_separate_stencil\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_ATI_separate_stencil\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_ATI_separate_stencil not found\n");
}
// GL_SGIS_generate_mipmap
glConfig2.generateMipmapAvailable = qfalse;
- if(GLEW_SGIS_generate_mipmap) {
- if(r_ext_generate_mipmap->value) {
+ if(GLEW_SGIS_generate_mipmap)
+ {
+ if(r_ext_generate_mipmap->value)
+ {
glConfig2.generateMipmapAvailable = qtrue;
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_SGIS_generate_mipmap\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...ignoring GL_SGIS_generate_mipmap\n");
}
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_SGIS_generate_mipmap not found\n");
}
// GL_GREMEDY_string_marker
- if(GLEW_GREMEDY_string_marker) {
+ if(GLEW_GREMEDY_string_marker)
+ {
ri.Printf(PRINT_ALL, "...found OpenGL extension - GL_GREMEDY_string_marker\n");
- } else {
+ }
+ else
+ {
ri.Printf(PRINT_ALL, "...GL_GREMEDY_string_marker not found\n");
}
}
@@ -1754,7 +1895,8 @@ qboolean GLimp_Init(void)
#endif
// Create the window and set up the context
- if(GLimp_StartDriverAndSetMode(r_mode->integer, r_fullscreen->integer, qfalse)) {
+ if(GLimp_StartDriverAndSetMode(r_mode->integer, r_fullscreen->integer, qfalse))
+ {
goto success;
}
Please sign in to comment.
Something went wrong with that request. Please try again.