handle up to 512x512 map textures /properly/. would be nicer if the max

could be dynamic
This commit is contained in:
Bill Currie 2002-08-22 19:00:55 +00:00
parent 27f9b7a1c0
commit c44ec1993d
6 changed files with 9 additions and 8 deletions

View file

@ -464,7 +464,8 @@ 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 */ )
//FIXME even 512 is really too small, need a saner test
if (!(tex->flags & TEX_SPECIAL) && s->extents[i] > 512)
Sys_Error ("Bad surface extents: %x %d", tex->flags,
s->extents[i]);
}

View file

@ -67,7 +67,7 @@ int lightmap_textures;
// LordHavoc: changed to be allocated at runtime (typically lower memory usage)
byte *lightmaps[MAX_LIGHTMAPS];
unsigned int blocklights[18 * 18 * 3];
unsigned int blocklights[34 * 34 * 3]; //FIXME make dynamic
int allocated[MAX_LIGHTMAPS][BLOCK_WIDTH];
glpoly_t *lightmap_modified[MAX_GLTEXTURES];

View file

@ -148,10 +148,10 @@ D_SCAlloc (int width, int size)
surfcache_t *new;
qboolean wrapped_this_time;
if ((width < 0) || (width > 256))
if ((width < 0) || (width > 512)) // FIXME shouldn't really have a max
Sys_Error ("D_SCAlloc: bad cache width %d", width);
if ((size <= 0) || (size > 0x10000))
if ((size <= 0) || (size > 0x40000)) // FIXME ditto
Sys_Error ("D_SCAlloc: bad cache size %d", size);
/* This adds the offset of data[0] in the surfcache_t struct. */

View file

@ -60,7 +60,7 @@ static void (*surfmiptable[4]) (void) = {
R_DrawSurfaceBlock_mip0, R_DrawSurfaceBlock_mip1,
R_DrawSurfaceBlock_mip2, R_DrawSurfaceBlock_mip3};
unsigned int blocklights[18 * 18];
unsigned int blocklights[34 * 34]; //FIXME make dynamic
void

View file

@ -149,10 +149,10 @@ D_SCAlloc (int width, int size)
surfcache_t *new;
qboolean wrapped_this_time;
if ((width < 0) || (width > 256))
if ((width < 0) || (width > 512)) // FIXME shouldn't really have a max
Sys_Error ("D_SCAlloc: bad cache width %d", width);
if ((size <= 0) || (size > (0x10000 * r_pixbytes)))
if ((size <= 0) || (size > (0x40000 * r_pixbytes))) //FIXME ditto
Sys_Error ("D_SCAlloc: bad cache size %d", size);
/* This adds the offset of data[0] in the surfcache_t struct. */

View file

@ -86,7 +86,7 @@ static void (*surfmiptable32[4]) (void) = {
R_DrawSurfaceBlock32_mip3
};
int blocklights[18 * 18];
int blocklights[34 * 34]; //FIXME make dynamic
void