mod->loaded = false;
}
-void R_Model_Null_Draw(entity_render_t *ent)
+static void R_Model_Null_Draw(entity_render_t *ent)
{
return;
}
typedef void (*mod_framegroupify_parsegroups_t) (unsigned int i, int start, int len, float fps, qboolean loop, const char *name, void *pass);
-int Mod_FrameGroupify_ParseGroups(const char *buf, mod_framegroupify_parsegroups_t cb, void *pass)
+static int Mod_FrameGroupify_ParseGroups(const char *buf, mod_framegroupify_parsegroups_t cb, void *pass)
{
const char *bufptr;
- const char *name;
int start, len;
float fps;
unsigned int i;
qboolean loop;
+ char name[64];
bufptr = buf;
i = 0;
- for(;;)
+ while(bufptr)
{
// an anim scene!
- if (!COM_ParseToken_Simple(&bufptr, true, false, false))
- break;
+
+ // REQUIRED: fetch start
+ COM_ParseToken_Simple(&bufptr, true, false, true);
+ if (!bufptr)
+ break; // end of file
if (!strcmp(com_token, "\n"))
continue; // empty line
start = atoi(com_token);
- if (!COM_ParseToken_Simple(&bufptr, true, false, false))
- break;
- if (!strcmp(com_token, "\n"))
+
+ // REQUIRED: fetch length
+ COM_ParseToken_Simple(&bufptr, true, false, true);
+ if (!bufptr || !strcmp(com_token, "\n"))
{
Con_Printf("framegroups file: missing number of frames\n");
continue;
}
len = atoi(com_token);
- if (!COM_ParseToken_Simple(&bufptr, true, false, false))
- break;
- // we default to looping as it's usually wanted, so to NOT loop you append a 0
- if (strcmp(com_token, "\n") && strcmp(com_token, "//"))
+
+ // OPTIONAL args start
+ COM_ParseToken_Simple(&bufptr, true, false, true);
+
+ // OPTIONAL: fetch fps
+ fps = 20;
+ if (bufptr && strcmp(com_token, "\n"))
{
fps = atof(com_token);
- if (!COM_ParseToken_Simple(&bufptr, true, false, false))
- break;
- if (strcmp(com_token, "\n") && strcmp(com_token, "//"))
- loop = atoi(com_token) != 0;
- else
- loop = true;
+ COM_ParseToken_Simple(&bufptr, true, false, true);
}
- else
+
+ // OPTIONAL: fetch loopflag
+ loop = true;
+ if (bufptr && strcmp(com_token, "\n"))
{
- fps = 20;
- loop = true;
+ loop = (atoi(com_token) != 0);
+ COM_ParseToken_Simple(&bufptr, true, false, true);
}
- name = NULL;
- if(!strcmp(com_token, "//"))
+ // OPTIONAL: fetch name
+ name[0] = 0;
+ if (bufptr && strcmp(com_token, "\n"))
{
- if (COM_ParseToken_Simple(&bufptr, true, false, false))
- {
- if(strcmp(com_token, "\n"))
- {
- name = com_token;
- // skip to EOL
- while (*bufptr && !(*bufptr == '\n' || *bufptr == '\r'))
- bufptr++;
- while (*bufptr && (*bufptr == '\n' || *bufptr == '\r'))
- bufptr++;
- }
- }
+ strlcpy(name, com_token, sizeof(name));
+ COM_ParseToken_Simple(&bufptr, true, false, true);
}
- Con_Printf("data: %d %d %d %f %d (%s)\n", i, start, len, fps, loop, name);
+
+ // OPTIONAL: remaining unsupported tokens (eat them)
+ while (bufptr && strcmp(com_token, "\n"))
+ COM_ParseToken_Simple(&bufptr, true, false, true);
+
+ //Con_Printf("data: %d %d %d %f %d (%s)\n", i, start, len, fps, loop, name);
if(cb)
- cb(i, start, len, fps, loop, name, pass);
+ cb(i, start, len, fps, loop, (name[0] ? name : NULL), pass);
++i;
}
//Con_Printf("frame group %d is %d %d %f %d\n", i, start, len, fps, loop);
}
-void Mod_FrameGroupify(dp_model_t *mod, const char *buf)
+static void Mod_FrameGroupify(dp_model_t *mod, const char *buf)
{
unsigned int cnt;
Mod_FrameGroupify_ParseGroups(buf, Mod_FrameGroupify_ParseGroups_Store, mod);
}
-void Mod_FindPotentialDeforms(dp_model_t *mod)
+static void Mod_FindPotentialDeforms(dp_model_t *mod)
{
int i, j;
texture_t *texture;
unsigned int crc;
void *buf;
fs_offset_t filesize = 0;
+ char vabuf[1024];
mod->used = true;
// errors can prevent the corresponding mod->loaded = true;
mod->loaded = false;
+ // default lightmap scale
+ mod->lightmapscale = 1;
+
// default model radius and bounding box (mainly for missing models)
mod->radius = 16;
VectorSet(mod->normalmins, -mod->radius, -mod->radius, -mod->radius);
Mem_Free(buf);
Mod_FindPotentialDeforms(mod);
-
- buf = FS_LoadFile (va("%s.framegroups", mod->name), tempmempool, false, &filesize);
+
+ buf = FS_LoadFile(va(vabuf, sizeof(vabuf), "%s.framegroups", mod->name), tempmempool, false, &filesize);
if(buf)
{
Mod_FrameGroupify(mod, (const char *)buf);
VectorNormalize(vectorNormal);
}
-void Mod_BuildBumpVectors(const float *v0, const float *v1, const float *v2, const float *tc0, const float *tc1, const float *tc2, float *svector3f, float *tvector3f, float *normal3f)
+#if 0
+static void Mod_BuildBumpVectors(const float *v0, const float *v1, const float *v2, const float *tc0, const float *tc1, const float *tc2, float *svector3f, float *tvector3f, float *normal3f)
{
float f, tangentcross[3], v10[3], v20[3], tc10[2], tc20[2];
// 79 add/sub/negate/multiply (1 cycle), 1 compare (3 cycle?), total cycles not counting load/store/exchange roughly 82 cycles
VectorNegate(tvector3f, tvector3f);
}
}
+#endif
// warning: this is a very expensive function!
void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qboolean areaweighting)
mod->brush.collisionmesh = Mod_ShadowMesh_Finish(mempool, mod->brush.collisionmesh, false, false, false);
}
-void Mod_GetTerrainVertex3fTexCoord2fFromBGRA(const unsigned char *imagepixels, int imagewidth, int imageheight, int ix, int iy, float *vertex3f, float *texcoord2f, matrix4x4_t *pixelstepmatrix, matrix4x4_t *pixeltexturestepmatrix)
+#if 0
+static void Mod_GetTerrainVertex3fTexCoord2fFromBGRA(const unsigned char *imagepixels, int imagewidth, int imageheight, int ix, int iy, float *vertex3f, float *texcoord2f, matrix4x4_t *pixelstepmatrix, matrix4x4_t *pixeltexturestepmatrix)
{
float v[3], tc[3];
v[0] = ix;
texcoord2f[1] = tc[1];
}
-void Mod_GetTerrainVertexFromBGRA(const unsigned char *imagepixels, int imagewidth, int imageheight, int ix, int iy, float *vertex3f, float *svector3f, float *tvector3f, float *normal3f, float *texcoord2f, matrix4x4_t *pixelstepmatrix, matrix4x4_t *pixeltexturestepmatrix)
+static void Mod_GetTerrainVertexFromBGRA(const unsigned char *imagepixels, int imagewidth, int imageheight, int ix, int iy, float *vertex3f, float *svector3f, float *tvector3f, float *normal3f, float *texcoord2f, matrix4x4_t *pixelstepmatrix, matrix4x4_t *pixeltexturestepmatrix)
{
float vup[3], vdown[3], vleft[3], vright[3];
float tcup[3], tcdown[3], tcleft[3], tcright[3];
VectorAdd(normal3f, nl, normal3f);
}
-void Mod_ConstructTerrainPatchFromBGRA(const unsigned char *imagepixels, int imagewidth, int imageheight, int x1, int y1, int width, int height, int *element3i, int *neighbor3i, float *vertex3f, float *svector3f, float *tvector3f, float *normal3f, float *texcoord2f, matrix4x4_t *pixelstepmatrix, matrix4x4_t *pixeltexturestepmatrix)
+static void Mod_ConstructTerrainPatchFromBGRA(const unsigned char *imagepixels, int imagewidth, int imageheight, int x1, int y1, int width, int height, int *element3i, int *neighbor3i, float *vertex3f, float *svector3f, float *tvector3f, float *normal3f, float *texcoord2f, matrix4x4_t *pixelstepmatrix, matrix4x4_t *pixeltexturestepmatrix)
{
int x, y, ix, iy, *e;
e = element3i;
for (x = 0, ix = x1;x < width + 1;x++, ix++, vertex3f += 3, texcoord2f += 2, svector3f += 3, tvector3f += 3, normal3f += 3)
Mod_GetTerrainVertexFromBGRA(imagepixels, imagewidth, imageheight, ix, iy, vertex3f, texcoord2f, svector3f, tvector3f, normal3f, pixelstepmatrix, pixeltexturestepmatrix);
}
+#endif
#if 0
void Mod_Terrain_SurfaceRecurseChunk(dp_model_t *model, int stepsize, int x, int y)
}
#endif
-int Mod_LoadQ3Shaders_EnumerateWaveFunc(const char *s)
+static int Mod_LoadQ3Shaders_EnumerateWaveFunc(const char *s)
{
int offset = 0;
if (!strncasecmp(s, "user", 4)) // parse stuff like "user1sin", always user<n>func
int numparameters;
char parameter[TEXTURE_MAXFRAMES + 4][Q3PATHLENGTH];
char *custsurfaceparmnames[256]; // VorteX: q3map2 has 64 but well, someone will need more
- unsigned long custsurfaceparms[256];
- int numcustsurfaceparms;
+ unsigned long custsurfaceflags[256];
+ int numcustsurfaceflags;
qboolean dpshaderkill;
Mod_FreeQ3Shaders();
q3shaders_mem, sizeof (char**), 256);
// parse custinfoparms.txt
- numcustsurfaceparms = 0;
+ numcustsurfaceflags = 0;
if ((text = f = (char *)FS_LoadFile("scripts/custinfoparms.txt", tempmempool, false, NULL)) != NULL)
{
if (!COM_ParseToken_QuakeC(&text, false) || strcasecmp(com_token, "{"))
if (!strcasecmp(com_token, "}"))
break;
// register surfaceflag
- if (numcustsurfaceparms >= 256)
+ if (numcustsurfaceflags >= 256)
{
Con_Printf("scripts/custinfoparms.txt: surfaceflags section parsing error - max 256 surfaceflags exceeded\n");
break;
}
// name
j = strlen(com_token)+1;
- custsurfaceparmnames[numcustsurfaceparms] = (char *)Mem_Alloc(tempmempool, j);
- strlcpy(custsurfaceparmnames[numcustsurfaceparms], com_token, j+1);
+ custsurfaceparmnames[numcustsurfaceflags] = (char *)Mem_Alloc(tempmempool, j);
+ strlcpy(custsurfaceparmnames[numcustsurfaceflags], com_token, j+1);
// value
if (COM_ParseToken_QuakeC(&text, false))
- custsurfaceparms[numcustsurfaceparms] = strtol(com_token, NULL, 0);
+ custsurfaceflags[numcustsurfaceflags] = strtol(com_token, NULL, 0);
else
- custsurfaceparms[numcustsurfaceparms] = 0;
- numcustsurfaceparms++;
+ custsurfaceflags[numcustsurfaceflags] = 0;
+ numcustsurfaceflags++;
}
}
}
shader.surfaceparms |= Q3SURFACEPARM_POINTLIGHT;
else if (!strcasecmp(parameter[1], "antiportal"))
shader.surfaceparms |= Q3SURFACEPARM_ANTIPORTAL;
+ else if (!strcasecmp(parameter[1], "skip"))
+ ; // shader.surfaceparms |= Q3SURFACEPARM_SKIP; FIXME we don't have enough #defines for this any more, and the engine doesn't need this one anyway
else
{
// try custom surfaceparms
- for (j = 0; j < numcustsurfaceparms; j++)
+ for (j = 0; j < numcustsurfaceflags; j++)
{
if (!strcasecmp(custsurfaceparmnames[j], parameter[1]))
{
- shader.surfaceparms |= custsurfaceparms[j];
+ shader.surfaceflags |= custsurfaceflags[j];
break;
}
}
// failed all
- if (j == numcustsurfaceparms)
+ if (j == numcustsurfaceflags)
Con_DPrintf("%s parsing warning: unknown surfaceparm \"%s\"\n", search->filenames[fileindex], parameter[1]);
}
}
}
FS_FreeSearch(search);
// free custinfoparm values
- for (j = 0; j < numcustsurfaceparms; j++)
+ for (j = 0; j < numcustsurfaceflags; j++)
Mem_Free(custsurfaceparmnames[j]);
}
{
if (developer_loading.integer)
Con_Printf("%s: loaded shader for %s\n", loadmodel->name, name);
- texture->surfaceparms = shader->surfaceparms;
// allow disabling of picmip or compression by defaulttexflags
texture->textureflags = (shader->textureflags & texflagsmask) | texflagsor;
texture->basematerialflags |= MATERIALFLAG_NOSHADOW;
if (shader->dpnortlight)
texture->basematerialflags |= MATERIALFLAG_NORTLIGHT;
+ if (shader->vertexalpha)
+ texture->basematerialflags |= MATERIALFLAG_ALPHAGEN_VERTEX;
memcpy(texture->deforms, shader->deforms, sizeof(texture->deforms));
texture->reflectmin = shader->reflectmin;
texture->reflectmax = shader->reflectmax;
// if (shader->surfaceparms & Q3SURFACEPARM_LIGHTGRID ) texture->supercontents |= SUPERCONTENTS_LIGHTGRID ;
// if (shader->surfaceparms & Q3SURFACEPARM_ANTIPORTAL ) texture->supercontents |= SUPERCONTENTS_ANTIPORTAL ;
+ texture->surfaceflags = shader->surfaceflags;
+ if (shader->surfaceparms & Q3SURFACEPARM_ALPHASHADOW ) texture->surfaceflags |= Q3SURFACEFLAG_ALPHASHADOW ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_AREAPORTAL ) texture->surfaceflags |= Q3SURFACEFLAG_AREAPORTAL ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_CLUSTERPORTAL) texture->surfaceflags |= Q3SURFACEFLAG_CLUSTERPORTAL;
+ // if (shader->surfaceparms & Q3SURFACEPARM_DETAIL ) texture->surfaceflags |= Q3SURFACEFLAG_DETAIL ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_DONOTENTER ) texture->surfaceflags |= Q3SURFACEFLAG_DONOTENTER ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_FOG ) texture->surfaceflags |= Q3SURFACEFLAG_FOG ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_LAVA ) texture->surfaceflags |= Q3SURFACEFLAG_LAVA ;
+ if (shader->surfaceparms & Q3SURFACEPARM_LIGHTFILTER ) texture->surfaceflags |= Q3SURFACEFLAG_LIGHTFILTER ;
+ if (shader->surfaceparms & Q3SURFACEPARM_METALSTEPS ) texture->surfaceflags |= Q3SURFACEFLAG_METALSTEPS ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NODAMAGE ) texture->surfaceflags |= Q3SURFACEFLAG_NODAMAGE ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NODLIGHT ) texture->surfaceflags |= Q3SURFACEFLAG_NODLIGHT ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NODRAW ) texture->surfaceflags |= Q3SURFACEFLAG_NODRAW ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_NODROP ) texture->surfaceflags |= Q3SURFACEFLAG_NODROP ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NOIMPACT ) texture->surfaceflags |= Q3SURFACEFLAG_NOIMPACT ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NOLIGHTMAP ) texture->surfaceflags |= Q3SURFACEFLAG_NOLIGHTMAP ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NOMARKS ) texture->surfaceflags |= Q3SURFACEFLAG_NOMARKS ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_NOMIPMAPS ) texture->surfaceflags |= Q3SURFACEFLAG_NOMIPMAPS ;
+ if (shader->surfaceparms & Q3SURFACEPARM_NONSOLID ) texture->surfaceflags |= Q3SURFACEFLAG_NONSOLID ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_ORIGIN ) texture->surfaceflags |= Q3SURFACEFLAG_ORIGIN ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_PLAYERCLIP ) texture->surfaceflags |= Q3SURFACEFLAG_PLAYERCLIP ;
+ if (shader->surfaceparms & Q3SURFACEPARM_SKY ) texture->surfaceflags |= Q3SURFACEFLAG_SKY ;
+ if (shader->surfaceparms & Q3SURFACEPARM_SLICK ) texture->surfaceflags |= Q3SURFACEFLAG_SLICK ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_SLIME ) texture->surfaceflags |= Q3SURFACEFLAG_SLIME ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_STRUCTURAL ) texture->surfaceflags |= Q3SURFACEFLAG_STRUCTURAL ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_TRANS ) texture->surfaceflags |= Q3SURFACEFLAG_TRANS ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_WATER ) texture->surfaceflags |= Q3SURFACEFLAG_WATER ;
+ if (shader->surfaceparms & Q3SURFACEPARM_POINTLIGHT ) texture->surfaceflags |= Q3SURFACEFLAG_POINTLIGHT ;
+ if (shader->surfaceparms & Q3SURFACEPARM_HINT ) texture->surfaceflags |= Q3SURFACEFLAG_HINT ;
+ if (shader->surfaceparms & Q3SURFACEPARM_DUST ) texture->surfaceflags |= Q3SURFACEFLAG_DUST ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_BOTCLIP ) texture->surfaceflags |= Q3SURFACEFLAG_BOTCLIP ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_LIGHTGRID ) texture->surfaceflags |= Q3SURFACEFLAG_LIGHTGRID ;
+ // if (shader->surfaceparms & Q3SURFACEPARM_ANTIPORTAL ) texture->surfaceflags |= Q3SURFACEFLAG_ANTIPORTAL ;
+
if (shader->dpmeshcollisions)
texture->basematerialflags |= MATERIALFLAG_MESHCOLLISIONS;
if (shader->dpshaderkill && developer_extra.integer)
{
if (developer_extra.integer)
Con_DPrintf("^1%s:^7 using fallback noshader material for ^3\"%s\"\n", loadmodel->name, name);
- texture->surfaceparms = 0;
texture->supercontents = SUPERCONTENTS_SOLID | SUPERCONTENTS_OPAQUE;
}
else if (!strcmp(texture->name, "common/nodraw") || !strcmp(texture->name, "textures/common/nodraw"))
{
if (developer_extra.integer)
Con_DPrintf("^1%s:^7 using fallback nodraw material for ^3\"%s\"\n", loadmodel->name, name);
- texture->surfaceparms = 0;
texture->basematerialflags = MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;
texture->supercontents = SUPERCONTENTS_SOLID;
}
{
if (developer_extra.integer)
Con_DPrintf("^1%s:^7 No shader found for texture ^3\"%s\"\n", loadmodel->name, texture->name);
- texture->surfaceparms = 0;
if (texture->surfaceflags & Q3SURFACEFLAG_NODRAW)
{
texture->basematerialflags |= MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW;
skinfile_t *skinfile = NULL, *first = NULL;
skinfileitem_t *skinfileitem;
char word[10][MAX_QPATH];
+ char vabuf[1024];
/*
sample file:
tag_torso,
*/
memset(word, 0, sizeof(word));
- for (i = 0;i < 256 && (data = text = (char *)FS_LoadFile(va("%s_%i.skin", loadmodel->name, i), tempmempool, true, NULL));i++)
+ for (i = 0;i < 256 && (data = text = (char *)FS_LoadFile(va(vabuf, sizeof(vabuf), "%s_%i.skin", loadmodel->name, i), tempmempool, true, NULL));i++)
{
// If it's the first file we parse
if (skinfile == NULL)
int zymtextsize = 0;
int dpmtextsize = 0;
int framegroupstextsize = 0;
+ char vabuf[1024];
if (Cmd_Argc() != 2)
{
}
}
if (zymtextsize)
- FS_WriteFile(va("%s_decompiled/out_zym.txt", basename), zymtextbuffer, (fs_offset_t)zymtextsize);
+ FS_WriteFile(va(vabuf, sizeof(vabuf), "%s_decompiled/out_zym.txt", basename), zymtextbuffer, (fs_offset_t)zymtextsize);
if (dpmtextsize)
- FS_WriteFile(va("%s_decompiled/out_dpm.txt", basename), dpmtextbuffer, (fs_offset_t)dpmtextsize);
+ FS_WriteFile(va(vabuf, sizeof(vabuf), "%s_decompiled/out_dpm.txt", basename), dpmtextbuffer, (fs_offset_t)dpmtextsize);
if (framegroupstextsize)
- FS_WriteFile(va("%s_decompiled.framegroups", basename), framegroupstextbuffer, (fs_offset_t)framegroupstextsize);
+ FS_WriteFile(va(vabuf, sizeof(vabuf), "%s_decompiled.framegroups", basename), framegroupstextbuffer, (fs_offset_t)framegroupstextsize);
}
}
static int mod_generatelightmaps_numlights;
static lightmaplight_t *mod_generatelightmaps_lightinfo;
-extern int R_Shadow_GetRTLightInfo(unsigned int lightindex, float *origin, float *radius, float *color);
extern cvar_t r_shadow_lightattenuationdividebias;
extern cvar_t r_shadow_lightattenuationlinearscale;
unsigned char *lightmappixels;
unsigned char *deluxemappixels;
mod_alloclightmap_state_t lmstate;
+ char vabuf[1024];
// generate lightmap projection information for all triangles
if (model->texturepool == NULL)
for (lightmapindex = 0;lightmapindex < model->brushq3.num_mergedlightmaps;lightmapindex++)
{
- model->brushq3.data_lightmaps[lightmapindex] = R_LoadTexture2D(model->texturepool, va("lightmap%i", lightmapindex), lm_texturesize, lm_texturesize, lightmappixels + lightmapindex * lm_texturesize * lm_texturesize * 4, TEXTYPE_BGRA, TEXF_FORCELINEAR, -1, NULL);
- model->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(model->texturepool, va("deluxemap%i", lightmapindex), lm_texturesize, lm_texturesize, deluxemappixels + lightmapindex * lm_texturesize * lm_texturesize * 4, TEXTYPE_BGRA, TEXF_FORCELINEAR, -1, NULL);
+ model->brushq3.data_lightmaps[lightmapindex] = R_LoadTexture2D(model->texturepool, va(vabuf, sizeof(vabuf), "lightmap%i", lightmapindex), lm_texturesize, lm_texturesize, lightmappixels + lightmapindex * lm_texturesize * lm_texturesize * 4, TEXTYPE_BGRA, TEXF_FORCELINEAR, -1, NULL);
+ model->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(model->texturepool, va(vabuf, sizeof(vabuf), "deluxemap%i", lightmapindex), lm_texturesize, lm_texturesize, deluxemappixels + lightmapindex * lm_texturesize * lm_texturesize * 4, TEXTYPE_BGRA, TEXF_FORCELINEAR, -1, NULL);
}
if (lightmappixels)