mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-25 13:32:01 +00:00
whitespace.
This commit is contained in:
parent
c1e0cf7b8e
commit
2fdeaf7aaa
3 changed files with 40 additions and 53 deletions
|
@ -47,7 +47,7 @@ cvar_t *r_skyname;
|
||||||
cvar_t *pr_boundscheck;
|
cvar_t *pr_boundscheck;
|
||||||
|
|
||||||
void SV_Error (char *error, ...);
|
void SV_Error (char *error, ...);
|
||||||
void FindEdictFieldOffsets ();
|
void FindEdictFieldOffsets (void);
|
||||||
|
|
||||||
dprograms_t *progs;
|
dprograms_t *progs;
|
||||||
dfunction_t *pr_functions;
|
dfunction_t *pr_functions;
|
||||||
|
@ -60,9 +60,16 @@ float *pr_globals; // same as pr_global_struct
|
||||||
int pr_edict_size; // in bytes
|
int pr_edict_size; // in bytes
|
||||||
int pr_edictareasize; // LordHavoc: in bytes
|
int pr_edictareasize; // LordHavoc: in bytes
|
||||||
|
|
||||||
int type_size[8] =
|
int type_size[8] = {
|
||||||
{ 1, sizeof (void *) / 4, 1, 3, 1, 1, sizeof (void *) / 4,
|
1,
|
||||||
sizeof (void *) / 4 };
|
sizeof (void *) / 4,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
sizeof (void *) / 4,
|
||||||
|
sizeof (void *) / 4
|
||||||
|
};
|
||||||
|
|
||||||
ddef_t *ED_FieldAtOfs (int ofs);
|
ddef_t *ED_FieldAtOfs (int ofs);
|
||||||
qboolean ED_ParseEpair (void *base, ddef_t *key, char *s);
|
qboolean ED_ParseEpair (void *base, ddef_t *key, char *s);
|
||||||
|
@ -111,7 +118,7 @@ instead of being removed and recreated, which can cause interpolated
|
||||||
angles and bad trails.
|
angles and bad trails.
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
edict_t *
|
edict_t *
|
||||||
ED_Alloc (void)
|
ED_Alloc (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -175,7 +182,7 @@ ED_Free (edict_t *ed)
|
||||||
ED_GlobalAtOfs
|
ED_GlobalAtOfs
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
ddef_t *
|
ddef_t *
|
||||||
ED_GlobalAtOfs (int ofs)
|
ED_GlobalAtOfs (int ofs)
|
||||||
{
|
{
|
||||||
ddef_t *def;
|
ddef_t *def;
|
||||||
|
@ -194,7 +201,7 @@ ED_GlobalAtOfs (int ofs)
|
||||||
ED_FieldAtOfs
|
ED_FieldAtOfs
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
ddef_t *
|
ddef_t *
|
||||||
ED_FieldAtOfs (int ofs)
|
ED_FieldAtOfs (int ofs)
|
||||||
{
|
{
|
||||||
ddef_t *def;
|
ddef_t *def;
|
||||||
|
@ -213,7 +220,7 @@ ED_FieldAtOfs (int ofs)
|
||||||
ED_FindField
|
ED_FindField
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
ddef_t *
|
ddef_t *
|
||||||
ED_FindField (char *name)
|
ED_FindField (char *name)
|
||||||
{
|
{
|
||||||
ddef_t *def;
|
ddef_t *def;
|
||||||
|
@ -233,7 +240,7 @@ ED_FindField (char *name)
|
||||||
ED_FindGlobal
|
ED_FindGlobal
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
ddef_t *
|
ddef_t *
|
||||||
ED_FindGlobal (char *name)
|
ED_FindGlobal (char *name)
|
||||||
{
|
{
|
||||||
ddef_t *def;
|
ddef_t *def;
|
||||||
|
|
|
@ -260,7 +260,7 @@ struct maplist {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct maplist *
|
static struct maplist *
|
||||||
maplist_new ()
|
maplist_new (void)
|
||||||
{
|
{
|
||||||
return calloc (1, sizeof (struct maplist));
|
return calloc (1, sizeof (struct maplist));
|
||||||
}
|
}
|
||||||
|
@ -492,7 +492,7 @@ COM_CopyFile (char *netpath, char *cachepath)
|
||||||
/*
|
/*
|
||||||
COM_OpenRead
|
COM_OpenRead
|
||||||
*/
|
*/
|
||||||
QFile *
|
QFile *
|
||||||
COM_OpenRead (const char *path, int offs, int len, int zip)
|
COM_OpenRead (const char *path, int offs, int len, int zip)
|
||||||
{
|
{
|
||||||
int fd = open (path, O_RDONLY);
|
int fd = open (path, O_RDONLY);
|
||||||
|
@ -650,22 +650,20 @@ int loadsize;
|
||||||
Filename are relative to the quake directory.
|
Filename are relative to the quake directory.
|
||||||
Allways appends a 0 byte to the loaded data.
|
Allways appends a 0 byte to the loaded data.
|
||||||
*/
|
*/
|
||||||
byte *
|
byte *
|
||||||
COM_LoadFile (char *path, int usehunk)
|
COM_LoadFile (char *path, int usehunk)
|
||||||
{
|
{
|
||||||
QFile *h;
|
QFile *h;
|
||||||
byte *buf;
|
byte *buf = NULL;
|
||||||
char base[32];
|
char base[32];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
buf = NULL; // quiet compiler warning
|
// look for it in the filesystem or pack files
|
||||||
|
|
||||||
// look for it in the filesystem or pack files
|
|
||||||
len = com_filesize = COM_FOpenFile (path, &h);
|
len = com_filesize = COM_FOpenFile (path, &h);
|
||||||
if (!h)
|
if (!h)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// extract the filename base name for hunk tag
|
// extract the filename base name for hunk tag
|
||||||
COM_FileBase (path, base);
|
COM_FileBase (path, base);
|
||||||
|
|
||||||
if (usehunk == 1)
|
if (usehunk == 1)
|
||||||
|
@ -700,13 +698,13 @@ COM_LoadFile (char *path, int usehunk)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte *
|
byte *
|
||||||
COM_LoadHunkFile (char *path)
|
COM_LoadHunkFile (char *path)
|
||||||
{
|
{
|
||||||
return COM_LoadFile (path, 1);
|
return COM_LoadFile (path, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte *
|
byte *
|
||||||
COM_LoadTempFile (char *path)
|
COM_LoadTempFile (char *path)
|
||||||
{
|
{
|
||||||
return COM_LoadFile (path, 2);
|
return COM_LoadFile (path, 2);
|
||||||
|
@ -720,7 +718,7 @@ COM_LoadCacheFile (char *path, struct cache_user_s *cu)
|
||||||
}
|
}
|
||||||
|
|
||||||
// uses temp hunk if larger than bufsize
|
// uses temp hunk if larger than bufsize
|
||||||
byte *
|
byte *
|
||||||
COM_LoadStackFile (char *path, void *buffer, int bufsize)
|
COM_LoadStackFile (char *path, void *buffer, int bufsize)
|
||||||
{
|
{
|
||||||
byte *buf;
|
byte *buf;
|
||||||
|
@ -740,7 +738,7 @@ COM_LoadStackFile (char *path, void *buffer, int bufsize)
|
||||||
Loads the header and directory, adding the files at the beginning
|
Loads the header and directory, adding the files at the beginning
|
||||||
of the list so they override previous pack files.
|
of the list so they override previous pack files.
|
||||||
*/
|
*/
|
||||||
pack_t *
|
pack_t *
|
||||||
COM_LoadPackFile (char *packfile)
|
COM_LoadPackFile (char *packfile)
|
||||||
{
|
{
|
||||||
dpackheader_t header;
|
dpackheader_t header;
|
||||||
|
@ -772,7 +770,7 @@ COM_LoadPackFile (char *packfile)
|
||||||
Qread (packhandle, info, header.dirlen);
|
Qread (packhandle, info, header.dirlen);
|
||||||
|
|
||||||
|
|
||||||
// parse the directory
|
// parse the directory
|
||||||
for (i = 0; i < numpackfiles; i++) {
|
for (i = 0; i < numpackfiles; i++) {
|
||||||
strcpy (newfiles[i].name, info[i].name);
|
strcpy (newfiles[i].name, info[i].name);
|
||||||
newfiles[i].filepos = LittleLong (info[i].filepos);
|
newfiles[i].filepos = LittleLong (info[i].filepos);
|
||||||
|
@ -826,7 +824,6 @@ qstrcmp (char **os1, char **os2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
COM_LoadGameDirectory (char *dir)
|
COM_LoadGameDirectory (char *dir)
|
||||||
{
|
{
|
||||||
|
@ -922,18 +919,13 @@ COM_AddDirectory (char *dir)
|
||||||
strcpy (com_gamedir, va ("%s/%s", fs_userpath->string, dir));
|
strcpy (com_gamedir, va ("%s/%s", fs_userpath->string, dir));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// add the directory to the search path
|
||||||
// add the directory to the search path
|
|
||||||
//
|
|
||||||
search = calloc (1, sizeof (searchpath_t));
|
search = calloc (1, sizeof (searchpath_t));
|
||||||
strcpy (search->filename, dir);
|
strcpy (search->filename, dir);
|
||||||
search->next = com_searchpaths;
|
search->next = com_searchpaths;
|
||||||
com_searchpaths = search;
|
com_searchpaths = search;
|
||||||
|
|
||||||
//
|
// add any pak files in the format pak0.pak pak1.pak, ...
|
||||||
// add any pak files in the format pak0.pak pak1.pak, ...
|
|
||||||
//
|
|
||||||
|
|
||||||
COM_LoadGameDirectory (dir);
|
COM_LoadGameDirectory (dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1063,9 +1055,7 @@ COM_Filesystem_Init (void)
|
||||||
|
|
||||||
Cmd_AddCommand ("gamedir", COM_Gamedir_f);
|
Cmd_AddCommand ("gamedir", COM_Gamedir_f);
|
||||||
|
|
||||||
/*
|
// start up with basegame->string by default
|
||||||
start up with basegame->string by default
|
|
||||||
*/
|
|
||||||
COM_CreateGameDirectory (fs_basegame->string);
|
COM_CreateGameDirectory (fs_basegame->string);
|
||||||
|
|
||||||
// If we're dealing with id1, use qw too
|
// If we're dealing with id1, use qw too
|
||||||
|
@ -1105,7 +1095,7 @@ COM_Filesystem_Init_Cvars (void)
|
||||||
COM_SkipPath
|
COM_SkipPath
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
COM_SkipPath (char *pathname)
|
COM_SkipPath (char *pathname)
|
||||||
{
|
{
|
||||||
char *last;
|
char *last;
|
||||||
|
@ -1137,7 +1127,7 @@ COM_StripExtension (char *in, char *out)
|
||||||
COM_FileExtension
|
COM_FileExtension
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
COM_FileExtension (char *in)
|
COM_FileExtension (char *in)
|
||||||
{
|
{
|
||||||
static char exten[8];
|
static char exten[8];
|
||||||
|
|
|
@ -62,7 +62,7 @@ extern mtriangle_t triangles[MAXALIASTRIS];
|
||||||
extern trivertx_t *poseverts[MAXALIASFRAMES];
|
extern trivertx_t *poseverts[MAXALIASFRAMES];
|
||||||
extern int posenum;
|
extern int posenum;
|
||||||
|
|
||||||
void *
|
void *
|
||||||
Mod_LoadSkin (byte * skin, int skinsize, int *pskinindex, int snum, int gnum)
|
Mod_LoadSkin (byte * skin, int skinsize, int *pskinindex, int snum, int gnum)
|
||||||
{
|
{
|
||||||
byte *pskin;
|
byte *pskin;
|
||||||
|
@ -94,7 +94,7 @@ Mod_LoadSkin (byte * skin, int skinsize, int *pskinindex, int snum, int gnum)
|
||||||
Mod_LoadAllSkins
|
Mod_LoadAllSkins
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex)
|
Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex)
|
||||||
{
|
{
|
||||||
int snum, gnum, t;
|
int snum, gnum, t;
|
||||||
|
@ -172,9 +172,7 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
||||||
int numt = hdr->mdl.numtris;
|
int numt = hdr->mdl.numtris;
|
||||||
|
|
||||||
pstverts = (stvert_t *) Hunk_AllocName (numv * sizeof (stvert_t), loadname);
|
pstverts = (stvert_t *) Hunk_AllocName (numv * sizeof (stvert_t), loadname);
|
||||||
ptri =
|
ptri = (mtriangle_t *) Hunk_AllocName (numt * sizeof (mtriangle_t), loadname);
|
||||||
|
|
||||||
(mtriangle_t *) Hunk_AllocName (numt * sizeof (mtriangle_t), loadname);
|
|
||||||
|
|
||||||
hdr->stverts = (byte *) pstverts - (byte *) hdr;
|
hdr->stverts = (byte *) pstverts - (byte *) hdr;
|
||||||
hdr->triangles = (byte *) ptri - (byte *) hdr;
|
hdr->triangles = (byte *) ptri - (byte *) hdr;
|
||||||
|
@ -198,7 +196,7 @@ GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
||||||
Mod_LoadAliasFrame
|
Mod_LoadAliasFrame
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
Mod_LoadAliasFrame (void *pin, maliasframedesc_t *frame)
|
Mod_LoadAliasFrame (void *pin, maliasframedesc_t *frame)
|
||||||
{
|
{
|
||||||
trivertx_t *pframe, *pinframe;
|
trivertx_t *pframe, *pinframe;
|
||||||
|
@ -209,16 +207,13 @@ Mod_LoadAliasFrame (void *pin, maliasframedesc_t *frame)
|
||||||
|
|
||||||
strcpy (frame->name, pdaliasframe->name);
|
strcpy (frame->name, pdaliasframe->name);
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) { // byte values, don't worry about endianness
|
||||||
// these are byte values, so we don't have to worry about
|
|
||||||
// endianness
|
|
||||||
frame->bboxmin.v[i] = pdaliasframe->bboxmin.v[i];
|
frame->bboxmin.v[i] = pdaliasframe->bboxmin.v[i];
|
||||||
frame->bboxmax.v[i] = pdaliasframe->bboxmax.v[i];
|
frame->bboxmax.v[i] = pdaliasframe->bboxmax.v[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
pinframe = (trivertx_t *) (pdaliasframe + 1);
|
pinframe = (trivertx_t *) (pdaliasframe + 1);
|
||||||
pframe =
|
pframe = Hunk_AllocName (pheader->mdl.numverts * sizeof (*pframe), loadname);
|
||||||
Hunk_AllocName (pheader->mdl.numverts * sizeof (*pframe), loadname);
|
|
||||||
|
|
||||||
frame->frame = (byte *) pframe - (byte *) pheader;
|
frame->frame = (byte *) pframe - (byte *) pheader;
|
||||||
|
|
||||||
|
@ -244,7 +239,7 @@ Mod_LoadAliasFrame (void *pin, maliasframedesc_t *frame)
|
||||||
Mod_LoadAliasGroup
|
Mod_LoadAliasGroup
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
Mod_LoadAliasGroup (void *pin, maliasframedesc_t *frame)
|
Mod_LoadAliasGroup (void *pin, maliasframedesc_t *frame)
|
||||||
{
|
{
|
||||||
daliasgroup_t *pingroup;
|
daliasgroup_t *pingroup;
|
||||||
|
@ -258,12 +253,7 @@ Mod_LoadAliasGroup (void *pin, maliasframedesc_t *frame)
|
||||||
|
|
||||||
numframes = LittleLong (pingroup->numframes);
|
numframes = LittleLong (pingroup->numframes);
|
||||||
|
|
||||||
paliasgroup = Hunk_AllocName (sizeof (maliasgroup_t) +
|
paliasgroup = Hunk_AllocName (sizeof (maliasgroup_t) + (numframes - 1) * sizeof (paliasgroup->frames[0]), loadname);
|
||||||
(numframes -
|
|
||||||
1) * sizeof (paliasgroup->frames[0]),
|
|
||||||
|
|
||||||
loadname);
|
|
||||||
|
|
||||||
paliasgroup->numframes = numframes;
|
paliasgroup->numframes = numframes;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
|
|
Loading…
Reference in a new issue