mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
Whitespace, comment cleanups.
This commit is contained in:
parent
ff03367bc2
commit
19315a399f
13 changed files with 65 additions and 88 deletions
|
@ -47,10 +47,7 @@ static const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
/*
|
||||
ALIAS MODEL DISPLAY LIST GENERATION
|
||||
*/
|
||||
|
||||
// ALIAS MODEL DISPLAY LIST GENERATION ========================================
|
||||
|
||||
model_t *aliasmodel;
|
||||
aliashdr_t *paliashdr;
|
||||
|
@ -58,8 +55,7 @@ aliashdr_t *paliashdr;
|
|||
qboolean *used;
|
||||
int used_size;
|
||||
|
||||
// the command list holds counts and s/t values that are valid for
|
||||
// every frame
|
||||
// the command list holds counts and s/t values that are valid for every frame
|
||||
int *commands;
|
||||
int numcommands;
|
||||
int commands_size;
|
||||
|
@ -77,6 +73,7 @@ int *striptris;
|
|||
int stripcount;
|
||||
int strip_size;
|
||||
|
||||
|
||||
void
|
||||
alloc_used (int size)
|
||||
{
|
||||
|
@ -131,10 +128,8 @@ add_strip (int vert, int tri)
|
|||
int
|
||||
StripLength (int starttri, int startv)
|
||||
{
|
||||
int m1, m2;
|
||||
int j;
|
||||
int m1, m2, j, k;
|
||||
mtriangle_t *last, *check;
|
||||
int k;
|
||||
|
||||
used[starttri] = 2;
|
||||
|
||||
|
@ -191,10 +186,8 @@ done:
|
|||
int
|
||||
FanLength (int starttri, int startv)
|
||||
{
|
||||
int m1, m2;
|
||||
int j;
|
||||
int m1, m2, j, k;
|
||||
mtriangle_t *last, *check;
|
||||
int k;
|
||||
|
||||
used[starttri] = 2;
|
||||
|
||||
|
@ -246,7 +239,6 @@ FanLength (int starttri, int startv)
|
|||
return stripcount - 2;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
BuildTris
|
||||
|
||||
|
@ -256,13 +248,10 @@ FanLength (int starttri, int startv)
|
|||
void
|
||||
BuildTris (void)
|
||||
{
|
||||
int i, j, k;
|
||||
int startv;
|
||||
float s, t;
|
||||
int len, bestlen, besttype = 0;
|
||||
int *bestverts = 0;
|
||||
int *besttris = 0;
|
||||
int type;
|
||||
float s, t;
|
||||
int bestlen, len, startv, type, i, j, k;
|
||||
int besttype = 0;
|
||||
int *bestverts = 0, *besttris = 0;
|
||||
|
||||
// build tristrips
|
||||
numorder = 0;
|
||||
|
@ -322,8 +311,8 @@ BuildTris (void)
|
|||
s = (s + 0.5) / pheader->mdl.skinwidth;
|
||||
t = (t + 0.5) / pheader->mdl.skinheight;
|
||||
|
||||
add_command (*(int*)&s);
|
||||
add_command (*(int*)&t);
|
||||
add_command (*(int *) &s);
|
||||
add_command (*(int *) &t);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,12 +333,12 @@ BuildTris (void)
|
|||
void
|
||||
Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, int extra)
|
||||
{
|
||||
int i, j;
|
||||
int *cmds;
|
||||
char cache[MAX_QPATH], fullpath[MAX_OSPATH];
|
||||
VFile *f;
|
||||
unsigned char model_digest[MDFOUR_DIGEST_BYTES];
|
||||
unsigned char mesh_digest[MDFOUR_DIGEST_BYTES];
|
||||
int i, j;
|
||||
int *cmds;
|
||||
VFile *f;
|
||||
qboolean remesh = true;
|
||||
qboolean do_cache = false;
|
||||
|
||||
|
@ -373,12 +362,9 @@ Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, i
|
|||
unsigned char d1[MDFOUR_DIGEST_BYTES];
|
||||
unsigned char d2[MDFOUR_DIGEST_BYTES];
|
||||
struct mdfour md;
|
||||
int *c = 0;
|
||||
int nc = 0;
|
||||
int *vo = 0;
|
||||
int no = 0;
|
||||
int len;
|
||||
int vers;
|
||||
int len, vers;
|
||||
int nc = 0, no = 0;
|
||||
int *c = 0, *vo = 0;
|
||||
|
||||
memset (d1, 0, sizeof (d1));
|
||||
memset (d2, 0, sizeof (d2));
|
||||
|
@ -444,7 +430,8 @@ Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, i
|
|||
|
||||
if (do_cache) {
|
||||
// save out the cached version
|
||||
snprintf (fullpath, sizeof (fullpath), "%s/%s", com_gamedir, cache);
|
||||
snprintf (fullpath, sizeof (fullpath), "%s/%s", com_gamedir,
|
||||
cache);
|
||||
f = Qopen (fullpath, "wbz9");
|
||||
if (!f) {
|
||||
COM_CreatePath (fullpath);
|
||||
|
@ -459,7 +446,8 @@ Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, i
|
|||
mdfour_begin (&md);
|
||||
mdfour_update (&md, (unsigned char *) &vers, sizeof (int));
|
||||
mdfour_update (&md, (unsigned char *) &len, sizeof (int));
|
||||
mdfour_update (&md, (unsigned char *) &numcommands, sizeof (int));
|
||||
mdfour_update (&md, (unsigned char *) &numcommands,
|
||||
sizeof (int));
|
||||
mdfour_update (&md, (unsigned char *) &numorder, sizeof (int));
|
||||
mdfour_update (&md, (unsigned char *) commands,
|
||||
numcommands * sizeof (commands[0]));
|
||||
|
@ -488,7 +476,6 @@ Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, i
|
|||
paliashdr->commands = (byte *) cmds - (byte *) paliashdr;
|
||||
memcpy (cmds, commands, numcommands * sizeof (int));
|
||||
|
||||
|
||||
if (extra) {
|
||||
trivertx16_t *verts;
|
||||
verts = Hunk_Alloc (paliashdr->numposes * paliashdr->poseverts
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
gl_model.c
|
||||
gl_model_alias.c
|
||||
|
||||
model loading and caching
|
||||
alias model loading and caching for gl
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -58,8 +58,6 @@ byte player_8bit_texels[320 * 200];
|
|||
// a pose is a single set of vertexes. a frame may be
|
||||
// an animating sequence of poses
|
||||
|
||||
// =========================================================
|
||||
|
||||
typedef struct {
|
||||
short x, y;
|
||||
} floodfill_t;
|
||||
|
@ -112,8 +110,8 @@ Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight)
|
|||
inpt = (inpt + 1) & FLOODFILL_FIFO_MASK;
|
||||
|
||||
while (outpt != inpt) {
|
||||
byte *pos = &skin[x + skinwidth * y];
|
||||
int x = fifo[outpt].x, y = fifo[outpt].y, fdc = filledcolor;
|
||||
byte *pos = &skin[x + skinwidth * y];
|
||||
|
||||
outpt = (outpt + 1) & FLOODFILL_FIFO_MASK;
|
||||
|
||||
|
@ -269,8 +267,8 @@ Mod_FinalizeAliasModel (model_t *m, aliashdr_t *hdr)
|
|||
void
|
||||
Mod_LoadExternalSkin (maliasskindesc_t *pskindesc, char *filename)
|
||||
{
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
VFile *f;
|
||||
|
||||
COM_FOpenFile (filename, &f);
|
||||
if (f)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
gl_model.c
|
||||
model_alias.c
|
||||
|
||||
model loading and caching
|
||||
alias model loading and caching
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -136,12 +136,12 @@ Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator)
|
|||
{
|
||||
byte *p;
|
||||
int i, j, len, size, version, numframes, start, end, total;
|
||||
mdl_t *pinmodel, *pmodel;
|
||||
stvert_t *pinstverts;
|
||||
dtriangle_t *pintriangles;
|
||||
daliasframetype_t *pframetype;
|
||||
daliasskintype_t *pskintype;
|
||||
mdl_t *pinmodel, *pmodel;
|
||||
unsigned short crc;
|
||||
stvert_t *pinstverts;
|
||||
void *mem;
|
||||
|
||||
int extra = 0; // extra precision bytes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
sw_model_alias.c
|
||||
|
||||
model loading and caching
|
||||
alias model loading and caching for the software renderer
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -47,13 +47,6 @@ static const char rcsid[] =
|
|||
#include "compat.h"
|
||||
#include "d_iface.h"
|
||||
|
||||
|
||||
/*
|
||||
ALIAS MODELS
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// a pose is a single set of vertexes. a frame may be
|
||||
// an animating sequence of poses
|
||||
|
||||
|
@ -62,7 +55,7 @@ void *
|
|||
Mod_LoadSkin (byte *skin, int skinsize, int snum, int gnum,
|
||||
qboolean group, maliasskindesc_t *skindesc)
|
||||
{
|
||||
byte *pskin;
|
||||
byte *pskin;
|
||||
|
||||
pskin = Hunk_AllocName (skinsize, loadname);
|
||||
skindesc->skin = (byte *) pskin - (byte *) pheader;
|
||||
|
@ -73,13 +66,13 @@ Mod_LoadSkin (byte *skin, int skinsize, int snum, int gnum,
|
|||
}
|
||||
|
||||
void
|
||||
Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, int extra)
|
||||
Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s,
|
||||
int extra)
|
||||
{
|
||||
int i, j;
|
||||
stvert_t *pstverts;
|
||||
int i, j;
|
||||
int numv = hdr->mdl.numverts, numt = hdr->mdl.numtris;
|
||||
stvert_t *pstverts;
|
||||
mtriangle_t *ptri;
|
||||
int numv = hdr->mdl.numverts;
|
||||
int numt = hdr->mdl.numtris;
|
||||
|
||||
pstverts = (stvert_t *) Hunk_AllocName (numv * sizeof (stvert_t),
|
||||
loadname);
|
||||
|
@ -104,11 +97,12 @@ Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m, int _s, i
|
|||
}
|
||||
|
||||
void *
|
||||
Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame, int extra)
|
||||
Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
|
||||
int extra)
|
||||
{
|
||||
trivertx_t *pframe, *pinframe;
|
||||
int i, j;
|
||||
daliasframe_t *pdaliasframe;
|
||||
daliasframe_t *pdaliasframe;
|
||||
int i, j;
|
||||
trivertx_t *pframe, *pinframe;
|
||||
|
||||
pdaliasframe = (daliasframe_t *) pin;
|
||||
|
||||
|
@ -135,7 +129,7 @@ Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame, int extra
|
|||
frame->frame = (byte *) pframe - (byte *) pheader;
|
||||
|
||||
for (j = 0; j < pheader->mdl.numverts; j++) {
|
||||
int k;
|
||||
int k;
|
||||
|
||||
// these are all byte values, so no need to deal with endianness
|
||||
pframe[j].lightnormalindex = pinframe[j].lightnormalindex;
|
||||
|
@ -165,14 +159,15 @@ Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame, int extra
|
|||
}
|
||||
|
||||
void *
|
||||
Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame, int extra)
|
||||
Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
||||
int extra)
|
||||
{
|
||||
daliasgroup_t *pingroup;
|
||||
maliasgroup_t *paliasgroup;
|
||||
int i, numframes;
|
||||
daliasgroup_t *pingroup;
|
||||
daliasinterval_t *pin_intervals;
|
||||
float *poutintervals;
|
||||
void *ptemp;
|
||||
float *poutintervals;
|
||||
int i, numframes;
|
||||
maliasgroup_t *paliasgroup;
|
||||
void *ptemp;
|
||||
|
||||
pingroup = (daliasgroup_t *) pin;
|
||||
|
||||
|
@ -229,4 +224,3 @@ void
|
|||
Mod_LoadExternalSkins (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
gl_model_brush.c
|
||||
|
||||
model loading and caching
|
||||
gl support routines for model loading and caching
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -71,9 +71,9 @@ Mod_LoadExternalTextures (model_t *mod)
|
|||
{
|
||||
char filename[MAX_QPATH + 8];
|
||||
int length, i;
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
texture_t *tx;
|
||||
VFile *f;
|
||||
|
||||
for (i = 0; i < mod->numtextures; i++)
|
||||
{
|
||||
|
|
|
@ -461,7 +461,7 @@ CalcSurfaceExtents (msurface_t *s)
|
|||
|
||||
s->texturemins[i] = bmins[i] * 16;
|
||||
s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
|
||||
//FIXME even 512 is really too small, need a saner test
|
||||
// FIXME even 512 is really too small, need a saner test
|
||||
if (!(tex->flags & TEX_SPECIAL) && s->extents[i] > 512)
|
||||
Sys_Error ("Bad surface extents: %x %d", tex->flags,
|
||||
s->extents[i]);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
sw_model_brush.c
|
||||
|
||||
model loading and caching
|
||||
sw renderer support routines for model loading and caching
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static const char rcsid[] =
|
|||
clip_hull_t *MOD_Alloc_Hull (int nodes, int planes)
|
||||
{
|
||||
clip_hull_t *ch;
|
||||
int size, i;
|
||||
int size, i;
|
||||
|
||||
size = sizeof (hull_t);
|
||||
size += sizeof (dclipnode_t) * nodes + sizeof (mplane_t) * planes;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
gl_model_fullbright.c
|
||||
|
||||
model loading and caching
|
||||
fullbright skin handling
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -68,18 +68,18 @@ Mod_Fullbright (byte *skin, int width, int height, char *name)
|
|||
int pixels;
|
||||
int texnum = 0;
|
||||
|
||||
// Check for fullbright pixels
|
||||
|
||||
pixels = width * height;
|
||||
|
||||
// ptexels = Hunk_Alloc(s);
|
||||
ptexels = malloc (pixels);
|
||||
SYS_CHECKMEM (ptexels);
|
||||
|
||||
// Check for fullbright pixels
|
||||
if (Mod_CalcFullbright (skin, ptexels, pixels)) {
|
||||
Sys_DPrintf ("FB Model ID: '%s'\n", name);
|
||||
texnum = GL_LoadTexture (name, width, height, ptexels, true, true, 1);
|
||||
}
|
||||
|
||||
free (ptexels);
|
||||
return texnum;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,8 @@
|
|||
static const char rcsid[] =
|
||||
"$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"
|
||||
|
@ -170,8 +168,8 @@ Mod_LoadModel (model_t *mod, qboolean crash)
|
|||
model_t *
|
||||
Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
|
||||
{
|
||||
byte stackbuf[1024]; // avoid dirtying the cache heap
|
||||
unsigned int *buf;
|
||||
byte stackbuf[1024]; // avoid dirtying the cache heap
|
||||
|
||||
// load the file
|
||||
buf = (unsigned int *) COM_LoadStackFile (mod->name, stackbuf,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
gl_model.c
|
||||
gl_model_sprite.c
|
||||
|
||||
model loading and caching
|
||||
gl support routines for sprite model loading and caching
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -51,8 +51,8 @@ Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum)
|
|||
{
|
||||
char name[64];
|
||||
char filename[MAX_QPATH + 4];
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
VFile *f;
|
||||
|
||||
snprintf (name, sizeof (name), "%s_%i", loadmodel->name, framenum);
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ void *
|
|||
Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
|
||||
{
|
||||
dspriteframe_t *pinframe;
|
||||
mspriteframe_t *pspriteframe;
|
||||
int width, height, size, origin[2];
|
||||
mspriteframe_t *pspriteframe;
|
||||
|
||||
pinframe = (dspriteframe_t *) pin;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
sw_model_sprite.c
|
||||
|
||||
model loading and caching
|
||||
sw renderer support routines for sprite model loading and caching
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
|
Loading…
Reference in a new issue