]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_decals.c
added CVAR_SAVE and CVAR_NOTIFY flags to cvar_t structure (at the beginning), updated...
[xonotic/darkplaces.git] / r_decals.c
index 9cfe99fdcd11490f2160fa865c2fed43f5e56aef..8f8176aac2a10c4f04127c8e1afa8b0d06ad5de1 100644 (file)
@@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 See the GNU General Public License for more details.
 
@@ -38,28 +38,28 @@ decal_t;
 decal_t *decals;
 int currentdecal; // wraps around in decal array, replacing old ones when a new one is needed
 
-cvar_t r_drawdecals = {"r_drawdecals", "1"};
-cvar_t r_decals_lighting = {"r_decals_lighting", "1"};
+cvar_t r_drawdecals = {0, "r_drawdecals", "1"};
+cvar_t r_decals_lighting = {0, "r_decals_lighting", "1"};
 
-void r_decals_start()
+void r_decals_start(void)
 {
        decals = (decal_t *) qmalloc(MAX_DECALS * sizeof(decal_t));
        memset(decals, 0, MAX_DECALS * sizeof(decal_t));
        currentdecal = 0;
 }
 
-void r_decals_shutdown()
+void r_decals_shutdown(void)
 {
        qfree(decals);
 }
 
-void r_decals_newmap()
+void r_decals_newmap(void)
 {
        memset(decals, 0, MAX_DECALS * sizeof(decal_t));
        currentdecal = 0;
 }
 
-void R_Decals_Init()
+void R_Decals_Init(void)
 {
        Cvar_RegisterVariable (&r_drawdecals);
        Cvar_RegisterVariable (&r_decals_lighting);
@@ -235,7 +235,7 @@ void GL_DrawDecals (void)
 
        dynamiclight = (int) r_dynamic.value != 0 && (int) r_decals_lighting.value != 0;
 
-       mindist = DotProduct(r_refdef.vieworg, vpn) + 4.0f;
+       mindist = DotProduct(r_origin, vpn) + 4.0f;
 
        if (r_render.value)
        {
@@ -261,7 +261,7 @@ void GL_DrawDecals (void)
                        continue;
 
                // do not render if the view origin is behind the decal
-               VectorSubtract(p->org, r_refdef.vieworg, v);
+               VectorSubtract(p->org, r_origin, v);
                if (DotProduct(p->direction, v) < 0)
                        continue;