Small changes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@903 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-03-18 06:13:36 +00:00
parent 74f9fa8581
commit f23f8ba961
12 changed files with 101 additions and 26 deletions

View File

@ -955,7 +955,7 @@ static cmd_function_t *cmd_functions; // possible commands to execute
Cmd_Argc
============
*/
int Cmd_Argc (void)
int VARGS Cmd_Argc (void)
{
return cmd_argc;
}
@ -965,7 +965,7 @@ int Cmd_Argc (void)
Cmd_Argv
============
*/
char *Cmd_Argv (int arg)
char *VARGS Cmd_Argv (int arg)
{
if ( arg >= cmd_argc )
return cmd_null_string;
@ -980,7 +980,7 @@ Returns a single string containing argv(1) to argv(argc()-1)
============
*/
char *Cmd_Args (void)
char *VARGS Cmd_Args (void)
{
if (!cmd_args)
return "";
@ -2639,6 +2639,7 @@ void Cmd_Init (void)
// register our commands
//
Cmd_AddCommand ("cfg_save",Cmd_WriteConfig_f);
Cmd_AddCommand ("cfg_load",Cmd_Exec_f);
Cmd_AddCommand ("exec",Cmd_Exec_f);
@ -2656,7 +2657,6 @@ void Cmd_Init (void)
// Cmd_AddCommand ("msg_trigger", Cmd_Msg_Trigger_f);
// Cmd_AddCommand ("filter", Cmd_Msg_Filter_f);
Cmd_AddCommand ("set", Cmd_set_f);
Cmd_AddCommand ("seta", Cmd_set_f);
Cmd_AddCommand ("inc", Cvar_Inc_f);
@ -2666,10 +2666,8 @@ void Cmd_Init (void)
Cmd_AddCommand ("cmdlist", Cmd_List_f);
Cmd_AddCommand ("aliaslist", Cmd_AliasList_f);
Cmd_AddCommand ("cvarlist", Cvar_List_f);
Cmd_AddCommand ("fs_flush", COM_RefreshFSCache_f);
Cvar_Register(&com_fs_cache, "Filesystem");
Cvar_Register(&tp_disputablemacros, "Teamplay");
#ifndef SERVERONLY
@ -2681,7 +2679,6 @@ void Cmd_Init (void)
cmd_maxbuffersize.restriction = RESTRICT_MAX; //filling this causes a loop for quite some time.
Cvar_Register(&cl_aliasoverlap, "Console");
//FIXME: go through quake.rc and parameters looking for sets and setas and setting them now.
}

View File

@ -88,9 +88,9 @@ qboolean Cmd_IsCommand (char *line);
// attempts to match a partial command for automatic command line completion
// returns NULL if nothing fits
int Cmd_Argc (void);
char *Cmd_Argv (int arg);
char *Cmd_Args (void);
int VARGS Cmd_Argc (void);
char *VARGS Cmd_Argv (int arg);
char *VARGS Cmd_Args (void);
extern int Cmd_ExecLevel;
extern cvar_t cmd_gamecodelevel, cmd_allowaccess;

View File

@ -336,6 +336,7 @@ char *Q_strlwr(char *s)
int Q_strwildcmp(char *s1, char *s2) //2 is wild
{
return !wildcmp(s1, s2);
while (1)
{
if (!*s1 && !*s2)
@ -1369,6 +1370,55 @@ char *COM_FileExtension (char *in)
return exten;
}
//Quake 2's tank model has a borked skin (or two).
void COM_CleanUpPath(char *str)
{
char *dots;
char *slash;
int critisize = 0;
for (dots = str; *dots; dots++)
{
if (*dots >= 'A' && *dots <= 'Z')
{
*dots = *dots - 'A' + 'a';
critisize = 1;
}
else if (*dots == '\\')
{
*dots = '/';
critisize = 2;
}
}
while (dots = strstr(str, ".."))
{
for (slash = dots-2; slash >= str; slash--)
{
if (*slash == '/')
{
memmove(slash, dots+2, strlen(dots+2)+1);
critisize = 3;
break;
}
}
}
while(*str == '/')
{
memmove(str, str+1, strlen(str+1)+1);
critisize = 4;
}
if(critisize)
{
if (critisize == 1) //not a biggy, so not red.
Con_Printf("Please fix file case on your files\n");
else if (critisize == 2) //you're evil.
Con_Printf("^1NEVER use backslash in a quake filename (we like portability)\n");
else if (critisize == 3) //compleatly stupid. The main reason why this function exists. Quake2 does it!
Con_Printf("You realise that relative paths are a waste of space?\n");
else if (critisize == 4) //AAAAHHHHH! (consider sys_error instead)
Con_Printf("^1AAAAAAAHHHH! An absolute path!\n");
}
}
/*
============
COM_FileBase
@ -3526,7 +3576,7 @@ pack_t *COM_LoadPackFile (char *packfile)
CRC_ProcessByte(&crc, ((qbyte *)&info)[j]);
*/
strcpy (newfiles[i].name, info.name);
Q_strlwr(newfiles[i].name);
COM_CleanUpPath(newfiles[i].name); //blooming tanks.
newfiles[i].filepos = LittleLong(info.filepos);
newfiles[i].filelen = LittleLong(info.filelen);
#ifdef HASH_FILESYSTEM

View File

@ -234,6 +234,7 @@ void COM_StripExtension (char *in, char *out);
void COM_FileBase (char *in, char *out);
void COM_DefaultExtension (char *path, char *extension);
char *COM_FileExtension (char *in);
void COM_CleanUpPath(char *str);
char *VARGS va(char *format, ...);
// does a varargs printf into a temp buffer

View File

@ -71,10 +71,8 @@ cvar_group_t *Cvar_GetGroup(char *gname)
g = Z_Malloc(sizeof(cvar_group_t));
g->name = gname;
g->next = NULL;
g->next = cvar_groups;
cvar_groups = g;
return g;
}

View File

@ -1198,6 +1198,7 @@ void CMod_LoadTexInfo (lump_t *l) //yes I know these load from the same place
}
if (j == texcount) //load a new one
{
strlwr(in->texture);
_snprintf (name, sizeof(name), "textures/%s.wal", in->texture);
out->texture = Mod_LoadWall (name);
@ -1363,7 +1364,7 @@ void CMod_LoadFaces (lump_t *l)
out->samples = loadmodel->lightdata + i/3;
// set the drawing flags
/*
if (out->texinfo->flags & SURF_WARP)
{
out->flags |= SURF_DRAWTURB;
@ -1372,9 +1373,9 @@ void CMod_LoadFaces (lump_t *l)
out->extents[i] = 16384;
out->texturemins[i] = -8192;
}
GL_SubdivideSurface (out); // cut up polygon for warps
GL_SubdivideSurface (out, 64); // cut up polygon for warps
}
*/
}
}
#endif
@ -4883,7 +4884,7 @@ void FloodAreaConnections (void)
}
void CMQ2_SetAreaPortalState (int portalnum, qboolean open)
void VARGS CMQ2_SetAreaPortalState (int portalnum, qboolean open)
{
if (mapisq3)
Host_Error ("CMQ2_SetAreaPortalState on q3 map");
@ -4918,7 +4919,7 @@ void CMQ3_SetAreaPortalState (int area1, int area2, qboolean open)
}
}
qboolean CM_AreasConnected (int area1, int area2)
qboolean VARGS CM_AreasConnected (int area1, int area2)
{
if (map_noareas.value)
return true;

View File

@ -106,4 +106,6 @@ void ML_Project (vec3_t in, vec3_t out, vec3_t viewangles, vec3_t vieworg, float
void Matrix3_Multiply (vec3_t *in1, vec3_t *in2, vec3_t *out);
void Matrix4_Transform3(float *matrix, float *vector, float *product);
void ML_ModelViewMatrix(vec3_t modelview, vec3_t viewangles, vec3_t vieworg);
void ML_ModelViewMatrixFromAxis(float *modelview, vec3_t pn, vec3_t right, vec3_t up, vec3_t vieworg);

View File

@ -106,7 +106,8 @@ void P_NewServer(void);
//allocate a new effect
int P_ParticleTypeForName(char *name);
int P_AllocateParticleType(char *name);
int P_AllocateParticleType(char *name); //find one if it exists, or create if it doesn't.
qboolean P_DescriptionIsLoaded(char *name); //returns true if it's usable.
void P_SkyTri(float *v1, float *v2, float *v3, struct msurface_s *surf);

View File

@ -142,3 +142,4 @@ qboolean PM_TestPlayerPosition (vec3_t point);
#ifndef __cplusplus
struct trace_s PM_PlayerTrace (vec3_t start, vec3_t stop);
#endif

View File

@ -1244,7 +1244,7 @@ Pmove
Can be called by either the server or the client
================
*/
void Q2_Pmove (q2pmove_t *pmove)
void VARGS Q2_Pmove (q2pmove_t *pmove)
{
q2pm = pmove;

View File

@ -151,7 +151,7 @@ int Z_Allocated(void)
return used;
}
void Z_Free (void *c)
void VARGS Z_Free (void *c)
{
zone_t *nz;
nz = ((zone_t *)((char*)c-ZONEDEBUG))-1;
@ -221,8 +221,31 @@ void BZ_CheckSentinals(void *c)
#endif
}
void BZ_CheckAllSentinals(void)
{
zone_t *zone;
for(zone = zone_head; zone; zone=zone->next)
{
int i;
qbyte *buf;
buf = (qbyte *)(zone+1);
for (i = 0; i < ZONEDEBUG; i++)
{
if (buf[i] != sentinalkey)
*(int*)0 = -3; //force a crash... this'll get our attention.
}
buf+=ZONEDEBUG;
//app data
buf += zone->size;
for (i = 0; i < ZONEDEBUG; i++)
{
if (buf[i] != sentinalkey)
*(int*)0 = -3; //force a crash... this'll get our attention.
}
}
}
void Z_FreeTags(int tag)
void VARGS Z_FreeTags(int tag)
{
zone_t *zone, *next;
for(zone = zone_head; zone; zone=next)
@ -286,9 +309,10 @@ void *Z_BaseTagMalloc (int size, int tag, qboolean clear)
#ifdef NAMEDMALLOCS
strcpy((char *)(nt+1) + nt->size + ZONEDEBUG*2, buffer);
#endif
BZ_CheckAllSentinals();
return buf;
}
void *Z_TagMalloc (int size, int tag)
void *VARGS Z_TagMalloc (int size, int tag)
{
#ifdef NAMEDMALLOCS
return Z_BaseTagMalloc(size, tag, true, "");

View File

@ -85,12 +85,12 @@ Zone block
void Memory_Init (void *buf, int size);
void Z_Free (void *ptr);
void VARGS Z_Free (void *ptr);
void *Z_Malloc (int size); // returns 0 filled memory
void *Z_MallocNamed (int size, char *, int); // returns 0 filled memory
//#define Z_Malloc(x) Z_MallocNamed2(x, __FILE__, __LINE__ )
void *Z_TagMalloc (int size, int tag);
void Z_FreeTags(int tag);
void *VARGS Z_TagMalloc (int size, int tag);
void VARGS Z_FreeTags(int tag);
void Z_DumpHeap (void);
void Z_CheckHeap (void);