mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
More whitespace.
This commit is contained in:
parent
d4a385adbf
commit
44e2fbaa87
5 changed files with 92 additions and 107 deletions
|
@ -52,25 +52,18 @@ static const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
byte player_8bit_texels[320 * 200];
|
||||
byte player_8bit_texels[320 * 200];
|
||||
|
||||
|
||||
// a pose is a single set of vertexes. a frame may be
|
||||
// an animating sequence of poses
|
||||
|
||||
//=========================================================
|
||||
|
||||
/*
|
||||
Mod_FloodFillSkin
|
||||
|
||||
Fill background pixels so mipmapping doesn't have haloes - Ed
|
||||
*/
|
||||
// =========================================================
|
||||
|
||||
typedef struct {
|
||||
short x, y;
|
||||
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;
|
||||
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;
|
||||
daliasframe_t *pdaliasframe;
|
||||
int i;
|
||||
trivertx_t *pinframe;
|
||||
|
||||
pdaliasframe = (daliasframe_t *) pin;
|
||||
|
||||
|
@ -217,12 +212,13 @@ 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;
|
||||
daliasgroup_t *pingroup;
|
||||
daliasinterval_t *pin_intervals;
|
||||
void *ptemp;
|
||||
int i, numframes;
|
||||
void *ptemp;
|
||||
|
||||
pingroup = (daliasgroup_t *) pin;
|
||||
|
||||
|
@ -282,25 +278,25 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadExternalSkins (model_t *mod)
|
||||
{
|
||||
char filename[MAX_QPATH + 4];
|
||||
maliasskindesc_t *pskindesc;
|
||||
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 *)
|
||||
((byte *) pheader + pheader->skindesc)) + i;
|
||||
((byte *) pheader + pheader->skindesc)) + i;
|
||||
if (pskindesc->type == ALIAS_SKIN_SINGLE) {
|
||||
snprintf (filename, sizeof (filename), "%s_%i.tga", mod->name, i);
|
||||
Mod_LoadExternalSkin (pskindesc, filename);
|
||||
|
|
|
@ -56,7 +56,7 @@ int mod_lightmap_bytes = 3;
|
|||
void
|
||||
Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
|
||||
{
|
||||
char name[32];
|
||||
char name[32];
|
||||
|
||||
snprintf (name, sizeof (name), "fb_%s", mt->name);
|
||||
tx->gl_fb_texturenum =
|
||||
|
@ -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];
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
int i, length;
|
||||
int length, i;
|
||||
VFile *f;
|
||||
tex_t *targa;
|
||||
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++;
|
||||
}
|
||||
|
|
|
@ -52,17 +52,18 @@ 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);
|
||||
void R_InitSky (struct texture_s *mt);
|
||||
void GL_SubdivideSurface (msurface_t *fa);
|
||||
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)
|
||||
{
|
||||
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;
|
||||
dmiptexlump_t *m;
|
||||
int i, j, pixels, num, max, altmax;
|
||||
miptex_t *mt;
|
||||
texture_t *tx, *tx2;
|
||||
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))
|
||||
|
@ -429,11 +426,11 @@ Mod_LoadTexinfo (lump_t *l)
|
|||
void
|
||||
CalcSurfaceExtents (msurface_t *s)
|
||||
{
|
||||
float mins[2], maxs[2], val;
|
||||
int i, j, e;
|
||||
mvertex_t *v;
|
||||
float mins[2], maxs[2], val;
|
||||
int e, i, j;
|
||||
int bmins[2], bmaxs[2];
|
||||
mtexinfo_t *tex;
|
||||
int bmins[2], bmaxs[2];
|
||||
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;
|
||||
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;
|
||||
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,8 +757,8 @@ Mod_LoadMarksurfaces (lump_t *l)
|
|||
void
|
||||
Mod_LoadSurfedges (lump_t *l)
|
||||
{
|
||||
int i, count;
|
||||
int *in, *out;
|
||||
int count, i;
|
||||
int *in, *out;
|
||||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
|
@ -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;
|
||||
|
||||
|
@ -891,7 +887,7 @@ Mod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
|
||||
if (i < mod->numsubmodels - 1) {
|
||||
// duplicate the basic information
|
||||
char name[10];
|
||||
char name[10];
|
||||
|
||||
snprintf (name, sizeof (name), "*%i", i + 1);
|
||||
loadmodel = Mod_FindName (name);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
@ -48,7 +48,7 @@ Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
|
|||
{
|
||||
dspriteframe_t *pinframe;
|
||||
mspriteframe_t *pspriteframe;
|
||||
int width, height, size, origin[2];
|
||||
int width, height, size, origin[2];
|
||||
|
||||
pinframe = (dspriteframe_t *) pin;
|
||||
|
||||
|
@ -82,12 +82,12 @@ Mod_LoadSpriteFrame (void *pin, mspriteframe_t **ppframe, int framenum)
|
|||
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;
|
||||
void *ptemp;
|
||||
dspritegroup_t *pingroup;
|
||||
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;
|
||||
dsprite_t *pin;
|
||||
dspriteframetype_t *pframetype;
|
||||
int numframes, size, version, i;
|
||||
msprite_t *psprite;
|
||||
|
||||
pin = (dsprite_t *) buffer;
|
||||
|
||||
|
@ -173,7 +170,7 @@ Mod_LoadSpriteModel (model_t *mod, void *buffer)
|
|||
pframetype = (dspriteframetype_t *) (pin + 1);
|
||||
|
||||
for (i = 0; i < numframes; i++) {
|
||||
spriteframetype_t frametype;
|
||||
spriteframetype_t frametype;
|
||||
|
||||
frametype = LittleLong (pframetype->type);
|
||||
psprite->frames[i].type = frametype;
|
||||
|
|
Loading…
Reference in a new issue