More conversion
This commit is contained in:
+16
-16
@@ -36,8 +36,8 @@ static qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash);
|
||||
|
||||
static void Mod_Print (void);
|
||||
|
||||
static cvar_t external_ents = {"external_ents", "1", CVAR_ARCHIVE};
|
||||
static cvar_t external_vis = {"external_vis", "1", CVAR_ARCHIVE};
|
||||
static convar external_ents = {"external_ents", "1", {.archive = true}};
|
||||
static convar external_vis = {"external_vis", "1", {.archive = true}};
|
||||
|
||||
static byte *mod_novis;
|
||||
static int mod_novis_capacity;
|
||||
@@ -59,11 +59,11 @@ Mod_Init
|
||||
*/
|
||||
void Mod_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&gl_subdivide_size);
|
||||
Cvar_RegisterVariable (&external_vis);
|
||||
Cvar_RegisterVariable (&external_ents);
|
||||
gl_subdivide_size.inscribe();
|
||||
external_vis.inscribe();
|
||||
external_ents.inscribe();
|
||||
|
||||
Cmd_AddCommand ("mcache", Mod_Print);
|
||||
command::add ("mcache", Mod_Print);
|
||||
|
||||
//johnfitz -- create notexture miptex
|
||||
r_notexture_mip = (texture_t *) Hunk_AllocName (sizeof(texture_t), "r_notexture_mip");
|
||||
@@ -525,7 +525,7 @@ static void Mod_LoadTextures (lump_t *l)
|
||||
if (((byte*)(mt+1) + pixels) > (mod_base + l->fileofs + l->filelen))
|
||||
{
|
||||
Con_DPrintf("Texture %s extends past end of lump\n", mt->name);
|
||||
pixels = q_max(0L, (long)((mod_base + l->fileofs + l->filelen) - (byte*)(mt+1)));
|
||||
pixels = std::max(0L, (long)((mod_base + l->fileofs + l->filelen) - (byte*)(mt+1)));
|
||||
}
|
||||
|
||||
tx->update_warp = false; //johnfitz
|
||||
@@ -2054,21 +2054,21 @@ static void Mod_BoundsFromClipNode (qmodel_t *mod, int hull, int nodenum)
|
||||
|
||||
case PLANE_X:
|
||||
if (plane->signbits == 1)
|
||||
mod->clipmins[0] = q_min(mod->clipmins[0], -plane->dist - mod->hulls[hull].clip_mins[0]);
|
||||
mod->clipmins[0] = std::min(mod->clipmins[0], -plane->dist - mod->hulls[hull].clip_mins[0]);
|
||||
else
|
||||
mod->clipmaxs[0] = q_max(mod->clipmaxs[0], plane->dist - mod->hulls[hull].clip_maxs[0]);
|
||||
mod->clipmaxs[0] = std::max(mod->clipmaxs[0], plane->dist - mod->hulls[hull].clip_maxs[0]);
|
||||
break;
|
||||
case PLANE_Y:
|
||||
if (plane->signbits == 2)
|
||||
mod->clipmins[1] = q_min(mod->clipmins[1], -plane->dist - mod->hulls[hull].clip_mins[1]);
|
||||
mod->clipmins[1] = std::min(mod->clipmins[1], -plane->dist - mod->hulls[hull].clip_mins[1]);
|
||||
else
|
||||
mod->clipmaxs[1] = q_max(mod->clipmaxs[1], plane->dist - mod->hulls[hull].clip_maxs[1]);
|
||||
mod->clipmaxs[1] = std::max(mod->clipmaxs[1], plane->dist - mod->hulls[hull].clip_maxs[1]);
|
||||
break;
|
||||
case PLANE_Z:
|
||||
if (plane->signbits == 4)
|
||||
mod->clipmins[2] = q_min(mod->clipmins[2], -plane->dist - mod->hulls[hull].clip_mins[2]);
|
||||
mod->clipmins[2] = std::min(mod->clipmins[2], -plane->dist - mod->hulls[hull].clip_mins[2]);
|
||||
else
|
||||
mod->clipmaxs[2] = q_max(mod->clipmaxs[2], plane->dist - mod->hulls[hull].clip_maxs[2]);
|
||||
mod->clipmaxs[2] = std::max(mod->clipmaxs[2], plane->dist - mod->hulls[hull].clip_maxs[2]);
|
||||
break;
|
||||
default:
|
||||
//skip nonaxial planes; don't need them
|
||||
@@ -2648,8 +2648,8 @@ static void Mod_CalcAliasBounds (aliashdr_t *a)
|
||||
|
||||
for (k=0; k<3;k++)
|
||||
{
|
||||
loadmodel->mins[k] = q_min(loadmodel->mins[k], v[k]);
|
||||
loadmodel->maxs[k] = q_max(loadmodel->maxs[k], v[k]);
|
||||
loadmodel->mins[k] = std::min(loadmodel->mins[k], v[k]);
|
||||
loadmodel->maxs[k] = std::max(loadmodel->maxs[k], v[k]);
|
||||
}
|
||||
dist = v[0] * v[0] + v[1] * v[1];
|
||||
if (yawradius < dist)
|
||||
@@ -2711,7 +2711,7 @@ Mod_SetExtraFlags -- johnfitz -- set up extra flags that aren't in the mdl
|
||||
*/
|
||||
void Mod_SetExtraFlags (qmodel_t *mod)
|
||||
{
|
||||
extern cvar_t r_nolerp_list, r_noshadow_list;
|
||||
extern convar r_nolerp_list, r_noshadow_list;
|
||||
|
||||
if (!mod || mod->type != mod_alias)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user