whitespace and comment cleanups.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-07-22 05:40:34 +00:00
parent 1422163099
commit 111dc205d5
10 changed files with 44 additions and 192 deletions

View file

@ -38,12 +38,13 @@
#include <stdio.h>
#include "compat.h"
#include "QF/console.h"
#include "QF/mdfour.h"
#include "QF/model.h"
#include "QF/vfs.h"
#include "compat.h"
/*
ALIAS MODEL DISPLAY LIST GENERATION
*/
@ -69,9 +70,7 @@ int stripverts[128];
int striptris[128];
int stripcount;
/*
StripLength
*/
int
StripLength (int starttri, int startv)
{
@ -136,9 +135,6 @@ done:
return stripcount;
}
/*
FanLength
*/
int
FanLength (int starttri, int startv)
{
@ -219,9 +215,7 @@ BuildTris (void)
int besttris[1024];
int type;
//
// build tristrips
//
numorder = 0;
numcommands = 0;
memset (used, 0, sizeof (used));
@ -286,10 +280,6 @@ BuildTris (void)
alltris += pheader->mdl.numtris;
}
/*
GL_MakeAliasModelDisplayLists
*/
void
GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s)
{
@ -307,9 +297,7 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s)
mdfour (model_digest, (unsigned char *) _m, _s);
//
// look for a cached version
//
strcpy (cache, "glquake/");
COM_StripExtension (m->name + strlen ("progs/"),
cache + strlen ("glquake/"));
@ -355,16 +343,12 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s)
}
}
if (remesh) {
//
// build it from scratch
//
Con_Printf ("meshing %s...\n", m->name);
BuildTris (); // trifans or lists
//
// save out the cached version
//
snprintf (fullpath, sizeof (fullpath), "%s/%s", com_gamedir, cache);
f = Qopen (fullpath, "wbz9");
if (!f) {

View file

@ -114,8 +114,7 @@ Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight)
break;
}
}
// can't fill to filled color or to transparent color (used as visited
// marker)
// can't fill to filled color or transparent color (used as visited marker)
if ((fillcolor == filledcolor) || (fillcolor == 255)) {
//printf ("not filling skin from %d to %d\n", fillcolor, filledcolor);
return;
@ -187,9 +186,6 @@ Mod_LoadSkin (byte * skin, int skinsize, int snum, int gnum, qboolean group)
return skin + skinsize;
}
/*
Mod_LoadAllSkins
*/
void *
Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex)
{
@ -243,9 +239,6 @@ Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex)
return pskintype;
}
/*
Mod_LoadAliasFrame
*/
void *
Mod_LoadAliasFrame (void *pin, maliasframedesc_t *frame)
{
@ -275,9 +268,6 @@ Mod_LoadAliasFrame (void *pin, maliasframedesc_t *frame)
return (void *) pinframe;
}
/*
Mod_LoadAliasGroup
*/
void *
Mod_LoadAliasGroup (void *pin, maliasframedesc_t *frame)
{

View file

@ -68,8 +68,8 @@ aliashdr_t *pheader;
stvert_t stverts[MAXALIASVERTS];
mtriangle_t triangles[MAXALIASTRIS];
// a pose is a single set of vertexes. a frame may be
// an animating sequence of poses
// a pose is a single set of vertexes. a frame may be an animating
// sequence of poses
trivertx_t *poseverts[MAXALIASFRAMES];
int posenum = 0;
@ -79,9 +79,6 @@ void *Mod_LoadAliasGroup (void *pin, maliasframedesc_t *frame);
//=========================================================================
/*
Mod_LoadAliasModel
*/
void
Mod_LoadAliasModel (model_t *mod, void *buffer)
{
@ -111,10 +108,8 @@ Mod_LoadAliasModel (model_t *mod, void *buffer)
Sys_Error ("%s has wrong version number (%i should be %i)",
mod->name, version, ALIAS_VERSION);
//
// allocate space for a working header, plus all the data except the frames,
// skin and group info
//
// allocate space for a working header, plus all the data except the
// frames, skin and group info
size = field_offset (aliashdr_t, frames[LittleLong (pinmodel->numframes)]);
pheader = Hunk_AllocName (size, loadname);
memset (pheader, 0, size);
@ -125,9 +120,7 @@ Mod_LoadAliasModel (model_t *mod, void *buffer)
mod->flags = LittleLong (pinmodel->flags);
//
// endian-adjust and copy the data, starting with the alias model header
//
// endian-adjust and copy the data, starting with the alias model header
pmodel->boundingradius = LittleFloat (pinmodel->boundingradius);
pmodel->numskins = LittleLong (pinmodel->numskins);
pmodel->skinwidth = LittleLong (pinmodel->skinwidth);
@ -165,17 +158,12 @@ Mod_LoadAliasModel (model_t *mod, void *buffer)
pmodel->eyeposition[i] = LittleFloat (pinmodel->eyeposition[i]);
}
//
// load the skins
//
// load the skins
pskintype = (daliasskintype_t *) &pinmodel[1];
pskintype =
Mod_LoadAllSkins (pheader->mdl.numskins, pskintype, &pheader->skindesc);
//
// load base s and t vertices
//
// load base s and t vertices
pinstverts = (stvert_t *) pskintype;
for (i = 0; i < pheader->mdl.numverts; i++) {
@ -184,9 +172,7 @@ Mod_LoadAliasModel (model_t *mod, void *buffer)
stverts[i].t = LittleLong (pinstverts[i].t);
}
//
// load triangle lists
//
// load triangle lists
pintriangles = (dtriangle_t *) &pinstverts[pheader->mdl.numverts];
for (i = 0; i < pheader->mdl.numtris; i++) {
@ -198,9 +184,7 @@ Mod_LoadAliasModel (model_t *mod, void *buffer)
}
}
//
// load the frames
//
// load the frames
posenum = 0;
pframetype = (daliasframetype_t *) &pintriangles[pheader->mdl.numtris];
@ -227,14 +211,10 @@ Mod_LoadAliasModel (model_t *mod, void *buffer)
mod->mins[0] = mod->mins[1] = mod->mins[2] = -16;
mod->maxs[0] = mod->maxs[1] = mod->maxs[2] = 16;
//
// build the draw lists
//
GL_MakeAliasModelDisplayLists (mod, pheader, buffer, com_filesize);
//
// move the complete, relocatable alias model to the cache
//
// move the complete, relocatable alias model to the cache
end = Hunk_LowMark ();
total = end - start;

View file

@ -39,13 +39,14 @@
# include <strings.h>
#endif
#include "compat.h"
#include "QF/console.h"
#include "QF/model.h"
#include "QF/qendian.h"
#include "QF/vfs.h"
#include "QF/GL/qf_textures.h"
#include "compat.h"
int Mod_Fullbright (byte * skin, int width, int height, char *name);
extern model_t *loadmodel;
@ -55,6 +56,7 @@ extern byte *mod_base;
const int mod_lightmap_bytes = 3;
void
Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
{
@ -68,9 +70,6 @@ Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
true, false, 1);
}
/*
Mod_LoadLighting
*/
void
Mod_LoadLighting (lump_t *l)
{

View file

@ -43,12 +43,13 @@
#include "QF/checksum.h"
#include "compat.h"
#include "QF/cvar.h"
#include "QF/model.h"
#include "QF/qendian.h"
#include "QF/sys.h"
#include "compat.h"
extern struct texture_s *r_notexture_mip;
void R_InitSky (struct texture_s *mt);
@ -62,9 +63,7 @@ byte mod_novis[MAX_MAP_LEAFS / 8];
void GL_SubdivideSurface (msurface_t *fa);
cvar_t *gl_sky_divide;
/*
Mod_PointInLeaf
*/
mleaf_t *
Mod_PointInLeaf (vec3_t p, model_t *model)
{
@ -90,10 +89,6 @@ Mod_PointInLeaf (vec3_t p, model_t *model)
return NULL; // never reached
}
/*
Mod_DecompressVis
*/
byte *
Mod_DecompressVis (byte * in, model_t *model)
{
@ -148,10 +143,6 @@ Mod_LeafPVS (mleaf_t *leaf, model_t *model)
byte *mod_base;
/*
Mod_LoadTextures
*/
void
Mod_LoadTextures (lump_t *l)
{
@ -207,9 +198,7 @@ Mod_LoadTextures (lump_t *l)
}
}
//
// sequence the animations
//
// sequence the animations
for (i = 0; i < m->nummiptex; i++) {
tx = loadmodel->textures[i];
if (!tx || tx->name[0] != '+')
@ -289,9 +278,6 @@ Mod_LoadTextures (lump_t *l)
}
}
/*
Mod_LoadVisibility
*/
void
Mod_LoadVisibility (lump_t *l)
{
@ -303,10 +289,6 @@ Mod_LoadVisibility (lump_t *l)
memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
}
/*
Mod_LoadEntities
*/
void
Mod_LoadEntities (lump_t *l)
{
@ -318,10 +300,6 @@ Mod_LoadEntities (lump_t *l)
memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen);
}
/*
Mod_LoadVertexes
*/
void
Mod_LoadVertexes (lump_t *l)
{
@ -345,9 +323,6 @@ Mod_LoadVertexes (lump_t *l)
}
}
/*
Mod_LoadSubmodels
*/
void
Mod_LoadSubmodels (lump_t *l)
{
@ -378,9 +353,6 @@ Mod_LoadSubmodels (lump_t *l)
}
}
/*
Mod_LoadEdges
*/
void
Mod_LoadEdges (lump_t *l)
{
@ -403,9 +375,6 @@ Mod_LoadEdges (lump_t *l)
}
}
/*
Mod_LoadTexinfo
*/
void
Mod_LoadTexinfo (lump_t *l)
{
@ -508,10 +477,6 @@ CalcSurfaceExtents (msurface_t *s)
}
}
/*
Mod_LoadFaces
*/
void
Mod_LoadFaces (lump_t *l)
{
@ -583,10 +548,6 @@ Mod_LoadFaces (lump_t *l)
}
}
/*
Mod_SetParent
*/
void
Mod_SetParent (mnode_t *node, mnode_t *parent)
{
@ -597,9 +558,6 @@ Mod_SetParent (mnode_t *node, mnode_t *parent)
Mod_SetParent (node->children[1], node);
}
/*
Mod_LoadNodes
*/
void
Mod_LoadNodes (lump_t *l)
{
@ -640,9 +598,6 @@ Mod_LoadNodes (lump_t *l)
Mod_SetParent (loadmodel->nodes, NULL); // sets nodes and leafs
}
/*
Mod_LoadLeafs
*/
void
Mod_LoadLeafs (lump_t *l)
{
@ -700,9 +655,6 @@ Mod_LoadLeafs (lump_t *l)
}
}
/*
Mod_LoadClipnodes
*/
void
Mod_LoadClipnodes (lump_t *l)
{
@ -793,9 +745,6 @@ Mod_MakeHull0 (void)
}
}
/*
Mod_LoadMarksurfaces
*/
void
Mod_LoadMarksurfaces (lump_t *l)
{
@ -820,9 +769,6 @@ Mod_LoadMarksurfaces (lump_t *l)
}
}
/*
Mod_LoadSurfedges
*/
void
Mod_LoadSurfedges (lump_t *l)
{
@ -842,9 +788,6 @@ Mod_LoadSurfedges (lump_t *l)
out[i] = LittleLong (in[i]);
}
/*
Mod_LoadPlanes
*/
void
Mod_LoadPlanes (lump_t *l)
{
@ -877,9 +820,6 @@ Mod_LoadPlanes (lump_t *l)
}
}
/*
RadiusFromBounds
*/
float
RadiusFromBounds (vec3_t mins, vec3_t maxs)
{
@ -894,9 +834,6 @@ RadiusFromBounds (vec3_t mins, vec3_t maxs)
return Length (corner);
}
/*
Mod_LoadBrushModel
*/
void
Mod_LoadBrushModel (model_t *mod, void *buffer)
{
@ -914,7 +851,7 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
("Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
mod->name, i, BSPVERSION);
// swap all the lumps
// swap all the lumps
mod_base = (byte *) header;
for (i = 0; i < sizeof (dheader_t) / 4; i++)
@ -941,7 +878,7 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
header->lumps[i].filelen));
}
// load into heap
// load into heap
Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
Mod_LoadEdges (&header->lumps[LUMP_EDGES]);
@ -963,9 +900,7 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
mod->numframes = 2; // regular and alternate animation
//
// set up the submodels (FIXME: this is confusing)
//
// set up the submodels (FIXME: this is confusing)
for (i = 0; i < mod->numsubmodels; i++) {
bm = &mod->submodels[i];

View file

@ -47,6 +47,7 @@ extern byte *mod_base;
const int mod_lightmap_bytes = 1;
void
GL_SubdivideSurface (msurface_t *fa)
{
@ -57,9 +58,6 @@ Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
{
}
/*
Mod_LoadLighting
*/
void
Mod_LoadLighting (lump_t *l)
{

View file

@ -26,8 +26,10 @@
$Id$
*/
// models are the only shared resource between a client and server running
// on the same machine.
/*
Models are the only shared resource between a client and server running
on the same machine.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@ -63,9 +65,7 @@ extern byte mod_novis[MAX_MAP_LEAFS / 8];
texture_t *r_notexture_mip;
/*
Mod_Init
*/
void
Mod_Init (void)
{
@ -105,12 +105,9 @@ Mod_Init_Cvars (void)
{
gl_subdivide_size =
Cvar_Get ("gl_subdivide_size", "128", CVAR_ARCHIVE, NULL,
"Sets the division value for the sky brushes.");
"Sets the division value for the sky brushes.");
}
/*
Mod_ClearAll
*/
void
Mod_ClearAll (void)
{
@ -122,9 +119,6 @@ Mod_ClearAll (void)
mod->needload = true;
}
/*
Mod_FindName
*/
model_t *
Mod_FindName (const char *name)
{
@ -134,9 +128,7 @@ Mod_FindName (const char *name)
if (!name[0])
Sys_Error ("Mod_FindName: NULL name");
//
// search the currently loaded models
//
// search the currently loaded models
for (i = 0, mod = mod_known; i < mod_numknown; i++, mod++)
if (!strcmp (mod->name, name))
break;
@ -172,9 +164,8 @@ Mod_LoadModel (model_t *mod, qboolean crash)
} else
return mod; // not cached at all
}
//
// load the file
//
// load the file
buf =
(unsigned int *) COM_LoadStackFile (mod->name, stackbuf,
sizeof (stackbuf));
@ -183,18 +174,15 @@ Mod_LoadModel (model_t *mod, qboolean crash)
Sys_Error ("Mod_LoadModel: %s not found", mod->name);
return NULL;
}
//
// allocate a new model
//
// allocate a new model
COM_FileBase (mod->name, loadname);
loadmodel = mod;
//
// fill it in
//
// fill it in
// call the apropriate loader
// call the apropriate loader
mod->needload = false;
mod->hasfullbrights = false;
@ -252,9 +240,6 @@ Mod_Extradata (model_t *mod)
return mod->cache.data;
}
/*
Mod_TouchModel
*/
void
Mod_TouchModel (const char *name)
{
@ -268,9 +253,6 @@ Mod_TouchModel (const char *name)
}
}
/*
Mod_Print
*/
void
Mod_Print (void)
{

View file

@ -39,17 +39,15 @@
# include <strings.h>
#endif
#include "compat.h"
#include "QF/model.h"
#include "QF/qendian.h"
#include "QF/GL/qf_textures.h"
#include "compat.h"
extern model_t *loadmodel;
extern char loadname[];
/*
Mod_LoadSpriteFrame
*/
void *
Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
{

View file

@ -26,9 +26,6 @@
$Id$
*/
// models are the only shared resource between a client and server running
// on the same machine.
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@ -43,12 +40,8 @@ extern model_t *loadmodel;
extern char loadname[];
void *Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe,
int framenum);
/*
Mod_LoadSpriteGroup
*/
void *
Mod_LoadSpriteGroup (void *pin, mspriteframe_t **ppframe, int framenum)
{
@ -96,9 +89,6 @@ Mod_LoadSpriteGroup (void *pin, mspriteframe_t **ppframe, int framenum)
return ptemp;
}
/*
Mod_LoadSpriteModel
*/
void
Mod_LoadSpriteModel (model_t *mod, void *buffer)
{
@ -137,9 +127,7 @@ Mod_LoadSpriteModel (model_t *mod, void *buffer)
mod->mins[2] = -psprite->maxheight / 2;
mod->maxs[2] = psprite->maxheight / 2;
//
// load the frames
//
// load the frames
if (numframes < 1)
Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes);

View file

@ -26,8 +26,8 @@
$Id$
*/
// models are the only shared resource between a client and server running
// on the same machine.
// models are the only shared resource between a client and server running
// on the same machine.
#ifdef HAVE_CONFIG_H
# include "config.h"
@ -48,9 +48,7 @@
extern model_t *loadmodel;
extern char loadname[];
/*
Mod_LoadSpriteFrame
*/
void *
Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
{