summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-03-26 16:50:03 +0000
committerTim Angus <tim@ngus.net>2013-03-27 11:33:16 +0000
commitecf45acd236aaf1a0d2b00a94a24d8f24fbceae4 (patch)
tree23d703104aa48a4533daed653d5c429f73dccb05 /src/renderergl2/tr_backend.c
parenta6e5804c1162832fa99d31c88033cbf6f1efd2f0 (diff)
Fix some of the things clang --analyze flagged
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index 6d6b0274..6b541fec 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -54,7 +54,9 @@ void GL_Bind2( image_t *image, GLenum type ) {
}
if ( glState.currenttextures[glState.currenttmu] != texnum ) {
- image->frameUsed = tr.frameCount;
+ if ( image ) {
+ image->frameUsed = tr.frameCount;
+ }
glState.currenttextures[glState.currenttmu] = texnum;
qglBindTexture (type, texnum);
}
@@ -252,7 +254,7 @@ void GL_State( unsigned long stateBits )
//
if ( diff & ( GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS ) )
{
- GLenum srcFactor, dstFactor;
+ GLenum srcFactor = GL_ONE, dstFactor = GL_ONE;
if ( stateBits & ( GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS ) )
{
@@ -286,7 +288,6 @@ void GL_State( unsigned long stateBits )
srcFactor = GL_SRC_ALPHA_SATURATE;
break;
default:
- srcFactor = GL_ONE; // to get warning to shut up
ri.Error( ERR_DROP, "GL_State: invalid src blend state bits" );
break;
}
@@ -318,7 +319,6 @@ void GL_State( unsigned long stateBits )
dstFactor = GL_ONE_MINUS_DST_ALPHA;
break;
default:
- dstFactor = GL_ONE; // to get warning to shut up
ri.Error( ERR_DROP, "GL_State: invalid dst blend state bits" );
break;
}
@@ -608,7 +608,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldDlighted = qfalse;
oldPshadowed = qfalse;
oldSort = -1;
- depthRange = qfalse;
depth[0] = 0.f;
depth[1] = 1.f;
@@ -631,8 +630,8 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
// change the tess parameters if needed
// a "entityMergable" shader is a shader that can have surfaces from seperate
// entities merged into a single batch, like smoke and blood puff sprites
- if (shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted || pshadowed != oldPshadowed
- || ( entityNum != oldEntityNum && !shader->entityMergable ) ) {
+ if ( shader != NULL && ( shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted || pshadowed != oldPshadowed
+ || ( entityNum != oldEntityNum && !shader->entityMergable ) ) ) {
if (oldShader != NULL) {
RB_EndSurface();
}
@@ -757,7 +756,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
}
if (inQuery) {
- inQuery = qfalse;
qglEndQueryARB(GL_SAMPLES_PASSED_ARB);
}