]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_sky.c
Finally removed the Win32 specific code from "snd_main.c". Changed a few comments...
[xonotic/darkplaces.git] / r_sky.c
diff --git a/r_sky.c b/r_sky.c
index 505db1a50b5a9daf86530a568de088ba7927610d..6b1526361543b4a72b6c8db9f0ea6538d98bdce1 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -4,6 +4,8 @@
 
 // FIXME: fix skybox after vid_restart
 cvar_t r_sky = {CVAR_SAVE, "r_sky", "1"};
+cvar_t r_skyscroll1 = {CVAR_SAVE, "r_skyscroll1", "1"};
+cvar_t r_skyscroll2 = {CVAR_SAVE, "r_skyscroll2", "2"};
 qboolean skyavailable_quake;
 qboolean skyavailable_box;
 int skyrendernow;
@@ -372,14 +374,16 @@ static void R_SkySphere(void)
                skyspherecalc();
        }
 
+       // wrap the scroll values just to be extra kind to float accuracy
+
        // scroll speed for upper layer
-       speedscale = cl.time*8.0/128.0;
-       // wrap the scroll just to be extra kind to float accuracy
+       speedscale = cl.time*r_skyscroll1.value*8.0/128.0;
        speedscale -= (int)speedscale;
-
-       // scroll the lower cloud layer twice as fast (just like quake did)
        Matrix4x4_CreateTranslate(&scroll1matrix, speedscale, speedscale, 0);
-       Matrix4x4_CreateTranslate(&scroll2matrix, speedscale * 2, speedscale * 2, 0);
+       // scroll speed for lower layer (transparent layer)
+       speedscale = cl.time*r_skyscroll2.value*8.0/128.0;
+       speedscale -= (int)speedscale;
+       Matrix4x4_CreateTranslate(&scroll2matrix, speedscale, speedscale, 0);
 
        GL_Color(1, 1, 1, 1);
        GL_BlendFunc(GL_ONE, GL_ZERO);
@@ -558,6 +562,8 @@ void R_Sky_Init(void)
 {
        Cmd_AddCommand ("loadsky", &LoadSky_f);
        Cvar_RegisterVariable (&r_sky);
+       Cvar_RegisterVariable (&r_skyscroll1);
+       Cvar_RegisterVariable (&r_skyscroll2);
        R_ResetSkyBox();
        R_ResetQuakeSky();
        R_RegisterModule("R_Sky", r_sky_start, r_sky_shutdown, r_sky_newmap);