From 976ce69b413a8833529e5ccc76dec62a7dd5ac58 Mon Sep 17 00:00:00 2001 From: sago007 Date: Sun, 27 Nov 2016 12:25:51 +0100 Subject: [PATCH] Small corrections --- code/renderer_oa/tr_bloom.c | 24 ++++++------------------ code/renderer_oa/tr_flares.c | 11 ++++------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/code/renderer_oa/tr_bloom.c b/code/renderer_oa/tr_bloom.c index e4df0b38..3e00af48 100644 --- a/code/renderer_oa/tr_bloom.c +++ b/code/renderer_oa/tr_bloom.c @@ -673,10 +673,7 @@ extern int mpasses; static void ID_INLINE R_Bloom_QuadTV( int width, int height, float texX, float texY, float texWidth, float texHeight, int aa ) { - int x = 0; - int y = 0; float aspcenter = 0; - int aspoff = 0; float raa = r_retroAA->value; if (raa < 1) raa = 1; @@ -684,8 +681,8 @@ static void ID_INLINE R_Bloom_QuadTV( int width, int height, float texX, float t float ypix = 1.0f / height / (4 / raa); float xaa; float yaa; - x = 0; - y = 0; + int x = 0; + int y = 0; @@ -744,10 +741,6 @@ static void ID_INLINE R_Bloom_QuadTV( int width, int height, float texX, float t qglColor4f( 1.0, 1.0, 1.0, 1 ); } - - //aspcenter = 0; - aspoff = tvWidth * tvAspectW; - if (!aa) { qglViewport(aspcenter, 0, (tvWidth * tvAspectW), tvHeight ); qglScissor(aspcenter, 0, (tvWidth * tvAspectW), tvHeight ); @@ -1129,18 +1122,17 @@ static void R_Postprocess_InitTextures( void ) { #ifdef GLSL_POSTPROCESSING byte *data; - int vidinted = glConfig.vidHeight * 0.55f; int intdiv = 1; force32upload = 1; // find closer power of 2 to screen size - for (postproc.screen.width = 1; postproc.screen.width< glConfig.vidWidth; postproc.screen.width *= 2); + for (postproc.screen.width = 1; postproc.screen.width< glConfig.vidWidth; postproc.screen.width *= 2) {} // if (r_tvMode->integer > 1) // interlaced // for (postproc.screen.height = 1;postproc.screen.height < vidinted;postproc.screen.height *= 2); //else - for (postproc.screen.height = 1; postproc.screen.height < glConfig.vidHeight; postproc.screen.height *= 2); + for (postproc.screen.height = 1; postproc.screen.height < glConfig.vidHeight; postproc.screen.height *= 2) {} // if (r_tvMode->integer > 1) // intdiv = 2; @@ -1155,8 +1147,8 @@ static void R_Postprocess_InitTextures( void ) postproc.work.width = r_bloom_sample_size->integer; postproc.work.height = postproc.work.width * ( glConfig.vidWidth / glConfig.vidHeight ); - for (postproc.effect.width = 1; postproc.effect.width < postproc.work.width; postproc.effect.width *= 2); - for (postproc.effect.height = 1; postproc.effect.height < postproc.work.height; postproc.effect.height *= 2); + for (postproc.effect.width = 1; postproc.effect.width < postproc.work.width; postproc.effect.width *= 2) {} + for (postproc.effect.height = 1; postproc.effect.height < postproc.work.height; postproc.effect.height *= 2) {} postproc.effect.readW = postproc.work.width / (float)postproc.effect.width; postproc.effect.readH = postproc.work.height / (float)postproc.effect.height; @@ -2070,10 +2062,6 @@ void R_MblurScreenPost( void ) static void R_Postprocess_BackupScreenTV( void ) { #ifdef GLSL_POSTPROCESSING - int intdiv; - intdiv = 1; - - GL_TexEnv( GL_MODULATE ); qglScissor( 0, 0, glConfig.vidWidth, glConfig.vidHeight ); qglViewport( 0, 0, glConfig.vidWidth, glConfig.vidHeight ); diff --git a/code/renderer_oa/tr_flares.c b/code/renderer_oa/tr_flares.c index 182d8de4..b8a6b065 100644 --- a/code/renderer_oa/tr_flares.c +++ b/code/renderer_oa/tr_flares.c @@ -160,7 +160,7 @@ float flaredsize; // leilei - dirty flare fix for widescreens void RB_AddFlare(srfFlare_t *surface, int fogNum, vec3_t point, vec3_t color, vec3_t normal, int radii, int efftype, float scaled, int type) { int i; - flare_t *f, *oldest; + flare_t *f; vec3_t local; float d = 1; vec4_t eye, clip, normalized, window; @@ -203,7 +203,6 @@ void RB_AddFlare(srfFlare_t *surface, int fogNum, vec3_t point, vec3_t color, ve } // see if a flare with a matching surface, scene, and view exists - oldest = r_flareStructs; for ( f = r_activeFlares ; f ; f = f->next ) { if ( f->surface == surface && f->frameSceneNum == backEnd.viewParms.frameSceneNum && f->inPortal == backEnd.viewParms.isPortal ) { @@ -379,7 +378,7 @@ static void RB_TestFlareFast( flare_t *f, int dotrace ) // leilei - do trace, then complain if (dotrace) { trace_t yeah; - CM_Trace( &yeah, f->origin, backEnd.or.viewOrigin, NULL, NULL, NULL, f->origin, 1, NULL, NULL ); + CM_Trace( &yeah, f->origin, backEnd.or.viewOrigin, NULL, NULL, 0, f->origin, 1, 0, NULL ); if (yeah.fraction < 1) { visible = 0; return; @@ -471,7 +470,7 @@ static void RB_TestFlare( flare_t *f, int dotrace ) // leilei - do trace, then complain if (dotrace) { trace_t yeah; - CM_Trace( &yeah, f->origin, backEnd.or.viewOrigin, NULL, NULL, NULL, f->origin, 1, NULL, NULL ); + CM_Trace( &yeah, f->origin, backEnd.or.viewOrigin, NULL, NULL, 0, f->origin, 1, 0, NULL ); if (yeah.fraction < 1) { visible = 0; return; @@ -524,10 +523,8 @@ static void RB_TestFlare( flare_t *f, int dotrace ) static void RB_TestFlareTraceOnly( flare_t *f ) { - float depth; qboolean visible; float fade; - float screenZ; backEnd.pc.c_flareTests++; @@ -538,7 +535,7 @@ static void RB_TestFlareTraceOnly( flare_t *f ) // read from a traceline trace_t yeah; - CM_Trace( &yeah, f->origin, backEnd.or.viewOrigin, NULL, NULL, NULL, f->origin, 1, NULL, NULL ); + CM_Trace( &yeah, f->origin, backEnd.or.viewOrigin, NULL, NULL, 0, f->origin, 1, 0, NULL ); if (yeah.fraction < 1) { visible = 0; return;