]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix remaining warnings
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Jun 2020 05:10:51 +0000 (05:10 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Jun 2020 05:10:51 +0000 (05:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12758 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c
view.c

index 65955f50d2dd845af9dc523fca94a3a43bf87a7e..a34af2c8a5614b74363bbba7a7879f5ff6e0fca2 100644 (file)
@@ -1757,8 +1757,8 @@ static void R_Shadow_BounceGrid_UpdateSpacing(void)
        int resolution[3];
        int numpixels;
        vec3_t ispacing;
-       vec3_t maxs;
-       vec3_t mins;
+       vec3_t maxs = {0,0,0};
+       vec3_t mins = {0,0,0};
        vec3_t size;
        vec3_t spacing;
        r_shadow_bouncegrid_settings_t *settings = &r_shadow_bouncegrid_state.settings;
diff --git a/view.c b/view.c
index 5683ff097dd074455fdddb2a87c513f0b5147bbd..8f9b9bf93cb2319a60a91796cbe2154f52f8e7c3 100644 (file)
--- a/view.c
+++ b/view.c
@@ -696,7 +696,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
                        if (!cldead)
                        {
                                double xyspeed, bob, bobfall;
-                               double cycle; // double-precision because cl.time can be a very large number, where float would get stuttery at high time values
+                               double bobcycle = 0, cycle; // double-precision because cl.time can be a very large number, where float would get stuttery at high time values
                                vec_t frametime;
 
                                frametime = (cl.time - cl.calcrefdef_prevtime) * cl.movevars_timescale;
@@ -793,9 +793,9 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
                                        cycle = cl.time / cl_bobcycle.value;
                                        cycle -= (int) cycle;
                                        if (cycle < cl_bobup.value)
-                                               cycle = sin(M_PI * cycle / cl_bobup.value);
+                                               bobcycle = cycle = sin(M_PI * cycle / cl_bobup.value);
                                        else
-                                               cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
+                                               bobcycle = cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
                                        // bob is proportional to velocity in the xy plane
                                        // (don't count Z, or jumping messes it up)
                                        bob = xyspeed * cl_bob.value;
@@ -919,7 +919,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
                                        bob = bspeed * cl_bobmodel_up.value * cl_viewmodel_scale.value * cos (s * 2) * t;
                                        VectorMA (gunorg, bob, up, gunorg);
                                        // Classic Quake bobbing
-                                       bob = (cl_bobmodel_classic.integer ? xyspeed * cl_bob.value * 0.25 * cycle : bspeed * cl_bobmodel_forward.value * cos(s * 2) * t) * cl_viewmodel_scale.value;
+                                       bob = (cl_bobmodel_classic.integer ? xyspeed * cl_bob.value * 0.25 * bobcycle : bspeed * cl_bobmodel_forward.value * cos(s * 2) * t) * cl_viewmodel_scale.value;
                                        VectorMA (gunorg, (cl_bobmodel_classic.integer ? (bob > 1 ? 1 : bob) : bob), forward, gunorg);
                                }
                        }