summaryrefslogtreecommitdiff
path: root/src/renderergl1/tr_backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl1/tr_backend.c')
-rw-r--r--src/renderergl1/tr_backend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/renderergl1/tr_backend.c b/src/renderergl1/tr_backend.c
index f00a9257..432050b6 100644
--- a/src/renderergl1/tr_backend.c
+++ b/src/renderergl1/tr_backend.c
@@ -54,7 +54,9 @@ void GL_Bind( image_t *image ) {
}
if ( glState.currenttextures[glState.currenttmu] != texnum ) {
- image->frameUsed = tr.frameCount;
+ if ( image ) {
+ image->frameUsed = tr.frameCount;
+ }
glState.currenttextures[glState.currenttmu] = texnum;
qglBindTexture (GL_TEXTURE_2D, texnum);
}
@@ -216,7 +218,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 ) )
{
@@ -250,7 +252,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;
}
@@ -282,7 +283,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;
}
@@ -546,8 +546,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
- || ( entityNum != oldEntityNum && !shader->entityMergable ) ) {
+ if ( shader != NULL && ( shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted
+ || ( entityNum != oldEntityNum && !shader->entityMergable ) ) ) {
if (oldShader != NULL) {
RB_EndSurface();
}