diff options
Diffstat (limited to 'src/renderergl2')
| -rw-r--r-- | src/renderergl2/tr_backend.c | 14 | ||||
| -rw-r--r-- | src/renderergl2/tr_bsp.c | 3 | ||||
| -rw-r--r-- | src/renderergl2/tr_image.c | 8 | ||||
| -rw-r--r-- | src/renderergl2/tr_main.c | 4 | ||||
| -rw-r--r-- | src/renderergl2/tr_marks.c | 4 | ||||
| -rw-r--r-- | src/renderergl2/tr_shader.c | 3 | ||||
| -rw-r--r-- | src/renderergl2/tr_world.c | 2 | 
7 files changed, 13 insertions, 25 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);  	} diff --git a/src/renderergl2/tr_bsp.c b/src/renderergl2/tr_bsp.c index 9b26241b..824e6c2b 100644 --- a/src/renderergl2/tr_bsp.c +++ b/src/renderergl2/tr_bsp.c @@ -2124,8 +2124,6 @@ static void R_CreateWorldVBO(void)  	} -	startTime = ri.Milliseconds(); -  	ri.Free(surfacesSorted);  	ri.Hunk_FreeTempMemory(triangles); @@ -2152,7 +2150,6 @@ static	void R_LoadSurfaces( lump_t *surfs, lump_t *verts, lump_t *indexLump ) {  	numTriSurfs = 0;  	numFlares = 0; -	in = (void *)(fileBase + surfs->fileofs);  	if (surfs->filelen % sizeof(*in))  		ri.Error (ERR_DROP, "LoadMap: funny lump size in %s",s_worldData.name);  	count = surfs->filelen / sizeof(*in); diff --git a/src/renderergl2/tr_image.c b/src/renderergl2/tr_image.c index 72a59329..6681cbd9 100644 --- a/src/renderergl2/tr_image.c +++ b/src/renderergl2/tr_image.c @@ -327,7 +327,6 @@ static void ResampleTexture( byte *in, int inwidth, int inheight, byte *out,  	for (i=0 ; i<outheight ; i++) {  		inrow = in + 4*inwidth*(int)((i+0.25)*inheight/outheight);  		inrow2 = in + 4*inwidth*(int)((i+0.75)*inheight/outheight); -		frac = fracstep >> 1;  		for (j=0 ; j<outwidth ; j++) {  			pix1 = inrow + p1[j];  			pix2 = inrow + p2[j]; @@ -958,7 +957,7 @@ static void DoLinear(byte *in, byte *out, int width, int height)  	for (y = 1; y < height - 1; y += 2)  	{ -		byte sd[4], se[4], sh[4], si[4]; +		byte sd[4] = {0}, se[4] = {0}, sh[4] = {0}, si[4] = {0};  		byte *line2, *line3;  		x = 1; @@ -1573,8 +1572,8 @@ static void RawImage_ScaleToPower2( byte **data, int *inout_width, int *inout_he  {  	int width =         *inout_width;  	int height =        *inout_height; -	int scaled_width =  *inout_scaled_width; -	int scaled_height = *inout_scaled_height; +	int scaled_width; +	int scaled_height;  	qboolean picmip = flags & IMGFLAG_PICMIP;  	qboolean mipmap = flags & IMGFLAG_MIPMAP;  	qboolean clampToEdge = flags & IMGFLAG_CLAMPTOEDGE; @@ -1770,7 +1769,6 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, qboolean light  	}  	else if(lightMap)  	{ -		samples = 4;  		if(r_greyscale->integer)  			internalFormat = GL_LUMINANCE;  		else diff --git a/src/renderergl2/tr_main.c b/src/renderergl2/tr_main.c index 2f528bb3..dc8a478c 100644 --- a/src/renderergl2/tr_main.c +++ b/src/renderergl2/tr_main.c @@ -1558,10 +1558,6 @@ static qboolean IsMirror( const drawSurf_t *drawSurf, int entityNum )  		// translate the original plane  		originalPlane.dist = originalPlane.dist + DotProduct( originalPlane.normal, tr.or.origin );  	}  -	else  -	{ -		plane = originalPlane; -	}  	// locate the portal entity closest to this plane.  	// origin will be the origin of the portal, origin2 will be diff --git a/src/renderergl2/tr_marks.c b/src/renderergl2/tr_marks.c index f510b2db..bf6980e9 100644 --- a/src/renderergl2/tr_marks.c +++ b/src/renderergl2/tr_marks.c @@ -42,8 +42,8 @@ Out must have space for two more vertexes than in  static void R_ChopPolyBehindPlane( int numInPoints, vec3_t inPoints[MAX_VERTS_ON_POLY],  								   int *numOutPoints, vec3_t outPoints[MAX_VERTS_ON_POLY],   							vec3_t normal, vec_t dist, vec_t epsilon) { -	float		dists[MAX_VERTS_ON_POLY+4]; -	int			sides[MAX_VERTS_ON_POLY+4]; +	float		dists[MAX_VERTS_ON_POLY+4] = { 0 }; +	int			sides[MAX_VERTS_ON_POLY+4] = { 0 };  	int			counts[3];  	float		dot;  	int			i, j; diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c index 06b004b1..6a42f4cb 100644 --- a/src/renderergl2/tr_shader.c +++ b/src/renderergl2/tr_shader.c @@ -1767,7 +1767,7 @@ static qboolean ParseShader( char **text )  		// light <value> determines flaring in q3map, not needed here  		else if ( !Q_stricmp(token, "light") )   		{ -			token = COM_ParseExt( text, qfalse ); +			COM_ParseExt( text, qfalse );  			continue;  		}  		// cull <face> @@ -2908,7 +2908,6 @@ static shader_t *FinishShader( void ) {  	//  	if ( stage > 1 && ( (r_vertexLight->integer && !r_uiFullScreen->integer) || glConfig.hardwareType == GLHW_PERMEDIA2 ) ) {  		VertexLightingCollapse(); -		stage = 1;  		hasLightmapStage = qfalse;  	} diff --git a/src/renderergl2/tr_world.c b/src/renderergl2/tr_world.c index 95cfea36..cbce8157 100644 --- a/src/renderergl2/tr_world.c +++ b/src/renderergl2/tr_world.c @@ -636,7 +636,7 @@ R_ClusterPVS  ==============  */  static const byte *R_ClusterPVS (int cluster) { -	if (!tr.world || !tr.world->vis || cluster < 0 || cluster >= tr.world->numClusters ) { +	if (!tr.world->vis || cluster < 0 || cluster >= tr.world->numClusters ) {  		return tr.world->novis;  	}  | 
