]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
now supports upto 256x256 texel lightmaps (rather than 17x17), as_tundra.bsp works now
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Mar 2001 22:30:07 +0000 (22:30 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Mar 2001 22:30:07 +0000 (22:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@179 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c
model_brush.c

index ba5e89d8b1ac25d54e5849d730476c3e276f62ab..7276632e7a43564f1ce9e26fec8dc85b827c8a69 100644 (file)
@@ -23,11 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 int            lightmap_textures;
 
-signed int blocklights[18*18*3]; // LordHavoc: *3 for colored lighting
-
 // LordHavoc: skinny but tall lightmaps for quicker subimage uploads
-#define        BLOCK_WIDTH             128
-#define        BLOCK_HEIGHT    128
+#define        BLOCK_WIDTH             256
+#define        BLOCK_HEIGHT    256
 // LordHavoc: increased lightmap limit from 64 to 1024
 #define        MAX_LIGHTMAPS   1024
 #define LIGHTMAPSIZE   (BLOCK_WIDTH*BLOCK_HEIGHT*4)
@@ -39,6 +37,8 @@ short allocated[MAX_LIGHTMAPS][BLOCK_WIDTH];
 byte *lightmaps[MAX_LIGHTMAPS];
 short lightmapupdate[MAX_LIGHTMAPS][2];
 
+signed int blocklights[BLOCK_WIDTH*BLOCK_HEIGHT*3]; // LordHavoc: *3 for colored lighting
+
 int lightmapalign, lightmapalignmask; // LordHavoc: NVIDIA's broken subimage fix, see BuildLightmaps for notes
 cvar_t gl_lightmapalign = {"gl_lightmapalign", "4"};
 cvar_t gl_lightmaprgba = {"gl_lightmaprgba", "1"};
@@ -328,7 +328,7 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
        }
 }
 
-byte templight[32*32*4];
+byte templight[BLOCK_WIDTH*BLOCK_HEIGHT*4];
 
 void R_UpdateLightmap(msurface_t *s, int lnum)
 {
@@ -1324,7 +1324,7 @@ int AllocBlock (int w, int h, short *x, short *y)
                // LordHavoc: clear texture to blank image, fragments are uploaded using subimage
                else if (!allocated[texnum][0])
                {
-                       byte blank[BLOCK_WIDTH*BLOCK_HEIGHT*3];
+                       byte blank[BLOCK_WIDTH*BLOCK_HEIGHT*4];
                        memset(blank, 0, sizeof(blank));
                        if(r_upload.value)
                        {
@@ -1344,7 +1344,7 @@ int AllocBlock (int w, int h, short *x, short *y)
                return texnum;
        }
 
-       Sys_Error ("AllocBlock: full");
+       Host_Error ("AllocBlock: full, unable to find room for %i by %i lightmap", w, h);
        return 0;
 }
 
index a9860d916fecbd121554614124afcd34af5eeef4..86d565a24653ac3bf030e3d89b90124f02d9f762 100644 (file)
@@ -696,7 +696,8 @@ void CalcSurfaceExtents (msurface_t *s)
 
                s->texturemins[i] = bmins[i] * 16;
                s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
-               if ( !(tex->flags & TEX_SPECIAL) && s->extents[i] > 512 /* 256 */ )
+//             if ( !(tex->flags & TEX_SPECIAL) && s->extents[i] > 512)
+               if ((tex->flags & TEX_SPECIAL) == 0 && (s->extents[i]+1) > (256*16))
                        Host_Error ("Bad surface extents");
        }
 }