More whitespace.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-08-22 20:06:30 +00:00
parent d4a385adbf
commit 44e2fbaa87
5 changed files with 92 additions and 107 deletions

View file

@ -60,17 +60,10 @@ byte player_8bit_texels[320 * 200];
// =========================================================
/*
Mod_FloodFillSkin
Fill background pixels so mipmapping doesn't have haloes - Ed
*/
typedef struct {
short x, y;
} floodfill_t;
// must be a power of 2
#define FLOODFILL_FIFO_SIZE 0x1000
#define FLOODFILL_FIFO_MASK (FLOODFILL_FIFO_SIZE - 1)
@ -86,13 +79,17 @@ typedef struct {
else if (pos[off] != 255) fdc = pos[off]; \
}
/*
Mod_FloodFillSkin
Fill background pixels so mipmapping doesn't have halos - Ed
*/
void
Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight)
{
byte fillcolor = *skin; // assume this is the pixel to fill
floodfill_t fifo[FLOODFILL_FIFO_SIZE];
int inpt = 0, outpt = 0;
int filledcolor = -1;
int filledcolor = -1, inpt = 0, outpt = 0;
int i;
if (filledcolor == -1) {
@ -115,8 +112,7 @@ Mod_FloodFillSkin (byte * skin, int skinwidth, int skinheight)
inpt = (inpt + 1) & FLOODFILL_FIFO_MASK;
while (outpt != inpt) {
int x = fifo[outpt].x, y = fifo[outpt].y;
int fdc = filledcolor;
int x = fifo[outpt].x, y = fifo[outpt].y, fdc = filledcolor;
byte *pos = &skin[x + skinwidth * y];
outpt = (outpt + 1) & FLOODFILL_FIFO_MASK;
@ -137,10 +133,9 @@ void *
Mod_LoadSkin (byte * skin, int skinsize, int snum, int gnum, qboolean group,
maliasskindesc_t *skindesc)
{
char name[32];
int fb_texnum = 0;
int texnum = 0;
byte *pskin;
char name[32];
int fb_texnum = 0, texnum = 0;
pskin = Hunk_AllocName (skinsize, loadname);
skindesc->skin = (byte *) pskin - (byte *) pheader;
@ -184,9 +179,9 @@ void *
Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
int extra)
{
trivertx_t *pinframe;
int i;
daliasframe_t *pdaliasframe;
int i;
trivertx_t *pinframe;
pdaliasframe = (daliasframe_t *) pin;
@ -217,11 +212,12 @@ Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
}
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;
int i, numframes;
daliasinterval_t *pin_intervals;
int i, numframes;
void *ptemp;
pingroup = (daliasgroup_t *) pin;
@ -282,11 +278,11 @@ Mod_LoadExternalSkin (maliasskindesc_t *pskindesc, char *filename)
targa = LoadTGA (f);
Qclose (f);
if (targa->format < 4)
pskindesc->texnum = GL_LoadTexture ("", targa->width,
targa->height, targa->data, true, false, 3);
pskindesc->texnum = GL_LoadTexture
("", targa->width, targa->height, targa->data, true, false, 3);
else
pskindesc->texnum = GL_LoadTexture ("", targa->width,
targa->height, targa->data, true, true, 4);
pskindesc->texnum = GL_LoadTexture
("", targa->width, targa->height, targa->data, true, true, 4);
}
}
@ -294,9 +290,9 @@ void
Mod_LoadExternalSkins (model_t *mod)
{
char filename[MAX_QPATH + 4];
int i, j;
maliasskindesc_t *pskindesc;
maliasskingroup_t *pskingroup;
int i, j;
for (i = 0; i < pheader->mdl.numskins; i++) {
pskindesc = ((maliasskindesc_t *)

View file

@ -69,11 +69,11 @@ Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
void
Mod_LoadExternalTextures (model_t *mod)
{
texture_t *tx;
char filename[MAX_QPATH + 8];
int length, i;
VFile *f;
tex_t *targa;
int i, length;
texture_t *tx;
for (i = 0; i < mod->numtextures; i++)
{
@ -112,10 +112,10 @@ Mod_LoadExternalTextures (model_t *mod)
void
Mod_LoadLighting (lump_t *l)
{
int i;
byte *in, *out, *data;
byte d;
byte *in, *out, *data;
char litfilename[1024];
int i;
loadmodel->lightdata = NULL;
if (mod_lightmap_bytes > 1) {
@ -147,17 +147,14 @@ Mod_LoadLighting (lump_t *l)
in = mod_base + l->fileofs;
out = loadmodel->lightdata;
if (mod_lightmap_bytes > 1) {
if (mod_lightmap_bytes > 1)
for (i = 0; i < l->filelen ; i++) {
d = *in++;
*out++ = d;
*out++ = d;
*out++ = d;
}
} else {
for (i = 0; i < l->filelen ; i++) {
d = *in++;
*out++ = d;
}
}
else
for (i = 0; i < l->filelen ; i++)
*out++ = *in++;
}

View file

@ -52,6 +52,7 @@ static const char rcsid[] =
#include "compat.h"
byte mod_novis[MAX_MAP_LEAFS / 8];
cvar_t *gl_sky_divide;
void GL_SubdivideSurface (msurface_t *fa);
@ -61,8 +62,8 @@ void R_InitSky (struct texture_s *mt);
mleaf_t *
Mod_PointInLeaf (const vec3_t p, model_t *model)
{
mnode_t *node;
float d;
mnode_t *node;
mplane_t *plane;
if (!model || !model->nodes)
@ -87,9 +88,8 @@ byte *
Mod_DecompressVis (byte * in, model_t *model)
{
static byte decompressed[MAX_MAP_LEAFS / 8];
int c;
byte *out;
int row;
int row, c;
row = (model->numleafs + 7) >> 3;
out = decompressed;
@ -138,12 +138,11 @@ byte *mod_base;
void
Mod_LoadTextures (lump_t *l)
{
dmiptexlump_t *m;
int i, j, pixels, num, max, altmax;
miptex_t *mt;
texture_t *tx, *tx2;
texture_t *anims[10];
texture_t *altanims[10];
dmiptexlump_t *m;
texture_t *anims[10], *altanims[10];
if (!l->filelen) {
loadmodel->textures = NULL;
@ -296,8 +295,8 @@ void
Mod_LoadVertexes (lump_t *l)
{
dvertex_t *in;
int count, i;
mvertex_t *out;
int i, count;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -318,9 +317,8 @@ Mod_LoadVertexes (lump_t *l)
void
Mod_LoadSubmodels (lump_t *l)
{
dmodel_t *in;
dmodel_t *out;
int i, j, count;
dmodel_t *in, *out;
int count, i, j;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -349,8 +347,8 @@ void
Mod_LoadEdges (lump_t *l)
{
dedge_t *in;
int count, i;
medge_t *out;
int i, count;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -370,11 +368,10 @@ Mod_LoadEdges (lump_t *l)
void
Mod_LoadTexinfo (lump_t *l)
{
texinfo_t *in;
mtexinfo_t *out;
int i, j, count;
int miptex;
float len1, len2;
int count, miptex, i, j;
mtexinfo_t *out;
texinfo_t *in;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -430,10 +427,10 @@ void
CalcSurfaceExtents (msurface_t *s)
{
float mins[2], maxs[2], val;
int i, j, e;
mvertex_t *v;
mtexinfo_t *tex;
int e, i, j;
int bmins[2], bmaxs[2];
mtexinfo_t *tex;
mvertex_t *v;
mins[0] = mins[1] = 999999;
maxs[0] = maxs[1] = -99999;
@ -475,9 +472,8 @@ void
Mod_LoadFaces (lump_t *l)
{
dface_t *in;
int count, planenum, side, surfnum, i;
msurface_t *out;
int i, count, surfnum;
int planenum, side;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -552,8 +548,8 @@ Mod_SetParent (mnode_t *node, mnode_t *parent)
void
Mod_LoadNodes (lump_t *l)
{
int i, j, count, p;
dnode_t *in;
int count, i, j, p;
mnode_t *out;
in = (void *) (mod_base + l->fileofs);
@ -593,8 +589,8 @@ void
Mod_LoadLeafs (lump_t *l)
{
dleaf_t *in;
int count, i, j, p;
mleaf_t *out;
int i, j, count, p;
qboolean isnotmap = true;
in = (void *) (mod_base + l->fileofs);
@ -648,8 +644,8 @@ void
Mod_LoadClipnodes (lump_t *l)
{
dclipnode_t *in, *out;
int i, count;
hull_t *hull;
int count, i;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -706,10 +702,10 @@ Mod_LoadClipnodes (lump_t *l)
void
Mod_MakeHull0 (void)
{
mnode_t *in, *child;
dclipnode_t *out;
int i, j, count;
hull_t *hull;
int count, i, j;
mnode_t *in, *child;
hull = &loadmodel->hulls[0];
@ -737,9 +733,9 @@ Mod_MakeHull0 (void)
void
Mod_LoadMarksurfaces (lump_t *l)
{
int i, j, count;
short *in;
int count, i, j;
msurface_t **out;
short *in;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -761,7 +757,7 @@ Mod_LoadMarksurfaces (lump_t *l)
void
Mod_LoadSurfedges (lump_t *l)
{
int i, count;
int count, i;
int *in, *out;
in = (void *) (mod_base + l->fileofs);
@ -780,9 +776,9 @@ Mod_LoadSurfedges (lump_t *l)
void
Mod_LoadPlanes (lump_t *l)
{
int i, j, bits, count;
mplane_t *out;
dplane_t *in;
int bits, count, i, j;
mplane_t *out;
in = (void *) (mod_base + l->fileofs);
if (l->filelen % sizeof (*in))
@ -810,9 +806,9 @@ Mod_LoadPlanes (lump_t *l)
void
Mod_LoadBrushModel (model_t *mod, void *buffer)
{
int i, j;
dheader_t *header;
dmodel_t *bm;
int i, j;
loadmodel->type = mod_brush;

View file

@ -1,5 +1,5 @@
/*
sw_model_bursh.c
sw_model_brush.c
model loading and caching
@ -42,7 +42,6 @@ static const char rcsid[] =
#include "QF/model.h"
int mod_lightmap_bytes = 1;

View file

@ -1,7 +1,7 @@
/*
gl_model.c
model_sprite.c
model loading and caching
sprite model loading and caching
Copyright (C) 1996-1997 Id Software, Inc.
@ -83,10 +83,10 @@ void *
Mod_LoadSpriteGroup (void *pin, mspriteframe_t **ppframe, int framenum)
{
dspritegroup_t *pingroup;
mspritegroup_t *pspritegroup;
int i, numframes;
dspriteinterval_t *pin_intervals;
float *poutintervals;
int numframes, i;
mspritegroup_t *pspritegroup;
void *ptemp;
pingroup = (dspritegroup_t *) pin;
@ -129,13 +129,10 @@ Mod_LoadSpriteGroup (void *pin, mspriteframe_t **ppframe, int framenum)
void
Mod_LoadSpriteModel (model_t *mod, void *buffer)
{
int i;
int version;
dsprite_t *pin;
msprite_t *psprite;
int numframes;
int size;
dspriteframetype_t *pframetype;
int numframes, size, version, i;
msprite_t *psprite;
pin = (dsprite_t *) buffer;