]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
NUM_FOR_EDICT now casts to int so that it never returns a 64bit integer on 64bit...
[xonotic/darkplaces.git] / gl_backend.c
index 2be923d17600b2d3bb3f4e7315d24dc29fdca147..7dd9fefb21ac66d1efe9a48ed046bccfd7cd92c2 100644 (file)
@@ -149,7 +149,7 @@ static void R_Mesh_CacheArray_Shutdown(void);
 void GL_Backend_AllocArrays(void)
 {
        if (!gl_backend_mempool)
-               gl_backend_mempool = Mem_AllocPool("GL_Backend");
+               gl_backend_mempool = Mem_AllocPool("GL_Backend", 0, NULL);
        R_Mesh_CacheArray_Startup();
 }
 
@@ -1257,7 +1257,7 @@ CalcFov
 float CalcFov (float fov_x, float width, float height)
 {
        // calculate vision size and alter by aspect, then convert back to angle
-       return atan (((height/width)/vid_pixelaspect.value)*tan(fov_x/360.*M_PI))*360./M_PI; 
+       return atan (((height/width)/vid_pixelaspect.value)*tan(fov_x/360.0*M_PI))*360.0/M_PI; 
 }
 
 int r_stereo_side;
@@ -1293,7 +1293,7 @@ void SCR_DrawScreen (void)
                        if (r_stereo_sidebyside.integer)
                        {
                                r_refdef.width = vid.realwidth * size / 2.5;
-                               r_refdef.height = vid.realheight * size / 2.5;
+                               r_refdef.height = vid.realheight * size / 2.5 * (1 - bound(0, r_letterbox.value, 100) / 100);
                                r_refdef.x = (vid.realwidth - r_refdef.width * 2.5) * 0.5;
                                r_refdef.y = (vid.realheight - r_refdef.height)/2;
                                if (r_stereo_side)
@@ -1302,7 +1302,7 @@ void SCR_DrawScreen (void)
                        else
                        {
                                r_refdef.width = vid.realwidth * size;
-                               r_refdef.height = vid.realheight * size;
+                               r_refdef.height = vid.realheight * size * (1 - bound(0, r_letterbox.value, 100) / 100);
                                r_refdef.x = (vid.realwidth - r_refdef.width)/2;
                                r_refdef.y = (vid.realheight - r_refdef.height)/2;
                        }
@@ -1363,6 +1363,15 @@ void SCR_UpdateScreen (void)
        if (gl_combine.integer && (!gl_combine_extension || r_textureunits.integer < 2))
                Cvar_SetValueQuick(&gl_combine, 0);
 
+       // don't allow cheats in multiplayer
+       if (!cl.islocalgame && cl.worldmodel)
+       {
+               if (r_fullbright.integer != 0)
+                       Cvar_Set ("r_fullbright", "0");
+               if (r_ambient.value != 0)
+                       Cvar_Set ("r_ambient", "0");
+       }
+
        // bound viewsize
        if (scr_viewsize.value < 30)
                Cvar_Set ("viewsize","30");
@@ -1481,12 +1490,16 @@ void SCR_UpdateScreen (void)
 // dynamic vertex array buffer subsystem
 //===========================================================================
 
+// FIXME: someday this should be dynamically allocated and resized?
 float varray_vertex3f[65536*3];
+float varray_svector3f[65536*3];
+float varray_tvector3f[65536*3];
+float varray_normal3f[65536*3];
 float varray_color4f[65536*4];
 float varray_texcoord2f[4][65536*2];
 float varray_texcoord3f[4][65536*3];
-float varray_normal3f[65536*3];
 int earray_element3i[65536];
+float varray_vertex3f2[65536*3];
 
 //===========================================================================
 // vertex array caching subsystem