I've been fixing warnings.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1448 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
08de916232
commit
d4d365175d
29 changed files with 154 additions and 304 deletions
|
@ -2997,7 +2997,7 @@ void Host_Init (quakeparms_t *parms)
|
|||
Plug_Init();
|
||||
#endif
|
||||
|
||||
Masker_SetupSockets();
|
||||
Master_SetupSockets();
|
||||
|
||||
// Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
||||
Con_TPrintf (TL_HEAPSIZE, parms->memsize/ (1024*1024.0));
|
||||
|
|
|
@ -138,6 +138,7 @@ void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles);
|
|||
serverinfo_t *Master_InfoForServer (netadr_t addr);
|
||||
serverinfo_t *Master_InfoForNum (int num);
|
||||
int Master_TotalCount(void);
|
||||
void Master_SetupSockets(void);
|
||||
void Master_QueryServer(serverinfo_t *server);
|
||||
void MasterInfo_WriteServers(void);
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ void ConcatPackageLists(package_t *l2)
|
|||
static void dlnotification(char *localfile, qboolean sucess)
|
||||
{
|
||||
FILE *f;
|
||||
FS_FlushFSHash();
|
||||
COM_RefreshFSCache_f();
|
||||
COM_FOpenFile(localfile, &f);
|
||||
if (f)
|
||||
{
|
||||
|
|
|
@ -107,7 +107,7 @@ int lastpollsockIPX;
|
|||
#define POLLIPXSOCKETS 0
|
||||
#endif
|
||||
|
||||
void Masker_SetupSockets(void)
|
||||
void Master_SetupSockets(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < POLLUDPSOCKETS; i++)
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include "glquake.h" //evil to include this
|
||||
#endif
|
||||
|
||||
#include "pr_common.h"
|
||||
|
||||
static progfuncs_t *csqcprogs;
|
||||
|
||||
typedef struct csqctreadstate_s {
|
||||
|
@ -250,119 +252,8 @@ csqcfields //any *64->int32 casts are erroneous, it's biased off NULL.
|
|||
static csqcedict_t **csqcent;
|
||||
static int maxcsqcentities;
|
||||
|
||||
#define RETURN_SSTRING(s) (((string_t *)pr_globals)[OFS_RETURN] = PR_SetString(prinst, s)) //static - exe will not change it.
|
||||
char *PF_TempStr(progfuncs_t *prinst);
|
||||
|
||||
static int csqcentsize;
|
||||
|
||||
//pr_cmds.c builtins that need to be moved to a common.
|
||||
void VARGS PR_BIError(progfuncs_t *progfuncs, char *format, ...);
|
||||
void PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_dprint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_floor (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ceil (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Tokenize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_randomvec (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Sin (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Cos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Sqrt (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_bound (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strcat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ftos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fabs (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_etos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_stof (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_mod (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_substring (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_stov (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Spawn (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_min (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_max (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_registercvar (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_pow (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_localcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fputs (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_normalize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vlen (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vectoyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vectoangles (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_FindFlags (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_coredump (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_traceon (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_traceoff (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_eprint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_bitshift(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
void PF_registercvar (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Abort(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_externcall (progfuncs_t *prinst, globalvars_t *pr_globals);
|
||||
void PF_externrefcall (progfuncs_t *prinst, globalvars_t *pr_globals);
|
||||
void PF_externvalue (progfuncs_t *prinst, globalvars_t *pr_globals);
|
||||
void PF_externset (progfuncs_t *prinst, globalvars_t *pr_globals);
|
||||
void PF_instr (progfuncs_t *prinst, globalvars_t *pr_globals);
|
||||
|
||||
void PF_strstrofs (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_str2chr (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strconv (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_infoadd (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_infoget (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strncmp (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strcasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strncasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strpad (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
//these functions are from pr_menu.dat
|
||||
void PF_CL_is_cached_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_free_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawcharacter (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawstring (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawpic (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawline (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawfill (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawsetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawresetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_CL_drawgetimagesize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
void PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_cl_stringtokeynum(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_cl_getkeybind (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
void search_close_progs(progfuncs_t *prinst, qboolean complain);
|
||||
void PF_search_begin (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_search_end (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_search_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_search_getfilename (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
|
||||
#define MAXTEMPBUFFERLEN 1024
|
||||
|
||||
void PF_fclose_progs (progfuncs_t *prinst);
|
||||
char *PF_VarString (progfuncs_t *prinst, int first, struct globalvars_s *pr_globals);
|
||||
int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **parms);
|
||||
|
||||
static model_t *CSQC_GetModelForIndex(int index);
|
||||
static void CS_LinkEdict(csqcedict_t *ent, qboolean touchtriggers);
|
||||
|
||||
|
@ -1482,6 +1373,9 @@ static int FindModel(char *name, int *free)
|
|||
|
||||
*free = 0;
|
||||
|
||||
if (!name || !*name)
|
||||
return 0;
|
||||
|
||||
for (i = 1; i < MAX_CSQCMODELS; i++)
|
||||
{
|
||||
if (!*cl.model_csqcname[i])
|
||||
|
@ -1499,6 +1393,27 @@ static int FindModel(char *name, int *free)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void csqc_setmodel(progfuncs_t *prinst, csqcedict_t *ent, int modelindex)
|
||||
{
|
||||
model_t *model;
|
||||
|
||||
ent->v->modelindex = modelindex;
|
||||
if (modelindex < 0)
|
||||
{
|
||||
ent->v->model = PR_SetString(prinst, cl.model_csqcname[-modelindex]);
|
||||
model = cl.model_csqcprecache[-modelindex];
|
||||
}
|
||||
else
|
||||
{
|
||||
ent->v->model = PR_SetString(prinst, cl.model_name[modelindex]);
|
||||
model = cl.model_precache[modelindex];
|
||||
}
|
||||
|
||||
VectorCopy(model->mins, ent->v->mins);
|
||||
VectorCopy(model->maxs, ent->v->maxs);
|
||||
}
|
||||
|
||||
static void PF_cs_SetModel(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
csqcedict_t *ent = (void*)G_EDICT(prinst, OFS_PARM0);
|
||||
|
@ -1506,7 +1421,7 @@ static void PF_cs_SetModel(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
int freei;
|
||||
int modelindex = FindModel(modelname, &freei);
|
||||
|
||||
if (!modelindex)
|
||||
if (!modelindex && modelname && *modelname)
|
||||
{
|
||||
if (!freei)
|
||||
Host_EndGame("CSQC ran out of model slots\n");
|
||||
|
@ -1517,22 +1432,14 @@ static void PF_cs_SetModel(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
cl.model_csqcprecache[-freei] = Mod_ForName(cl.model_csqcname[-freei], false);
|
||||
}
|
||||
|
||||
ent->v->modelindex = modelindex;
|
||||
if (modelindex < 0)
|
||||
ent->v->model = PR_SetString(prinst, cl.model_csqcname[-modelindex]);
|
||||
else
|
||||
ent->v->model = PR_SetString(prinst, cl.model_name[modelindex]);
|
||||
csqc_setmodel(prinst, ent, modelindex);
|
||||
}
|
||||
static void PF_cs_SetModelIndex(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
csqcedict_t *ent = (void*)G_EDICT(prinst, OFS_PARM0);
|
||||
int modelindex = G_FLOAT(OFS_PARM1);
|
||||
|
||||
ent->v->modelindex = modelindex;
|
||||
if (modelindex < 0)
|
||||
ent->v->model = PR_SetString(prinst, cl.model_csqcname[-modelindex]);
|
||||
else
|
||||
ent->v->model = PR_SetString(prinst, cl.model_name[modelindex]);
|
||||
csqc_setmodel(prinst, ent, modelindex);
|
||||
}
|
||||
static void PF_cs_PrecacheModel(progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
int MP_TranslateFTEtoDPCodes(int code);
|
||||
#include "pr_common.h"
|
||||
|
||||
|
||||
typedef struct menuedict_s
|
||||
{
|
||||
|
@ -20,9 +21,7 @@ typedef struct menuedict_s
|
|||
void *fields;
|
||||
} menuedict_t;
|
||||
|
||||
#define RETURN_SSTRING(s) (((int *)pr_globals)[OFS_RETURN] = PR_SetString(prinst, s)) //static - exe will not change it.
|
||||
char *PF_TempStr(progfuncs_t *prinst);
|
||||
#define MAXTEMPBUFFERLEN 4096
|
||||
|
||||
|
||||
int menuentsize;
|
||||
|
||||
|
@ -31,66 +30,6 @@ int menuentsize;
|
|||
cvar_t forceqmenu = {"forceqmenu", "0"};
|
||||
cvar_t pr_menuqc_coreonerror = {"pr_menuqc_coreonerror", "1"};
|
||||
|
||||
//pr_cmds.c builtins that need to be moved to a common.
|
||||
void VARGS PR_BIError(progfuncs_t *progfuncs, char *format, ...);
|
||||
void PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_dprint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_floor (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ceil (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Tokenize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Sin (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Cos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Sqrt (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_bound (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_strcat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_ftos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fabs (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_etos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_stof (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_mod (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_substring (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_stov (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_Spawn (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_min (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_max (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_registercvar (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_pow (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_localcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fputs (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_normalize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vlen (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vectoyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_vectoangles (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_coredump (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_traceon (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_traceoff (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_eprint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void search_close_progs(progfuncs_t *prinst, qboolean complain);
|
||||
void PF_search_begin (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_search_end (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_search_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_search_getfilename (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
||||
void PR_fclose_progs (progfuncs_t *prinst);
|
||||
char *PF_VarString (progfuncs_t *prinst, int first, struct globalvars_s *pr_globals);
|
||||
|
||||
//new generic functions.
|
||||
|
||||
|
@ -213,7 +152,7 @@ char *RemapCvarNameFromDPToFTE(char *name)
|
|||
return name;
|
||||
}
|
||||
|
||||
static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
static void PF_menu_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
cvar_t *var;
|
||||
char *str;
|
||||
|
@ -232,7 +171,7 @@ static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
G_FLOAT(OFS_RETURN) = 0;
|
||||
}
|
||||
}
|
||||
static void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
static void PF_menu_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
char *var_name, *val;
|
||||
cvar_t *var;
|
||||
|
@ -244,7 +183,7 @@ static void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
var = Cvar_Get(var_name, val, 0, "QC variables");
|
||||
Cvar_Set (var, val);
|
||||
}
|
||||
static void PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
static void PF_menu_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
char *str = PR_GetStringOfs(prinst, OFS_PARM0);
|
||||
cvar_t *cv = Cvar_Get(RemapCvarNameFromDPToFTE(str), "", 0, "QC variables");
|
||||
|
@ -1176,8 +1115,8 @@ builtin_t menu_builtins[] = {
|
|||
PF_vectoangles,//11 //vector vectoangles(vector v) = #11;
|
||||
PF_random,//12
|
||||
PF_localcmd,//13
|
||||
PF_cvar,//14
|
||||
PF_cvar_set,//15
|
||||
PF_menu_cvar,//14
|
||||
PF_menu_cvar_set,//15
|
||||
PF_dprint,//16
|
||||
PF_ftos,//17
|
||||
PF_fabs,//18
|
||||
|
@ -1240,7 +1179,7 @@ builtin_t menu_builtins[] = {
|
|||
PF_loadfromfile,
|
||||
//70
|
||||
PF_mod,//0
|
||||
PF_cvar_string,//1
|
||||
PF_menu_cvar_string,//1
|
||||
PF_Fixme,//2 //void crash(void) = #72;
|
||||
PF_Fixme,//3 //void stackdump(void) = #73;
|
||||
PF_search_begin,//4
|
||||
|
|
|
@ -2678,22 +2678,6 @@ void CLQ2_BlasterTrail (vec3_t start, vec3_t end)
|
|||
P_ParticleTrail(start, end, rt_blastertrail, NULL);
|
||||
}
|
||||
|
||||
void MakeNormalVectors (vec3_t forward, vec3_t right, vec3_t up)
|
||||
{
|
||||
float d;
|
||||
|
||||
// this rotate and negat guarantees a vector
|
||||
// not colinear with the original
|
||||
right[1] = -forward[0];
|
||||
right[2] = forward[1];
|
||||
right[0] = forward[2];
|
||||
|
||||
d = DotProduct (right, forward);
|
||||
VectorMA (right, -d, forward, right);
|
||||
VectorNormalize (right);
|
||||
CrossProduct (right, forward, up);
|
||||
}
|
||||
|
||||
void CLQ2_RailTrail (vec3_t start, vec3_t end)
|
||||
{
|
||||
P_ParticleTrail(start, end, rt_railtrail, NULL);
|
||||
|
|
|
@ -33,6 +33,6 @@ void GLV_UpdatePalette (void);
|
|||
void SWV_UpdatePalette (void);
|
||||
qboolean V_CheckGamma (void);
|
||||
void V_AddEntity(entity_t *in);
|
||||
void V_AddLerpEntity(entity_t *in);
|
||||
void V_AddAxisEntity(entity_t *in);
|
||||
void V_AddEntity(entity_t *in);
|
||||
void V_AddLight (vec3_t org, float quant, float r, float g, float b);
|
||||
|
|
|
@ -240,6 +240,7 @@ extern int com_argc;
|
|||
extern char **com_argv;
|
||||
|
||||
int COM_CheckParm (char *parm);
|
||||
int COM_CheckNextParm (char *parm, int last);
|
||||
void COM_AddParm (char *parm);
|
||||
|
||||
void COM_Init (void);
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef struct {
|
|||
|
||||
|
||||
|
||||
|
||||
int COM_FileOpenRead (char *path, FILE **hndl);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -951,10 +951,6 @@ void ML_ProjectionMatrix2(float *proj, float fovx, float fovy)
|
|||
proj[15] = 0;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
float m[4][4];
|
||||
} matrix4x4_t;
|
||||
|
||||
void Matrix4x4_Invert_Simple (matrix4x4_t *out, const matrix4x4_t *in1)
|
||||
{
|
||||
// we only support uniform scaling, so assume the first row is enough
|
||||
|
@ -1108,3 +1104,19 @@ float ColorNormalize (vec3_t in, vec3_t out)
|
|||
|
||||
return f;
|
||||
}
|
||||
|
||||
void MakeNormalVectors (vec3_t forward, vec3_t right, vec3_t up)
|
||||
{
|
||||
float d;
|
||||
|
||||
// this rotate and negat guarantees a vector
|
||||
// not colinear with the original
|
||||
right[1] = -forward[0];
|
||||
right[2] = forward[1];
|
||||
right[0] = forward[2];
|
||||
|
||||
d = DotProduct (right, forward);
|
||||
VectorMA (right, -d, forward, right);
|
||||
VectorNormalize (right);
|
||||
CrossProduct (right, forward, up);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ void VectorScale (vec3_t in, vec_t scale, vec3_t out);
|
|||
int Q_log2(int val);
|
||||
|
||||
float ColorNormalize (vec3_t in, vec3_t out);
|
||||
void MakeNormalVectors (vec3_t forward, vec3_t right, vec3_t up);
|
||||
|
||||
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
|
||||
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
|
||||
|
@ -103,13 +104,17 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
|
|||
: \
|
||||
BoxOnPlaneSide( (emins), (emaxs), (p)))
|
||||
|
||||
typedef struct {
|
||||
float m[4][4];
|
||||
} matrix4x4_t;
|
||||
|
||||
//used for crosshair stuff.
|
||||
void ML_Project (vec3_t in, vec3_t out, vec3_t viewangles, vec3_t vieworg, float wdivh, float fovy);
|
||||
void Matrix3_Multiply (vec3_t *in1, vec3_t *in2, vec3_t *out);
|
||||
void Matrix4_Multiply(float *a, float *b, float *out);
|
||||
void Matrix4_Transform3(float *matrix, float *vector, float *product);
|
||||
void Matrix4_Transform4(float *matrix, float *vector, float *product);
|
||||
void Matrix4x4_Invert_Simple (float *out, const float *in1);
|
||||
void Matrix4x4_Invert_Simple (matrix4x4_t *out, const matrix4x4_t *in1);
|
||||
void ML_ModelViewMatrix(float *modelview, vec3_t viewangles, vec3_t vieworg);
|
||||
void ML_ProjectionMatrix2(float *proj, float fovx, float fovy);
|
||||
void ML_ModelViewMatrixFromAxis(float *modelview, vec3_t pn, vec3_t right, vec3_t up, vec3_t vieworg);
|
||||
|
|
|
@ -166,6 +166,7 @@ qboolean Huff_CompressionCRC(int crc);
|
|||
void Huff_CompressPacket(sizebuf_t *msg, int offset);
|
||||
void Huff_DecompressPacket(sizebuf_t *msg, int offset);
|
||||
int Huff_GetByte(qbyte *buffer, int *count);
|
||||
void Huff_EmitByte(int ch, qbyte *buffer, int *count);
|
||||
#endif
|
||||
|
||||
#ifdef NQPROT
|
||||
|
|
|
@ -962,14 +962,14 @@ int IPX_OpenSocket (int port, qboolean bcast)
|
|||
if ((newsocket = socket (PF_IPX, SOCK_DGRAM, NSPROTO_IPX)) == -1)
|
||||
{
|
||||
if (qerrno != EAFNOSUPPORT)
|
||||
Con_Printf ("WARNING: IPX_Socket: socket: %s\n", qerrno);
|
||||
Con_Printf ("WARNING: IPX_Socket: socket: %i\n", qerrno);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// make it non-blocking
|
||||
if (ioctlsocket (newsocket, FIONBIO, &_true) == -1)
|
||||
{
|
||||
Con_Printf ("WARNING: IPX_Socket: ioctl FIONBIO: %s\n", qerrno);
|
||||
Con_Printf ("WARNING: IPX_Socket: ioctl FIONBIO: %i\n", qerrno);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
|
@ -978,7 +978,7 @@ int IPX_OpenSocket (int port, qboolean bcast)
|
|||
// make it broadcast capable
|
||||
if (setsockopt(newsocket, SOL_SOCKET, SO_BROADCAST, (char *)&_true, sizeof(_true)) == -1)
|
||||
{
|
||||
Con_Printf ("WARNING: IPX_Socket: setsockopt SO_BROADCAST: %s\n", qerrno);
|
||||
Con_Printf ("WARNING: IPX_Socket: setsockopt SO_BROADCAST: %i\n", qerrno);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
|
@ -1063,21 +1063,32 @@ void NET_GetLocalAddress (int socket, netadr_t *out)
|
|||
struct sockaddr_qstorage address;
|
||||
int namelen;
|
||||
netadr_t adr;
|
||||
qboolean notvalid = false;
|
||||
|
||||
strcpy(buff, "localhost");
|
||||
gethostname(buff, 512);
|
||||
buff[512-1] = 0;
|
||||
|
||||
NET_StringToAdr (buff, &adr);
|
||||
if (!NET_StringToAdr (buff, &adr)) //urm
|
||||
NET_StringToAdr ("127.0.0.1", &adr);
|
||||
|
||||
|
||||
namelen = sizeof(address);
|
||||
if (getsockname (socket, (struct sockaddr *)&address, &namelen) == -1)
|
||||
Sys_Error ("NET_Init: getsockname:", strerror(qerrno));
|
||||
{
|
||||
notvalid = true;
|
||||
NET_StringToSockaddr("0.0.0.0", (struct sockaddr_qstorage *)&address);
|
||||
// Sys_Error ("NET_Init: getsockname:", strerror(qerrno));
|
||||
}
|
||||
|
||||
SockadrToNetadr(&address, out);
|
||||
if (!*(int*)out->ip) //socket was set to auto
|
||||
*(int *)out->ip = *(int *)adr.ip; //change it to what the machine says it is, rather than the socket.
|
||||
|
||||
Con_TPrintf(TL_IPADDRESSIS, NET_AdrToString (*out) );
|
||||
if (notvalid)
|
||||
Con_Printf("Couldn't detect local ip\n");
|
||||
else
|
||||
Con_TPrintf(TL_IPADDRESSIS, NET_AdrToString (*out) );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -724,10 +724,6 @@ void GL_LoadHeightmapModel (model_t *mod, void *buffer)
|
|||
mod->hulls[2].funcs.HullPointContents = Heightmap_PointContents;
|
||||
mod->hulls[3].funcs.HullPointContents = Heightmap_PointContents;
|
||||
*/
|
||||
mod->hulls[0].firstclipnode = (void*)hm;
|
||||
mod->hulls[1].firstclipnode = (void*)hm;
|
||||
mod->hulls[2].firstclipnode = (void*)hm;
|
||||
mod->hulls[3].firstclipnode = (void*)hm;
|
||||
|
||||
mod->terrain = hm;
|
||||
}
|
||||
|
|
|
@ -2793,7 +2793,7 @@ void * GLMod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe, int framenum
|
|||
else if (version == SPRITEHL_VERSION)
|
||||
{
|
||||
if (!pspriteframe->gl_texturenum)
|
||||
pspriteframe->gl_texturenum = GL_LoadTexture8Pal32 (name, width, height, (unsigned *)(pinframe + 1), palette, true, true);
|
||||
pspriteframe->gl_texturenum = GL_LoadTexture8Pal32 (name, width, height, (unsigned *)(pinframe + 1), (qbyte*)palette, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -4955,7 +4955,7 @@ int sh_maxverts;
|
|||
int sh_numverts; //total emitted
|
||||
int sh_maxindicies;
|
||||
int sh_numindicies;
|
||||
float *sh_vertexpointer;
|
||||
const float *sh_vertexpointer;
|
||||
int sh_vpstride;
|
||||
shadowmesh_t *sh_shmesh;
|
||||
void APIENTRY SH_Begin (GLenum e)
|
||||
|
|
|
@ -116,6 +116,7 @@ void GL_Upload8_EXT (qbyte *data, int width, int height, qboolean mipmap, qbool
|
|||
int GL_LoadTexture (char *identifier, int width, int height, qbyte *data, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture8Bump (char *identifier, int width, int height, unsigned char *data, qboolean mipmap, float bumpscale);
|
||||
int GL_LoadTexture8Pal24 (char *identifier, int width, int height, qbyte *data, qbyte *palette24, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture8Pal32 (char *identifier, int width, int height, qbyte *data, qbyte *palette32, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture32 (char *identifier, int width, int height, unsigned *data, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadCompressed(char *name);
|
||||
int GL_FindTexture (char *identifier);
|
||||
|
@ -322,6 +323,12 @@ int GLR_LightPoint (vec3_t p);
|
|||
|
||||
void GLQ3_LightGrid(vec3_t point, vec3_t res_diffuse, vec3_t res_ambient, vec3_t res_lightdir);
|
||||
|
||||
|
||||
//gl_heightmap.c
|
||||
void GL_DrawHeightmapModel (entity_t *e);
|
||||
void GL_LoadHeightmapModel (model_t *mod, void *buffer);
|
||||
|
||||
|
||||
//
|
||||
// gl_rsurf.c
|
||||
//
|
||||
|
|
|
@ -95,7 +95,7 @@ int PR_InitEnts(progfuncs_t *progfuncs, int max_ents)
|
|||
sv_edicts = PRHunkAlloc(progfuncs, externs->edictsize);
|
||||
prinst->edicttable[0] = sv_edicts;
|
||||
((edictrun_t*)prinst->edicttable[0])->fields = PRAddressableAlloc(progfuncs, max_fields_size);
|
||||
ED_ClearEdict(progfuncs, sv_edicts);
|
||||
ED_ClearEdict(progfuncs, (edictrun_t *)sv_edicts);
|
||||
sv_num_edicts = 1;
|
||||
|
||||
return max_fields_size;
|
||||
|
@ -105,7 +105,7 @@ float tempedictfields[2048];
|
|||
|
||||
void PR_Configure (progfuncs_t *progfuncs, int addressable_size, int max_progs) //can be used to wipe all memory
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
edictrun_t *e;
|
||||
|
||||
// int a;
|
||||
|
@ -174,11 +174,10 @@ struct entvars_s *PR_entvars (progfuncs_t *progfuncs, struct edict_s *ed)
|
|||
|
||||
func_t PR_FindFunc(progfuncs_t *progfuncs, char *funcname, progsnum_t pnum)
|
||||
{
|
||||
|
||||
dfunction_t *f=NULL;
|
||||
if (pnum == PR_ANY)
|
||||
{
|
||||
for (pnum = 0; pnum < maxprogs; pnum++)
|
||||
for (pnum = 0; (unsigned)pnum < maxprogs; pnum++)
|
||||
{
|
||||
if (!pr_progstate[pnum].progs)
|
||||
continue;
|
||||
|
@ -227,6 +226,7 @@ func_t PR_FindFunc(progfuncs_t *progfuncs, char *funcname, progsnum_t pnum)
|
|||
|
||||
eval_t *PR_FindGlobal(progfuncs_t *progfuncs, char *globname, progsnum_t pnum)
|
||||
{
|
||||
unsigned int i;
|
||||
ddef16_t *var16;
|
||||
ddef32_t *var32;
|
||||
if (pnum == PR_CURRENT)
|
||||
|
@ -234,17 +234,17 @@ eval_t *PR_FindGlobal(progfuncs_t *progfuncs, char *globname, progsnum_t pnum)
|
|||
if (pnum == PR_ANY)
|
||||
{
|
||||
eval_t *ev;
|
||||
for (pnum = 0; pnum < maxprogs; pnum++)
|
||||
for (i = 0; i < maxprogs; i++)
|
||||
{
|
||||
if (!pr_progstate[pnum].progs)
|
||||
if (!pr_progstate[i].progs)
|
||||
continue;
|
||||
ev = PR_FindGlobal(progfuncs, globname, pnum);
|
||||
ev = PR_FindGlobal(progfuncs, globname, i);
|
||||
if (ev)
|
||||
return ev;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (pnum < 0 || pnum >= maxprogs || !pr_progstate[pnum].progs)
|
||||
if (pnum < 0 || (unsigned)pnum >= maxprogs || !pr_progstate[pnum].progs)
|
||||
return NULL;
|
||||
switch(pr_progstate[pnum].intsize)
|
||||
{
|
||||
|
@ -321,7 +321,7 @@ eval_t *GetEdictFieldValue(progfuncs_t *progfuncs, struct edict_s *ed, char *nam
|
|||
|
||||
struct edict_s *ProgsToEdict (progfuncs_t *progfuncs, int progs)
|
||||
{
|
||||
if ((unsigned)progs >= maxedicts)
|
||||
if ((unsigned)progs >= (unsigned)maxedicts)
|
||||
progs = 0;
|
||||
return (struct edict_s *)PROG_TO_EDICT(progfuncs, progs);
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ void CloseProgs(progfuncs_t *inst)
|
|||
// extensionbuiltin_t *eb;
|
||||
void (VARGS *f) (void *);
|
||||
|
||||
int i;
|
||||
unsigned int i;
|
||||
edictrun_t *e;
|
||||
|
||||
f = inst->parms->memfree;
|
||||
|
|
|
@ -84,7 +84,7 @@ angles and bad trails.
|
|||
*/
|
||||
struct edict_s *ED_Alloc (progfuncs_t *progfuncs)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
edictrun_t *e;
|
||||
|
||||
for ( i=0 ; i<sv_num_edicts ; i++)
|
||||
|
@ -427,7 +427,7 @@ unsigned int *ED_FindGlobalOfsFromProgs (progfuncs_t *progfuncs, char *name, pro
|
|||
ED_FindFunction
|
||||
============
|
||||
*/
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *prnum, int fromprogs)
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *prnum, unsigned int fromprogs)
|
||||
{
|
||||
dfunction_t *func;
|
||||
unsigned int i;
|
||||
|
@ -601,16 +601,16 @@ char *PR_UglyValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val)
|
|||
break;
|
||||
case ev_function:
|
||||
i = (val->function & 0xff000000)>>24; //progs number
|
||||
if (i > maxprogs || !pr_progstate[i].progs)
|
||||
if ((unsigned)i > maxprogs || !pr_progstate[(unsigned)i].progs)
|
||||
sprintf (line, "BAD FUNCTION INDEX: %i", val->function);
|
||||
else
|
||||
{
|
||||
j = (val->function & ~0xff000000); //function number
|
||||
if ((unsigned)j > pr_progstate[i].progs->numfunctions)
|
||||
if ((unsigned)j > pr_progstate[(unsigned)i].progs->numfunctions)
|
||||
sprintf(line, "%i:%s", i, "CORRUPT FUNCTION POINTER");
|
||||
else
|
||||
{
|
||||
f = pr_progstate[i].functions + j;
|
||||
f = pr_progstate[(unsigned)i].functions + j;
|
||||
sprintf (line, "%i:%s", i, f->s_name+progfuncs->stringtable);
|
||||
}
|
||||
}
|
||||
|
@ -907,7 +907,7 @@ For debugging, prints all the entities in the current server
|
|||
*/
|
||||
void ED_PrintEdicts (progfuncs_t *progfuncs)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
printf ("%i entities\n", sv_num_edicts);
|
||||
for (i=0 ; i<sv_num_edicts ; i++)
|
||||
|
@ -923,9 +923,9 @@ For debugging
|
|||
*/
|
||||
void ED_Count (progfuncs_t *progfuncs)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
edictrun_t *ent;
|
||||
int active, models, solid, step;
|
||||
unsigned int active, models, solid, step;
|
||||
|
||||
active = models = solid = step = 0;
|
||||
for (i=0 ; i<sv_num_edicts ; i++)
|
||||
|
@ -1470,7 +1470,7 @@ char *SaveEnts(progfuncs_t *progfuncs, char *mem, int *len, int alldata)
|
|||
{
|
||||
#define AddS(str) strcpy(s, str);s+=strlen(str);
|
||||
char *s, *os;
|
||||
int a;
|
||||
unsigned int a;
|
||||
int oldprogs;
|
||||
|
||||
if (mem)
|
||||
|
@ -2968,18 +2968,18 @@ retry:
|
|||
|
||||
|
||||
|
||||
struct edict_s *EDICT_NUM(progfuncs_t *progfuncs, int n)
|
||||
struct edict_s *EDICT_NUM(progfuncs_t *progfuncs, unsigned int n)
|
||||
{
|
||||
if (n < 0 || n >= maxedicts)
|
||||
if (n >= maxedicts)
|
||||
Sys_Error ("QCLIB: EDICT_NUM: bad number %i", n);
|
||||
|
||||
return prinst->edicttable[n];
|
||||
}
|
||||
|
||||
int NUM_FOR_EDICT(progfuncs_t *progfuncs, struct edict_s *e)
|
||||
unsigned int NUM_FOR_EDICT(progfuncs_t *progfuncs, struct edict_s *e)
|
||||
{
|
||||
edictrun_t *er = (edictrun_t*)e;
|
||||
if (er->entnum < 0 || er->entnum >= maxedicts)
|
||||
if (er->entnum >= maxedicts)
|
||||
Sys_Error ("QCLIB: NUM_FOR_EDICT: bad pointer (%i)", e);
|
||||
return er->entnum;
|
||||
}
|
||||
|
|
|
@ -556,7 +556,7 @@ int PR_ToggleBreakpoint(progfuncs_t *progfuncs, char *filename, int linenum, int
|
|||
dfunction_t *f;
|
||||
int op;
|
||||
|
||||
for (pn = 0; pn < maxprogs; pn++)
|
||||
for (pn = 0; (unsigned)pn < maxprogs; pn++)
|
||||
{
|
||||
if (!pr_progstate || !pr_progstate[pn].progs)
|
||||
continue;
|
||||
|
@ -852,12 +852,12 @@ void PR_ExecuteProgram (progfuncs_t *progfuncs, func_t fnum)
|
|||
{
|
||||
dfunction_t *f;
|
||||
int i;
|
||||
progsnum_t initial_progs;
|
||||
unsigned int initial_progs;
|
||||
int oldexitdepth;
|
||||
|
||||
int s;
|
||||
|
||||
int newprogs = (fnum & 0xff000000)>>24;
|
||||
unsigned int newprogs = (fnum & 0xff000000)>>24;
|
||||
|
||||
initial_progs = pr_typecurrent;
|
||||
if (newprogs != initial_progs)
|
||||
|
|
|
@ -18,14 +18,14 @@ int maxshares;
|
|||
|
||||
pbool PR_SwitchProgs(progfuncs_t *progfuncs, progsnum_t type)
|
||||
{
|
||||
if (type >= maxprogs || type < 0)
|
||||
if ((unsigned)type >= maxprogs)
|
||||
PR_RunError(progfuncs, "QCLIB: Bad prog type - %i", type);
|
||||
// Sys_Error("Bad prog type - %i", type);
|
||||
|
||||
if (pr_progstate[(int)type].progs == NULL) //we havn't loaded it yet, for some reason
|
||||
if (pr_progstate[(unsigned)type].progs == NULL) //we havn't loaded it yet, for some reason
|
||||
return false;
|
||||
|
||||
current_progstate = &pr_progstate[(int)type];
|
||||
current_progstate = &pr_progstate[(unsigned)type];
|
||||
|
||||
pr_typecurrent = type;
|
||||
|
||||
|
@ -44,9 +44,9 @@ void PR_MoveParms(progfuncs_t *progfuncs, progsnum_t progs1, progsnum_t progs2)
|
|||
p1 = &pr_progstate[(int)progs1];
|
||||
p2 = &pr_progstate[(int)progs2];
|
||||
|
||||
if (progs1 >= maxprogs || progs1 < 0 || !p1->globals)
|
||||
if ((unsigned)progs1 >= maxprogs || !p1->globals)
|
||||
Sys_Error("QCLIB: Bad prog type - %i", progs1);
|
||||
if (progs2 >= maxprogs || progs2 < 0 || !p2->globals)
|
||||
if ((unsigned)progs2 >= maxprogs || !p2->globals)
|
||||
Sys_Error("QCLIB: Bad prog type - %i", progs2);
|
||||
|
||||
//copy parms.
|
||||
|
@ -77,15 +77,15 @@ void PR_MoveParms(progfuncs_t *progfuncs, progsnum_t progs1, progsnum_t progs2)
|
|||
|
||||
progsnum_t PR_LoadProgs(progfuncs_t *progfuncs, char *s, int headercrc, builtin_t *builtins, int numbuiltins)
|
||||
{
|
||||
progsnum_t a;
|
||||
unsigned int a;
|
||||
progsnum_t oldtype;
|
||||
oldtype = pr_typecurrent;
|
||||
for (a = 0; a < maxprogs; a++)
|
||||
{
|
||||
if (pr_progstate[(int)a].progs == NULL)
|
||||
if (pr_progstate[a].progs == NULL)
|
||||
{
|
||||
pr_typecurrent = a;
|
||||
current_progstate = &pr_progstate[(int)a];
|
||||
current_progstate = &pr_progstate[a];
|
||||
if (PR_ReallyLoadProgs(progfuncs, s, headercrc, &pr_progstate[a], false)) //try and load it
|
||||
{
|
||||
current_progstate->builtins = builtins;
|
||||
|
@ -113,7 +113,7 @@ void PR_ShiftParms(progfuncs_t *progfuncs, int amount)
|
|||
//forget a progs
|
||||
void PR_Clear(progfuncs_t *progfuncs)
|
||||
{
|
||||
int a;
|
||||
unsigned int a;
|
||||
for (a = 0; a < maxprogs; a++)
|
||||
{
|
||||
pr_progstate[a].progs = NULL;
|
||||
|
|
|
@ -100,7 +100,7 @@ void StripExtension (char *path);
|
|||
#define edvars(ed) (((edictrun_t*)ed)->fields) //pointer to the field vars, given an edict
|
||||
|
||||
|
||||
|
||||
void SetEndian(void);
|
||||
extern short (*PRBigShort) (short l);
|
||||
extern short (*PRLittleShort) (short l);
|
||||
extern long (*PRBigLong) (long l);
|
||||
|
@ -132,7 +132,7 @@ typedef struct edictrun_s
|
|||
pbool isfree;
|
||||
|
||||
float freetime; // realtime when the object was freed
|
||||
int entnum;
|
||||
unsigned int entnum;
|
||||
pbool readonly; //causes error when QC tries writing to it. (quake's world entity)
|
||||
void *fields;
|
||||
|
||||
|
@ -243,8 +243,8 @@ void ED_ParseGlobals (char *data);
|
|||
//define EDICT_NUM(n) ((edict_t *)(sv.edicts+ (n)*pr_edict_size))
|
||||
//define NUM_FOR_EDICT(e) (((byte *)(e) - sv.edicts)/pr_edict_size)
|
||||
|
||||
struct edict_s *EDICT_NUM(progfuncs_t *progfuncs, int n);
|
||||
int NUM_FOR_EDICT(progfuncs_t *progfuncs, struct edict_s *e);
|
||||
struct edict_s *EDICT_NUM(progfuncs_t *progfuncs, unsigned int n);
|
||||
unsigned int NUM_FOR_EDICT(progfuncs_t *progfuncs, struct edict_s *e);
|
||||
|
||||
//#define NEXT_EDICT(e) ((edictrun_t *)( (byte *)e + pr_edict_size))
|
||||
|
||||
|
@ -333,7 +333,7 @@ var(progstate_t *, pr_progstate);
|
|||
|
||||
var(progsnum_t, pr_typecurrent);
|
||||
#define pr_typecurrent prinst->pr_typecurrent
|
||||
var(int, maxprogs);
|
||||
var(unsigned int, maxprogs);
|
||||
#define maxprogs prinst->maxprogs
|
||||
|
||||
var(progstate_t *,current_progstate);
|
||||
|
@ -389,7 +389,7 @@ var(int, pr_argc);
|
|||
|
||||
//pr_edict.c
|
||||
|
||||
var(int, maxedicts);
|
||||
var(unsigned int, maxedicts);
|
||||
#define maxedicts prinst->maxedicts
|
||||
|
||||
var(evalc_t, spawnflagscache);
|
||||
|
@ -426,11 +426,14 @@ ddef32_t *ED_FindTypeGlobalFromProgs32 (progfuncs_t *progfuncs, char *name, prog
|
|||
ddef16_t *ED_FindGlobalFromProgs16 (progfuncs_t *progfuncs, char *name, progsnum_t prnum);
|
||||
ddef32_t *ED_FindGlobalFromProgs32 (progfuncs_t *progfuncs, char *name, progsnum_t prnum);
|
||||
fdef_t *ED_FindField (progfuncs_t *progfuncs, char *name);
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, int *pnum, int fromprogs);
|
||||
dfunction_t *ED_FindFunction (progfuncs_t *progfuncs, char *name, progsnum_t *pnum, unsigned int fromprogs);
|
||||
func_t PR_FindFunc(progfuncs_t *progfncs, char *funcname, progsnum_t pnum);
|
||||
void PR_Configure (progfuncs_t *progfncs, int addressable_size, int max_progs);
|
||||
int PR_InitEnts(progfuncs_t *progfncs, int maxents);
|
||||
char *PR_ValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val);
|
||||
void ED_ClearEdict (progfuncs_t *progfuncs, edictrun_t *e);
|
||||
void PRAddressableFlush(progfuncs_t *progfuncs, int totalammount);
|
||||
void QC_FlushProgsOffsets(progfuncs_t *progfuncs);
|
||||
|
||||
ddef16_t *ED_GlobalAtOfs16 (progfuncs_t *progfuncs, int ofs);
|
||||
ddef16_t *ED_FindGlobal16 (progfuncs_t *progfuncs, char *name);
|
||||
|
|
|
@ -63,7 +63,7 @@ struct progfuncs_s {
|
|||
struct edict_s *(*EntAlloc) (progfuncs_t *prinst);
|
||||
void (*EntFree) (progfuncs_t *prinst, struct edict_s *ed);
|
||||
|
||||
struct edict_s *(*EDICT_NUM) (progfuncs_t *prinst, int n); //get the nth edict
|
||||
struct edict_s *(*EDICT_NUM) (progfuncs_t *prinst, unsigned int n); //get the nth edict
|
||||
int (*NUM_FOR_EDICT) (progfuncs_t *prinst, struct edict_s *e); //so you can find out what that 'n' will be
|
||||
|
||||
void (*SetGlobalEdict) (progfuncs_t *prinst, struct edict_s *ed, int ofs); //set a global to an edict (partially obsolete)
|
||||
|
@ -164,7 +164,7 @@ typedef struct progexterns_s {
|
|||
double *gametime; //used to prevent the vm from reusing an entity faster than 2 secs.
|
||||
|
||||
struct edict_s **sv_edicts; //pointer to the engine's reference to world.
|
||||
int *sv_num_edicts; //pointer to the engine's edict count.
|
||||
unsigned int *sv_num_edicts; //pointer to the engine's edict count.
|
||||
|
||||
int (*useeditor) (progfuncs_t *prinst, char *filename, int line, int nump, char **parms); //called on syntax errors or step-by-step debugging.
|
||||
} progparms_t, progexterns_t;
|
||||
|
|
|
@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#include "pr_common.h"
|
||||
|
||||
#define G_PROG G_FLOAT
|
||||
#define Z_QC_TAG 2
|
||||
|
||||
|
@ -3072,7 +3074,7 @@ void PF_spawnclient (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
svs.clients[i].datagram.allowoverflow = true;
|
||||
svs.clients[i].datagram.maxsize = 0;
|
||||
|
||||
SetUpClientEdict (&svs.clients[i], svs.clients[i].edict);
|
||||
SV_SetUpClientEdict (&svs.clients[i], svs.clients[i].edict);
|
||||
|
||||
RETURN_EDICT(prinst, svs.clients[i].edict);
|
||||
return;
|
||||
|
@ -4457,13 +4459,13 @@ void PF_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
pr_netglob = pr_globals;
|
||||
if (progstype == PROG_NQ || progstype == PROG_H2)
|
||||
{
|
||||
NPP_NQWriteShort(G_FLOAT(OFS_PARM0), (int)G_FLOAT(OFS_PARM1));
|
||||
NPP_NQWriteShort(G_FLOAT(OFS_PARM0), (short)(int)G_FLOAT(OFS_PARM1));
|
||||
return;
|
||||
}
|
||||
#ifdef NQPROT
|
||||
else
|
||||
{
|
||||
NPP_QWWriteShort(G_FLOAT(OFS_PARM0), (int)G_FLOAT(OFS_PARM1));
|
||||
NPP_QWWriteShort(G_FLOAT(OFS_PARM0), (short)(int)G_FLOAT(OFS_PARM1));
|
||||
return;
|
||||
}
|
||||
#else
|
||||
|
@ -4648,13 +4650,13 @@ void PF_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
pr_netglob = pr_globals;
|
||||
if (progstype == PROG_NQ || progstype == PROG_H2)
|
||||
{
|
||||
NPP_NQWriteEntity(G_FLOAT(OFS_PARM0), G_EDICTNUM(prinst, OFS_PARM1));
|
||||
NPP_NQWriteEntity(G_FLOAT(OFS_PARM0), (short)G_EDICTNUM(prinst, OFS_PARM1));
|
||||
return;
|
||||
}
|
||||
#ifdef NQPROT
|
||||
else
|
||||
{
|
||||
NPP_QWWriteEntity(G_FLOAT(OFS_PARM0), G_EDICTNUM(prinst, OFS_PARM1));
|
||||
NPP_QWWriteEntity(G_FLOAT(OFS_PARM0), (short)G_EDICTNUM(prinst, OFS_PARM1));
|
||||
return;
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -978,6 +978,7 @@ void SV_TogglePause (void);
|
|||
void SV_ClientThink (void);
|
||||
|
||||
void VoteFlushAll(void);
|
||||
void SV_SetUpClientEdict (client_t *cl, edict_t *ent);
|
||||
|
||||
//sv_master.c
|
||||
void SVM_Think(int port);
|
||||
|
|
|
@ -1158,7 +1158,7 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
*spawnparamglobals[j] = host_client->spawn_parms[j];
|
||||
}
|
||||
|
||||
SetUpClientEdict(host_client, sv_player);
|
||||
SV_SetUpClientEdict(host_client, sv_player);
|
||||
sv_player->v->clientcolors = atoi(Info_ValueForKey(host_client->userinfo, "topcolor"))*16 + atoi(Info_ValueForKey(host_client->userinfo, "bottomcolor"));
|
||||
|
||||
// call the spawn function
|
||||
|
|
|
@ -1060,7 +1060,6 @@ void SV_PreSpawn_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
void SetUpClientEdict (client_t *cl, edict_t *ent);
|
||||
/*
|
||||
==================
|
||||
SV_Spawn_f
|
||||
|
@ -1145,7 +1144,7 @@ void SV_Spawn_f (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
SetUpClientEdict(split, ent);
|
||||
SV_SetUpClientEdict(split, ent);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2650,7 +2649,7 @@ void Cmd_SetPos_f(void)
|
|||
}
|
||||
|
||||
void ED_ClearEdict (progfuncs_t *progfuncs, edict_t *e);
|
||||
void SetUpClientEdict (client_t *cl, edict_t *ent)
|
||||
void SV_SetUpClientEdict (client_t *cl, edict_t *ent)
|
||||
{
|
||||
extern int pr_teamfield;
|
||||
if (progstype != PROG_NQ) //allow frikbots to work in NQ mods (but not qw!)
|
||||
|
@ -2720,7 +2719,7 @@ void Cmd_Join_f (void)
|
|||
PR_ExecuteProgram (svprogfuncs, SpectatorDisconnect);
|
||||
|
||||
host_client->old_frags = 0;
|
||||
SetUpClientEdict (host_client, host_client->edict);
|
||||
SV_SetUpClientEdict (host_client, host_client->edict);
|
||||
|
||||
// turn the spectator into a player
|
||||
host_client->spectator = false;
|
||||
|
@ -2802,7 +2801,7 @@ void Cmd_Observe_f (void)
|
|||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->ClientDisconnect);
|
||||
|
||||
host_client->old_frags = 0;
|
||||
SetUpClientEdict (host_client, host_client->edict);
|
||||
SV_SetUpClientEdict (host_client, host_client->edict);
|
||||
|
||||
// turn the player into a spectator
|
||||
host_client->spectator = true;
|
||||
|
|
|
@ -1281,25 +1281,6 @@ Offset is filled in to contain the adjustment that must be added to the
|
|||
testing object's origin to get a point to use with the returned hull.
|
||||
================
|
||||
*/
|
||||
static model_t *SV_ModelForEntity (edict_t *ent)
|
||||
{
|
||||
model_t *model;
|
||||
|
||||
// decide which clipping hull to use, based on the size
|
||||
if (ent->v->solid == SOLID_BSP)
|
||||
{ // explicit hulls in the BSP model
|
||||
model = sv.models[ (int)ent->v->modelindex ];
|
||||
|
||||
if (!model)
|
||||
SV_Error ("MOVETYPE_PUSH with a non bsp model");
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
// create a temp hull from bounding box sizes
|
||||
|
||||
return CM_TempBoxModel (ent->v->mins, ent->v->maxs);
|
||||
}
|
||||
|
||||
#ifdef Q2SERVER
|
||||
static model_t *SVQ2_ModelForEntity (q2edict_t *ent)
|
||||
|
|
Loading…
Reference in a new issue