Go to the documentation of this file.
37 #define MAX_MOD_KNOWN 256
141 memset(mod->
name, 0,
sizeof(mod->
name));
194 if (!model || !model->
nodes)
230 memcpy (out, in, row);
257 }
while (out - decompressed < row);
270 if (cluster == -1 || !model->
vis)
308 for (
i = 0;
i<size;
i++, in += 3)
310 if (in[0] > in[1] && in[0] > in[2])
312 else if (in[1] > in[0] && in[1] > in[2])
415 memset(out, 0, (
count + 6) *
sizeof(*out));
421 for (
i = 0;
i <
count;
i++, in++, out++)
450 for (
i = 0;
i <
count;
i++, in++, out++)
452 for (
j = 0;
j < 3;
j++)
463 if (lastface < out->firstface)
489 for (
i = 0;
i <
count;
i++, in++, out++)
522 for (
i = 0;
i <
count;
i++, in++, out++)
524 for (
j = 0;
j < 8;
j++)
528 len1 = (len1 + len2) / 2;
531 else if (len1 < 0.49)
533 else if (len1 < 0.99)
538 if (len1 + len2 < 0.001)
541 out->
mipadjust = 1 / floor( (len1+len2)/2 + 0.1 );
578 for (step = out->
next; step && step != out; step = step->
next)
592 float mins[2], maxs[2], val;
596 int bmins[2], bmaxs[2];
598 mins[0] = mins[1] = 999999;
599 maxs[0] = maxs[1] = -99999;
603 for (
i = 0;
i <
s->numedges;
i++)
611 for (
j = 0;
j < 2;
j++)
613 val =
v->position[0] * tex->
vecs[
j][0] +
614 v->position[1] * tex->
vecs[
j][1] +
615 v->position[2] * tex->
vecs[
j][2] +
624 for (
i = 0;
i < 2;
i++)
626 bmins[
i] = floor(mins[
i] / 16);
627 bmaxs[
i] = ceil(maxs[
i] / 16);
629 s->texturemins[
i] = bmins[
i] * 16;
630 s->extents[
i] = (bmaxs[
i] - bmins[
i]) * 16;
631 if (
s->extents[
i] < 16)
661 for (surfnum = 0; surfnum <
count; surfnum++, in++, out++)
670 if (out->
numedges < 3 || lastedge < out->firstedge)
722 for (
i = 0;
i < 2;
i++)
736 for (
i = 0;
i < 2;
i++)
783 for (
i = 0;
i <
count;
i++, in++, out++)
785 for (
j = 0;
j < 3;
j++)
800 for (
j = 0;
j < 2;
j++)
834 for (
i = 0;
i<
count;
i++, in++, out++)
836 for (
j = 0;
j<3;
j++)
941 for (
i = 0;
i <
count;
i++, in++, out++)
944 for (
j = 0;
j < 3;
j++)
1049 dmdl_t *pinmodel, *pheader;
1053 int *pincmd, *poutcmd;
1079 if (pheader->
num_st <= 0)
1108 for (
j = 0;
j < 3;
j++)
1125 memcpy(poutframe->
name, pinframe->
name,
sizeof(poutframe->
name));
1126 for (
j = 0;
j < 3;
j++)
1142 pincmd = (
int *)((
byte *)pinmodel + pheader->
ofs_glcmds);
1143 poutcmd = (
int *)((
byte *)pheader + pheader->
ofs_glcmds);
1220 Com_sprintf(fullname,
sizeof(fullname),
"maps/%s.bsp", model);
1294 memset(mod, 0,
sizeof(*mod));
1316 memset(mod, 0,
sizeof(*mod));
void Mod_LoadSurfedges(lump_t *l)
model_t * Mod_LoadModel(model_t *mod, qboolean crash)
void Mod_LoadTexinfo(lump_t *l)
byte styles[MAXLIGHTMAPS]
void Mod_LoadSpriteModel(model_t *mod, void *buffer)
void * Hunk_Begin(int maxsize)
void Mod_LoadVertexes(lump_t *l)
short LittleShort(short l)
void Mod_LoadRighting(lump_t *l)
CONST PIXELFORMATDESCRIPTOR int
model_t mod_known[MAX_MOD_KNOWN]
void Mod_LoadMarksurfaces(lump_t *l)
void Hunk_Free(void *base)
byte * Mod_DecompressVis(byte *in, model_t *model)
mleaf_t * Mod_PointInLeaf(vec3_t p, model_t *model)
void Mod_LoadLighting(lump_t *l)
int(* FS_LoadFile)(char *name, void **buf)
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
image_t * R_FindImage(char *name, imagetype_t type)
image_t * r_notexture_mip
msurface_t ** firstmarksurface
byte mod_novis[MAX_MAP_LEAFS/8]
void Mod_LoadLeafs(lump_t *l)
msurface_t ** marksurfaces
struct mnode_s * children[2]
int registration_sequence
void(* FS_FreeFile)(void *buf)
void Mod_LoadBrushModel(model_t *mod, void *buffer)
void R_FreeUnusedImages(void)
void R_NumberLeafs(mnode_t *node)
int registration_sequence
void(* Con_Printf)(int print_level, char *str,...)
struct model_s * R_RegisterModel(char *name)
void Mod_LoadSubmodels(lump_t *l)
void Mod_LoadEdges(lump_t *l)
float LittleFloat(float l)
void Mod_LoadPlanes(lump_t *l)
model_t * Mod_ForName(char *name, qboolean crash)
vec_t VectorLength(vec3_t v)
int r_leaftovis[MAX_MAP_LEAFS]
void(* Sys_Error)(int err_level, char *str,...)
int r_vistoleaf[MAX_MAP_LEAFS]
void Mod_LoadFaces(lump_t *l)
model_t mod_inline[MAX_MOD_KNOWN]
image_t * skins[MAX_MD2SKINS]
void CalcSurfaceExtents(msurface_t *s)
void Mod_LoadNodes(lump_t *l)
unsigned short firstsurface
void Com_PageInMemory(byte *buffer, int size)
void Mod_LoadVisibility(lump_t *l)
void R_EndRegistration(void)
int registration_sequence
void Mod_SetParent(mnode_t *node, mnode_t *parent)
void Mod_Free(model_t *mod)
void Mod_LoadAliasModel(model_t *mod, void *buffer)
unsigned short numsurfaces
void R_BeginRegistration(char *model)
void Mod_Modellist_f(void)
byte * Mod_ClusterPVS(int cluster, model_t *model)
void * Hunk_Alloc(int size)
void Com_sprintf(char *dest, int size, char *fmt,...)