]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix a few compile warnings. Remove unused locals.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 18 May 2020 15:05:42 +0000 (15:05 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 18 May 2020 15:05:42 +0000 (15:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12537 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
prvm_edict.c
r_shadow.c
snd_main.c

index bc3577bbbae54b97c9e9f7413d7b34b4218f44f0..6400d65b9036dd0619874c6a13d07133ac717271 100644 (file)
@@ -5033,7 +5033,7 @@ finish:
 
 static void R_Bloom_StartFrame(void)
 {
-       int bloomtexturewidth, bloomtextureheight, screentexturewidth, screentextureheight;
+       int screentexturewidth, screentextureheight;
        int viewwidth, viewheight;
        textype_t textype = TEXTYPE_COLORBUFFER;
 
@@ -5083,8 +5083,6 @@ static void R_Bloom_StartFrame(void)
        // calculate desired texture sizes
        screentexturewidth = viewwidth;
        screentextureheight = viewheight;
-       bloomtexturewidth = r_fb.bloomwidth;
-       bloomtextureheight = r_fb.bloomheight;
 
        if ((r_bloom.integer || (!R_Stereo_Active() && (r_motionblur.value > 0 || r_damageblur.value > 0))) && ((r_bloom_resolution.integer < 4 || r_bloom_blur.value < 1 || r_bloom_blur.value >= 512) || r_refdef.view.width > (int)vid.maxtexturesize_2d || r_refdef.view.height > (int)vid.maxtexturesize_2d))
        {
@@ -10077,10 +10075,7 @@ void R_DebugLine(vec3_t start, vec3_t end)
 
 void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qboolean writedepth, qboolean prepass, qboolean ui)
 {
-       int q;
        static texture_t texture;
-       static msurface_t surface;
-       const msurface_t *surfacelist = &surface;
 
        // fake enough texture and surface state to render this geometry
 
index a2e23b651933f456c0ff7027afd954f2c6205dea..0c9b0d77304c55cba155cf7aa31e26edc30d50fc 100644 (file)
@@ -449,14 +449,14 @@ static char *PRVM_ValueString (prvm_prog_t *prog, etype_t type, prvm_eval_t *val
                        dpsnprintf (line, linelength, "%s()", PRVM_GetString(prog, f->s_name));
                }
                else
-                       dpsnprintf (line, linelength, "function%i() (invalid!)", val->function);
+                       dpsnprintf (line, linelength, "function%lli() (invalid!)", val->function);
                break;
        case ev_field:
                def = PRVM_ED_FieldAtOfs ( prog, val->_int );
                if (def != NULL)
                        dpsnprintf (line, linelength, ".%s", PRVM_GetString(prog, def->s_name));
                else
-                       dpsnprintf (line, linelength, "field%i (invalid!)", val->_int );
+                       dpsnprintf (line, linelength, "field%lli (invalid!)", val->_int );
                break;
        case ev_void:
                dpsnprintf (line, linelength, "void");
@@ -543,14 +543,14 @@ char *PRVM_UglyValueString (prvm_prog_t *prog, etype_t type, prvm_eval_t *val, c
                        strlcpy (line, PRVM_GetString (prog, f->s_name), linelength);
                }
                else
-                       dpsnprintf (line, linelength, "bad function %i (invalid!)", val->function);
+                       dpsnprintf (line, linelength, "bad function %lli (invalid!)", val->function);
                break;
        case ev_field:
                def = PRVM_ED_FieldAtOfs ( prog, val->_int );
                if (def != NULL)
                        dpsnprintf (line, linelength, ".%s", PRVM_GetString(prog, def->s_name));
                else
-                       dpsnprintf (line, linelength, "field%i (invalid!)", val->_int );
+                       dpsnprintf (line, linelength, "field%lli (invalid!)", val->_int );
                break;
        case ev_void:
                dpsnprintf (line, linelength, "void");
index e6fda0f5d398178d1042c64f0105b56889740314..0dbcdfab36906d321d41382cbb2a5de007411f8c 100644 (file)
@@ -1536,7 +1536,6 @@ static void R_Shadow_RenderMode_ShadowMap(int side, int size, int x, int y)
        float nearclip, farclip, bias;
        r_viewport_t viewport;
        int flipped;
-       float clearcolor[4];
 
        if (r_shadow_rendermode != R_SHADOW_RENDERMODE_SHADOWMAP2D)
        {
@@ -1565,7 +1564,6 @@ static void R_Shadow_RenderMode_ShadowMap(int side, int size, int x, int y)
        r_refdef.view.cullface_front = flipped ? r_shadow_cullface_back : r_shadow_cullface_front;
        r_refdef.view.cullface_back = flipped ? r_shadow_cullface_front : r_shadow_cullface_back;
 
-       Vector4Set(clearcolor, 1,1,1,1);
        if (r_shadow_shadowmap2ddepthbuffer)
                GL_ColorMask(1,1,1,1);
        else
@@ -3718,7 +3716,7 @@ static void R_Shadow_DrawLightShadowMaps(rtlight_t *rtlight)
 {
        int i;
        int numsurfaces;
-       unsigned char *shadowtrispvs, *lighttrispvs, *surfacesides;
+       unsigned char *shadowtrispvs, *surfacesides;
        int numlightentities;
        int numlightentities_noselfshadow;
        int numshadowentities;
@@ -3766,7 +3764,6 @@ static void R_Shadow_DrawLightShadowMaps(rtlight_t *rtlight)
        shadowentities = rtlight->cached_shadowentities;
        shadowentities_noselfshadow = rtlight->cached_shadowentities_noselfshadow;
        shadowtrispvs = rtlight->cached_shadowtrispvs;
-       lighttrispvs = rtlight->cached_lighttrispvs;
        surfacelist = rtlight->cached_surfacelist;
 
        // make this the active rtlight for rendering purposes
@@ -3861,11 +3858,9 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
 {
        int i;
        int numsurfaces;
-       unsigned char *shadowtrispvs, *lighttrispvs;
+       unsigned char *lighttrispvs;
        int numlightentities;
        int numlightentities_noselfshadow;
-       int numshadowentities;
-       int numshadowentities_noselfshadow;
        entity_render_t **lightentities;
        entity_render_t **lightentities_noselfshadow;
        entity_render_t **shadowentities;
@@ -3887,14 +3882,11 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
 
        numlightentities = rtlight->cached_numlightentities;
        numlightentities_noselfshadow = rtlight->cached_numlightentities_noselfshadow;
-       numshadowentities = rtlight->cached_numshadowentities;
-       numshadowentities_noselfshadow = rtlight->cached_numshadowentities_noselfshadow;
        numsurfaces = rtlight->cached_numsurfaces;
        lightentities = rtlight->cached_lightentities;
        lightentities_noselfshadow = rtlight->cached_lightentities_noselfshadow;
        shadowentities = rtlight->cached_shadowentities;
        shadowentities_noselfshadow = rtlight->cached_shadowentities_noselfshadow;
-       shadowtrispvs = rtlight->cached_shadowtrispvs;
        lighttrispvs = rtlight->cached_lighttrispvs;
        surfacelist = rtlight->cached_surfacelist;
        castshadows = rtlight->castshadows;
@@ -3919,7 +3911,6 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
        {
                float borderbias;
                int size;
-               float shadowmapoffsetnoselfshadow = 0;
                matrix4x4_t radiustolight = rtlight->matrix_worldtolight;
                Matrix4x4_Abs(&radiustolight);
 
@@ -3928,9 +3919,6 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
 
                //Con_Printf("distance %f lodlinear %i size %i\n", distance, lodlinear, size);
 
-               if (rtlight->cached_numshadowentities_noselfshadow)
-                       shadowmapoffsetnoselfshadow = rtlight->shadowmapatlassidesize * 2;
-
                // render lighting using the depth texture as shadowmap
                // draw lighting in the unmasked areas
                if (numsurfaces + numlightentities)
index 95273acf769877d84968498d89ce2142554e7770..a677b174ea39f2b759c0b4d9c57fcd22c3e01a6c 100644 (file)
@@ -456,7 +456,6 @@ static void S_SetChannelLayout (void)
 
 void S_Startup (void)
 {
-       qboolean fixed_speed, fixed_width, fixed_channels;
        snd_format_t chosen_fmt;
        static snd_format_t prev_render_format = {0, 0, 0};
        char* env;
@@ -468,10 +467,6 @@ void S_Startup (void)
        if (!snd_initialized.integer)
                return;
 
-       fixed_speed = false;
-       fixed_width = false;
-       fixed_channels = false;
-
        // Get the starting sound format from the cvars
        chosen_fmt.speed = snd_speed.integer;
        chosen_fmt.width = snd_width.integer;
@@ -489,7 +484,6 @@ void S_Startup (void)
 #if _MSC_VER >= 1400
                free(env);
 #endif
-               fixed_channels = true;
        }
 #if _MSC_VER >= 1400
        _dupenv_s(&env, &envlen, "QUAKE_SOUND_SPEED");
@@ -502,7 +496,6 @@ void S_Startup (void)
 #if _MSC_VER >= 1400
                free(env);
 #endif
-               fixed_speed = true;
        }
 #if _MSC_VER >= 1400
        _dupenv_s(&env, &envlen, "QUAKE_SOUND_SAMPLEBITS");
@@ -515,7 +508,6 @@ void S_Startup (void)
 #if _MSC_VER >= 1400
                free(env);
 #endif
-               fixed_width = true;
        }
 
        // Parse the command line to see if the player wants a particular sound format
@@ -523,33 +515,28 @@ void S_Startup (void)
        if (COM_CheckParm ("-sndquad") != 0)
        {
                chosen_fmt.channels = 4;
-               fixed_channels = true;
        }
 // COMMANDLINEOPTION: Sound: -sndstereo sets sound output to stereo
        else if (COM_CheckParm ("-sndstereo") != 0)
        {
                chosen_fmt.channels = 2;
-               fixed_channels = true;
        }
 // COMMANDLINEOPTION: Sound: -sndmono sets sound output to mono
        else if (COM_CheckParm ("-sndmono") != 0)
        {
                chosen_fmt.channels = 1;
-               fixed_channels = true;
        }
 // COMMANDLINEOPTION: Sound: -sndspeed <hz> chooses sound output rate (supported values are 48000, 44100, 32000, 24000, 22050, 16000, 11025 (quake), 8000)
        i = COM_CheckParm ("-sndspeed");
        if (0 < i && i < com_argc - 1)
        {
                chosen_fmt.speed = atoi (com_argv[i + 1]);
-               fixed_speed = true;
        }
 // COMMANDLINEOPTION: Sound: -sndbits <bits> chooses 8 bit or 16 bit or 32bit float sound output
        i = COM_CheckParm ("-sndbits");
        if (0 < i && i < com_argc - 1)
        {
                chosen_fmt.width = atoi (com_argv[i + 1]) / 8;
-               fixed_width = true;
        }
 
 #if 0
@@ -557,7 +544,6 @@ void S_Startup (void)
        // You can't change sound speed after start time (not yet supported)
        if (prev_render_format.speed != 0)
        {
-               fixed_speed = true;
                if (chosen_fmt.speed != prev_render_format.speed)
                {
                        Con_Printf("S_Startup: sound speed has changed! This is NOT supported yet. Falling back to previous speed (%u Hz)\n",
@@ -571,39 +557,32 @@ void S_Startup (void)
        if (chosen_fmt.speed < SND_MIN_SPEED)
        {
                chosen_fmt.speed = SND_MIN_SPEED;
-               fixed_speed = false;
        }
        else if (chosen_fmt.speed > SND_MAX_SPEED)
        {
                chosen_fmt.speed = SND_MAX_SPEED;
-               fixed_speed = false;
        }
 
        if (chosen_fmt.width < SND_MIN_WIDTH)
        {
                chosen_fmt.width = SND_MIN_WIDTH;
-               fixed_width = false;
        }
     else if (chosen_fmt.width == 3)
        {
                chosen_fmt.width = 4;
-               fixed_width = false;
        }
        else if (chosen_fmt.width > SND_MAX_WIDTH)
        {
                chosen_fmt.width = SND_MAX_WIDTH;
-               fixed_width = false;
        }
 
        if (chosen_fmt.channels < SND_MIN_CHANNELS)
        {
                chosen_fmt.channels = SND_MIN_CHANNELS;
-               fixed_channels = false;
        }
        else if (chosen_fmt.channels > SND_MAX_CHANNELS)
        {
                chosen_fmt.channels = SND_MAX_CHANNELS;
-               fixed_channels = false;
        }
 
        // create the sound buffer used for sumitting the samples to the plaform-dependent module