From: lordhavoc Date: Sun, 4 Mar 2001 22:30:07 +0000 (+0000) Subject: now supports upto 256x256 texel lightmaps (rather than 17x17), as_tundra.bsp works now X-Git-Tag: RELEASE_0_2_0_RC1~848 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=c7628588d23a976f14719cb26d9fd1c9cfa9a52d now supports upto 256x256 texel lightmaps (rather than 17x17), as_tundra.bsp works now git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@179 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index ba5e89d8..7276632e 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -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; } diff --git a/model_brush.c b/model_brush.c index a9860d91..86d565a2 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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"); } }