mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-25 22:10:59 +00:00
maps: cleanup maptype cvar code
This commit is contained in:
parent
1775874418
commit
97f207e230
11 changed files with 18 additions and 23 deletions
|
@ -562,7 +562,7 @@ Mod_LoadBSPXFindLump(const bspx_header_t *bspx_header, const char *lumpname,
|
|||
}
|
||||
|
||||
const bspx_header_t *
|
||||
Mod_LoadBSPX(int filesize, const byte *mod_base, maptype_t maptype)
|
||||
Mod_LoadBSPX(int filesize, const byte *mod_base)
|
||||
{
|
||||
const bspx_header_t *xheader;
|
||||
const dheader_t *header;
|
||||
|
@ -1016,8 +1016,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t
|
|||
}
|
||||
|
||||
int
|
||||
Mod_CalcNonModelLumpHunkSize(const byte *mod_base, const dheader_t *header,
|
||||
maptype_t maptype)
|
||||
Mod_CalcNonModelLumpHunkSize(const byte *mod_base, const dheader_t *header)
|
||||
{
|
||||
int hunkSize = 0;
|
||||
|
||||
|
|
|
@ -2257,6 +2257,7 @@ Mod_LoadModel_Flex(const char *mod_name, const void *buffer, int modfilelen,
|
|||
__func__, blockname, version);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 516 mesh node size */
|
||||
if (size != (num_mesh_nodes * 516))
|
||||
{
|
||||
|
|
|
@ -417,7 +417,7 @@ R_DrawEntitiesOnList(void)
|
|||
R_EnableMultitexture(false);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
R_DrawParticles2(int num_particles, const particle_t particles[],
|
||||
const unsigned *colortable)
|
||||
{
|
||||
|
|
|
@ -311,10 +311,10 @@ Mod_LoadBrushModel(model_t *mod, const void *buffer, int modfilelen)
|
|||
header = (dheader_t *)mod_base;
|
||||
|
||||
/* check for BSPX extensions */
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base, map_quake2rr);
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base);
|
||||
|
||||
// calculate the needed hunksize from the lumps
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header, map_quake2rr);
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header);
|
||||
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_MODELS],
|
||||
sizeof(dmodel_t), sizeof(model_t), 0);
|
||||
|
|
|
@ -314,11 +314,6 @@ void glCheckError_(const char *file, const char *function, int line);
|
|||
#define glEnd() glEnd(); glCheckError_(__FILE__, __func__, __LINE__)
|
||||
#endif
|
||||
|
||||
/* GL extension emulation functions */
|
||||
void R_DrawParticles2(int n,
|
||||
const particle_t particles[],
|
||||
const unsigned *colortable);
|
||||
|
||||
/*
|
||||
* GL config stuff
|
||||
*/
|
||||
|
|
|
@ -312,10 +312,10 @@ Mod_LoadBrushModel(gl3model_t *mod, const void *buffer, int modfilelen)
|
|||
header = (dheader_t *)mod_base;
|
||||
|
||||
/* check for BSPX extensions */
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base, map_quake2rr);
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base);
|
||||
|
||||
// calculate the needed hunksize from the lumps
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header, map_quake2rr);
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header);
|
||||
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_MODELS],
|
||||
sizeof(dmodel_t), sizeof(gl3model_t), 0);
|
||||
|
|
|
@ -312,10 +312,10 @@ Mod_LoadBrushModel(gl4model_t *mod, const void *buffer, int modfilelen)
|
|||
header = (dheader_t *)mod_base;
|
||||
|
||||
/* check for BSPX extensions */
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base, map_quake2rr);
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base);
|
||||
|
||||
// calculate the needed hunksize from the lumps
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header, map_quake2rr);
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header);
|
||||
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_MODELS],
|
||||
sizeof(dmodel_t), sizeof(gl4model_t), 0);
|
||||
|
|
|
@ -368,11 +368,9 @@ extern void Mod_LoadSurfedges(const char *name, int **surfedges, int *numsurfedg
|
|||
extern mleaf_t *Mod_PointInLeaf(const vec3_t p, mnode_t *node);
|
||||
extern const void *Mod_LoadBSPXFindLump(const bspx_header_t *bspx_header,
|
||||
const char *lumpname, int *plumpsize, const byte *mod_base);
|
||||
extern const bspx_header_t *Mod_LoadBSPX(int filesize, const byte *mod_base,
|
||||
maptype_t maptype);
|
||||
extern const bspx_header_t *Mod_LoadBSPX(int filesize, const byte *mod_base);
|
||||
extern int Mod_LoadBSPXDecoupledLM(const dlminfo_t* lminfos, int surfnum, msurface_t *out);
|
||||
extern int Mod_CalcNonModelLumpHunkSize(const byte *mod_base, const dheader_t *header,
|
||||
maptype_t maptype);
|
||||
extern int Mod_CalcNonModelLumpHunkSize(const byte *mod_base, const dheader_t *header);
|
||||
|
||||
/* Surface logic */
|
||||
#define DLIGHT_CUTOFF 64
|
||||
|
|
|
@ -319,10 +319,10 @@ Mod_LoadBrushModel(model_t *mod, const void *buffer, int modfilelen)
|
|||
header = (dheader_t *)mod_base;
|
||||
|
||||
/* check for BSPX extensions */
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base, map_quake2rr);
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base);
|
||||
|
||||
// calculate the needed hunksize from the lumps
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header, map_quake2rr);
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header);
|
||||
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_MODELS],
|
||||
sizeof(dmodel_t), sizeof(model_t), 0);
|
||||
|
|
|
@ -286,10 +286,10 @@ Mod_LoadBrushModel(model_t *mod, const void *buffer, int modfilelen)
|
|||
header = (dheader_t *)mod_base;
|
||||
|
||||
/* check for BSPX extensions */
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base, map_quake2rr);
|
||||
bspx_header = Mod_LoadBSPX(modfilelen, (byte*)mod_base);
|
||||
|
||||
// calculate the needed hunksize from the lumps
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header, map_quake2rr);
|
||||
hunkSize = Mod_CalcNonModelLumpHunkSize(mod_base, header);
|
||||
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_MODELS],
|
||||
sizeof(dmodel_t), sizeof(model_t), 0);
|
||||
|
|
|
@ -332,6 +332,8 @@ Qcommon_Init(int argc, char **argv)
|
|||
the settings of the config files */
|
||||
Cbuf_AddEarlyCommands(false);
|
||||
Cbuf_Execute();
|
||||
/* Set default maptype */
|
||||
Cvar_Get("maptype", "0", CVAR_ARCHIVE);
|
||||
|
||||
// remember the initial game name that might have been set on commandline
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue