refresh: Sync lightmap function names

This commit is contained in:
Denis Pauk 2023-12-20 20:05:05 +02:00
parent a180fd3086
commit bd86f646da
11 changed files with 83 additions and 83 deletions

View file

@ -233,7 +233,7 @@ calcTexinfoAndFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *tl
// R_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ // R_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */
// for each (pot. recursive) call to R_SubdividePolygon(): // for each (pot. recursive) call to R_SubdividePolygon():
// sizeof(mpoly_t) + ((numverts - 4) + 2) * sizeof(gl3_3D_vtx_t) // sizeof(mpoly_t) + ((numverts - 4) + 2) * sizeof(mvtx_t)
// this is tricky, how much is allocated depends on the size of the surface // this is tricky, how much is allocated depends on the size of the surface
// which we don't know (we'd need the vertices etc to know, but we can't load // which we don't know (we'd need the vertices etc to know, but we can't load
@ -309,7 +309,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t
// R_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ // R_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */
// for each (pot. recursive) call to R_SubdividePolygon(): // for each (pot. recursive) call to R_SubdividePolygon():
// sizeof(mpoly_t) + ((numverts - 4) + 2) * sizeof(gl3_3D_vtx_t) // sizeof(mpoly_t) + ((numverts - 4) + 2) * sizeof(mvtx_t)
// this is tricky, how much is allocated depends on the size of the surface // this is tricky, how much is allocated depends on the size of the surface
// which we don't know (we'd need the vertices etc to know, but we can't load // which we don't know (we'd need the vertices etc to know, but we can't load
@ -804,7 +804,7 @@ Mod_ForName(const char *name, model_t *parent_model, qboolean crash)
strcpy(mod->name, name); strcpy(mod->name, name);
/* load the file */ /* load the file */
modfilelen = Mod_LoadFile (mod->name, &buf); modfilelen = Mod_LoadFile(mod->name, &buf);
if (!buf) if (!buf)
{ {

View file

@ -33,13 +33,13 @@
extern gl3lightmapstate_t gl3_lms; extern gl3lightmapstate_t gl3_lms;
void void
GL3_LM_InitBlock(void) LM_InitBlock(void)
{ {
memset(gl3_lms.allocated, 0, sizeof(gl3_lms.allocated)); memset(gl3_lms.allocated, 0, sizeof(gl3_lms.allocated));
} }
void void
GL3_LM_UploadBlock(void) LM_UploadBlock(void)
{ {
int map; int map;
@ -71,7 +71,7 @@ GL3_LM_UploadBlock(void)
* returns a texture number and the position inside it * returns a texture number and the position inside it
*/ */
qboolean qboolean
GL3_LM_AllocBlock(int w, int h, int *x, int *y) LM_AllocBlock(int w, int h, int *x, int *y)
{ {
int i, j; int i, j;
int best, best2; int best, best2;
@ -117,7 +117,7 @@ GL3_LM_AllocBlock(int w, int h, int *x, int *y)
} }
void void
GL3_LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa) LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa)
{ {
int i, lindex, lnumverts; int i, lindex, lnumverts;
medge_t *pedges, *r_pedge; medge_t *pedges, *r_pedge;
@ -200,7 +200,7 @@ GL3_LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa)
} }
void void
GL3_LM_CreateSurfaceLightmap(msurface_t *surf) LM_CreateSurfaceLightmap(msurface_t *surf)
{ {
int smax, tmax; int smax, tmax;
@ -212,12 +212,12 @@ GL3_LM_CreateSurfaceLightmap(msurface_t *surf)
smax = (surf->extents[0] >> surf->lmshift) + 1; smax = (surf->extents[0] >> surf->lmshift) + 1;
tmax = (surf->extents[1] >> surf->lmshift) + 1; tmax = (surf->extents[1] >> surf->lmshift) + 1;
if (!GL3_LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t)) if (!LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t))
{ {
GL3_LM_UploadBlock(); LM_UploadBlock();
GL3_LM_InitBlock(); LM_InitBlock();
if (!GL3_LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t)) if (!LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t))
{ {
Com_Error(ERR_FATAL, Com_Error(ERR_FATAL,
"%s: Consecutive calls to LM_AllocBlock(%d,%d) failed\n", "%s: Consecutive calls to LM_AllocBlock(%d,%d) failed\n",
@ -231,7 +231,7 @@ GL3_LM_CreateSurfaceLightmap(msurface_t *surf)
} }
void void
GL3_LM_BeginBuildingLightmaps(gl3model_t *m) LM_BeginBuildingLightmaps(gl3model_t *m)
{ {
static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; static lightstyle_t lightstyles[MAX_LIGHTSTYLES];
@ -260,8 +260,8 @@ GL3_LM_BeginBuildingLightmaps(gl3model_t *m)
} }
void void
GL3_LM_EndBuildingLightmaps(void) LM_EndBuildingLightmaps(void)
{ {
GL3_LM_UploadBlock(); LM_UploadBlock();
} }

View file

@ -240,7 +240,7 @@ calcTexinfoAndFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *tl
} }
else else
{ {
// GL3_LM_BuildPolygonFromSurface(out); // LM_BuildPolygonFromSurface(out);
// => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t)); // => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t));
int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t); int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t);
polySize = (polySize + 31) & ~31; polySize = (polySize + 31) & ~31;
@ -316,7 +316,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t
} }
else else
{ {
// GL3_LM_BuildPolygonFromSurface(out); // LM_BuildPolygonFromSurface(out);
// => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t)); // => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t));
int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t); int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t);
polySize = (polySize + 31) & ~31; polySize = (polySize + 31) & ~31;
@ -355,7 +355,7 @@ Mod_LoadFaces(gl3model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;
GL3_LM_BeginBuildingLightmaps(loadmodel); LM_BeginBuildingLightmaps(loadmodel);
for (surfnum = 0; surfnum < count; surfnum++, in++, out++) for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
{ {
@ -430,16 +430,16 @@ Mod_LoadFaces(gl3model_t *loadmodel, const byte *mod_base, const lump_t *l,
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)))
{ {
GL3_LM_CreateSurfaceLightmap(out); LM_CreateSurfaceLightmap(out);
} }
if (!(out->texinfo->flags & SURF_WARP)) if (!(out->texinfo->flags & SURF_WARP))
{ {
GL3_LM_BuildPolygonFromSurface(loadmodel, out); LM_BuildPolygonFromSurface(loadmodel, out);
} }
} }
GL3_LM_EndBuildingLightmaps(); LM_EndBuildingLightmaps();
} }
static void static void
@ -464,7 +464,7 @@ Mod_LoadQFaces(gl3model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;
GL3_LM_BeginBuildingLightmaps(loadmodel); LM_BeginBuildingLightmaps(loadmodel);
for (surfnum = 0; surfnum < count; surfnum++, in++, out++) for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
{ {
@ -539,16 +539,16 @@ Mod_LoadQFaces(gl3model_t *loadmodel, const byte *mod_base, const lump_t *l,
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)))
{ {
GL3_LM_CreateSurfaceLightmap(out); LM_CreateSurfaceLightmap(out);
} }
if (!(out->texinfo->flags & SURF_WARP)) if (!(out->texinfo->flags & SURF_WARP))
{ {
GL3_LM_BuildPolygonFromSurface(loadmodel, out); LM_BuildPolygonFromSurface(loadmodel, out);
} }
} }
GL3_LM_EndBuildingLightmaps(); LM_EndBuildingLightmaps();
} }
static void static void
@ -705,7 +705,7 @@ Mod_LoadBrushModel(gl3model_t *mod, const void *buffer, int modfilelen)
* Loads in a model for the given name * Loads in a model for the given name
*/ */
static gl3model_t * static gl3model_t *
Mod_ForName (const char *name, gl3model_t *parent_model, qboolean crash) Mod_ForName(const char *name, gl3model_t *parent_model, qboolean crash)
{ {
gl3model_t *mod; gl3model_t *mod;
void *buf; void *buf;

View file

@ -460,13 +460,13 @@ extern void GL3_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride);
// gl3_lightmap.c // gl3_lightmap.c
#define GL_LIGHTMAP_FORMAT GL_RGBA #define GL_LIGHTMAP_FORMAT GL_RGBA
extern void GL3_LM_InitBlock(void); extern void LM_InitBlock(void);
extern void GL3_LM_UploadBlock(void); extern void LM_UploadBlock(void);
extern qboolean GL3_LM_AllocBlock(int w, int h, int *x, int *y); extern qboolean LM_AllocBlock(int w, int h, int *x, int *y);
extern void GL3_LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa); extern void LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa);
extern void GL3_LM_CreateSurfaceLightmap(msurface_t *surf); extern void LM_CreateSurfaceLightmap(msurface_t *surf);
extern void GL3_LM_BeginBuildingLightmaps(gl3model_t *m); extern void LM_BeginBuildingLightmaps(gl3model_t *m);
extern void GL3_LM_EndBuildingLightmaps(void); extern void LM_EndBuildingLightmaps(void);
// gl3_warp.c // gl3_warp.c
extern void GL3_EmitWaterPolys(msurface_t *fa); extern void GL3_EmitWaterPolys(msurface_t *fa);

View file

@ -33,13 +33,13 @@
extern gl4lightmapstate_t gl4_lms; extern gl4lightmapstate_t gl4_lms;
void void
GL4_LM_InitBlock(void) LM_InitBlock(void)
{ {
memset(gl4_lms.allocated, 0, sizeof(gl4_lms.allocated)); memset(gl4_lms.allocated, 0, sizeof(gl4_lms.allocated));
} }
void void
GL4_LM_UploadBlock(void) LM_UploadBlock(void)
{ {
int map; int map;
@ -71,7 +71,7 @@ GL4_LM_UploadBlock(void)
* returns a texture number and the position inside it * returns a texture number and the position inside it
*/ */
qboolean qboolean
GL4_LM_AllocBlock(int w, int h, int *x, int *y) LM_AllocBlock(int w, int h, int *x, int *y)
{ {
int i, j; int i, j;
int best, best2; int best, best2;
@ -117,7 +117,7 @@ GL4_LM_AllocBlock(int w, int h, int *x, int *y)
} }
void void
GL4_LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa) LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa)
{ {
int i, lindex, lnumverts; int i, lindex, lnumverts;
medge_t *pedges, *r_pedge; medge_t *pedges, *r_pedge;
@ -200,7 +200,7 @@ GL4_LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa)
} }
void void
GL4_LM_CreateSurfaceLightmap(msurface_t *surf) LM_CreateSurfaceLightmap(msurface_t *surf)
{ {
int smax, tmax; int smax, tmax;
@ -212,12 +212,12 @@ GL4_LM_CreateSurfaceLightmap(msurface_t *surf)
smax = (surf->extents[0] >> surf->lmshift) + 1; smax = (surf->extents[0] >> surf->lmshift) + 1;
tmax = (surf->extents[1] >> surf->lmshift) + 1; tmax = (surf->extents[1] >> surf->lmshift) + 1;
if (!GL4_LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t)) if (!LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t))
{ {
GL4_LM_UploadBlock(); LM_UploadBlock();
GL4_LM_InitBlock(); LM_InitBlock();
if (!GL4_LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t)) if (!LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t))
{ {
Com_Error(ERR_FATAL, Com_Error(ERR_FATAL,
"%s: Consecutive calls to LM_AllocBlock(%d,%d) failed\n", "%s: Consecutive calls to LM_AllocBlock(%d,%d) failed\n",
@ -231,7 +231,7 @@ GL4_LM_CreateSurfaceLightmap(msurface_t *surf)
} }
void void
GL4_LM_BeginBuildingLightmaps(gl4model_t *m) LM_BeginBuildingLightmaps(gl4model_t *m)
{ {
static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; static lightstyle_t lightstyles[MAX_LIGHTSTYLES];
@ -260,8 +260,8 @@ GL4_LM_BeginBuildingLightmaps(gl4model_t *m)
} }
void void
GL4_LM_EndBuildingLightmaps(void) LM_EndBuildingLightmaps(void)
{ {
GL4_LM_UploadBlock(); LM_UploadBlock();
} }

View file

@ -238,7 +238,7 @@ calcTexinfoAndFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *tl
} }
else else
{ {
// GL4_LM_BuildPolygonFromSurface(out); // LM_BuildPolygonFromSurface(out);
// => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t)); // => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t));
int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t); int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t);
polySize = (polySize + 31) & ~31; polySize = (polySize + 31) & ~31;
@ -314,7 +314,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t
} }
else else
{ {
// GL3_LM_BuildPolygonFromSurface(out); // LM_BuildPolygonFromSurface(out);
// => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t)); // => poly = Hunk_Alloc(sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t));
int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t); int polySize = sizeof(mpoly_t) + (numverts - 4) * sizeof(mvtx_t);
polySize = (polySize + 31) & ~31; polySize = (polySize + 31) & ~31;
@ -353,7 +353,7 @@ Mod_LoadFaces(gl4model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;
GL4_LM_BeginBuildingLightmaps(loadmodel); LM_BeginBuildingLightmaps(loadmodel);
for (surfnum = 0; surfnum < count; surfnum++, in++, out++) for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
{ {
@ -428,16 +428,16 @@ Mod_LoadFaces(gl4model_t *loadmodel, const byte *mod_base, const lump_t *l,
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)))
{ {
GL4_LM_CreateSurfaceLightmap(out); LM_CreateSurfaceLightmap(out);
} }
if (!(out->texinfo->flags & SURF_WARP)) if (!(out->texinfo->flags & SURF_WARP))
{ {
GL4_LM_BuildPolygonFromSurface(loadmodel, out); LM_BuildPolygonFromSurface(loadmodel, out);
} }
} }
GL4_LM_EndBuildingLightmaps(); LM_EndBuildingLightmaps();
} }
static void static void
@ -462,7 +462,7 @@ Mod_LoadQFaces(gl4model_t *loadmodel, const byte *mod_base, const lump_t *l,
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;
GL4_LM_BeginBuildingLightmaps(loadmodel); LM_BeginBuildingLightmaps(loadmodel);
for (surfnum = 0; surfnum < count; surfnum++, in++, out++) for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
{ {
@ -537,16 +537,16 @@ Mod_LoadQFaces(gl4model_t *loadmodel, const byte *mod_base, const lump_t *l,
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)))
{ {
GL4_LM_CreateSurfaceLightmap(out); LM_CreateSurfaceLightmap(out);
} }
if (!(out->texinfo->flags & SURF_WARP)) if (!(out->texinfo->flags & SURF_WARP))
{ {
GL4_LM_BuildPolygonFromSurface(loadmodel, out); LM_BuildPolygonFromSurface(loadmodel, out);
} }
} }
GL4_LM_EndBuildingLightmaps(); LM_EndBuildingLightmaps();
} }
static void static void

View file

@ -460,13 +460,13 @@ extern void GL4_BuildLightMap(msurface_t *surf, int offsetInLMbuf, int stride);
// gl4_lightmap.c // gl4_lightmap.c
#define GL_LIGHTMAP_FORMAT GL_RGBA #define GL_LIGHTMAP_FORMAT GL_RGBA
extern void GL4_LM_InitBlock(void); extern void LM_InitBlock(void);
extern void GL4_LM_UploadBlock(void); extern void LM_UploadBlock(void);
extern qboolean GL4_LM_AllocBlock(int w, int h, int *x, int *y); extern qboolean LM_AllocBlock(int w, int h, int *x, int *y);
extern void GL4_LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa); extern void LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa);
extern void GL4_LM_CreateSurfaceLightmap(msurface_t *surf); extern void LM_CreateSurfaceLightmap(msurface_t *surf);
extern void GL4_LM_BeginBuildingLightmaps(gl4model_t *m); extern void LM_BeginBuildingLightmaps(gl4model_t *m);
extern void GL4_LM_EndBuildingLightmaps(void); extern void LM_EndBuildingLightmaps(void);
// gl4_warp.c // gl4_warp.c
extern void GL4_EmitWaterPolys(msurface_t *fa); extern void GL4_EmitWaterPolys(msurface_t *fa);

View file

@ -201,7 +201,7 @@ Mod_LoadFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
} }
count = l->filelen / sizeof(*in); count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count + EXTRA_LUMP_FACES) * sizeof(*out)); // extra for skybox out = Hunk_Alloc((count + EXTRA_LUMP_FACES) * sizeof(*out));
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;
@ -310,7 +310,7 @@ Mod_LoadQFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
} }
count = l->filelen / sizeof(*in); count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count + EXTRA_LUMP_FACES) * sizeof(*out)); // extra for skybox out = Hunk_Alloc((count + EXTRA_LUMP_FACES) * sizeof(*out));
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;
@ -623,7 +623,7 @@ Mod_ForName(const char *name, model_t *parent_model, qboolean crash)
strcpy(mod->name, name); strcpy(mod->name, name);
/* load the file */ /* load the file */
modfilelen = Mod_LoadFile (mod->name, &buf); modfilelen = Mod_LoadFile(mod->name, &buf);
if (!buf) if (!buf)
{ {

View file

@ -226,10 +226,10 @@ void Vk_TextureMode( char *string );
void Vk_LmapTextureMode( char *string ); void Vk_LmapTextureMode( char *string );
void Vk_ImageList_f (void); void Vk_ImageList_f (void);
void Vk_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa); void LM_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa);
void Vk_CreateSurfaceLightmap (msurface_t *surf); void LM_CreateSurfaceLightmap (msurface_t *surf);
void Vk_EndBuildingLightmaps (void); void LM_EndBuildingLightmaps (void);
void Vk_BeginBuildingLightmaps (model_t *m); void LM_BeginBuildingLightmaps (model_t *m);
void Vk_InitImages (void); void Vk_InitImages (void);
void Vk_ShutdownImages (void); void Vk_ShutdownImages (void);

View file

@ -117,7 +117,7 @@ LM_AllocBlock(int w, int h, int *x, int *y)
} }
void void
Vk_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa) LM_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa)
{ {
int i, lnumverts; int i, lnumverts;
medge_t *pedges, *r_pedge; medge_t *pedges, *r_pedge;
@ -203,7 +203,7 @@ Vk_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa)
} }
void void
Vk_CreateSurfaceLightmap(msurface_t *surf) LM_CreateSurfaceLightmap(msurface_t *surf)
{ {
int smax, tmax; int smax, tmax;
byte *base; byte *base;
@ -241,7 +241,7 @@ Vk_CreateSurfaceLightmap(msurface_t *surf)
} }
void void
Vk_BeginBuildingLightmaps(model_t *m) LM_BeginBuildingLightmaps(model_t *m)
{ {
static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; static lightstyle_t lightstyles[MAX_LIGHTSTYLES];
int i; int i;
@ -294,7 +294,7 @@ Vk_BeginBuildingLightmaps(model_t *m)
} }
void void
Vk_EndBuildingLightmaps(void) LM_EndBuildingLightmaps(void)
{ {
LM_UploadBlock(); LM_UploadBlock();
} }

View file

@ -279,7 +279,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t
// R_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ // R_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */
// for each (pot. recursive) call to R_SubdividePolygon(): // for each (pot. recursive) call to R_SubdividePolygon():
// sizeof(mpoly_t) + ((numverts - 4) + 2) * sizeof(gl3_3D_vtx_t) // sizeof(mpoly_t) + ((numverts - 4) + 2) * sizeof(mvtx_t)
// this is tricky, how much is allocated depends on the size of the surface // this is tricky, how much is allocated depends on the size of the surface
// which we don't know (we'd need the vertices etc to know, but we can't load // which we don't know (we'd need the vertices etc to know, but we can't load
@ -337,7 +337,7 @@ Mod_LoadFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
lminfos = NULL; lminfos = NULL;
} }
Vk_BeginBuildingLightmaps(loadmodel); LM_BeginBuildingLightmaps(loadmodel);
for (surfnum = 0; surfnum < count; surfnum++, in++, out++) for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
{ {
@ -421,16 +421,16 @@ Mod_LoadFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)))
{ {
Vk_CreateSurfaceLightmap(out); LM_CreateSurfaceLightmap(out);
} }
if (!(out->texinfo->flags & SURF_WARP)) if (!(out->texinfo->flags & SURF_WARP))
{ {
Vk_BuildPolygonFromSurface(loadmodel, out); LM_BuildPolygonFromSurface(loadmodel, out);
} }
} }
Vk_EndBuildingLightmaps(); LM_EndBuildingLightmaps();
} }
static void static void
@ -463,7 +463,7 @@ Mod_LoadQFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
lminfos = NULL; lminfos = NULL;
} }
Vk_BeginBuildingLightmaps(loadmodel); LM_BeginBuildingLightmaps(loadmodel);
for (surfnum = 0; surfnum < count; surfnum++, in++, out++) for (surfnum = 0; surfnum < count; surfnum++, in++, out++)
{ {
@ -533,7 +533,7 @@ Mod_LoadQFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
} }
R_SubdivideSurface(loadmodel->surfedges, loadmodel->vertexes, R_SubdivideSurface(loadmodel->surfedges, loadmodel->vertexes,
loadmodel->edges, out); // cut up polygon for warps loadmodel->edges, out); /* cut up polygon for warps */
} }
if (r_fixsurfsky->value) if (r_fixsurfsky->value)
@ -547,16 +547,16 @@ Mod_LoadQFaces(model_t *loadmodel, const byte *mod_base, const lump_t *l,
/* create lightmaps and polygons */ /* create lightmaps and polygons */
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP))) if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANSPARENT | SURF_WARP)))
{ {
Vk_CreateSurfaceLightmap(out); LM_CreateSurfaceLightmap(out);
} }
if (!(out->texinfo->flags & SURF_WARP)) if (!(out->texinfo->flags & SURF_WARP))
{ {
Vk_BuildPolygonFromSurface(loadmodel, out); LM_BuildPolygonFromSurface(loadmodel, out);
} }
} }
Vk_EndBuildingLightmaps(); LM_EndBuildingLightmaps();
} }
static void static void