]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_warp.c
added back r_speeds2, with masses of information (6 lines high), and made it print...
[xonotic/darkplaces.git] / gl_warp.c
index 812b82a6bbfe9a01e3df1c9f53e6b1461f015403..8f35afba4df63e3d9f474ebd6483537d2fca09ac 100644 (file)
--- a/gl_warp.c
+++ b/gl_warp.c
@@ -120,7 +120,7 @@ void SubdividePolygon (int numverts, float *verts)
                return;
        }
 
-       poly = Hunk_Alloc (sizeof(glpoly_t) + (numverts-4) * VERTEXSIZE*sizeof(float));
+       poly = Hunk_AllocName (sizeof(glpoly_t) + (numverts-4) * VERTEXSIZE*sizeof(float), "surfaces");
        poly->next = warpface->polys;
        warpface->polys = poly;
        poly->numverts = numverts;
@@ -176,17 +176,12 @@ void GL_SubdivideSurface (msurface_t *fa)
 
 
 
-extern qboolean lighthalf;
-
 int skyboxside[6];
 
 char skyname[256];
 
 // LordHavoc: moved LoadTGA and LoadPCX to gl_draw.c
 
-extern int image_width, image_height;
-
-byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int matchheight);
 /*
 ==================
 R_LoadSkyBox
@@ -196,9 +191,14 @@ char       *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
 void R_LoadSkyBox (void)
 {
        int             i;
-       char    name[64];
+       char    name[1024];
        byte*   image_rgba;
 
+       if (strlen(skyname) >= 1000)
+       {
+               Con_Printf ("sky name too long (%i, max is 1000)\n", strlen(skyname));
+               return;
+       }
        for (i=0 ; i<6 ; i++)
        {
                sprintf (name, "env/%s%s", skyname, suf[i]);
@@ -212,7 +212,7 @@ void R_LoadSkyBox (void)
                        }
                }
                skyboxside[i] = GL_LoadTexture(va("skyboxside%d", i), image_width, image_height, image_rgba, false, false, 4);
-               free (image_rgba);
+               qfree(image_rgba);
        }
 }
 
@@ -391,12 +391,12 @@ void R_SkyDome()
                skydomecalc(skydomeouter, 1024, 1024, 256);
                skydomecalc(skydomeinner, 512, 512, 128);
        }
-       speedscale = realtime*8.0/256.0;
+       speedscale = cl.time*8.0/256.0;
        speedscale -= (int)speedscale;
        skydome(skydomeouter, speedscale, 1.0 / 256.0);
        glEnable (GL_BLEND);
        glBindTexture(GL_TEXTURE_2D, alphaskytexture); // lower clouds
-       speedscale = realtime*8.0/128.0;
+       speedscale = cl.time*8.0/128.0;
        speedscale -= (int)speedscale;
        skydome(skydomeinner, speedscale, 1.0 / 128.0);
        glDisable (GL_BLEND);
@@ -405,6 +405,8 @@ void R_SkyDome()
 
 void R_Sky()
 {
+       if (!r_render.value)
+               return;
        if (!skyname[0])
                return;
        glDisable(GL_DEPTH_TEST);