diff --git a/engine/client/cl_input.c b/engine/client/cl_input.c index 8f8fdf21d..87cf4f72e 100644 --- a/engine/client/cl_input.c +++ b/engine/client/cl_input.c @@ -1769,8 +1769,7 @@ void CL_SendCmd (double frametime, qboolean mainloop) } #ifdef PEXT2_VOICECHAT - if (cls.fteprotocolextensions2 & PEXT2_VOICECHAT) - S_Voip_Transmit(clc_voicechat, &buf); + S_Voip_Transmit(clc_voicechat, &buf); #endif // diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 2ea032a1c..626d6dfcc 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -3380,7 +3380,7 @@ float Host_Frame (double time) if (!spare) return 1; - //realtime -= spare/1000; //don't use it all! + realtime -= spare/1000; //don't use it all! } } else diff --git a/engine/client/cl_tent.c b/engine/client/cl_tent.c index 840558118..ba658f523 100644 --- a/engine/client/cl_tent.c +++ b/engine/client/cl_tent.c @@ -354,13 +354,6 @@ void P_LoadedModel(model_t *mod) mod->particleeffect = P_INVALID; mod->particletrail = P_INVALID; mod->engineflags &= ~(MDLF_NODEFAULTTRAIL | MDLF_ENGULPHS); - - if (mod->type == mod_brush) - { - if (*mod->name != '*') - for (j = 0; j < mod->numtextures; j++) - mod->textures[j]->parttype = P_FindParticleType(va("tex_%s", mod->textures[j]->name)); - } for(ae = associatedeffect; ae; ae = ae->next) { if (!strcmp(ae->mname, mod->name)) diff --git a/engine/client/p_classic.c b/engine/client/p_classic.c index d94aee56e..b3af30a0c 100644 --- a/engine/client/p_classic.c +++ b/engine/client/p_classic.c @@ -175,7 +175,7 @@ static void PClassic_ParticleTrailIndex (vec3_t start, vec3_t end, int color, in } //this function is called to tell the particle system about surfaces that might emit particles at map startup. -static void PClassic_EmitSkyEffectTris(model_t *mod, msurface_t *fa) +static void PClassic_EmitSkyEffectTris(model_t *mod, msurface_t *fa, int ptype) { } @@ -228,6 +228,7 @@ static qboolean PClassic_InitParticles (void) static void PClassic_ShutdownParticles(void) { BZ_Free(particles); + particles = NULL; } //called when an entity is removed from the world, taking its trailstate with it. diff --git a/engine/client/p_null.c b/engine/client/p_null.c index 6d9a3f1b6..79fcd8260 100644 --- a/engine/client/p_null.c +++ b/engine/client/p_null.c @@ -29,7 +29,7 @@ static void PNULL_RunParticleEffect3 (vec3_t org, vec3_t box, int color, int eff static void PNULL_RunParticleEffect4 (vec3_t org, float radius, int color, int effect, int count){} static void PNULL_ParticleTrailIndex (vec3_t start, vec3_t end, int color, int crnd, trailstate_t **tsk){} -static void PNULL_EmitSkyEffectTris(model_t *mod, msurface_t *fa){} +static void PNULL_EmitSkyEffectTris(model_t *mod, msurface_t *fa, int ptype){} static qboolean PNULL_InitParticles (void) { diff --git a/engine/client/p_script.c b/engine/client/p_script.c index 8fb665783..8549cb595 100644 --- a/engine/client/p_script.c +++ b/engine/client/p_script.c @@ -2130,7 +2130,7 @@ static void P_AddRainParticles(void) } } -static void R_Part_SkyTri(float *v1, float *v2, float *v3, msurface_t *surf) +static void R_Part_SkyTri(float *v1, float *v2, float *v3, msurface_t *surf, int ptype) { float dot; float xm; @@ -2142,7 +2142,7 @@ static void R_Part_SkyTri(float *v1, float *v2, float *v3, msurface_t *surf) skytris_t *st; st = Hunk_Alloc(sizeof(skytris_t)); - st->next = part_type[surf->texinfo->texture->parttype].skytris; + st->next = part_type[ptype].skytris; VectorCopy(v1, st->org); VectorSubtract(v2, st->org, st->x); VectorSubtract(v3, st->org, st->y); @@ -2165,12 +2165,12 @@ static void R_Part_SkyTri(float *v1, float *v2, float *v3, msurface_t *surf) if (st->area<=0) return;//bummer. - part_type[surf->texinfo->texture->parttype].skytris = st; + part_type[ptype].skytris = st; } -static void PScript_EmitSkyEffectTris(model_t *mod, msurface_t *fa) +static void PScript_EmitSkyEffectTris(model_t *mod, msurface_t *fa, int ptype) { vec3_t verts[64]; int v1; @@ -2180,6 +2180,9 @@ static void PScript_EmitSkyEffectTris(model_t *mod, msurface_t *fa) int i, lindex; float *vec; + if (ptype < 0 || ptype >= numparticletypes) + return; + // // convert edges back to a normal polygon // @@ -2206,7 +2209,7 @@ static void PScript_EmitSkyEffectTris(model_t *mod, msurface_t *fa) v2 = 1; for (v3 = 2; v3 < numverts; v3++) { - R_Part_SkyTri(verts[v1], verts[v2], verts[v3], fa); + R_Part_SkyTri(verts[v1], verts[v2], verts[v3], fa, ptype); v2 = v3; } @@ -4210,7 +4213,7 @@ static void PScript_DrawParticleTypes (void (*texturedparticles)(int count, part b = b->next; } - continue; + goto endtype; } //kill off early ones. @@ -4463,8 +4466,8 @@ static void PScript_DrawParticleTypes (void (*texturedparticles)(int count, part } } - // if (b->p->die < particletime) - // b->flags |= BS_DEAD; + if (b->p->die < particletime) + b->flags |= BS_DEAD; } } else @@ -4482,6 +4485,8 @@ static void PScript_DrawParticleTypes (void (*texturedparticles)(int count, part } } +endtype: + // delete from run list if necessary if (!type->particles && !type->beams && !type->clippeddecals) { diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 157f3d173..1821e9c12 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -517,7 +517,7 @@ static void cs_getframestate(csqcedict_t *in, unsigned int rflags, framestate_t } -static void PF_cs_remove (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_remove (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ed; @@ -534,7 +534,7 @@ static void PF_cs_remove (progfuncs_t *prinst, struct globalvars_s *pr_globals) ED_Free (prinst, (void*)ed); } -static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { cvar_t *var; char *str; @@ -562,14 +562,14 @@ static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //too specific to the prinst's builtins. -static void PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_Printf("\n"); prinst->RunError(prinst, "\nBuiltin %i not implemented.\nCSQC is not compatible.", prinst->lastcalledbuiltinnumber); PR_BIError (prinst, "bulitin not implemented"); } -static void PF_NoCSQC (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_NoCSQC (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_Printf("\n"); @@ -577,13 +577,13 @@ static void PF_NoCSQC (progfuncs_t *prinst, struct globalvars_s *pr_globals) PR_BIError (prinst, "bulitin not implemented"); } -static void PF_cl_cprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_cprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PF_VarString(prinst, 0, pr_globals); SCR_CenterPrint(csqc_lplayernum, str, true); } -static void PF_cs_makevectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_makevectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (!csqcg.forward || !csqcg.right || !csqcg.up) Host_EndGame("PF_makevectors: one of v_forward, v_right or v_up was not defined\n"); @@ -695,7 +695,7 @@ static qboolean CopyCSQCEdictToEntity(csqcedict_t *in, entity_t *out) return true; } -static void PF_cs_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { //still does a remove. csqcedict_t *in = (void*)G_EDICT(prinst, OFS_PARM0); entity_t *ent; @@ -716,7 +716,7 @@ static void PF_cs_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globa PF_cs_remove(prinst, pr_globals); } -static void PF_R_AddEntity(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_AddEntity(progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *in = (void*)G_EDICT(prinst, OFS_PARM0); entity_t ent; @@ -730,7 +730,7 @@ static void PF_R_AddEntity(progfuncs_t *prinst, struct globalvars_s *pr_globals) V_AddAxisEntity(&ent); } -static void PF_R_DynamicLight_Set(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_DynamicLight_Set(progfuncs_t *prinst, struct globalvars_s *pr_globals) { dlight_t *l; unsigned int lno = G_FLOAT(OFS_PARM0); @@ -762,7 +762,7 @@ static void PF_R_DynamicLight_Set(progfuncs_t *prinst, struct globalvars_s *pr_g break; } } -static void PF_R_DynamicLight_Get(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_DynamicLight_Get(progfuncs_t *prinst, struct globalvars_s *pr_globals) { dlight_t *l; unsigned int lno = G_FLOAT(OFS_PARM0); @@ -799,7 +799,7 @@ static void PF_R_DynamicLight_Get(progfuncs_t *prinst, struct globalvars_s *pr_g } } -static void PF_R_DynamicLight_Add(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_DynamicLight_Add(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); float radius = G_FLOAT(OFS_PARM1); @@ -818,7 +818,7 @@ static void PF_R_DynamicLight_Add(progfuncs_t *prinst, struct globalvars_s *pr_g G_FLOAT(OFS_RETURN) = V_AddLight(0, org, radius, rgb[0]/5, rgb[1]/5, rgb[2]/5); } -static void PF_R_AddEntityMask(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_AddEntityMask(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int mask = G_FLOAT(OFS_PARM0); csqcedict_t *ent; @@ -873,14 +873,14 @@ static void PF_R_AddEntityMask(progfuncs_t *prinst, struct globalvars_s *pr_glob static shader_t *csqc_shadern; static int csqc_startpolyvert; // #306 void(string texturename) R_BeginPolygon (EXT_CSQC_???) -static void PF_R_PolygonBegin(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_PolygonBegin(progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqc_shadern = R_RegisterSkin(PR_GetStringOfs(prinst, OFS_PARM0)); csqc_startpolyvert = cl_numstrisvert; } // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex (EXT_CSQC_???) -static void PF_R_PolygonVertex(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_PolygonVertex(progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (cl_numstrisvert == cl_maxstrisvert) { @@ -898,7 +898,7 @@ static void PF_R_PolygonVertex(progfuncs_t *prinst, struct globalvars_s *pr_glob } // #308 void() R_EndPolygon (EXT_CSQC_???) -static void PF_R_PolygonEnd(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_PolygonEnd(progfuncs_t *prinst, struct globalvars_s *pr_globals) { scenetris_t *t; int i; @@ -963,7 +963,7 @@ float csqc_proj_matrix_inverse[16]; csqc_rebuildmatricies = false; } -void PF_cs_project (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_project (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (csqc_rebuildmatricies) buildmatricies(); @@ -996,7 +996,7 @@ void PF_cs_project (progfuncs_t *prinst, struct globalvars_s *pr_globals) out[2] *= -1; } } -void PF_cs_unproject (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_unproject (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (csqc_rebuildmatricies) buildmatricies(); @@ -1030,7 +1030,7 @@ void PF_cs_unproject (progfuncs_t *prinst, struct globalvars_s *pr_globals) //float CalcFov (float fov_x, float width, float height); //clear scene, and set up the default stuff. -static void PF_R_ClearScene (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_ClearScene (progfuncs_t *prinst, struct globalvars_s *pr_globals) { extern frame_t *view_frame; extern player_state_t *view_message; @@ -1072,7 +1072,7 @@ static void PF_R_ClearScene (progfuncs_t *prinst, struct globalvars_s *pr_global csqc_drawsbar = false; } -static void PF_R_SetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_SetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_globals) { viewflags parametertype = G_FLOAT(OFS_PARM0); float *p = G_VECTOR(OFS_PARM1); @@ -1192,7 +1192,7 @@ static void PF_R_SetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_global } } -static void PF_R_GetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_GetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_globals) { viewflags parametertype = G_FLOAT(OFS_PARM0); float *r = G_VECTOR(OFS_RETURN); @@ -1310,7 +1310,7 @@ static void PF_R_GetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_global } } -static void PF_R_RenderScene(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_R_RenderScene(progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (cl.worldmodel) R_PushDlights (); @@ -1348,13 +1348,13 @@ static void PF_R_RenderScene(progfuncs_t *prinst, struct globalvars_s *pr_global Draw_Crosshair(); } -static void PF_cs_getstatf(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_getstatf(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int stnum = G_FLOAT(OFS_PARM0); float val = cl.statsf[csqc_lplayernum][stnum]; //copy float into the stat G_FLOAT(OFS_RETURN) = val; } -static void PF_cs_getstatbits(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_getstatbits(progfuncs_t *prinst, struct globalvars_s *pr_globals) { //convert an int stat into a qc float. int stnum = G_FLOAT(OFS_PARM0); @@ -1372,7 +1372,7 @@ static void PF_cs_getstatbits(progfuncs_t *prinst, struct globalvars_s *pr_globa else G_FLOAT(OFS_RETURN) = val; } -static void PF_cs_getstats(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_getstats(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int stnum = G_FLOAT(OFS_PARM0); @@ -1392,7 +1392,7 @@ static void PF_cs_getstats(progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_TSTRING(out);*/ } -static void PF_cs_SetOrigin(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_SetOrigin(progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (void*)G_EDICT(prinst, OFS_PARM0); float *org = G_VECTOR(OFS_PARM1); @@ -1402,7 +1402,7 @@ static void PF_cs_SetOrigin(progfuncs_t *prinst, struct globalvars_s *pr_globals World_LinkEdict(&csqc_world, (wedict_t*)ent, false); } -static void PF_cs_SetSize(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_SetSize(progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (void*)G_EDICT(prinst, OFS_PARM0); float *mins = G_VECTOR(OFS_PARM1); @@ -1434,7 +1434,7 @@ static void cs_settracevars(trace_t *tr) *csqcg.trace_ent = EDICT_TO_PROG(csqcprogs, (void*)csqc_world.edicts); } -static void PF_cs_traceline(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_traceline(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v1, *v2, *mins, *maxs; trace_t trace; @@ -1465,7 +1465,7 @@ static void PF_cs_traceline(progfuncs_t *prinst, struct globalvars_s *pr_globals cs_settracevars(&trace); } -static void PF_cs_tracebox(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_tracebox(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v1, *v2, *mins, *maxs; trace_t trace; @@ -1541,7 +1541,7 @@ static trace_t CS_Trace_Toss (csqcedict_t *tossent, csqcedict_t *ignore) trace.fraction = 0; // not relevant return trace; } -static void PF_cs_tracetoss (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_tracetoss (progfuncs_t *prinst, struct globalvars_s *pr_globals) { trace_t trace; csqcedict_t *ent; @@ -1574,7 +1574,7 @@ static int CS_PointContents(vec3_t org) return FTECONTENTS_EMPTY; return cl.worldmodel->funcs.PointContents(cl.worldmodel, NULL, org); } -static void PF_cs_pointcontents(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_pointcontents(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v; int cont; @@ -1658,7 +1658,7 @@ static void csqc_setmodel(progfuncs_t *prinst, csqcedict_t *ent, int modelindex) World_LinkEdict(&csqc_world, (wedict_t*)ent, false); } -static void PF_cs_SetModel(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_SetModel(progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (void*)G_EDICT(prinst, OFS_PARM0); char *modelname = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1678,14 +1678,14 @@ static void PF_cs_SetModel(progfuncs_t *prinst, struct globalvars_s *pr_globals) csqc_setmodel(prinst, ent, modelindex); } -static void PF_cs_SetModelIndex(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN 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); csqc_setmodel(prinst, ent, modelindex); } -static void PF_cs_PrecacheModel(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_PrecacheModel(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int modelindex, freei; char *modelname = PR_GetStringOfs(prinst, OFS_PARM0); @@ -1723,13 +1723,13 @@ static void PF_cs_PrecacheModel(progfuncs_t *prinst, struct globalvars_s *pr_glo G_FLOAT(OFS_RETURN) = modelindex; } -static void PF_cs_PrecacheSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_PrecacheSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *soundname = PR_GetStringOfs(prinst, OFS_PARM0); S_PrecacheSound(soundname); } -static void PF_cs_ModelnameForIndex(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_ModelnameForIndex(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int modelindex = G_FLOAT(OFS_PARM0); @@ -1739,7 +1739,7 @@ static void PF_cs_ModelnameForIndex(progfuncs_t *prinst, struct globalvars_s *pr G_INT(OFS_RETURN) = (int)PR_SetString(prinst, cl.model_name[modelindex]); } -static void PF_ReadByte(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadByte(progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (csqc_fakereadbyte != -1) { @@ -1752,17 +1752,17 @@ static void PF_ReadByte(progfuncs_t *prinst, struct globalvars_s *pr_globals) } } -static void PF_ReadChar(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadChar(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = MSG_ReadChar(); } -static void PF_ReadShort(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadShort(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = MSG_ReadShort(); } -static void PF_ReadEntityNum(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadEntityNum(progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned short val; val = MSG_ReadShort(); @@ -1776,35 +1776,35 @@ static void PF_ReadEntityNum(progfuncs_t *prinst, struct globalvars_s *pr_global G_FLOAT(OFS_RETURN) = val; } -static void PF_ReadLong(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadLong(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = MSG_ReadLong(); } -static void PF_ReadCoord(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadCoord(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = MSG_ReadCoord(); } -static void PF_ReadFloat(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadFloat(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = MSG_ReadFloat(); } -static void PF_ReadString(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadString(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *read = MSG_ReadString(); RETURN_TSTRING(read); } -static void PF_ReadAngle(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadAngle(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = MSG_ReadAngle(); } -static void PF_objerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_objerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; struct edict_s *ed; @@ -1829,12 +1829,12 @@ static void PF_objerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) } } -static void PF_cs_setsensativityscaler (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_setsensativityscaler (progfuncs_t *prinst, struct globalvars_s *pr_globals) { in_sensitivityscale = G_FLOAT(OFS_PARM0); } -static void PF_cs_pointparticles (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_pointparticles (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int effectnum = G_FLOAT(OFS_PARM0)-1; float *org = G_VECTOR(OFS_PARM1); @@ -1849,7 +1849,7 @@ static void PF_cs_pointparticles (progfuncs_t *prinst, struct globalvars_s *pr_g P_RunParticleEffectType(org, vel, count, effectnum); } -static void PF_cs_trailparticles (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_trailparticles (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int efnum; csqcedict_t *ent; @@ -1873,7 +1873,7 @@ static void PF_cs_trailparticles (progfuncs_t *prinst, struct globalvars_s *pr_g pe->ParticleTrail(start, end, efnum, &ent->trailstate); } -static void PF_cs_particleeffectnum (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_particleeffectnum (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *effectname = PR_GetStringOfs(prinst, OFS_PARM0); @@ -1883,7 +1883,7 @@ static void PF_cs_particleeffectnum (progfuncs_t *prinst, struct globalvars_s *p G_FLOAT(OFS_RETURN) = pe->FindParticleType(effectname)+1; } -static void PF_cs_sendevent (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_sendevent (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent; int i; @@ -1989,7 +1989,7 @@ static void cs_get_input_state (usercmd_t *cmd) } //get the input commands, and stuff them into some globals. -static void PF_cs_getinputstate (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_getinputstate (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int f; usercmd_t *cmd; @@ -2016,7 +2016,7 @@ static void PF_cs_getinputstate (progfuncs_t *prinst, struct globalvars_s *pr_gl //read lots of globals, run the default player physics, write lots of globals. //not intended to affect client state at all -static void PF_cs_runplayerphysics (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_runplayerphysics (progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int msecs; extern vec3_t player_mins; @@ -2112,7 +2112,7 @@ static void PF_cs_runplayerphysics (progfuncs_t *prinst, struct globalvars_s *pr World_LinkEdict (&csqc_world, (wedict_t*)ent, true); } -static void PF_cs_getentitytoken (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_getentitytoken (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (!csqcmapentitydata) { @@ -2139,7 +2139,7 @@ static void CheckSendPings(void) } } -static void PF_cs_serverkey (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_serverkey (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *keyname = PF_VarString(prinst, 0, pr_globals); char *ret; @@ -2206,7 +2206,7 @@ static void PF_cs_serverkey (progfuncs_t *prinst, struct globalvars_s *pr_global } //string(float pnum, string keyname) -static void PF_cs_getplayerkey (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_getplayerkey (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char buffer[64]; char *ret; @@ -2283,7 +2283,7 @@ static void PF_cs_getplayerkey (progfuncs_t *prinst, struct globalvars_s *pr_glo G_INT(OFS_RETURN) = 0; } -static void PF_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *extname = PR_GetStringOfs(prinst, OFS_PARM0); int i; @@ -2305,7 +2305,7 @@ static void PF_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_glob G_FLOAT(OFS_RETURN) = false; } -static void PF_cs_sound(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_sound(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *sample; int channel; @@ -2331,7 +2331,7 @@ static void PF_cs_sound(progfuncs_t *prinst, struct globalvars_s *pr_globals) S_StartSound(-entity->entnum, channel, sfx, entity->v->origin, volume, attenuation, pitchpct); }; -void PF_cs_pointsound(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_pointsound(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *sample; float *origin; @@ -2355,7 +2355,7 @@ void PF_cs_pointsound(progfuncs_t *prinst, struct globalvars_s *pr_globals) S_StartSound(0, 0, sfx, origin, volume, attenuation, pitchpct); } -static void PF_cs_particle(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_particle(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); float *dir = G_VECTOR(OFS_PARM1); @@ -2364,7 +2364,7 @@ static void PF_cs_particle(progfuncs_t *prinst, struct globalvars_s *pr_globals) pe->RunParticleEffect(org, dir, colour, count); } -static void PF_cs_particle2(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_particle2(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org, *dmin, *dmax; float colour; @@ -2381,7 +2381,7 @@ static void PF_cs_particle2(progfuncs_t *prinst, struct globalvars_s *pr_globals pe->RunParticleEffect2 (org, dmin, dmax, colour, effect, count); } -static void PF_cs_particle3(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_particle3(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org, *box; float colour; @@ -2397,7 +2397,7 @@ static void PF_cs_particle3(progfuncs_t *prinst, struct globalvars_s *pr_globals pe->RunParticleEffect3(org, box, colour, effect, count); } -static void PF_cs_particle4(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_particle4(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org; float radius; @@ -2415,7 +2415,7 @@ static void PF_cs_particle4(progfuncs_t *prinst, struct globalvars_s *pr_globals } -void PF_cl_effect(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_effect(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); char *name = PR_GetStringOfs(prinst, OFS_PARM1); @@ -2431,7 +2431,7 @@ void PF_cl_effect(progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_Printf("PF_cl_effect: Couldn't load model %s\n", name); } -void PF_cl_ambientsound(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_ambientsound(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *samp; float *pos; @@ -2445,14 +2445,14 @@ void PF_cl_ambientsound(progfuncs_t *prinst, struct globalvars_s *pr_globals) S_StaticSound (S_PrecacheSound (samp), pos, vol, attenuation); } -static void PF_cs_vectorvectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_vectorvectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) { VectorCopy(G_VECTOR(OFS_PARM0), csqcg.forward); VectorNormalize(csqcg.forward); VectorVectors(csqcg.forward, csqcg.right, csqcg.up); } -static void PF_cs_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int stnum = G_FLOAT(OFS_PARM0); char *str = PR_GetStringOfs(prinst, OFS_PARM1); @@ -2468,7 +2468,7 @@ static void PF_cs_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globa cl_lightstyle[stnum].length = Q_strlen(cl_lightstyle[stnum].map); } -static void PF_cs_changeyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_changeyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent; float ideal, current, move, speed; @@ -2504,7 +2504,7 @@ static void PF_cs_changeyaw (progfuncs_t *prinst, struct globalvars_s *pr_global ent->v->angles[1] = anglemod (current + move); } -static void PF_cs_changepitch (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_changepitch (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent; float ideal, current, move, speed; @@ -2541,7 +2541,7 @@ static void PF_cs_changepitch (progfuncs_t *prinst, struct globalvars_s *pr_glob ent->v->angles[0] = anglemod (current + move); } -static void PF_cs_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent, *chain; float rad; @@ -2575,7 +2575,7 @@ static void PF_cs_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globa //entity(string field, float match) findchainflags = #450 //chained search for float, int, and entity reference fields -void PF_cs_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; int s; @@ -2602,7 +2602,7 @@ void PF_cs_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //entity(string field, float match) findchainfloat = #403 -void PF_cs_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; float s; @@ -2631,7 +2631,7 @@ void PF_cs_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) //entity(string field, string match) findchain = #402 //chained search for strings in entity fields -void PF_cs_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; char *s; @@ -2661,7 +2661,7 @@ void PF_cs_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_EDICT(prinst, (edict_t*)chain); } -static void PF_cl_te_gunshot (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_gunshot (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); float scaler = 1; @@ -2670,7 +2670,7 @@ static void PF_cl_te_gunshot (progfuncs_t *prinst, struct globalvars_s *pr_globa if (P_RunParticleEffectType(pos, NULL, scaler, pt_gunshot)) P_RunParticleEffect (pos, vec3_origin, 0, 20*scaler); } -static void PF_cl_te_bloodqw (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_bloodqw (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); float scaler = 1; @@ -2680,7 +2680,7 @@ static void PF_cl_te_bloodqw (progfuncs_t *prinst, struct globalvars_s *pr_globa if (P_RunParticleEffectType(pos, NULL, scaler, ptdp_blood)) P_RunParticleEffect (pos, vec3_origin, 73, 20*scaler); } -static void PF_cl_te_blooddp (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_blooddp (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); float *dir = G_VECTOR(OFS_PARM1); @@ -2690,20 +2690,20 @@ static void PF_cl_te_blooddp (progfuncs_t *prinst, struct globalvars_s *pr_globa if (P_RunParticleEffectType(pos, dir, scaler, ptqw_blood)) P_RunParticleEffect (pos, dir, 73, 20*scaler); } -static void PF_cl_te_lightningblood (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_lightningblood (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectType(pos, NULL, 1, ptqw_lightningblood)) P_RunParticleEffect (pos, vec3_origin, 225, 50); } -static void PF_cl_te_spike (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_spike (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectType(pos, NULL, 1, pt_spike)) if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot)) P_RunParticleEffect (pos, vec3_origin, 0, 10); } -static void PF_cl_te_superspike (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_superspike (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectType(pos, NULL, 1, pt_superspike)) @@ -2711,7 +2711,7 @@ static void PF_cl_te_superspike (progfuncs_t *prinst, struct globalvars_s *pr_gl if (P_RunParticleEffectType(pos, NULL, 20, pt_gunshot)) P_RunParticleEffect (pos, vec3_origin, 0, 20); } -static void PF_cl_te_explosion (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_explosion (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); @@ -2740,14 +2740,14 @@ static void PF_cl_te_explosion (progfuncs_t *prinst, struct globalvars_s *pr_glo S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1, 0); } -static void PF_cl_te_tarexplosion (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_tarexplosion (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); P_RunParticleEffectType(pos, NULL, 1, pt_tarexplosion); S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1, 0); } -static void PF_cl_te_wizspike (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_wizspike (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectType(pos, NULL, 1, pt_wizspike)) @@ -2755,7 +2755,7 @@ static void PF_cl_te_wizspike (progfuncs_t *prinst, struct globalvars_s *pr_glob S_StartSound (-2, 0, cl_sfx_knighthit, pos, 1, 1, 0); } -static void PF_cl_te_knightspike (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_knightspike (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectType(pos, NULL, 1, pt_knightspike)) @@ -2763,24 +2763,24 @@ static void PF_cl_te_knightspike (progfuncs_t *prinst, struct globalvars_s *pr_g S_StartSound (-2, 0, cl_sfx_knighthit, pos, 1, 1, 0); } -static void PF_cl_te_lavasplash (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_lavasplash (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); P_RunParticleEffectType(pos, NULL, 1, pt_lavasplash); } -static void PF_cl_te_teleport (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_teleport (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); P_RunParticleEffectType(pos, NULL, 1, pt_teleportsplash); } -static void PF_cl_te_gunshotquad (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_gunshotquad (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_gunshotquad")) if (P_RunParticleEffectType(pos, NULL, 1, pt_gunshot)) P_RunParticleEffect (pos, vec3_origin, 0, 20); } -static void PF_cl_te_spikequad (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_spikequad (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_spikequad")) @@ -2788,7 +2788,7 @@ static void PF_cl_te_spikequad (progfuncs_t *prinst, struct globalvars_s *pr_glo if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot)) P_RunParticleEffect (pos, vec3_origin, 0, 10); } -static void PF_cl_te_superspikequad (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_superspikequad (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_superspikequad")) @@ -2797,7 +2797,7 @@ static void PF_cl_te_superspikequad (progfuncs_t *prinst, struct globalvars_s *p if (P_RunParticleEffectType(pos, NULL, 20, pt_gunshot)) P_RunParticleEffect (pos, vec3_origin, 0, 20); } -static void PF_cl_te_explosionquad (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_explosionquad (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_explosionquad")) @@ -2828,7 +2828,7 @@ static void PF_cl_te_explosionquad (progfuncs_t *prinst, struct globalvars_s *pr } //void(vector org, float radius, float lifetime, vector color) te_customflash -static void PF_cl_te_customflash (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_customflash (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); float radius = G_FLOAT(OFS_PARM1); @@ -2847,10 +2847,10 @@ static void PF_cl_te_customflash (progfuncs_t *prinst, struct globalvars_s *pr_g dl->color[2] = colour[2]*0.5f; } -static void PF_cl_te_bloodshower (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_bloodshower (progfuncs_t *prinst, struct globalvars_s *pr_globals) { } -static void PF_cl_te_particlecube (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_particlecube (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *minb = G_VECTOR(OFS_PARM0); float *maxb = G_VECTOR(OFS_PARM1); @@ -2862,16 +2862,16 @@ static void PF_cl_te_particlecube (progfuncs_t *prinst, struct globalvars_s *pr_ P_RunParticleCube(minb, maxb, vel, howmany, color, gravity, jitter); } -static void PF_cl_te_spark (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_spark (progfuncs_t *prinst, struct globalvars_s *pr_globals) { } -static void PF_cl_te_smallflash (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_smallflash (progfuncs_t *prinst, struct globalvars_s *pr_globals) { } -static void PF_cl_te_explosion2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_explosion2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { } -static void PF_cl_te_lightning1 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_lightning1 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); float *start = G_VECTOR(OFS_PARM1); @@ -2879,7 +2879,7 @@ static void PF_cl_te_lightning1 (progfuncs_t *prinst, struct globalvars_s *pr_gl CL_AddBeam(0, ent->entnum+MAX_EDICTS, start, end); } -static void PF_cl_te_lightning2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_lightning2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); float *start = G_VECTOR(OFS_PARM1); @@ -2887,7 +2887,7 @@ static void PF_cl_te_lightning2 (progfuncs_t *prinst, struct globalvars_s *pr_gl CL_AddBeam(1, ent->entnum+MAX_EDICTS, start, end); } -static void PF_cl_te_lightning3 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_lightning3 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); float *start = G_VECTOR(OFS_PARM1); @@ -2895,7 +2895,7 @@ static void PF_cl_te_lightning3 (progfuncs_t *prinst, struct globalvars_s *pr_gl CL_AddBeam(2, ent->entnum+MAX_EDICTS, start, end); } -static void PF_cl_te_beam (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_beam (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); float *start = G_VECTOR(OFS_PARM1); @@ -2903,10 +2903,10 @@ static void PF_cl_te_beam (progfuncs_t *prinst, struct globalvars_s *pr_globals) CL_AddBeam(5, ent->entnum+MAX_EDICTS, start, end); } -static void PF_cl_te_plasmaburn (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_plasmaburn (progfuncs_t *prinst, struct globalvars_s *pr_globals) { } -static void PF_cl_te_explosionrgb (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_explosionrgb (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); float *colour = G_VECTOR(OFS_PARM1); @@ -2937,7 +2937,7 @@ static void PF_cl_te_explosionrgb (progfuncs_t *prinst, struct globalvars_s *pr_ S_StartSound (-2, 0, cl_sfx_r_exp3, org, 1, 1, 0); } -static void PF_cl_te_particlerain (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_particlerain (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *min = G_VECTOR(OFS_PARM0); float *max = G_VECTOR(OFS_PARM1); @@ -2947,7 +2947,7 @@ static void PF_cl_te_particlerain (progfuncs_t *prinst, struct globalvars_s *pr_ P_RunParticleWeather(min, max, vel, howmany, colour, "rain"); } -static void PF_cl_te_particlesnow (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_te_particlesnow (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *min = G_VECTOR(OFS_PARM0); float *max = G_VECTOR(OFS_PARM1); @@ -2988,7 +2988,7 @@ void CSQC_RunThreads(void) } } -static void PF_cs_addprogs (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_addprogs (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s = PR_GetStringOfs(prinst, OFS_PARM0); if (!s || !*s) @@ -2997,7 +2997,7 @@ static void PF_cs_addprogs (progfuncs_t *prinst, struct globalvars_s *pr_globals G_FLOAT(OFS_RETURN) = PR_LoadProgs(prinst, s, 0, NULL, 0); } -static void PF_cs_OpenPortal (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_OpenPortal (progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef Q2BSPS if (cl.worldmodel->fromgame == fg_quake2) @@ -3008,7 +3008,7 @@ static void PF_cs_OpenPortal (progfuncs_t *prinst, struct globalvars_s *pr_globa #ifndef NOMEDIA // #487 float(string name) gecko_create( string name ) -static void PF_cs_gecko_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *shader = PR_GetStringOfs(prinst, OFS_PARM0); cin_t *cin; @@ -3020,11 +3020,11 @@ static void PF_cs_gecko_create (progfuncs_t *prinst, struct globalvars_s *pr_glo G_FLOAT(OFS_RETURN) = 1; } // #488 void(string name) gecko_destroy( string name ) -static void PF_cs_gecko_destroy (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_destroy (progfuncs_t *prinst, struct globalvars_s *pr_globals) { } // #489 void(string name) gecko_navigate( string name, string URI ) -static void PF_cs_gecko_navigate (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_navigate (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *shader = PR_GetStringOfs(prinst, OFS_PARM0); char *command = PR_GetStringOfs(prinst, OFS_PARM1); @@ -3037,7 +3037,7 @@ static void PF_cs_gecko_navigate (progfuncs_t *prinst, struct globalvars_s *pr_g Media_Send_Command(cin, command); } // #490 float(string name) gecko_keyevent( string name, float key, float eventtype ) -static void PF_cs_gecko_keyevent (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_keyevent (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *shader = PR_GetStringOfs(prinst, OFS_PARM0); int key = G_FLOAT(OFS_PARM1); @@ -3050,7 +3050,7 @@ static void PF_cs_gecko_keyevent (progfuncs_t *prinst, struct globalvars_s *pr_g Media_Send_KeyEvent(cin, MP_TranslateDPtoFTECodes(key), (key>127)?0:key, eventtype); } // #491 void gecko_mousemove( string name, float x, float y ) -static void PF_cs_gecko_mousemove (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_mousemove (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *shader = PR_GetStringOfs(prinst, OFS_PARM0); float posx = G_FLOAT(OFS_PARM1); @@ -3063,7 +3063,7 @@ static void PF_cs_gecko_mousemove (progfuncs_t *prinst, struct globalvars_s *pr_ Media_Send_MouseMove(cin, posx, posy); } // #492 void gecko_resize( string name, float w, float h ) -static void PF_cs_gecko_resize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_resize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *shader = PR_GetStringOfs(prinst, OFS_PARM0); float sizex = G_FLOAT(OFS_PARM1); @@ -3075,7 +3075,7 @@ static void PF_cs_gecko_resize (progfuncs_t *prinst, struct globalvars_s *pr_glo Media_Send_Resize(cin, sizex, sizey); } // #493 vector gecko_get_texture_extent( string name ) -static void PF_cs_gecko_get_texture_extent (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gecko_get_texture_extent (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *shader = PR_GetStringOfs(prinst, OFS_PARM0); float *ret = G_VECTOR(OFS_RETURN); @@ -3097,7 +3097,7 @@ static void PF_cs_gecko_get_texture_extent (progfuncs_t *prinst, struct globalva } #endif -static void PF_cs_droptofloor (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_droptofloor (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent; vec3_t end; @@ -3124,7 +3124,7 @@ static void PF_cs_droptofloor (progfuncs_t *prinst, struct globalvars_s *pr_glob } } -static void PF_cs_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *in, *out; @@ -3136,12 +3136,12 @@ static void PF_cs_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globa World_LinkEdict (&csqc_world, (wedict_t*)out, false); } -static void PF_cl_playingdemo (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_playingdemo (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = !!cls.demoplayback; } -static void PF_cl_runningserver (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_runningserver (progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef CLIENTONLY G_FLOAT(OFS_RETURN) = false; @@ -3150,7 +3150,7 @@ static void PF_cl_runningserver (progfuncs_t *prinst, struct globalvars_s *pr_gl #endif } -static void PF_cl_getlight (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cl_getlight (progfuncs_t *prinst, struct globalvars_s *pr_globals) { vec3_t ambient, diffuse, dir; cl.worldmodel->funcs.LightPointValues(cl.worldmodel, G_VECTOR(OFS_PARM0), ambient, diffuse, dir); @@ -3158,13 +3158,13 @@ static void PF_cl_getlight (progfuncs_t *prinst, struct globalvars_s *pr_globals } /* -static void PF_Stub (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Stub (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_Printf("Obsolete csqc builtin (%i) executed\n", prinst->lastcalledbuiltinnumber); } */ -static void PF_rotatevectorsbytag (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_rotatevectorsbytag (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); int tagnum = G_FLOAT(OFS_PARM1); @@ -3232,7 +3232,7 @@ static void EdictToTransform(csqcedict_t *ed, float *trans) trans[11] = ed->v->origin[2]; } -static void PF_cs_gettaginfo (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gettaginfo (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); int tagnum = G_FLOAT(OFS_PARM1); @@ -3268,7 +3268,7 @@ static void PF_cs_gettaginfo (progfuncs_t *prinst, struct globalvars_s *pr_globa VectorCopy((result+8), csqcg.up); } -static void PF_cs_gettagindex (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_gettagindex (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent = (csqcedict_t*)G_EDICT(prinst, OFS_PARM0); char *tagname = PR_GetStringOfs(prinst, OFS_PARM1); @@ -3276,7 +3276,7 @@ static void PF_cs_gettagindex (progfuncs_t *prinst, struct globalvars_s *pr_glob model_t *mod = CSQC_GetModelForIndex(ent->v->modelindex); G_FLOAT(OFS_RETURN) = Mod_TagNumForName(mod, tagname); } -static void PF_rotatevectorsbyangles (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_rotatevectorsbyangles (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *ang = G_VECTOR(OFS_PARM0); vec3_t src[3], trans[3], res[3]; @@ -3295,7 +3295,7 @@ static void PF_rotatevectorsbyangles (progfuncs_t *prinst, struct globalvars_s * VectorNegate(res[1], csqcg.right); VectorCopy(res[2], csqcg.up); } -static void PF_rotatevectorsbymatrix (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_rotatevectorsbymatrix (progfuncs_t *prinst, struct globalvars_s *pr_globals) { vec3_t src[3], trans[3], res[3]; @@ -3313,7 +3313,7 @@ static void PF_rotatevectorsbymatrix (progfuncs_t *prinst, struct globalvars_s * VectorNegate(res[1], csqcg.right); VectorCopy(res[2], csqcg.up); } -static void PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int modelindex = G_FLOAT(OFS_PARM0); char *str = PF_VarString(prinst, 1, pr_globals); @@ -3324,7 +3324,7 @@ static void PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_global else G_FLOAT(OFS_RETURN) = -1; } -static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int modelindex = G_FLOAT(OFS_PARM0); int frameno = G_FLOAT(OFS_PARM1); @@ -3335,7 +3335,7 @@ static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globa else G_FLOAT(OFS_RETURN) = 0; } -static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int modelindex = G_FLOAT(OFS_PARM0); char *str = PF_VarString(prinst, 1, pr_globals); @@ -3347,7 +3347,7 @@ static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals else G_FLOAT(OFS_RETURN) = -1; } -static void PF_shaderforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_shaderforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PF_VarString(prinst, 0, pr_globals); @@ -3425,7 +3425,7 @@ skelobject_t *skel_get(progfuncs_t *prinst, int skelidx, int bonecount) } //float(float modelindex) skel_create (FTE_CSQC_SKELETONOBJECTS) -static void PF_skel_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int numbones; skelobject_t *skelobj; @@ -3463,7 +3463,7 @@ static void PF_skel_create (progfuncs_t *prinst, struct globalvars_s *pr_globals } //float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone) skel_build (FTE_CSQC_SKELETONOBJECTS) -static void PF_skel_build(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_build(progfuncs_t *prinst, struct globalvars_s *pr_globals) { #define MAX_BONES 256 int skelidx = G_FLOAT(OFS_PARM0); @@ -3554,7 +3554,7 @@ static void PF_skel_build(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(float skel) skel_get_numbones (FTE_CSQC_SKELETONOBJECTS) -static void PF_skel_get_numbones (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_get_numbones (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); skelobject_t *skelobj; @@ -3568,7 +3568,7 @@ static void PF_skel_get_numbones (progfuncs_t *prinst, struct globalvars_s *pr_g } //string(float skel, float bonenum) skel_get_bonename (FTE_CSQC_SKELETONOBJECTS) (returns tempstring) -static void PF_skel_get_bonename (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_get_bonename (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); int boneidx = G_FLOAT(OFS_PARM1); @@ -3585,7 +3585,7 @@ static void PF_skel_get_bonename (progfuncs_t *prinst, struct globalvars_s *pr_g } //float(float skel, float bonenum) skel_get_boneparent (FTE_CSQC_SKELETONOBJECTS) -static void PF_skel_get_boneparent (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_get_boneparent (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); int boneidx = G_FLOAT(OFS_PARM1); @@ -3600,7 +3600,7 @@ static void PF_skel_get_boneparent (progfuncs_t *prinst, struct globalvars_s *pr } //float(float skel, string tagname) gettagindex (DP_MD3_TAGSINFO) -static void PF_skel_find_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_find_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); char *bname = PR_GetStringOfs(prinst, OFS_PARM1); @@ -3661,7 +3661,7 @@ void bonematident_toqcvectors(float vx[3], float vy[3], float vz[3], float t[3]) } //vector(float skel, float bonenum) skel_get_bonerel (FTE_CSQC_SKELETONOBJECTS) (sets v_forward etc) -static void PF_skel_get_bonerel (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_get_bonerel (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); int boneidx = G_FLOAT(OFS_PARM1)-1; @@ -3673,7 +3673,7 @@ static void PF_skel_get_bonerel (progfuncs_t *prinst, struct globalvars_s *pr_gl } //vector(float skel, float bonenum) skel_get_boneabs (FTE_CSQC_SKELETONOBJECTS) (sets v_forward etc) -static void PF_skel_get_boneabs (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_get_boneabs (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); int boneidx = G_FLOAT(OFS_PARM1)-1; @@ -3714,7 +3714,7 @@ static void PF_skel_get_boneabs (progfuncs_t *prinst, struct globalvars_s *pr_gl } //void(float skel, float bonenum, vector org) skel_set_bone (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) -static void PF_skel_set_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_set_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); unsigned int boneidx = G_FLOAT(OFS_PARM1)-1; @@ -3744,7 +3744,7 @@ static void PF_skel_set_bone (progfuncs_t *prinst, struct globalvars_s *pr_globa } //void(float skel, float bonenum, vector org) skel_mul_bone (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) -static void PF_skel_mul_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_mul_bone (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); int boneidx = G_FLOAT(OFS_PARM1)-1; @@ -3767,7 +3767,7 @@ static void PF_skel_mul_bone (progfuncs_t *prinst, struct globalvars_s *pr_globa } //void(float skel, float startbone, float endbone, vector org) skel_mul_bone (FTE_CSQC_SKELETONOBJECTS) (reads v_forward etc) -static void PF_skel_mul_bones (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_mul_bones (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); unsigned int startbone = G_FLOAT(OFS_PARM1)-1; @@ -3797,7 +3797,7 @@ static void PF_skel_mul_bones (progfuncs_t *prinst, struct globalvars_s *pr_glob } //void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones (FTE_CSQC_SKELETONOBJECTS) -static void PF_skel_copybones (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_copybones (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skeldst = G_FLOAT(OFS_PARM0); int skelsrc = G_FLOAT(OFS_PARM1); @@ -3826,7 +3826,7 @@ static void PF_skel_copybones (progfuncs_t *prinst, struct globalvars_s *pr_glob } //void(float skel) skel_delete (FTE_CSQC_SKELETONOBJECTS) -static void PF_skel_delete (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skel_delete (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int skelidx = G_FLOAT(OFS_PARM0); skelobject_t *skelobj; @@ -3840,7 +3840,7 @@ static void PF_skel_delete (progfuncs_t *prinst, struct globalvars_s *pr_globals -static void PF_cs_checkbottom (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_checkbottom (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent; @@ -3849,7 +3849,7 @@ static void PF_cs_checkbottom (progfuncs_t *prinst, struct globalvars_s *pr_glob G_FLOAT(OFS_RETURN) = World_CheckBottom (&csqc_world, (wedict_t*)ent); } -static void PF_cs_break (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_break (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_Printf ("break statement\n"); #ifdef TEXTEDITOR @@ -3857,7 +3857,7 @@ static void PF_cs_break (progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -static void PF_cs_walkmove (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_walkmove (progfuncs_t *prinst, struct globalvars_s *pr_globals) { csqcedict_t *ent; float yaw, dist; @@ -3895,7 +3895,7 @@ static void PF_cs_walkmove (progfuncs_t *prinst, struct globalvars_s *pr_globals *csqcg.self = oldself; } -static void PF_cs_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals) { wedict_t *ent; float dist; @@ -3910,7 +3910,7 @@ static void CS_ConsoleCommand_f(void) Q_snprintfz(cmd, sizeof(cmd), "%s %s", Cmd_Argv(0), Cmd_Args()); CSQC_ConsoleCommand(cmd); } -static void PF_cs_registercommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_registercommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PF_VarString(prinst, 0, pr_globals); if (!strcmp(str, "+showscores") || !strcmp(str, "-showscores") || @@ -3929,7 +3929,7 @@ qboolean CSQC_SettingListener(void) } return false; } -static void PF_cs_setlistener (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cs_setlistener (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *origin = G_VECTOR(OFS_PARM0); float *forward = G_VECTOR(OFS_PARM1); @@ -4240,7 +4240,7 @@ void CSQC_DeltaEnd(void) } } -void PF_DeltaListen(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_DeltaListen(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; char *mname = PR_GetStringOfs(prinst, OFS_PARM0); @@ -4281,13 +4281,12 @@ void PF_DeltaListen(progfuncs_t *prinst, struct globalvars_s *pr_globals) #if 1 -void PF_ReadServerEntityState(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadServerEntityState(progfuncs_t *prinst, struct globalvars_s *pr_globals) { } #else - packet_entities_t *CL_ProcessPacketEntities(float *servertime, qboolean nolerp); -void PF_ReadServerEntityState(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ReadServerEntityState(progfuncs_t *prinst, struct globalvars_s *pr_globals) { //read the arguments the csqc gave us unsigned int flags = G_FLOAT(OFS_PARM0); diff --git a/engine/client/pr_menu.c b/engine/client/pr_menu.c index ee63fcc44..56d673ac0 100644 --- a/engine/client/pr_menu.c +++ b/engine/client/pr_menu.c @@ -215,7 +215,7 @@ int MP_TranslateDPtoFTECodes(int code) } //string findkeysforcommand(string command) = #610; -void PF_cl_findkeysforcommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_findkeysforcommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *cmdname = PR_GetStringOfs(prinst, OFS_PARM0); int keynums[2]; @@ -231,13 +231,13 @@ void PF_cl_findkeysforcommand (progfuncs_t *prinst, struct globalvars_s *pr_glob RETURN_TSTRING(keyname); } -void PF_cl_getkeybind (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_getkeybind (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *binding = Key_GetBinding(G_FLOAT(OFS_PARM0)); RETURN_TSTRING(binding); } -void PF_cl_stringtokeynum(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_stringtokeynum(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; int modifier; @@ -255,7 +255,7 @@ void PF_cl_stringtokeynum(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //string keynumtostring(float keynum) = #609; -void PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int code = G_FLOAT(OFS_PARM0); @@ -272,7 +272,7 @@ void PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals) //float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457; -void PF_CL_drawfill (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawfill (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); float *size = G_VECTOR(OFS_PARM1); @@ -285,7 +285,7 @@ void PF_CL_drawfill (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 1; } //void drawsetcliparea(float x, float y, float width, float height) = #458; -void PF_CL_drawsetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawsetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float x = G_FLOAT(OFS_PARM0), y = G_FLOAT(OFS_PARM1), w = G_FLOAT(OFS_PARM2), h = G_FLOAT(OFS_PARM3); @@ -315,7 +315,7 @@ void PF_CL_drawsetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals G_FLOAT(OFS_RETURN) = 0; } //void drawresetcliparea(void) = #459; -void PF_CL_drawresetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawresetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef GLQUAKE if (qrenderer == QR_OPENGL) @@ -328,7 +328,7 @@ void PF_CL_drawresetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globa G_FLOAT(OFS_RETURN) = 0; } -void PF_CL_DrawTextField (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_DrawTextField (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); float *size = G_VECTOR(OFS_PARM1); @@ -338,7 +338,7 @@ void PF_CL_DrawTextField (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float drawstring(vector position, string text, vector scale, float alpha, float flag) = #455; -void PF_CL_drawcolouredstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawcolouredstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); char *text = PR_GetStringOfs(prinst, OFS_PARM1); @@ -368,7 +368,7 @@ void PF_CL_drawcolouredstring (progfuncs_t *prinst, struct globalvars_s *pr_glob Font_EndString(font_conchar); } -void PF_CL_stringwidth(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_stringwidth(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *text = PR_GetStringOfs(prinst, OFS_PARM0); qboolean usecolours = G_FLOAT(OFS_PARM1); @@ -406,7 +406,7 @@ static void PF_SelectDPDrawFlag(int flag) } //float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456; -void PF_CL_drawpic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawpic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); char *picname = PR_GetStringOfs(prinst, OFS_PARM1); @@ -429,7 +429,7 @@ void PF_CL_drawpic (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 1; } -void PF_CL_drawsubpic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawsubpic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); float *size = G_VECTOR(OFS_PARM1); @@ -459,7 +459,7 @@ void PF_CL_drawsubpic (progfuncs_t *prinst, struct globalvars_s *pr_globals) -void PF_CL_is_cached_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_is_cached_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; @@ -471,7 +471,7 @@ void PF_CL_is_cached_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 1; } -void PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; mpic_t *pic; @@ -503,7 +503,7 @@ void PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_INT(OFS_RETURN) = 0; } -void PF_CL_free_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_free_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; @@ -514,7 +514,7 @@ void PF_CL_free_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals) //float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454; -void PF_CL_drawcharacter (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawcharacter (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); int chara = G_FLOAT(OFS_PARM1); @@ -540,7 +540,7 @@ void PF_CL_drawcharacter (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 1; } //float drawrawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455; -void PF_CL_drawrawstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawrawstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *pos = G_VECTOR(OFS_PARM0); char *text = PR_GetStringOfs(prinst, OFS_PARM1); @@ -569,7 +569,7 @@ void PF_CL_drawrawstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //void (float width, vector rgb, float alpha, float flags, vector pos1, ...) drawline; -void PF_CL_drawline (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawline (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *rgb = G_VECTOR(OFS_PARM1); float alpha = G_FLOAT(OFS_PARM2); @@ -594,7 +594,7 @@ void PF_CL_drawline (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //vector drawgetimagesize(string pic) = #460; -void PF_CL_drawgetimagesize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_drawgetimagesize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *picname = PR_GetStringOfs(prinst, OFS_PARM0); mpic_t *p = Draw_SafeCachePic(picname); @@ -652,14 +652,14 @@ cvar_t pr_menuqc_coreonerror = SCVAR("pr_menuqc_coreonerror", "1"); //new generic functions. //float isfunction(string function_name) = #607; -void PF_isfunction (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_isfunction (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *name = PR_GetStringOfs(prinst, OFS_PARM0); G_FLOAT(OFS_RETURN) = !!PR_FindFunction(prinst, name, PR_CURRENT); } //void callfunction(...) = #605; -void PF_callfunction (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_callfunction (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *name; func_t f; @@ -672,7 +672,7 @@ void PF_callfunction (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //void loadfromfile(string file) = #69; -void PF_loadfromfile (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_loadfromfile (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *filename = PR_GetStringOfs(prinst, OFS_PARM0); char *file = COM_LoadTempFile(filename); @@ -693,7 +693,7 @@ void PF_loadfromfile (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 0; } -void PF_loadfromdata (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_loadfromdata (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *file = PR_GetStringOfs(prinst, OFS_PARM0); @@ -713,7 +713,7 @@ void PF_loadfromdata (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 0; } -void PF_parseentitydata(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_parseentitydata(progfuncs_t *prinst, struct globalvars_s *pr_globals) { void *ed = G_EDICT(prinst, OFS_PARM0); char *file = PR_GetStringOfs(prinst, OFS_PARM1); @@ -740,7 +740,7 @@ void PF_parseentitydata(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 0; } -void PF_mod (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_mod (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = (float)(((int)G_FLOAT(OFS_PARM0))%((int)G_FLOAT(OFS_PARM1))); } @@ -770,7 +770,7 @@ char *RemapCvarNameFromDPToFTE(char *name) return name; } -static void PF_menu_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_menu_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { cvar_t *var; char *str; @@ -787,7 +787,7 @@ static void PF_menu_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) else G_FLOAT(OFS_RETURN) = 0; } -static void PF_menu_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_menu_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *var_name, *val; cvar_t *var; @@ -799,7 +799,7 @@ static void PF_menu_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globa var = Cvar_Get(var_name, val, 0, "QC variables"); Cvar_Set (var, val); } -static void PF_menu_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN 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"); @@ -808,7 +808,7 @@ static void PF_menu_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_gl qboolean M_Vid_GetMode(int num, int *w, int *h); //a bit pointless really -void PF_cl_getresolution (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_getresolution (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float mode = G_FLOAT(OFS_PARM0); float *ret = G_VECTOR(OFS_RETURN); @@ -825,7 +825,7 @@ void PF_cl_getresolution (progfuncs_t *prinst, struct globalvars_s *pr_globals) -void PF_nonfatalobjerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_nonfatalobjerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; struct edict_s *ed; @@ -860,7 +860,7 @@ void PF_nonfatalobjerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) //float isserver(void) = #60; -void PF_isserver (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_isserver (progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef CLIENTONLY G_FLOAT(OFS_RETURN) = false; @@ -870,13 +870,13 @@ void PF_isserver (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float clientstate(void) = #62; -void PF_clientstate (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_clientstate (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = cls.state >= ca_connected ? 2 : 1; //fit in with netquake (we never run a menu.dat dedicated) } //too specific to the prinst's builtins. -static void PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_Printf("\n"); @@ -886,7 +886,7 @@ static void PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) -void PF_CL_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; @@ -899,7 +899,7 @@ void PF_CL_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //void setkeydest(float dest) = #601; -void PF_cl_setkeydest (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_setkeydest (progfuncs_t *prinst, struct globalvars_s *pr_globals) { switch((int)G_FLOAT(OFS_PARM0)) { @@ -922,7 +922,7 @@ void PF_cl_setkeydest (progfuncs_t *prinst, struct globalvars_s *pr_globals) } } //float getkeydest(void) = #602; -void PF_cl_getkeydest (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_getkeydest (progfuncs_t *prinst, struct globalvars_s *pr_globals) { switch(key_dest) { @@ -945,7 +945,7 @@ void PF_cl_getkeydest (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //void setmousetarget(float trg) = #603; -void PF_cl_setmousetarget (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_setmousetarget (progfuncs_t *prinst, struct globalvars_s *pr_globals) { extern int mouseusedforgui; switch ((int)G_FLOAT(OFS_PARM0)) @@ -962,14 +962,14 @@ void PF_cl_setmousetarget (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float getmousetarget(void) = #604; -void PF_cl_getmousetarget (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cl_getmousetarget (progfuncs_t *prinst, struct globalvars_s *pr_globals) { extern int mouseusedforgui; G_FLOAT(OFS_RETURN) = mouseusedforgui?1:2; } //vector getmousepos(void) = #66; -void PF_cl_getmousepos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN QCBUILTIN PF_cl_getmousepos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *ret = G_VECTOR(OFS_RETURN); extern int mousemove_x, mousemove_y; @@ -987,7 +987,7 @@ void PF_cl_getmousepos (progfuncs_t *prinst, struct globalvars_s *pr_globals) } -static void PF_Remove_ (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Remove_ (progfuncs_t *prinst, struct globalvars_s *pr_globals) { menuedict_t *ed; @@ -1002,7 +1002,7 @@ static void PF_Remove_ (progfuncs_t *prinst, struct globalvars_s *pr_globals) ED_Free (prinst, (void*)ed); } -static void PF_CopyEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_CopyEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { menuedict_t *in, *out; @@ -1026,7 +1026,7 @@ typedef enum{ SLIST_SORTDESCENDING } hostcacheglobal_t; -void PF_M_gethostcachevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_gethostcachevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) { hostcacheglobal_t hcg = G_FLOAT(OFS_PARM0); G_FLOAT(OFS_RETURN) = 0; @@ -1062,12 +1062,12 @@ void PF_M_gethostcachevalue (progfuncs_t *prinst, struct globalvars_s *pr_global } //void resethostcachemasks(void) = #615; -void PF_M_resethostcachemasks(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_resethostcachemasks(progfuncs_t *prinst, struct globalvars_s *pr_globals) { Master_ClearMasks(); } //void sethostcachemaskstring(float mask, float fld, string str, float op) = #616; -void PF_M_sethostcachemaskstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_sethostcachemaskstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int mask = G_FLOAT(OFS_PARM0); int field = G_FLOAT(OFS_PARM1); @@ -1077,7 +1077,7 @@ void PF_M_sethostcachemaskstring(progfuncs_t *prinst, struct globalvars_s *pr_gl Master_SetMaskString(mask, field, str, op); } //void sethostcachemasknumber(float mask, float fld, float num, float op) = #617; -void PF_M_sethostcachemasknumber(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_sethostcachemasknumber(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int mask = G_FLOAT(OFS_PARM0); int field = G_FLOAT(OFS_PARM1); @@ -1087,22 +1087,22 @@ void PF_M_sethostcachemasknumber(progfuncs_t *prinst, struct globalvars_s *pr_gl Master_SetMaskInteger(mask, field, str, op); } //void resorthostcache(void) = #618; -void PF_M_resorthostcache(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_resorthostcache(progfuncs_t *prinst, struct globalvars_s *pr_globals) { Master_SortServers(); } //void sethostcachesort(float fld, float descending) = #619; -void PF_M_sethostcachesort(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_sethostcachesort(progfuncs_t *prinst, struct globalvars_s *pr_globals) { Master_SetSortField(G_FLOAT(OFS_PARM0), G_FLOAT(OFS_PARM1)); } //void refreshhostcache(void) = #620; -void PF_M_refreshhostcache(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_refreshhostcache(progfuncs_t *prinst, struct globalvars_s *pr_globals) { MasterInfo_Begin(); } //float gethostcachenumber(float fld, float hostnr) = #621; -void PF_M_gethostcachenumber(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_gethostcachenumber(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float ret = 0; int keynum = G_FLOAT(OFS_PARM0); @@ -1114,7 +1114,7 @@ void PF_M_gethostcachenumber(progfuncs_t *prinst, struct globalvars_s *pr_global G_FLOAT(OFS_RETURN) = ret; } -void PF_M_gethostcachestring (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_gethostcachestring (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *ret; int keynum = G_FLOAT(OFS_PARM0); @@ -1128,25 +1128,25 @@ void PF_M_gethostcachestring (progfuncs_t *prinst, struct globalvars_s *pr_globa } //float gethostcacheindexforkey(string key) = #622; -void PF_M_gethostcacheindexforkey(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_gethostcacheindexforkey(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *keyname = PR_GetStringOfs(prinst, OFS_PARM0); G_FLOAT(OFS_RETURN) = Master_KeyForName(keyname); } //void addwantedhostcachekey(string key) = #623; -void PF_M_addwantedhostcachekey(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_addwantedhostcachekey(progfuncs_t *prinst, struct globalvars_s *pr_globals) { PF_M_gethostcacheindexforkey(prinst, pr_globals); } -void PF_M_getextresponse(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_M_getextresponse(progfuncs_t *prinst, struct globalvars_s *pr_globals) { //this does something weird G_INT(OFS_RETURN) = 0; } -void PF_netaddress_resolve(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_netaddress_resolve(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *address = PR_GetStringOfs(prinst, OFS_PARM0); netadr_t adr; @@ -1181,7 +1181,7 @@ void PF_M_addwantedhostcachekey(progfuncs_t *prinst, struct globalvars_s *pr_glo #endif -void PF_localsound (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_localsound (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *soundname = PR_GetStringOfs(prinst, OFS_PARM0); S_LocalSound (soundname); @@ -1193,24 +1193,24 @@ void PF_localsound (progfuncs_t *prinst, struct globalvars_s *pr_globals) #define skip50 skip10 skip10 skip10 skip10 skip10 #define skip100 skip50 skip50 -void PF_menu_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_menu_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) { //yeah, this is a stub... not sure what form extex G_FLOAT(OFS_RETURN) = 0; } -void PF_gettime (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_gettime (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = *prinst->parms->gametime; } -void PF_CL_precache_file (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_CL_precache_file (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_INT(OFS_RETURN) = G_INT(OFS_PARM0); } //entity findchainstring(.string _field, string match) = #26; -void PF_menu_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_menu_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; char *s; @@ -1243,7 +1243,7 @@ void PF_menu_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_EDICT(prinst, (void*)chain); } //entity findchainfloat(.float _field, float match) = #27; -void PF_menu_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_menu_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; float s; @@ -1272,18 +1272,18 @@ void PF_menu_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_global RETURN_EDICT(prinst, (void*)chain); } -void PF_etof(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_etof(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = G_EDICTNUM(prinst, OFS_PARM0); } -void PF_ftoe(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_ftoe(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int entnum = G_FLOAT(OFS_PARM0); RETURN_EDICT(prinst, EDICT_NUM(prinst, entnum)); } -void PF_IsNotNull(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_IsNotNull(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int str = G_INT(OFS_PARM0); G_FLOAT(OFS_RETURN) = !!str; @@ -1291,7 +1291,7 @@ void PF_IsNotNull(progfuncs_t *prinst, struct globalvars_s *pr_globals) //float altstr_count(string str) = #82; //returns number of single quoted strings in the string. -void PF_altstr_count(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_altstr_count(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; int count = 0; @@ -1309,7 +1309,7 @@ void PF_altstr_count(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = count/2; } //string altstr_prepare(string str) = #83; -void PF_altstr_prepare(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_altstr_prepare(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char outstr[8192], *out; char *instr, *in; @@ -1336,7 +1336,7 @@ void PF_altstr_prepare(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_INT( OFS_RETURN ) = (int)PR_TempString( prinst, outstr ); } //string altstr_get(string str, float num) = #84; -void PF_altstr_get(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_altstr_get(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *altstr, *pos, outstr[8192], *out; int count, size; @@ -1382,7 +1382,7 @@ void PF_altstr_get(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_INT( OFS_RETURN ) = (int)PR_SetString( prinst, outstr ); } //string altstr_set(string str, float num, string set) = #85 -void PF_altstr_set(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_altstr_set(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int num; char *altstr, *str; diff --git a/engine/client/r_2d.c b/engine/client/r_2d.c index 8294dbda8..eb0e46bd1 100644 --- a/engine/client/r_2d.c +++ b/engine/client/r_2d.c @@ -14,7 +14,7 @@ shader_t *shader_polyblend; static mesh_t draw_mesh; static vecV_t draw_mesh_xyz[4]; -static vec2_t draw_mesh_st[4]; +vec2_t draw_mesh_st[4]; static avec4_t draw_mesh_colors[4]; index_t r_quad_indexes[6] = {0, 1, 2, 2, 3, 0}; diff --git a/engine/client/r_surf.c b/engine/client/r_surf.c index e0ec0f9a3..63892a037 100644 --- a/engine/client/r_surf.c +++ b/engine/client/r_surf.c @@ -2522,6 +2522,7 @@ void Surf_BuildLightmaps (void) batch_t *batch, *bstop; vec3_t sn; int sortid; + int ptype; r_framecount = 1; // no dlightcache @@ -2581,6 +2582,10 @@ void Surf_BuildLightmaps (void) for (t = m->numtextures-1; t >= 0; t--) { + if (m == cl.worldmodel) + ptype = P_FindParticleType(va("tex_%s", m->textures[t]->name)); + else + ptype = P_INVALID; m->textures[t]->wtexno = t; sortid = m->textures[t]->shader->sort; @@ -2591,7 +2596,7 @@ void Surf_BuildLightmaps (void) surf = m->surfaces + i; if (surf->texinfo->texture == m->textures[t]) { - P_EmitSkyEffectTris(m, surf); + P_EmitSkyEffectTris(m, surf, ptype); Surf_CreateSurfaceLightmap (surf, shift); /*the excessive logic is to give portals separate batches for separate planes*/ diff --git a/engine/client/sys_win.c b/engine/client/sys_win.c index 0ddcce2cd..14d522dbd 100644 --- a/engine/client/sys_win.c +++ b/engine/client/sys_win.c @@ -1249,6 +1249,10 @@ void NPQTV_Sys_Shutdown(void) Host_Shutdown(); } +void Sys_RecentServer(char *command, char *target, char *title, char *desc) +{ +} + #else /* diff --git a/engine/common/fs.c b/engine/common/fs.c index f4a0196a7..211e4bd1d 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -724,11 +724,13 @@ static const char *FS_GetCleanPath(const char *pattern, char *outbuf, int outlen if (strstr(pattern, "//")) { //amiga uses // as equivelent to /../ + //so strip those out + //any other system ignores the extras Q_strncpyz(outbuf, pattern, outlen); pattern = outbuf; - Con_Printf("Warning: // characters in filename %s\n", pattern); + Con_DPrintf("Warning: // characters in filename %s\n", pattern); while ((s=strstr(pattern, "//"))) { s++; @@ -739,11 +741,15 @@ static const char *FS_GetCleanPath(const char *pattern, char *outbuf, int outlen } } } + if (*pattern == '/') + { + /*'fix up' and ignore, compat with q3*/ + Con_DPrintf("Error: absolute path in filename %s\n", pattern); + pattern++; + } if (strstr(pattern, "..")) Con_Printf("Error: '..' characters in filename %s\n", pattern); - else if (pattern[0] == '/') - Con_Printf("Error: absolute path in filename %s\n", pattern); else if (strstr(pattern, ":")) //win32 drive seperator (or mac path seperator, but / works there and they're used to it) (or amiga device separator) Con_Printf("Error: absolute path in filename %s\n", pattern); else diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 72f506cfd..4410e842a 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -2583,29 +2583,38 @@ qboolean CModQ3_LoadRFaces (lump_t *l) else { //flare - -// int r, g, b; + int r, g, b; extern index_t r_quad_indexes[6]; + static vec2_t st[4] = {0,0,0,1,1,1,1,0}; - mesh = out->mesh = (mesh_t *)Hunk_Alloc ( sizeof(mesh_t)); - mesh->xyz_array = (vecV_t *)Hunk_Alloc ( sizeof(vecV_t)); - mesh->numvertexes = 1; + mesh = out->mesh = (mesh_t *)Hunk_Alloc(sizeof(mesh_t)); + mesh->xyz_array = (vecV_t *)Hunk_Alloc(sizeof(vecV_t)*4); + mesh->colors4b_array = (byte_vec4_t *)Hunk_Alloc(sizeof(byte_vec4_t)*4); + mesh->numvertexes = 4; mesh->indexes = r_quad_indexes; + mesh->st_array = st; mesh->numindexes = 6; - VectorCopy ( in->lightmap_origin, mesh->xyz_array[0] ); + VectorCopy (in->lightmap_origin, mesh->xyz_array[0]); + VectorCopy (in->lightmap_origin, mesh->xyz_array[1]); + VectorCopy (in->lightmap_origin, mesh->xyz_array[2]); + VectorCopy (in->lightmap_origin, mesh->xyz_array[3]); -/* r = LittleFloat ( in->lightmapVecs[0][0] ) * 255.0f; - r = bound ( 0, r, 255 ); + r = LittleFloat(in->lightmap_vecs[0][0]) * 255.0f; + r = bound (0, r, 255); + g = LittleFloat(in->lightmap_vecs[0][1]) * 255.0f; + g = bound (0, g, 255); + b = LittleFloat(in->lightmap_vecs[0][2]) * 255.0f; + b = bound (0, b, 255); - g = LittleFloat ( in->lightmapVecs[0][1] ) * 255.0f; - g = bound ( 0, g, 255 ); - - b = LittleFloat ( in->lightmapVecs[0][2] ) * 255.0f; - b = bound ( 0, b, 255 ); - - out->dlightbits = (unsigned int)COLOR_RGB ( r, g, b ); -*/ } + mesh->colors4b_array[0][0] = r; + mesh->colors4b_array[0][1] = g; + mesh->colors4b_array[0][2] = b; + mesh->colors4b_array[0][3] = 255; + Vector4Copy(mesh->colors4b_array[0], mesh->colors4b_array[1]); + Vector4Copy(mesh->colors4b_array[0], mesh->colors4b_array[2]); + Vector4Copy(mesh->colors4b_array[0], mesh->colors4b_array[3]); + } } Mod_NormaliseTextureVectors(map_normals_array, map_svector_array, map_tvector_array, numvertexes); @@ -2732,11 +2741,13 @@ qboolean CModRBSP_LoadRFaces (lump_t *l) { // int r, g, b; extern index_t r_quad_indexes[6]; + static vec2_t st[4] = {0,0,0,1,1,1,1,0}; mesh = out->mesh = (mesh_t *)Hunk_Alloc ( sizeof(mesh_t)); mesh->xyz_array = (vecV_t *)Hunk_Alloc ( sizeof(vecV_t)); mesh->numvertexes = 1; mesh->indexes = r_quad_indexes; + mesh->st_array = st; mesh->numindexes = 6; // VectorCopy ( out->origin, mesh->xyz_array[0] ); diff --git a/engine/common/particles.h b/engine/common/particles.h index 6e01df125..f5ee37d2b 100644 --- a/engine/common/particles.h +++ b/engine/common/particles.h @@ -137,7 +137,7 @@ typedef struct { void (*RunParticleEffect4) (vec3_t org, float radius, int color, int effect, int count); void (*ParticleTrailIndex) (vec3_t start, vec3_t end, int color, int crnd, trailstate_t **tsk); - void (*EmitSkyEffectTris) (struct model_s *mod, struct msurface_s *fa); + void (*EmitSkyEffectTris) (struct model_s *mod, struct msurface_s *fa, int ptype); qboolean (*InitParticles) (void); void (*ShutdownParticles) (void); void (*DelinkTrailstate) (trailstate_t **tsk); diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index ae9f736cd..981e2a998 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -272,7 +272,7 @@ void PF_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) //EXTENSION: DP_QC_FINDFLAGS //entity(entity start, float fld, float match) findflags = #449 -void PF_FindFlags (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_FindFlags (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int e, f; int s; @@ -298,7 +298,7 @@ void PF_FindFlags (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //entity(entity start, float fld, float match) findfloat = #98 -void PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int e, f; int s; @@ -330,7 +330,7 @@ void PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) } // entity (entity start, .string field, string match) find = #5; -void PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int e; int f; @@ -370,7 +370,7 @@ void PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals) //Cvars //string(string cvarname) cvar_string -void PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PR_GetStringOfs(prinst, OFS_PARM0); cvar_t *cv = Cvar_Get(str, "", 0, "QC variables"); @@ -378,7 +378,7 @@ void PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //string(string cvarname) cvar_defstring -void PF_cvar_defstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cvar_defstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PR_GetStringOfs(prinst, OFS_PARM0); cvar_t *cv = Cvar_Get(str, "", 0, "QC variables"); @@ -386,7 +386,7 @@ void PF_cvar_defstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //string(string cvarname) cvar_description -void PF_cvar_description (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cvar_description (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PR_GetStringOfs(prinst, OFS_PARM0); cvar_t *cv = Cvar_Get(str, "", 0, "QC variables"); @@ -394,7 +394,7 @@ void PF_cvar_description (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(string name) cvar_type -void PF_cvar_type (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cvar_type (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PR_GetStringOfs(prinst, OFS_PARM0); int ret = 0; @@ -418,7 +418,7 @@ void PF_cvar_type (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //void(string cvarname, string newvalue) cvar -void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *var_name, *val; cvar_t *var; @@ -432,7 +432,7 @@ void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) Cvar_Set (var, val); } -void PF_cvar_setf (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_cvar_setf (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *var_name; float val; @@ -449,7 +449,7 @@ void PF_cvar_setf (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(string name, string value) registercvar -void PF_registercvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_registercvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *name, *value; value = PR_GetStringOfs(prinst, OFS_PARM0); @@ -492,7 +492,7 @@ typedef struct { } pf_fopen_files_t; pf_fopen_files_t pf_fopen_files[MAX_QC_FILES]; -void PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *name = PR_GetStringOfs(prinst, OFS_PARM0); int fmode = G_FLOAT(OFS_PARM1); @@ -606,7 +606,7 @@ void PF_fclose_i (int fnum) pf_fopen_files[fnum].prinst = NULL; } -void PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int fnum = G_FLOAT(OFS_PARM0)-FIRST_QC_FILE_INDEX; @@ -625,7 +625,7 @@ void PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_fclose_i(fnum); } -void PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char c, *s, *o, *max, *eof; int fnum = G_FLOAT(OFS_PARM0) - FIRST_QC_FILE_INDEX; @@ -678,7 +678,7 @@ void PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_TSTRING(pr_string_temp); } -void PF_fputs (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_fputs (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int fnum = G_FLOAT(OFS_PARM0) - FIRST_QC_FILE_INDEX; char *msg = PF_VarString(prinst, 1, pr_globals); @@ -739,7 +739,7 @@ void PF_fcloseall (progfuncs_t *prinst) //DP_QC_WHICHPACK -void PF_whichpack (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_whichpack (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *srcname = PR_GetStringOfs(prinst, OFS_PARM0); flocation_t loc; @@ -863,7 +863,7 @@ int search_enumerate(const char *name, int fsize, void *parm) } //float search_begin(string pattern, float caseinsensitive, float quiet) = #74; -void PF_search_begin (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_search_begin (progfuncs_t *prinst, struct globalvars_s *pr_globals) { //< 0 for error, > 0 for handle. char *pattern = PR_GetStringOfs(prinst, OFS_PARM0); // qboolean caseinsensative = G_FLOAT(OFS_PARM1); @@ -887,13 +887,13 @@ void PF_search_begin (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = s->handle; } //void search_end(float handle) = #75; -void PF_search_end (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_search_end (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int handle = G_FLOAT(OFS_PARM0); search_close(prinst, handle); } //float search_getsize(float handle) = #76; -void PF_search_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_search_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int handle = G_FLOAT(OFS_PARM0); prvmsearch_t *s; @@ -914,7 +914,7 @@ void PF_search_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) } } //string search_getfilename(float handle, float num) = #77; -void PF_search_getfilename (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_search_getfilename (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int handle = G_FLOAT(OFS_PARM0); int num = G_FLOAT(OFS_PARM1); @@ -952,21 +952,21 @@ void PR_fclose_progs (progfuncs_t *prinst) //////////////////////////////////////////////////// //Entities -void PF_WasFreed (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WasFreed (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; ent = (edict_t*)G_EDICT(prinst, OFS_PARM0); G_FLOAT(OFS_RETURN) = ent->isfree; } -void PF_num_for_edict (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_num_for_edict (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; ent = (edict_t*)G_EDICT(prinst, OFS_PARM0); G_FLOAT(OFS_RETURN) = ent->entnum; } -void PF_edict_for_num(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_edict_for_num(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; ent = (edict_t*)EDICT_NUM(prinst, G_FLOAT(OFS_PARM0)); @@ -975,7 +975,7 @@ void PF_edict_for_num(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //entity nextent(entity) -void PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; edict_t *ent; @@ -999,7 +999,7 @@ void PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //entity() spawn -void PF_Spawn (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_Spawn (progfuncs_t *prinst, struct globalvars_s *pr_globals) { struct edict_s *ed; ed = ED_Alloc(prinst); @@ -1011,20 +1011,20 @@ void PF_Spawn (progfuncs_t *prinst, struct globalvars_s *pr_globals) //String functions //PF_dprint -void PF_dprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_dprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_DPrintf ("%s",PF_VarString(prinst, 0, pr_globals)); } //PF_print -void PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_Printf ("%s",PF_VarString(prinst, 0, pr_globals)); } //FTE_STRINGS //C style strncasecmp (compare first n characters - case insensative) -void PF_strncasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strncasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *a = PR_GetStringOfs(prinst, OFS_PARM0); char *b = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1035,7 +1035,7 @@ void PF_strncasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) //FTE_STRINGS //C style strcasecmp (case insensative string compare) -void PF_strcasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strcasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *a = PR_GetStringOfs(prinst, OFS_PARM0); char *b = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1045,7 +1045,7 @@ void PF_strcasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) //FTE_STRINGS //C style strncmp (compare first n characters - case sensative. Note that there is no strcmp provided) -void PF_strncmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strncmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *a = PR_GetStringOfs(prinst, OFS_PARM0); char *b = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1055,7 +1055,7 @@ void PF_strncmp (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //uses qw style \key\value strings -void PF_infoget (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_infoget (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *info = PR_GetStringOfs(prinst, OFS_PARM0); char *key = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1066,7 +1066,7 @@ void PF_infoget (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //uses qw style \key\value strings -void PF_infoadd (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_infoadd (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *info = PR_GetStringOfs(prinst, OFS_PARM0); char *key = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1081,7 +1081,7 @@ void PF_infoadd (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //string(float pad, string str1, ...) strpad -void PF_strpad (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strpad (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char destbuf[4096]; char *dest = destbuf; @@ -1206,7 +1206,7 @@ static int chrchar_alpha(int i, int basec, int baset, int convc, int convt, int } //FTE_STRINGS //bulk convert a string. change case or colouring. -void PF_strconv (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strconv (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int ccase = G_FLOAT(OFS_PARM0); //0 same, 1 lower, 2 upper int redalpha = G_FLOAT(OFS_PARM1); //0 same, 1 white, 2 red, 5 alternate, 6 alternate-alternate @@ -1254,7 +1254,7 @@ void PF_strconv (progfuncs_t *prinst, struct globalvars_s *pr_globals) //FTE_STRINGS //returns a string containing one character per parameter (up to the qc max params of 8). -void PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; @@ -1267,7 +1267,7 @@ void PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals) //FTE_STRINGS //returns character at position X -void PF_str2chr (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_str2chr (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *instr = PR_GetStringOfs(prinst, OFS_PARM0); int ofs = (*prinst->callargc>1)?G_FLOAT(OFS_PARM1):0; @@ -1283,7 +1283,7 @@ void PF_str2chr (progfuncs_t *prinst, struct globalvars_s *pr_globals) //FTE_STRINGS //strstr, without generating a new string. Use in conjunction with FRIK_FILE's substring for more similar strstr. -void PF_strstrofs (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strstrofs (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *instr = PR_GetStringOfs(prinst, OFS_PARM0); char *match = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1304,7 +1304,7 @@ void PF_strstrofs (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(string input) stof -void PF_stof (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_stof (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; @@ -1314,7 +1314,7 @@ void PF_stof (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //tstring(float input) ftos -void PF_ftos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_ftos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float v; char pr_string_temp[64]; @@ -1330,7 +1330,7 @@ void PF_ftos (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //tstring(integer input) itos -void PF_itos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_itos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int v; char pr_string_temp[64]; @@ -1341,7 +1341,7 @@ void PF_itos (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //int(string input) stoi -void PF_stoi (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_stoi (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *input = PR_GetStringOfs(prinst, OFS_PARM0); @@ -1349,7 +1349,7 @@ void PF_stoi (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //tstring(integer input) htos -void PF_htos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_htos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int v; char pr_string_temp[64]; @@ -1360,7 +1360,7 @@ void PF_htos (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //int(string input) stoh -void PF_stoh (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_stoh (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *input = PR_GetStringOfs(prinst, OFS_PARM0); @@ -1369,7 +1369,7 @@ void PF_stoh (progfuncs_t *prinst, struct globalvars_s *pr_globals) //vector(string s) stov = #117 //returns vector value from a string -void PF_stov (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_stov (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; char *s; @@ -1397,7 +1397,7 @@ void PF_stov (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //tstring(vector input) vtos -void PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char pr_string_temp[64]; //sprintf (pr_string_temp, "'%5.1f %5.1f %5.1f'", G_VECTOR(OFS_PARM0)[0], G_VECTOR(OFS_PARM0)[1], G_VECTOR(OFS_PARM0)[2]); @@ -1405,7 +1405,7 @@ void PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_TSTRING(pr_string_temp); } -void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s=PR_RemoveProgsString(prinst, G_INT(OFS_PARM0)); if (!s) @@ -1429,7 +1429,7 @@ void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) } -void PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //frik_file +void QCBUILTIN PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //frik_file { char *s, *in; int len; @@ -1443,7 +1443,7 @@ void PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //frik_f } //returns a section of a string as a tempstring -void PF_substring (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_substring (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, start, length; char *s; @@ -1483,7 +1483,7 @@ void PF_substring (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //string(string str1, string str2) strcat -void PF_strcat (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strcat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char dest[4096]; char *src = PF_VarString(prinst, 0, pr_globals); @@ -1491,13 +1491,13 @@ void PF_strcat (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_TSTRING(dest); } -void PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = strlen(PR_GetStringOfs(prinst, OFS_PARM0)); } //float(string input, string token) instr -void PF_instr (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_instr (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *sub; char *s1; @@ -1520,7 +1520,7 @@ void PF_instr (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_SSTRING(sub); //last as long as the original string } -void PF_strreplace (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strreplace (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char resultbuf[4096]; char *result = resultbuf; @@ -1549,7 +1549,7 @@ void PF_strreplace (progfuncs_t *prinst, struct globalvars_s *pr_globals) else RETURN_TSTRING(subject); } -void PF_strireplace (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strireplace (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char resultbuf[4096]; char *result = resultbuf; @@ -1580,7 +1580,7 @@ void PF_strireplace (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //string(entity ent) etos = #65 -void PF_etos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_etos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char s[64]; snprintf (s, sizeof(s), "entity %i", G_EDICTNUM(prinst, OFS_PARM0)); @@ -1589,7 +1589,7 @@ void PF_etos (progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_QC_STRINGCOLORFUNCTIONS // #476 float(string s) strlennocol - returns how many characters are in a string, minus color codes -void PF_strlennocol (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strlennocol (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *in = PR_GetStringOfs(prinst, OFS_PARM0); G_FLOAT(OFS_RETURN) = COM_FunStringLength(in); @@ -1597,7 +1597,7 @@ void PF_strlennocol (progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_QC_STRINGCOLORFUNCTIONS // string (string s) strdecolorize - returns the passed in string with color codes stripped -void PF_strdecolorize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strdecolorize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *in = PR_GetStringOfs(prinst, OFS_PARM0); char result[8192]; @@ -1609,7 +1609,7 @@ void PF_strdecolorize (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //DP_QC_STRING_CASE_FUNCTIONS -void PF_strtolower (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strtolower (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *in = PR_GetStringOfs(prinst, OFS_PARM0); char result[8192]; @@ -1621,7 +1621,7 @@ void PF_strtolower (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //DP_QC_STRING_CASE_FUNCTIONS -void PF_strtoupper (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strtoupper (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *in = PR_GetStringOfs(prinst, OFS_PARM0); char result[8192]; @@ -1633,7 +1633,7 @@ void PF_strtoupper (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //DP_QC_STRFTIME -void PF_strftime (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_strftime (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *in = PF_VarString(prinst, 1, pr_globals); char result[8192]; @@ -1669,7 +1669,7 @@ struct strbuf { struct strbuf strbuflist[NUMSTRINGBUFS]; // #440 float() buf_create (DP_QC_STRINGBUFFERS) -void PF_buf_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; @@ -1689,7 +1689,7 @@ void PF_buf_create (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 0; } // #441 void(float bufhandle) buf_del (DP_QC_STRINGBUFFERS) -void PF_buf_del (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_del (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; int bufno = G_FLOAT(OFS_PARM0)-1; @@ -1710,7 +1710,7 @@ void PF_buf_del (progfuncs_t *prinst, struct globalvars_s *pr_globals) strbuflist[bufno].prinst = NULL; } // #442 float(float bufhandle) buf_getsize (DP_QC_STRINGBUFFERS) -void PF_buf_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; @@ -1722,7 +1722,7 @@ void PF_buf_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = strbuflist[bufno].used; } // #443 void(float bufhandle_from, float bufhandle_to) buf_copy (DP_QC_STRINGBUFFERS) -void PF_buf_copy (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_copy (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int buffrom = G_FLOAT(OFS_PARM0)-1; int bufto = G_FLOAT(OFS_PARM1)-1; @@ -1740,7 +1740,7 @@ void PF_buf_copy (progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_Printf("PF_buf_copy: stub\n"); } // #444 void(float bufhandle, float sortpower, float backward) buf_sort (DP_QC_STRINGBUFFERS) -void PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; //int sortpower = G_FLOAT(OFS_PARM1); @@ -1754,7 +1754,7 @@ void PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_Printf("PF_buf_sort: stub\n"); } // #445 string(float bufhandle, string glue) buf_implode (DP_QC_STRINGBUFFERS) -void PF_buf_implode (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_implode (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; //char *glue = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1769,7 +1769,7 @@ void PF_buf_implode (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_TSTRING(""); } // #446 string(float bufhandle, float string_index) bufstr_get (DP_QC_STRINGBUFFERS) -void PF_bufstr_get (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_bufstr_get (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; int index = G_FLOAT(OFS_PARM1); @@ -1794,7 +1794,7 @@ void PF_bufstr_get (progfuncs_t *prinst, struct globalvars_s *pr_globals) RETURN_TSTRING(strbuflist[bufno].strings[index]); } // #447 void(float bufhandle, float string_index, string str) bufstr_set (DP_QC_STRINGBUFFERS) -void PF_bufstr_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_bufstr_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; int index = G_FLOAT(OFS_PARM1); @@ -1820,7 +1820,7 @@ void PF_bufstr_set (progfuncs_t *prinst, struct globalvars_s *pr_globals) strbuflist[bufno].used = index+1; } // #448 float(float bufhandle, string str, float order) bufstr_add (DP_QC_STRINGBUFFERS) -void PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; //char *string = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1836,7 +1836,7 @@ void PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = 0; } // #449 void(float bufhandle, float string_index) bufstr_free (DP_QC_STRINGBUFFERS) -void PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; //int index = G_FLOAT(OFS_PARM1); @@ -1849,7 +1849,7 @@ void PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_Printf("PF_bufstr_free: stub\n"); } -void PF_buf_cvarlist (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_buf_cvarlist (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bufno = G_FLOAT(OFS_PARM0)-1; //char *pattern = PR_GetStringOfs(prinst, OFS_PARM1); @@ -1867,7 +1867,7 @@ void PF_buf_cvarlist (progfuncs_t *prinst, struct globalvars_s *pr_globals) //////////////////////////////////////////////////// //float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16) -void PF_crc16 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_crc16 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int insens = G_FLOAT(OFS_PARM0); char *str = PF_VarString(prinst, 1, pr_globals); @@ -1880,7 +1880,7 @@ void PF_crc16 (progfuncs_t *prinst, struct globalvars_s *pr_globals) } // #510 string(string in) uri_escape = #510; -void PF_uri_escape (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_uri_escape (progfuncs_t *prinst, struct globalvars_s *pr_globals) { static const char *hex = "0123456789ABCDEF"; @@ -1906,7 +1906,7 @@ void PF_uri_escape (progfuncs_t *prinst, struct globalvars_s *pr_globals) } // #511 string(string in) uri_unescape = #511; -void PF_uri_unescape (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_uri_unescape (progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned char *s = (unsigned char*)PR_GetStringOfs(prinst, OFS_PARM0); unsigned char resultbuf[8192]; @@ -1962,7 +1962,7 @@ static struct { } qctoken[MAXQCTOKENS]; unsigned int qctoken_count; -void PF_ArgC (progfuncs_t *prinst, struct globalvars_s *pr_globals) //85 //float() argc; +void QCBUILTIN PF_ArgC (progfuncs_t *prinst, struct globalvars_s *pr_globals) //85 //float() argc; { G_FLOAT(OFS_RETURN) = qctoken_count; } @@ -1999,17 +1999,17 @@ int tokenizeqc(char *str, qboolean dpfuckage) } /*KRIMZON_SV_PARSECLIENTCOMMAND added these two - note that for compatibility with DP, this tokenize builtin is veeery vauge and doesn't match the console*/ -void PF_Tokenize (progfuncs_t *prinst, struct globalvars_s *pr_globals) //84 //void(string str) tokanize; +void QCBUILTIN PF_Tokenize (progfuncs_t *prinst, struct globalvars_s *pr_globals) //84 //void(string str) tokanize; { G_FLOAT(OFS_RETURN) = tokenizeqc(PR_GetStringOfs(prinst, OFS_PARM0), true); } -void PF_tokenize_console (progfuncs_t *prinst, struct globalvars_s *pr_globals) //84 //void(string str) tokanize; +void QCBUILTIN PF_tokenize_console (progfuncs_t *prinst, struct globalvars_s *pr_globals) //84 //void(string str) tokanize; { G_FLOAT(OFS_RETURN) = tokenizeqc(PR_GetStringOfs(prinst, OFS_PARM0), false); } -void PF_tokenizebyseparator (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_tokenizebyseparator (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PR_GetStringOfs(prinst, OFS_PARM0); char *sep[7]; @@ -2078,7 +2078,7 @@ void PF_tokenizebyseparator (progfuncs_t *prinst, struct globalvars_s *pr_globa G_FLOAT(OFS_RETURN) = qctoken_count; } -void PF_argv_start_index (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_argv_start_index (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int idx = G_FLOAT(OFS_PARM0); @@ -2092,7 +2092,7 @@ void PF_argv_start_index (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = qctoken[idx].start; } -void PF_argv_end_index (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_argv_end_index (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int idx = G_FLOAT(OFS_PARM0); @@ -2106,7 +2106,7 @@ void PF_argv_end_index (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = qctoken[idx].end; } -void PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals) //86 //string(float num) argv; +void QCBUILTIN PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals) //86 //string(float num) argv; { int idx = G_FLOAT(OFS_PARM0); @@ -2124,7 +2124,7 @@ void PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals) //86 / //////////////////////////////////////////////////// //Maths functions -void PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float num; @@ -2134,7 +2134,7 @@ void PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(float number, float quantity) bitshift = #218; -void PF_bitshift(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_bitshift(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int bitmask; int shift; @@ -2151,7 +2151,7 @@ void PF_bitshift(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(float a, floats) min = #94 -void PF_min (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_min (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; float f; @@ -2175,7 +2175,7 @@ void PF_min (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(float a, floats) max = #95 -void PF_max (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_max (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; float f; @@ -2200,7 +2200,7 @@ void PF_max (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(float minimum, float val, float maximum) bound = #96 -void PF_bound (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_bound (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM1) > G_FLOAT(OFS_PARM2)) G_FLOAT(OFS_RETURN) = G_FLOAT(OFS_PARM2); @@ -2210,51 +2210,51 @@ void PF_bound (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = G_FLOAT(OFS_PARM1); } -void PF_Sin (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_Sin (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = sin(G_FLOAT(OFS_PARM0)); } -void PF_Cos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_Cos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = cos(G_FLOAT(OFS_PARM0)); } -void PF_Sqrt (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_Sqrt (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = sqrt(G_FLOAT(OFS_PARM0)); } -void PF_pow (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_pow (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = pow(G_FLOAT(OFS_PARM0), G_FLOAT(OFS_PARM1)); } -void PF_asin (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_asin (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = asin(G_FLOAT(OFS_PARM0)); } -void PF_acos (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_acos (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = acos(G_FLOAT(OFS_PARM0)); } -void PF_atan (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_atan (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = atan(G_FLOAT(OFS_PARM0)); } -void PF_atan2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_atan2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = atan2(G_FLOAT(OFS_PARM0), G_FLOAT(OFS_PARM1)); } -void PF_tan (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_tan (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = tan(G_FLOAT(OFS_PARM0)); } -void PF_fabs (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_fabs (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float v; v = G_FLOAT(OFS_PARM0); G_FLOAT(OFS_RETURN) = fabs(v); } -void PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float f; f = G_FLOAT(OFS_PARM0); @@ -2264,12 +2264,12 @@ void PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = (int)(f - 0.5); } -void PF_floor (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_floor (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = floor(G_FLOAT(OFS_PARM0)); } -void PF_ceil (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_ceil (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = ceil(G_FLOAT(OFS_PARM0)); } @@ -2279,7 +2279,7 @@ void PF_ceil (progfuncs_t *prinst, struct globalvars_s *pr_globals) //Vector functions //vector() randomvec = #91 -void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals) { vec3_t temp; do @@ -2292,7 +2292,7 @@ void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float vectoyaw(vector) -void PF_vectoyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_vectoyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *value1; float yaw; @@ -2312,7 +2312,7 @@ void PF_vectoyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(vector) vlen -void PF_vlen (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_vlen (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *value1; float newv; @@ -2326,7 +2326,7 @@ void PF_vlen (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //vector vectoangles(vector) -void PF_vectoangles (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_vectoangles (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *value1, *up; float yaw, pitch, roll; @@ -2390,7 +2390,7 @@ void PF_vectoangles (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //vector normalize(vector) -void PF_normalize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_normalize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *value1; vec3_t newvalue; @@ -2418,7 +2418,7 @@ void PF_normalize (progfuncs_t *prinst, struct globalvars_s *pr_globals) //////////////////////////////////////////////////// //Progs internals -void PF_Abort(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_Abort(progfuncs_t *prinst, struct globalvars_s *pr_globals) { prinst->AbortStack(prinst); } @@ -2426,7 +2426,7 @@ void PF_Abort(progfuncs_t *prinst, struct globalvars_s *pr_globals) //this func calls a function in annother progs //it works in the same way as the above func, except that it calls by reference to a function, as opposed to by it's name //used for entity function variables - not actually needed anymore -void PF_externrefcall (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_externrefcall (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int progsnum; func_t f; @@ -2437,7 +2437,7 @@ void PF_externrefcall (progfuncs_t *prinst, struct globalvars_s *pr_globals) PR_ExecuteProgram(prinst, f); } -void PF_externset (progfuncs_t *prinst, struct globalvars_s *pr_globals) //set a value in annother progs +void QCBUILTIN PF_externset (progfuncs_t *prinst, struct globalvars_s *pr_globals) //set a value in annother progs { int n = G_PROG(OFS_PARM0); int v = G_INT(OFS_PARM1); @@ -2450,7 +2450,7 @@ void PF_externset (progfuncs_t *prinst, struct globalvars_s *pr_globals) //set a var->_int = v; } -void PF_externvalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) //return a value in annother progs +void QCBUILTIN PF_externvalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) //return a value in annother progs { int n = G_PROG(OFS_PARM0); char *varname = PF_VarString(prinst, 1, pr_globals); @@ -2468,7 +2468,7 @@ void PF_externvalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) //ret G_INT(OFS_RETURN) = 0; } -void PF_externcall (progfuncs_t *prinst, struct globalvars_s *pr_globals) //this func calls a function in annother progs (by name) +void QCBUILTIN PF_externcall (progfuncs_t *prinst, struct globalvars_s *pr_globals) //this func calls a function in annother progs (by name) { int progsnum; char *funcname; @@ -2506,19 +2506,16 @@ void PF_externcall (progfuncs_t *prinst, struct globalvars_s *pr_globals) //this } } -/* -pr_csqc.obj : error LNK2001: unresolved external symbol _ PR_BIError -*/ -void PF_traceon (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_traceon (progfuncs_t *prinst, struct globalvars_s *pr_globals) { (*prinst->pr_trace) = true; } -void PF_traceoff (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_traceoff (progfuncs_t *prinst, struct globalvars_s *pr_globals) { (*prinst->pr_trace) = false; } -void PF_coredump (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_coredump (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int size = 1024*1024*8; char *buffer = BZ_Malloc(size); @@ -2526,7 +2523,7 @@ void PF_coredump (progfuncs_t *prinst, struct globalvars_s *pr_globals) COM_WriteFile("core.txt", buffer, size); BZ_Free(buffer); } -void PF_eprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_eprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int size = 1024*1024; char *buffer = BZ_Malloc(size); @@ -2536,7 +2533,7 @@ void PF_eprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) BZ_Free(buffer); } -void PF_break (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_break (progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef SERVERONLY //new break code char *s; @@ -2570,7 +2567,7 @@ Con_Printf ("break statement\n"); #endif } -void PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; @@ -2602,7 +2599,7 @@ void PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals) //System //Sends text over to the client's execution buffer -void PF_localcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_localcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; diff --git a/engine/common/pr_common.h b/engine/common/pr_common.h index 928e0e2e9..7174641ef 100644 --- a/engine/common/pr_common.h +++ b/engine/common/pr_common.h @@ -100,80 +100,76 @@ int MP_TranslateDPtoFTECodes(int code); //pr_cmds.c builtins that need to be moved to a common. void VARGS PR_BIError(progfuncs_t *progfuncs, char *format, ...) LIKEPRINTF(2); -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_tokenizebyseparator (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_tokenize_console (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_argv_start_index (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_argv_end_index (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_asin (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_acos (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_atan (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_atan2 (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_tan (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 QCBUILTIN PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_dprint (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_floor (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_ceil (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_Tokenize (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_tokenizebyseparator (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_tokenize_console (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_argv_start_index (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_argv_end_index (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_Sin (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_Cos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_Sqrt (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_bound (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strcat (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_ftos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_fabs (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_vtos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_etos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_stof (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_mod (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_substring (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_stov (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_dupstring(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_Spawn (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_min (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_max (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_registercvar (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_pow (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_asin (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_acos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_atan (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_atan2 (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_tan (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_localcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_fputs (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_normalize (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_vlen (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_vectoyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN 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 QCBUILTIN PF_coredump (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_traceon (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_traceoff (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN 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 PF_WasFreed (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_break (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_crc16 (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cvar_type (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_uri_escape (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_uri_unescape (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_itos (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_stoi (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_stoh (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_htos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_search_begin (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_search_end (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_search_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_search_getfilename (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WasFreed (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_break (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_crc16 (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cvar_type (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_uri_escape (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_uri_unescape (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_itos (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_stoi (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_stoh (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_htos (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); @@ -186,137 +182,89 @@ char *PF_VarString (progfuncs_t *prinst, int first, struct globalvars_s *pr_glob //pr_cmds.c builtins that need to be moved to a common. void VARGS PR_BIError(progfuncs_t *progfuncs, char *format, ...) LIKEPRINTF(2); -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_cvar_setf (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_ArgC (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 QCBUILTIN PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cvar_setf (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_ArgC (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_strreplace (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_strireplace (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 QCBUILTIN PF_strreplace (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strireplace (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals); + +void QCBUILTIN PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN 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 QCBUILTIN 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, struct globalvars_s *pr_globals); -void PF_externrefcall (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_externvalue (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_externset (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_instr (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_Abort(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_externcall (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_externrefcall (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_externvalue (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_externset (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_instr (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_strlennocol (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_strdecolorize (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_strtolower (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_strtoupper (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_strftime (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strlennocol (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strdecolorize (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strtolower (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strtoupper (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strftime (progfuncs_t *prinst, struct globalvars_s *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); +void QCBUILTIN PF_strstrofs (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_str2chr (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strconv (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_infoadd (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_infoget (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strncmp (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strcasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strncasecmp (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_strpad (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_edict_for_num (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_num_for_edict (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cvar_defstring (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cvar_description (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_edict_for_num (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_num_for_edict (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cvar_defstring (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cvar_description (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_drawrawstring (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_CL_drawcolouredstring (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_stringwidth (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_CL_drawsubpic (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_is_cached_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_free_pic (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawcharacter (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawrawstring (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawcolouredstring (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawpic (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawline (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawfill (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawsetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawresetcliparea (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawgetimagesize (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_stringwidth (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_CL_drawsubpic (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cl_findkeysforcommand (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 QCBUILTIN PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cl_findkeysforcommand (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_cl_stringtokeynum(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN 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); -void PF_buf_create (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_buf_del (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_buf_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_buf_copy (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_buf_implode (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_bufstr_get (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_bufstr_set (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_buf_cvarlist (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_create (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_del (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_getsize (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_copy (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_sort (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_implode (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_bufstr_get (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_bufstr_set (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_bufstr_add (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_bufstr_free (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_buf_cvarlist (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_whichpack (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_whichpack (progfuncs_t *prinst, struct globalvars_s *pr_globals); void PF_fclose_progs (progfuncs_t *prinst); char *PF_VarString (progfuncs_t *prinst, int first, struct globalvars_s *pr_globals); @@ -331,29 +279,25 @@ void PF_Common_RegisterCvars(void); #ifdef VM_Q1 model_t *SVPR_GetCModel(world_t *w, int modelindex); void SVPR_Event_Touch(world_t *w, wedict_t *s, wedict_t *o); -void PF_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_multicast (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_svtraceline (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_changelevel (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_cvar_setf (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_applylightstyle(int style, char *val, int col); +void QCBUILTIN PF_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_multicast (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_svtraceline (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_changelevel (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_applylightstyle(int style, char *val, int col); void PF_ambientsound_Internal (float *pos, char *samp, float vol, float attenuation); -void PF_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_logfrag (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_centerprint (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_ExecuteCommand (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_ForceInfoKey(progfuncs_t *prinst, struct globalvars_s *pr_globals); -void PF_precache_vwep_model(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_logfrag (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_ExecuteCommand (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_ForceInfoKey(progfuncs_t *prinst, struct globalvars_s *pr_globals); +void QCBUILTIN PF_precache_vwep_model(progfuncs_t *prinst, struct globalvars_s *pr_globals); int PF_checkclient_Internal (progfuncs_t *prinst); void PF_precache_sound_Internal (progfuncs_t *prinst, char *s); int PF_precache_model_Internal (progfuncs_t *prinst, char *s); diff --git a/engine/dotnet2005/ftequake.vcproj b/engine/dotnet2005/ftequake.vcproj index 705eecf4e..046621c62 100644 --- a/engine/dotnet2005/ftequake.vcproj +++ b/engine/dotnet2005/ftequake.vcproj @@ -1692,7 +1692,7 @@ StringPooling="true" ExceptionHandling="0" RuntimeLibrary="0" - EnableEnhancedInstructionSet="2" + EnableEnhancedInstructionSet="0" FloatingPointModel="2" UsePrecompiledHeader="2" PrecompiledHeaderThrough="quakedef.h" diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index a57ec4eaf..444b37dd4 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -2583,11 +2583,13 @@ void BE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_t shaderstate.sourcevbo = &shaderstate.dummyvbo; shaderstate.curshader = shader; if (shaderstate.curentity != &r_worldentity) + { BE_SelectEntity(&r_worldentity); + shaderstate.curtime = shaderstate.updatetime - shaderstate.curentity->shaderTime; + } shaderstate.curtexnums = texnums; shaderstate.curlightmap = r_nulltex; shaderstate.curdeluxmap = r_nulltex; - shaderstate.curtime = shaderstate.updatetime - shaderstate.curentity->shaderTime; while (nummeshes--) { @@ -2611,11 +2613,13 @@ void BE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_t shaderstate.sourcevbo = vbo; shaderstate.curshader = shader; if (shaderstate.curentity != &r_worldentity) + { BE_SelectEntity(&r_worldentity); + shaderstate.curtime = shaderstate.updatetime - shaderstate.curentity->shaderTime; + } shaderstate.curtexnums = texnums; shaderstate.curlightmap = r_nulltex; shaderstate.curdeluxmap = r_nulltex; - shaderstate.curtime = realtime; shaderstate.meshcount = nummeshes; shaderstate.meshes = meshlist; @@ -2687,9 +2691,11 @@ void BE_SubmitBatch(batch_t *batch) shaderstate.curshader = batch->shader; if (shaderstate.curentity != batch->ent) + { BE_SelectEntity(batch->ent); + shaderstate.curtime = r_refdef.time - shaderstate.curentity->shaderTime; + } shaderstate.flags = batch->flags; - shaderstate.curtime = realtime; if (batch->skin) shaderstate.curtexnums = batch->skin; else diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index 1bc00a301..28a42c35b 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -1042,7 +1042,6 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n")); { tx = Hunk_AllocName (sizeof(texture_t), loadname ); memcpy(tx, r_notexture_mip, sizeof(texture_t)); - tx->parttype = -1; sprintf(tx->name, "unnamed%i", i); loadmodel->textures[i] = tx; continue; @@ -1074,8 +1073,6 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n")); tx->width = mt->width; tx->height = mt->height; - tx->parttype = P_INVALID; - if (!mt->offsets[0]) //this is a hl external style texture, load it a little later (from a wad) { continue; diff --git a/engine/gl/gl_model.h b/engine/gl/gl_model.h index b8155eed2..59ea985bc 100644 --- a/engine/gl/gl_model.h +++ b/engine/gl/gl_model.h @@ -245,8 +245,6 @@ typedef struct texture_s qbyte pixbytes; qbyte alphaed; //gl_blend needed on this surface. - int parttype; - struct shader_s *shader; int wtexno; diff --git a/engine/gl/gl_rmisc.c b/engine/gl/gl_rmisc.c index 9f0e3d256..3637ad776 100644 --- a/engine/gl/gl_rmisc.c +++ b/engine/gl/gl_rmisc.c @@ -968,10 +968,10 @@ TRACE(("dbg: GLR_NewMap: clear particles\n")); P_ClearParticles (); TRACE(("dbg: GLR_NewMap: wiping them stains (getting the cloth out)\n")); Surf_WipeStains(); + CL_RegisterParticles(); TRACE(("dbg: GLR_NewMap: building lightmaps\n")); Surf_BuildLightmaps (); - CL_RegisterParticles(); TRACE(("dbg: GLR_NewMap: ui\n")); #ifdef VM_UI diff --git a/engine/gl/gl_warp.c b/engine/gl/gl_warp.c index 462450a45..31acea952 100644 --- a/engine/gl/gl_warp.c +++ b/engine/gl/gl_warp.c @@ -461,10 +461,11 @@ static void R_DrawSkyMesh(batch_t *batch, mesh_t *m, shader_t *shader) batch_t b; float time = cl.gametime+realtime-cl.gametimemark; - float skydist = gl_maxdist.value; + float skydist = gl_skyboxdist.value; if (skydist<1) - skydist=gl_skyboxdist.value; - skydist/=16; + skydist=gl_maxdist.value * 0.577; + if (skydist<1) + skydist = 10000000; VectorCopy(r_refdef.vieworg, skyent.origin); skyent.axis[0][0] = skydist; @@ -486,6 +487,7 @@ static void R_DrawSkyMesh(batch_t *batch, mesh_t *m, shader_t *shader) b.ent = &skyent; b.shader = shader; b.skin = &shader->defaulttextures; + b.texture = NULL; BE_SubmitBatch(&b); } diff --git a/engine/qclib/initlib.c b/engine/qclib/initlib.c index bc66c3e2a..1f42a611c 100644 --- a/engine/qclib/initlib.c +++ b/engine/qclib/initlib.c @@ -463,7 +463,7 @@ char *PR_RemoveProgsString (progfuncs_t *progfuncs, string_t str) return NULL; } -char *PR_StringToNative (progfuncs_t *progfuncs, string_t str) +char *ASMCALL PR_StringToNative (progfuncs_t *progfuncs, string_t str) { if ((unsigned int)str & 0xc0000000) { diff --git a/engine/qclib/pr_exec.c b/engine/qclib/pr_exec.c index 9e1ce8d02..b96c86007 100644 --- a/engine/qclib/pr_exec.c +++ b/engine/qclib/pr_exec.c @@ -255,7 +255,7 @@ Returns the new program statement counter ==================== */ void PR_AbortStack (progfuncs_t *progfuncs); -int PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum) +int ASMCALL PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum) { int i, j, c, o; @@ -312,7 +312,7 @@ int PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum) PR_LeaveFunction ==================== */ -int PR_LeaveFunction (progfuncs_t *progfuncs) +int ASMCALL PR_LeaveFunction (progfuncs_t *progfuncs) { int i, c; diff --git a/engine/qclib/pr_x86.c b/engine/qclib/pr_x86.c index 4ebfdda20..7876b9adc 100644 --- a/engine/qclib/pr_x86.c +++ b/engine/qclib/pr_x86.c @@ -14,9 +14,9 @@ optimisations: ebx - prinst->edicttable ecx - tmp edx - tmp - esi - + esi - edi - tmp (because its preserved by subfunctions - ebp - + ebp - to use gas to provide binary opcodes: vim -N blob.s && as blob.s && objdump.exe -d a.out @@ -81,6 +81,74 @@ void Emit4ByteJump(int statementnum, int offset) codesize += 4; } +enum +{ + REG_EAX, + REG_ECX, + REG_EDX, + REG_EBX, + REG_ESP, + REG_EBP, + REG_ESI, + REG_EDI +}; +#define XOR(sr,dr) EmitByte(0x31);EmitByte(0xc0 | (sr<<3) | dr); +#define CLEARREG(reg) XOR(reg,reg) +#define LOADREG(addr, reg) if (reg == REG_EAX) {EmitByte(0xa1);} else {EmitByte(0x8b); EmitByte((reg<<3) | 0x05);} EmitAdr(addr); +#define STOREREG(reg, addr) if (reg == REG_EAX) {EmitByte(0xa3);} else {EmitByte(0x89); EmitByte((reg<<3) | 0x05);} EmitAdr(addr); +#define STOREF(f, addr) EmitByte(0xc7);EmitByte(0x05); EmitAdr(addr);EmitFloat(f); +#define STOREI(f, addr) EmitByte(0xc7);EmitByte(0x05); EmitAdr(addr);EmitFloat(f); +#define SETREGI(val,reg) EmitByte(0xbe);EmitByte(val);EmitByte(val>>8);EmitByte(val>>16);EmitByte(val>>24); + +void *LocalLoc(void) +{ + return &code[codesize]; +} +void *LocalJmp(int cond) +{ + if (cond == OP_GOTO) + EmitByte(0xeb); //jmp + else if (cond == OP_LE) + EmitByte(0x7e); //jle + else if (cond == OP_GE) + EmitByte(0x7d); //jge + else if (cond == OP_LT) + EmitByte(0x7c); //jl + else if (cond == OP_GT) + EmitByte(0x7f); //jg + else if ((cond >= OP_NE_F && cond <= OP_NE_FNC) || cond == OP_NE_I) + EmitByte(0x75); //jne + else if ((cond >= OP_EQ_F && cond <= OP_EQ_FNC) || cond == OP_EQ_I) + EmitByte(0x74); //je +#if defined(DEBUG) && defined(_WIN32) + else + { + OutputDebugString("oh noes!\n"); + return NULL; + } +#endif + + EmitByte(0); + + return LocalLoc(); +} +void LocalJmpLoc(void *jmp, void *loc) +{ + int offs; + unsigned char *a = jmp; + offs = (char *)loc - (char *)jmp; +#if defined(DEBUG) && defined(_WIN32) + if (offs > 127 || offs <= -128) + { + OutputDebugStringA("bad jump\n"); + a[-2] = 0xcd; + a[-1] = 0xcc; + return; + } +#endif + a[-1] = offs; +} + void FixupJumps(void) { unsigned int j; @@ -108,11 +176,14 @@ void FixupJumps(void) } } -int PR_LeaveFunction (progfuncs_t *progfuncs); -int PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum); +int ASMCALL PR_LeaveFunction (progfuncs_t *progfuncs); +int ASMCALL PR_EnterFunction (progfuncs_t *progfuncs, dfunction_t *f, int progsnum); pbool PR_GenerateJit(progfuncs_t *progfuncs) { + void *j0, *l0; + void *j1, *l1; + void *j2, *l2; unsigned int i; dstatement16_t *op = (dstatement16_t*)current_progstate->statements; unsigned int numstatements = current_progstate->progs->numstatements; @@ -135,6 +206,8 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) for (i = 0; i < numstatements; i++) { statementoffsets[i] = &code[codesize]; + + SETREGI(op[i].op, REG_ESI); switch(op[i].op) { //jumps @@ -173,25 +246,19 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) { //assumption: anything that returns address 0 is a void or zero return. //thus clear eax and copy that to the return vector. - EmitByte(0x31);EmitByte(0xc0); - EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+0); - EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+1); - EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+2); + CLEARREG(REG_EAX); + STOREREG(REG_EAX, glob + OFS_RETURN+0); + STOREREG(REG_EAX, glob + OFS_RETURN+1); + STOREREG(REG_EAX, glob + OFS_RETURN+2); } else { - //movl glob[A+0],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a+0); - //movl glob[A+0],edx - EmitByte(0x8b);EmitByte(0x0d);EmitAdr(glob + op[i].a+1); - //movl glob[A+0],ecx - EmitByte(0x8b);EmitByte(0x15);EmitAdr(glob + op[i].a+2); - //movl eax, glob[OFS_RET+0] - EmitByte(0xa3);EmitAdr(glob + OFS_RETURN+0); - //movl edx, glob[OFS_RET+0] - EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + OFS_RETURN+1); - //movl ecx, glob[OFS_RET+0] - EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + OFS_RETURN+2); + LOADREG(glob + op[i].a+0, REG_EAX); + LOADREG(glob + op[i].a+1, REG_EDX); + LOADREG(glob + op[i].a+2, REG_ECX); + STOREREG(REG_EAX, glob + OFS_RETURN+0); + STOREREG(REG_EDX, glob + OFS_RETURN+1); + STOREREG(REG_ECX, glob + OFS_RETURN+2); } //call leavefunction to get the return address @@ -207,14 +274,17 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) // cmp prinst->exitdepth,%edx EmitByte(0x3b);EmitByte(0x15);EmitAdr(&prinst->exitdepth); // je returntoc - EmitByte(0x74);EmitByte(0x09); -// mov statementoffsets[%eax*4],%eax - EmitByte(0x8b);EmitByte(0x04);EmitByte(0x85);EmitAdr(statementoffsets+1); -// jmp eax - EmitByte(0xff);EmitByte(0xe0); + j1 = LocalJmp(OP_EQ_E); +// mov statementoffsets[%eax*4],%eax + EmitByte(0x8b);EmitByte(0x04);EmitByte(0x85);EmitAdr(statementoffsets+1); +// jmp *eax + EmitByte(0xff);EmitByte(0xe0); // returntoc: + l1 = LocalLoc(); // ret EmitByte(0xc3); + + LocalJmpLoc(j1,l1); break; //function calls @@ -235,7 +305,7 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) //figure out who we're calling, and what that involves //%eax = glob[A] - EmitByte(0xa1); EmitAdr(glob + op[i].a); + LOADREG(glob + op[i].a, REG_EAX); //eax is now the func num //mov %eax,%ecx @@ -247,7 +317,7 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) //cmp %ecx,pr_typecurrent EmitByte(0x39); EmitByte(0x0d); EmitAdr(&pr_typecurrent); //je sameprogs - EmitByte(0x74); EmitByte(0x3); + j1 = LocalJmp(OP_EQ_I); { //can't handle switching progs @@ -266,6 +336,8 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) EmitByte(0xc3); } //sameprogs: + l1 = LocalLoc(); + LocalJmpLoc(j1,l1); //andl $0x00ffffff, %eax EmitByte(0x25);Emit4Byte(0x00ffffff); @@ -286,8 +358,7 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) //cmp $0,%edx EmitByte(0x83);EmitByte(0xfa);EmitByte(0x00); //jl isabuiltin - EmitByte(0x7c);EmitByte(22); - + j1 = LocalJmp(OP_LE); { //push %ecx EmitByte(0x51); @@ -305,7 +376,8 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) EmitByte(0xff);EmitByte(0x24);EmitByte(0x85);EmitAdr(statementoffsets+1); } //isabuiltin: - + l1 = LocalLoc(); + LocalJmpLoc(j1,l1); //push current_progstate->globals EmitByte(0x68);EmitAdr(current_progstate->globals); @@ -321,23 +393,21 @@ pbool PR_GenerateJit(progfuncs_t *progfuncs) //but that builtin might have been Abort() - //mov prinst->continuestatement,%eax - EmitByte(0xa1);EmitAdr(&prinst->continuestatement); - //eax is now prinst->continuestatement - + LOADREG(&prinst->continuestatement, REG_EAX); //cmp $-1,%eax EmitByte(0x83);EmitByte(0xf8);EmitByte(0xff); //je donebuiltincall - EmitByte(0x74);EmitByte(10+8); + j1 = LocalJmp(OP_EQ_I); { -EmitByte(0xcc); - //jmp statementoffsets[%eax*4] - EmitByte(0xff);EmitByte(0x24);EmitByte(0x85);EmitAdr(statementoffsets+1); - //mov $-1,prinst->continuestatement - EmitByte(0xc7);EmitByte(0x05);EmitAdr(&prinst->continuestatement+1);Emit4Byte((unsigned int)-1); + EmitByte(0xc7);EmitByte(0x05);EmitAdr(&prinst->continuestatement);Emit4Byte((unsigned int)-1); + + //jmp statementoffsets[%eax*4] + EmitByte(0xff);EmitByte(0x24);EmitByte(0x85);EmitAdr(statementoffsets); } //donebuiltincall: + l1 = LocalLoc(); + LocalJmpLoc(j1,l1); break; case OP_MUL_F: @@ -382,16 +452,21 @@ EmitByte(0xcc); EmitByte(0xdf);EmitByte(0xe0); //testb 0x40,%ah EmitByte(0xf6);EmitByte(0xc4);EmitByte(0x40); - //je noteq - EmitByte(0x74);EmitByte(0x0c); - //movl 1.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05);EmitAdr(glob + op[i].c);EmitFloat(0.0f); - //jmp end - EmitByte(0xeb);EmitByte(0x0a); - //noteq: - //movl 0.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05);EmitAdr(glob + op[i].c);EmitFloat(1.0f); + + j1 = LocalJmp(OP_NE_F); + { + STOREF(1.0f, glob + op[i].c); + j2 = LocalJmp(OP_GOTO); + } + { + //noteq: + l1 = LocalLoc(); + STOREF(0.0f, glob + op[i].c); + } //end: + l2 = LocalLoc(); + LocalJmpLoc(j1,l1); + LocalJmpLoc(j2,l2); break; case OP_STORE_F: @@ -399,26 +474,17 @@ EmitByte(0xcc); case OP_STORE_ENT: case OP_STORE_FLD: case OP_STORE_FNC: - //movl glob[A],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); - //movl eax,glob[B] - EmitByte(0xa3);EmitAdr(glob + op[i].b); + LOADREG(glob + op[i].a, REG_EAX); + STOREREG(REG_EAX, glob + op[i].b); break; case OP_STORE_V: - //movl glob[A+0],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a+0); - //movl glob[A+1],edx - EmitByte(0x8b);EmitByte(0x0d);EmitAdr(glob + op[i].a+1); - //movl glob[A+2],ecx - EmitByte(0x8b);EmitByte(0x15);EmitAdr(glob + op[i].a+2); - - //movl eax, glob[B+0] - EmitByte(0xa3);EmitAdr(glob + op[i].b+0); - //movl edx, glob[B+1] - EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + op[i].b+1); - //movl ecx, glob[B+2] - EmitByte(0x89);EmitByte(0x15);EmitAdr(glob + op[i].b+2); + LOADREG(glob + op[i].a+0, REG_EAX); + LOADREG(glob + op[i].a+1, REG_EDX); + LOADREG(glob + op[i].a+2, REG_ECX); + STOREREG(REG_EAX, glob + op[i].b+0); + STOREREG(REG_EDX, glob + op[i].b+1); + STOREREG(REG_ECX, glob + op[i].b+2); break; case OP_LOAD_F: @@ -430,10 +496,9 @@ EmitByte(0xcc); //a is the ent number, b is the field //c is the dest - //movl glob[A+0],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); - //mov glob[B],ecx - EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b); + LOADREG(glob + op[i].a, REG_EAX); + LOADREG(glob + op[i].b, REG_ECX); + //FIXME: bound eax (ent number) //FIXME: bound ecx (field index) //mov (ebx,eax,4).%eax @@ -445,20 +510,18 @@ EmitByte(0xcc); //mov fieldajust(%edx,%ecx,4),%eax //offset = progfuncs->fieldadjust EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(progfuncs->fieldadjust*4); - //mov edx,glob[C] - EmitByte(0xa3);EmitAdr(glob + op[i].c); + + STOREREG(REG_EAX, glob + op[i].c) if (op[i].op == OP_LOAD_V) { //mov fieldajust+4(%edx,%ecx,4),%eax //offset = progfuncs->fieldadjust EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(4+progfuncs->fieldadjust*4); - //mov edx,glob[C+1] - EmitByte(0xa3);EmitAdr(glob + op[i].c+1); + STOREREG(REG_EAX, glob + op[i].c+1) //mov fieldajust+8(%edx,%ecx,4),%eax //offset = progfuncs->fieldadjust - EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(4+progfuncs->fieldadjust*4); - //mov edx,glob[C+1] - EmitByte(0xa3);EmitAdr(glob + op[i].c+2); + EmitByte(0x8b); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(8+progfuncs->fieldadjust*4); + STOREREG(REG_EAX, glob + op[i].c+2) } break; @@ -466,10 +529,9 @@ EmitByte(0xcc); //a is the ent number, b is the field //c is the dest - //movl glob[A+0],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); - //mov glob[B],ecx - EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b); + LOADREG(glob + op[i].a, REG_EAX); + LOADREG(glob + op[i].b, REG_ECX); + //FIXME: bound eax (ent number) //FIXME: bound ecx (field index) //mov (ebx,eax,4).%eax @@ -481,8 +543,7 @@ EmitByte(0xcc); //mov fieldajust(%edx,%ecx,4),%eax //offset = progfuncs->fieldadjust //EmitByte(0x8d); EmitByte(0x84); EmitByte(0x8a); EmitByte(progfuncs->fieldadjust*4); EmitByte(0x8d); EmitByte(0x84); EmitByte(0x8a); Emit4Byte(progfuncs->fieldadjust*4); - //mov edx,glob[C] - EmitByte(0xa3);EmitAdr(glob + op[i].c); + STOREREG(REG_EAX, glob + op[i].c); break; case OP_STOREP_F: @@ -490,77 +551,70 @@ EmitByte(0xcc); case OP_STOREP_ENT: case OP_STOREP_FLD: case OP_STOREP_FNC: - //movl glob[A],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); - //mov glob[B],ecx - EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b); + LOADREG(glob + op[i].a, REG_EAX); + LOADREG(glob + op[i].b, REG_ECX); //mov %eax,(%ecx) EmitByte(0x89);EmitByte(0x01); break; case OP_STOREP_V: - //mov glob[B],ecx - EmitByte(0x8b); EmitByte(0x0d);EmitAdr(glob + op[i].b); - //movl glob[A],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a+0); + LOADREG(glob + op[i].b, REG_ECX); + + LOADREG(glob + op[i].a+0, REG_EAX); //mov %eax,0(%ecx) EmitByte(0x89);EmitByte(0x01); - //movl glob[A],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a+0); + + LOADREG(glob + op[i].a+1, REG_EAX); //mov %eax,4(%ecx) EmitByte(0x89);EmitByte(0x41);EmitByte(0x04); - //movl glob[A],eax - EmitByte(0xa1);EmitAdr(glob + op[i].a+0); + + LOADREG(glob + op[i].a+2, REG_EAX); //mov %eax,8(%ecx) EmitByte(0x89);EmitByte(0x41);EmitByte(0x08); break; + case OP_NE_I: + case OP_NE_E: + case OP_NE_FNC: + case OP_EQ_I: case OP_EQ_E: case OP_EQ_FNC: //integer equality - //movl glob[A],%eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); + LOADREG(glob + op[i].a, REG_EAX); + //cmp glob[B],%eax - EmitByte(0x3b); EmitByte(0x0f); EmitAdr(glob + op[i].b); - //je 12 - EmitByte(0x74);EmitByte(0x0c); - //mov 0.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(0.0f); - //jmp 10 - EmitByte(0xeb);EmitByte(0x0a); - //mov 1.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(1.0f); - break; - - case OP_NE_E: - case OP_NE_FNC: - //integer equality - //movl glob[A],%eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); - //cmp glob[B],%eax - EmitByte(0x3b); EmitByte(0x0f); EmitAdr(glob + op[i].b); - //je 12 - EmitByte(0x74);EmitByte(0x0c); - //mov 0.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(1.0f); - //jmp 10 - EmitByte(0xeb);EmitByte(0x0a); - //mov 1.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(0.0f); + EmitByte(0x3b); EmitByte(0x04); EmitByte(0x25); EmitAdr(glob + op[i].b); + j1 = LocalJmp(op[i].op); + { + STOREF(1.0f, glob + op[i].c); + j2 = LocalJmp(OP_GOTO); + } + { + l1 = LocalLoc(); + STOREF(0.0f, glob + op[i].c); + } + l2 = LocalLoc(); + LocalJmpLoc(j1,l1); + LocalJmpLoc(j2,l2); break; + case OP_NOT_I: case OP_NOT_ENT: case OP_NOT_FNC: - //cmp glob[B],%eax - EmitByte(0x8c); EmitByte(0x3d); EmitAdr(glob + op[i].a);EmitByte(0x00); - //je 12 - EmitByte(0x74);EmitByte(0x0c); - //mov 0.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].a);EmitFloat(0.0f); - //jmp 10 - EmitByte(0xeb);EmitByte(0x0a); - //mov 1.0f,glob[C] - EmitByte(0xc7);EmitByte(0x05); EmitAdr(glob + op[i].c);EmitFloat(1.0f); + //cmp glob[B],$0 + EmitByte(0x83); EmitByte(0x3d); EmitAdr(glob + op[i].a); EmitByte(0x00); + j1 = LocalJmp(OP_NE_I); + { + STOREF(1.0f, glob + op[i].c); + j2 = LocalJmp(OP_GOTO); + } + { + l1 = LocalLoc(); + STOREF(0.0f, glob + op[i].c); + } + l2 = LocalLoc(); + LocalJmpLoc(j1,l1); + LocalJmpLoc(j2,l2); break; case OP_BITOR: //floats... @@ -572,10 +626,10 @@ EmitByte(0xcc); EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&tb); //fistp ta EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&ta); - //mov ta,%eax - EmitByte(0xa1); EmitAdr(&ta); - //and tb,%eax + LOADREG(&ta, REG_EAX) + //or tb,%eax EmitByte(0x09); EmitByte(0x05);EmitAdr(&tb); + STOREREG(REG_EAX, &tb) //fild tb EmitByte(0xdf); EmitByte(0x05);EmitAdr(&tb); //fstps glob[C] @@ -591,10 +645,12 @@ EmitByte(0xcc); EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&tb); //fistp ta EmitByte(0xdf); EmitByte(0x1d);EmitAdr(&ta); - //mov ta,%eax - EmitByte(0xa1); EmitAdr(&ta); + /*two args are now at ta and tb*/ + LOADREG(&ta, REG_EAX) //and tb,%eax EmitByte(0x21); EmitByte(0x05);EmitAdr(&tb); + STOREREG(REG_EAX, &tb) + /*we just wrote the int value to tb, convert that to a float and store it at c*/ //fild tb EmitByte(0xdf); EmitByte(0x05);EmitAdr(&tb); //fstps glob[C] @@ -674,18 +730,17 @@ EmitByte(0xcc); case OP_EQ_S: case OP_NE_S: + { + void *j0b, *j1b, *j1c; //put a in ecx + LOADREG(glob + op[i].a, REG_ECX); //put b in edi - //mov a,%ecx - EmitByte(0x8b); EmitByte(0x0d); EmitAdr(glob + op[i].a); - //mov b,%edi - EmitByte(0x8b); EmitByte(0x3d); EmitAdr(glob + op[i].b); - + LOADREG(glob + op[i].b, REG_EDI); +/* //early out if they're equal //cmp %ecx,%edi - EmitByte(0x39); EmitByte(0xd1); - //je _true - EmitByte(0x74); EmitByte(0x68); + EmitByte(0x39); EmitByte(0xc0 | (REG_EDI<<3) | REG_ECX); + j1c = LocalJmp(OP_EQ_S); //if a is 0, check if b is "" //jecxz ais0 @@ -707,31 +762,30 @@ EmitByte(0xcc); EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08); //cmpb $0,(%eax) EmitByte(0x80); EmitByte(0x38); EmitByte(0x00); - //je _true - EmitByte(0x74); EmitByte(0x4b); - //jmp _false - EmitByte(0xeb); EmitByte(0x3d); + j1b = LocalJmp(OP_EQ_S); + j0b = LocalJmp(OP_GOTO); + } - //ais0: - { - //push edi - EmitByte(0x57); - //push progfuncs - EmitByte(0x68); EmitAdr(progfuncs); - //call PR_StringToNative - EmitByte(0xe8); EmitFOffset(PR_StringToNative,4); - //add $8,%esp - EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08); - //cmpb $0,(%eax) - EmitByte(0x80); EmitByte(0x38); EmitByte(0x00); - //je _true - EmitByte(0x74); EmitByte(0x36); - //jmp _false - EmitByte(0xeb); EmitByte(0x28); - } + //ais0: + { + //push edi + EmitByte(0x57); + //push progfuncs + EmitByte(0x68); EmitAdr(progfuncs); + //call PR_StringToNative + EmitByte(0xe8); EmitFOffset(PR_StringToNative,4); + //add $8,%esp + EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08); + //cmpb $0,(%eax) + EmitByte(0x80); EmitByte(0x38); EmitByte(0x00); + //je _true + EmitByte(0x74); EmitByte(0x36); + //jmp _false + EmitByte(0xeb); EmitByte(0x28); } //bnot0: - +*/ +LOADREG(glob + op[i].a, REG_ECX); //push ecx EmitByte(0x51); //push progfuncs @@ -741,6 +795,7 @@ EmitByte(0xcc); //push %eax EmitByte(0x50); +LOADREG(glob + op[i].b, REG_EDI); //push %edi EmitByte(0x57); //push progfuncs @@ -757,28 +812,35 @@ EmitByte(0xcc); EmitByte(0xe8); EmitFOffset(strcmp,4); //add $16,%esp EmitByte(0x83); EmitByte(0xc4); EmitByte(0x10); + //cmp $0,%eax EmitByte(0x83); EmitByte(0xf8); EmitByte(0x00); - //je _true - EmitByte(0x74); EmitByte(0x0c); -//_false: - //mov 0.0f,c - EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat((op[i].op == OP_NE_S)?1.0f:0.0f); - //jmp done - EmitByte(0xeb); EmitByte(0x0a); -//_true: - //mov 1.0f,c - EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat((op[i].op == OP_NE_S)?0.0f:1.0f); -//_done: + j1 = LocalJmp(OP_EQ_S); + { + l0 = LocalLoc(); + STOREF((op[i].op == OP_NE_S)?1.0f:0.0f, glob + op[i].c); + j2 = LocalJmp(OP_GOTO); + } + { + l1 = LocalLoc(); + STOREF((op[i].op == OP_NE_S)?0.0f:1.0f, glob + op[i].c); + } + l2 = LocalLoc(); + +// LocalJmpLoc(j0b, l0); + LocalJmpLoc(j1, l1); +// LocalJmpLoc(j1b, l1); + LocalJmpLoc(j2, l2); + } break; case OP_NOT_S: - //mov A,%eax - EmitByte(0xa1);EmitAdr(glob + op[i].a); + LOADREG(glob + op[i].a, REG_EAX) + //cmp $0,%eax EmitByte(0x83); EmitByte(0xf8); EmitByte(0x00); - //je _true - EmitByte(0x74); EmitByte(0x1f); + j2 = LocalJmp(OP_EQ_S); + //push %eax EmitByte(0x50); //push progfuncs @@ -787,19 +849,22 @@ EmitByte(0xcc); EmitByte(0xe8); EmitFOffset(PR_StringToNative,4); //add $8,%esp EmitByte(0x83); EmitByte(0xc4); EmitByte(0x08); + //cmpb $0,(%eax) EmitByte(0x80); EmitByte(0x38); EmitByte(0x00); - //je _true - EmitByte(0x74); EmitByte(0x0c); -//_false: - //mov 0.0f,c - EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f); - //jmp done - EmitByte(0xeb); EmitByte(0x0a); -//_true: - //mov 1.0f,c - EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f); -//_done: + j1 = LocalJmp(OP_EQ_S); + { + STOREF(0.0f, glob + op[i].c); + j0 = LocalJmp(OP_GOTO); + } + { + l1 = LocalLoc(); + STOREF(1.0f, glob + op[i].c); + } + l2 = LocalLoc(); + LocalJmpLoc(j2, l1); + LocalJmpLoc(j1, l1); + LocalJmpLoc(j0, l2); break; case OP_ADD_V: @@ -888,29 +953,18 @@ EmitByte(0xcc); //fstp %st(0) (aka: pop) EmitByte(0xdd);EmitByte(0xd8); - //jcc _true - if (op[i].op == OP_LE) - EmitByte(0x7e); //jle - else if (op[i].op == OP_GE) - EmitByte(0x7d); //jge - else if (op[i].op == OP_LT) - EmitByte(0x7c); //jl - else if (op[i].op == OP_GT) - EmitByte(0x7f); //jg - else if (op[i].op == OP_NE_F) - EmitByte(0x75); //jne - else - EmitByte(0x74); //je - EmitByte(0x0c); -//_false: - //mov 0.0f,c - EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(0.0f); - //jmp done - EmitByte(0xeb); EmitByte(0x0a); -//_true: - //mov 1.0f,c - EmitByte(0xc7); EmitByte(0x05); EmitAdr(glob + op[i].c); EmitFloat(1.0f); -//_done: + j1 = LocalJmp(op[i].op); + { + STOREF(0.0f, glob + op[i].c); + j2 = LocalJmp(OP_GOTO); + } + { + l1 = LocalLoc(); + STOREF(1.0f, glob + op[i].c); + } + l2 = LocalLoc(); + LocalJmpLoc(j1,l1); + LocalJmpLoc(j2,l2); break; case OP_MUL_FV: @@ -972,8 +1026,8 @@ EmitByte(0xcc); //add $12,%esp EmitByte(0x83); EmitByte(0xc4); EmitByte(0x0c); break; -#if 0 - case OP_NOT_V: +#if 1 +/* case OP_NOT_V: //flds 0 //flds glob[A+0] //fcomip %st(1),%st @@ -990,7 +1044,8 @@ EmitByte(0xcc); //mov 0,C //done: break; - +*/ + case OP_NE_V: case OP_EQ_V: //flds glob[A] EmitByte(0xd9);EmitByte(0x05);EmitAdr(glob + op[i].a+0); @@ -1020,17 +1075,6 @@ EmitByte(0xcc); //_done: break; - - case OP_EQ_V: - EmitByte(0xcd);EmitByte(op[i].op); - printf("QCJIT: instruction %i is not implemented\n", op[i].op); - break; - - case OP_NE_V: - EmitByte(0xcd);EmitByte(op[i].op); - printf("QCJIT: instruction %i is not implemented\n", op[i].op); - break; - case OP_NOT_V: EmitByte(0xcd);EmitByte(op[i].op); printf("QCJIT: instruction %i is not implemented\n", op[i].op); diff --git a/engine/qclib/progsint.h b/engine/qclib/progsint.h index a69de4ecc..27fecf196 100644 --- a/engine/qclib/progsint.h +++ b/engine/qclib/progsint.h @@ -29,10 +29,6 @@ typedef unsigned char qbyte; #include -#if defined(_M_IX86) || defined(__i386__) -//#define QCJIT -#endif - #define DLL_PROG #ifndef PROGSUSED #define PROGSUSED @@ -464,7 +460,7 @@ ddef32_t *ED_FindGlobal32 (progfuncs_t *progfuncs, char *name); ddef32_t *ED_GlobalAtOfs32 (progfuncs_t *progfuncs, unsigned int ofs); string_t PR_StringToProgs (progfuncs_t *inst, char *str); -char *PR_StringToNative (progfuncs_t *inst, string_t str); +char *ASMCALL PR_StringToNative (progfuncs_t *inst, string_t str); void PR_FreeTemps (progfuncs_t *progfuncs, int depth); diff --git a/engine/qclib/progslib.h b/engine/qclib/progslib.h index 5c474afb0..95e286c83 100644 --- a/engine/qclib/progslib.h +++ b/engine/qclib/progslib.h @@ -14,13 +14,24 @@ #define VARGS #endif +#if defined(_M_IX86) || defined(__i386__) +//#define QCJIT +#endif + +#ifdef QCJIT +#define ASMCALL VARGS +#else +#define ASMCALL +#endif +#define QCBUILTIN ASMCALL + struct edict_s; struct entvars_s; struct globalvars_s; struct qcthread_s; typedef struct progfuncs_s progfuncs_t; -typedef void (*builtin_t) (progfuncs_t *prinst, struct globalvars_s *gvars); +typedef void (ASMCALL *builtin_t) (progfuncs_t *prinst, struct globalvars_s *gvars); //used by progs engine. All nulls is reset. typedef struct { @@ -120,7 +131,7 @@ struct progfuncs_s { string_t (*TempString) (progfuncs_t *prinst, char *str); string_t (*StringToProgs) (progfuncs_t *prinst, char *str); - char *(*StringToNative) (progfuncs_t *prinst, string_t str); + char *(ASMCALL *StringToNative) (progfuncs_t *prinst, string_t str); int stringtablesize; int (*QueryField) (progfuncs_t *prinst, unsigned int fieldoffset, etype_t *type, char **name, evalc_t *fieldcache); //find info on a field definition at an offset @@ -141,10 +152,10 @@ typedef struct progexterns_s { void (*entspawn) (struct edict_s *ent, int loading); //ent has been spawned, but may not have all the extra variables (that may need to be set) set pbool (*entcanfree) (struct edict_s *ent); //return true to stop ent from being freed - void (*stateop) (progfuncs_t *prinst, float var, func_t func); //what to do on qc's state opcode. - void (*cstateop) (progfuncs_t *prinst, float vara, float varb, func_t currentfunc); //a hexen2 opcode. - void (*cwstateop) (progfuncs_t *prinst, float vara, float varb, func_t currentfunc); //a hexen2 opcode. - void (*thinktimeop) (progfuncs_t *prinst, struct edict_s *ent, float varb); //a hexen2 opcode. + void (ASMCALL *stateop) (progfuncs_t *prinst, float var, func_t func); //what to do on qc's state opcode. + void (ASMCALL *cstateop) (progfuncs_t *prinst, float vara, float varb, func_t currentfunc); //a hexen2 opcode. + void (ASMCALL *cwstateop) (progfuncs_t *prinst, float vara, float varb, func_t currentfunc); //a hexen2 opcode. + void (ASMCALL *thinktimeop) (progfuncs_t *prinst, struct edict_s *ent, float varb); //a hexen2 opcode. //used when loading a game diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 64e3b8f15..8aadbb02d 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -95,7 +95,7 @@ evalc_t evalc_idealpitch, evalc_pitch_speed; int pr_teamfield; unsigned int h2infoplaque[2]; /*hexen2 stat*/ -void PR_ClearThreads(void); +static void PRSV_ClearThreads(void); void PR_fclose_progs(progfuncs_t*); void PF_InitTempStrings(progfuncs_t *prinst); @@ -245,7 +245,7 @@ pbool ED_CanFree (edict_t *ed) return true; } -void StateOp (progfuncs_t *prinst, float var, func_t func) +void ASMCALL StateOp (progfuncs_t *prinst, float var, func_t func) { stdentvars_t *vars = PROG_TO_EDICT(prinst, pr_global_struct->self)->v; if (progstype == PROG_H2) @@ -255,7 +255,7 @@ void StateOp (progfuncs_t *prinst, float var, func_t func) vars->think = func; vars->frame = var; } -void CStateOp (progfuncs_t *prinst, float startFrame, float endFrame, func_t currentfunc) +void ASMCALL CStateOp (progfuncs_t *prinst, float startFrame, float endFrame, func_t currentfunc) { stdentvars_t *vars = PROG_TO_EDICT(prinst, pr_global_struct->self)->v; @@ -291,7 +291,7 @@ void CStateOp (progfuncs_t *prinst, float startFrame, float endFrame, func_t cur vars->frame = startFrame; } } -void CWStateOp (progfuncs_t *prinst, float startFrame, float endFrame, func_t currentfunc) +void ASMCALL CWStateOp (progfuncs_t *prinst, float startFrame, float endFrame, func_t currentfunc) { stdentvars_t *vars = PROG_TO_EDICT(prinst, pr_global_struct->self)->v; @@ -328,7 +328,7 @@ void CWStateOp (progfuncs_t *prinst, float startFrame, float endFrame, func_t cu } } -void ThinkTimeOp (progfuncs_t *prinst, edict_t *ed, float var) +void ASMCALL ThinkTimeOp (progfuncs_t *prinst, edict_t *ed, float var) { stdentvars_t *vars = ed->v; vars->nextthink = pr_global_struct->time+var; @@ -487,7 +487,7 @@ void Q_SetProgsParms(qboolean forcompiler) } sv.world.Event_Touch = SVPR_Event_Touch; sv.world.GetCModel = SVPR_GetCModel; - PR_ClearThreads(); + PRSV_ClearThreads(); PR_fclose_progs(svprogfuncs); // svs.numprogs = 0; @@ -504,7 +504,7 @@ void PR_Deinit(void) SQL_DeInit(); #endif - PR_ClearThreads(); + PRSV_ClearThreads(); if (svprogfuncs) { PR_fclose_progs(svprogfuncs); @@ -1890,7 +1890,7 @@ void PR_MoveParms(int progs1, int progs2); //from 2 to 1 float PR_LoadAditionalProgs(char *s); -void PF_addprogs(progfuncs_t *prinst, globalvars_t *pr_globals) +static void QCBUILTIN PF_addprogs(progfuncs_t *prinst, globalvars_t *pr_globals) { char *s = PR_GetStringOfs(prinst, OFS_PARM0); if (!s || !*s) @@ -1931,7 +1931,7 @@ removed, but the level can continue. objerror(value) ================= */ -static void PF_objerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_objerror (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; edict_t *ed; @@ -1979,7 +1979,7 @@ Writes new values for v_forward, v_up, and v_right based on angles makevectors(vector) ============== */ -static void PF_makevectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_makevectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) { AngleVectors (G_VECTOR(OFS_PARM0), P_VEC(v_forward), P_VEC(v_right), P_VEC(v_up)); } @@ -1993,7 +1993,7 @@ This is the only valid way to move an object without using the physics of the wo setorigin (entity, origin) ================= */ -void PF_setorigin (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_setorigin (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e; float *org; @@ -2014,7 +2014,7 @@ the size box is rotated by the current angle setsize (entity, minvector, maxvector) ================= */ -void PF_setsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_setsize (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e; float *min, *max; @@ -2182,7 +2182,7 @@ void PF_setmodel_Internal (progfuncs_t *prinst, edict_t *e, char *m) } } -void PF_setmodel (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_setmodel (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e; char *m; @@ -2193,7 +2193,7 @@ void PF_setmodel (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_setmodel_Internal(prinst, e, m); } -void PF_h2set_puzzle_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2set_puzzle_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) { //qc/hc lacks string manipulation. edict_t *e; char *shortname; @@ -2205,7 +2205,7 @@ void PF_h2set_puzzle_model (progfuncs_t *prinst, struct globalvars_s *pr_globals PF_setmodel_Internal(prinst, e, fullname); } -static void PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int modelindex = G_FLOAT(OFS_PARM0); char *str = PF_VarString(prinst, 1, pr_globals); @@ -2216,7 +2216,7 @@ static void PF_frameforname (progfuncs_t *prinst, struct globalvars_s *pr_global else G_FLOAT(OFS_RETURN) = -1; } -static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int modelindex = G_FLOAT(OFS_PARM0); unsigned int framenum = G_FLOAT(OFS_PARM1); @@ -2236,7 +2236,7 @@ static void PF_frameduration (progfuncs_t *prinst, struct globalvars_s *pr_globa G_FLOAT(OFS_RETURN) = 0; } } -static void PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_skinforname (progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifndef SERVERONLY unsigned int modelindex = G_FLOAT(OFS_PARM0); @@ -2260,7 +2260,7 @@ broadcast print to everyone on server bprint(value) ================= */ -void PF_bprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_bprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; int level; @@ -2294,7 +2294,7 @@ single print to a specific client sprint(clientent, value) ================= */ -void PF_sprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; client_t *client; @@ -2334,7 +2334,7 @@ void PF_sprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) //When a client is backbuffered, it's generally not a brilliant plan to send a bazillion stuffcmds. You have been warned. //This handy function will let the mod know when it shouldn't send more. (use instead of a timer, and you'll never get clients overflowing. yay.) -void PF_isbackbuffered (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_isbackbuffered (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int entnum; client_t *client; @@ -2396,7 +2396,7 @@ void PF_centerprint_Internal (int entnum, qboolean plaque, char *s) } } -void PF_centerprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_centerprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; int entnum; @@ -2413,7 +2413,7 @@ PF_vhlen scalar vhlen(vector) ================= */ -void PF_vhlen (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_vhlen (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *value1; float newv; @@ -2426,7 +2426,7 @@ void PF_vhlen (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = newv; } -void PF_anglemod (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_anglemod (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float v = G_FLOAT(OFS_PARM0); @@ -2445,7 +2445,7 @@ PF_particle particle(origin, color, count) ================= */ -static void PF_particle (progfuncs_t *prinst, globalvars_t *pr_globals) //I said it was for compatability only. +static void QCBUILTIN PF_particle (progfuncs_t *prinst, globalvars_t *pr_globals) //I said it was for compatability only. { float *org, *dir; float color; @@ -2526,7 +2526,7 @@ static void PF_particle (progfuncs_t *prinst, globalvars_t *pr_globals) //I said SV_MulticastProtExt(org, MULTICAST_PVS, pr_global_struct->dimension_send, PEXT_HEXEN2, 0); } -void PF_te_blooddp (progfuncs_t *prinst, globalvars_t *pr_globals) +static void QCBUILTIN PF_te_blooddp (progfuncs_t *prinst, globalvars_t *pr_globals) { float count; float *org, *dir; @@ -2571,7 +2571,7 @@ PF_particle2 - hexen2 particle(origin, dmin, dmax, color, effect, count) ================= */ -static void PF_particle2 (progfuncs_t *prinst, globalvars_t *pr_globals) +static void QCBUILTIN PF_particle2 (progfuncs_t *prinst, globalvars_t *pr_globals) { float *org, *dmin, *dmax; float color; @@ -2611,7 +2611,7 @@ PF_particle3 - hexen2 particle(origin, box, color, effect, count) ================= */ -static void PF_particle3 (progfuncs_t *prinst, globalvars_t *pr_globals) +static void QCBUILTIN PF_particle3 (progfuncs_t *prinst, globalvars_t *pr_globals) { float *org, *box; float color; @@ -2646,7 +2646,7 @@ PF_particle4 - hexen2 particle(origin, radius, color, effect, count) ================= */ -static void PF_particle4 (progfuncs_t *prinst, globalvars_t *pr_globals) +static void QCBUILTIN PF_particle4 (progfuncs_t *prinst, globalvars_t *pr_globals) { float *org; float radius; @@ -2673,7 +2673,7 @@ static void PF_particle4 (progfuncs_t *prinst, globalvars_t *pr_globals) SV_MulticastProtExt (org, MULTICAST_PVS, pr_global_struct->dimension_send, PEXT_HEXEN2, 0); } -void PF_h2particleexplosion(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2particleexplosion(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org; int color,radius,counter; @@ -2729,7 +2729,7 @@ void PF_ambientsound_Internal (float *pos, char *samp, float vol, float attenuat } -void PF_ambientsound (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ambientsound (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *samp; float *pos; @@ -2759,7 +2759,7 @@ pitchadj is a number between -128 and 127. values greater than 0 will result in ================= */ -static void PF_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *sample; int channel; @@ -2788,7 +2788,7 @@ static void PF_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //an evil one from telejano. -static void PF_LocalSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_LocalSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifndef SERVERONLY sfx_t *sfx; @@ -2841,7 +2841,7 @@ if the tryents flag is set. traceline (vector1, vector2, tryents) ================= */ -void PF_svtraceline (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_svtraceline (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v1, *v2, *mins, *maxs; trace_t trace; @@ -2876,7 +2876,7 @@ void PF_svtraceline (progfuncs_t *prinst, struct globalvars_s *pr_globals) set_trace_globals(&trace, pr_globals); } -static void PF_traceboxh2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_traceboxh2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v1, *v2, *mins, *maxs; trace_t trace; @@ -2899,7 +2899,7 @@ static void PF_traceboxh2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) set_trace_globals(&trace, pr_globals); } -static void PF_traceboxdp (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_traceboxdp (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v1, *v2, *mins, *maxs; trace_t trace; @@ -2923,7 +2923,7 @@ static void PF_traceboxdp (progfuncs_t *prinst, struct globalvars_s *pr_globals) } extern trace_t SV_Trace_Toss (edict_t *ent, edict_t *ignore); -static void PF_TraceToss (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_TraceToss (progfuncs_t *prinst, struct globalvars_s *pr_globals) { trace_t trace; edict_t *ent; @@ -2939,20 +2939,6 @@ static void PF_TraceToss (progfuncs_t *prinst, struct globalvars_s *pr_globals) set_trace_globals(&trace, pr_globals); } -/* -================= -PF_checkpos - -Returns true if the given entity can move to the given position from it's -current position by walking or rolling. -FIXME: make work... -scalar checkpos (entity, vector) -================= -*/ -void PF_checkpos (progfuncs_t *prinst, struct globalvars_s *pr_globals) -{ -} - //============================================================================ qbyte checkpvsbuffer[MAX_MAP_LEAFS/8]; @@ -3060,7 +3046,7 @@ c_invis++; return w->lastcheck; } -static void PF_checkclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_checkclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) { RETURN_EDICT(prinst, EDICT_NUM(prinst, PF_checkclient_Internal(prinst))); } @@ -3077,7 +3063,7 @@ Sends text over to the client's execution buffer stuffcmd (clientent, value) ================= */ -void PF_stuffcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_stuffcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int entnum; char *str; @@ -3170,7 +3156,7 @@ void PF_stuffcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //DP_QC_DROPCLIENT -static void PF_dropclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_dropclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int entnum; client_t *cl; @@ -3192,7 +3178,7 @@ static void PF_dropclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_SV_BOTCLIENT //entity() spawnclient = #454; -static void PF_spawnclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_spawnclient (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; for (i = 0; i < sv.allocated_client_slots; i++) @@ -3217,7 +3203,7 @@ static void PF_spawnclient (progfuncs_t *prinst, struct globalvars_s *pr_globals //DP_SV_BOTCLIENT //float(entity client) clienttype = #455; -static void PF_clienttype (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_clienttype (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int entnum = G_EDICTNUM(prinst, OFS_PARM0); if (entnum < 1 || entnum > sv.allocated_client_slots) @@ -3244,7 +3230,7 @@ PF_cvar float cvar (string) ================= */ -static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str; @@ -3279,7 +3265,7 @@ static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals) } } -void PF_sv_getlight (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_getlight (progfuncs_t *prinst, struct globalvars_s *pr_globals) { /*not shared with client - clients get more lights*/ float *point = G_VECTOR(OFS_PARM0); @@ -3307,7 +3293,7 @@ Returns a chain of entities that have origins within a spherical area findradius (origin, radius) ================= */ -void PF_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent, *chain; float rad; @@ -3345,13 +3331,13 @@ void PF_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_conprint ========= */ -static void PF_conprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_conprint (progfuncs_t *prinst, struct globalvars_s *pr_globals) { Sys_Printf ("%s",PF_VarString(prinst, 0, pr_globals)); } -static void PF_h2printf (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2printf (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char temp[256]; float v; @@ -3366,7 +3352,7 @@ static void PF_h2printf (progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_Printf (PR_GetStringOfs(prinst, OFS_PARM0),temp); } -static void PF_h2printv (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2printv (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char temp[256]; @@ -3375,14 +3361,14 @@ static void PF_h2printv (progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_Printf (PR_GetStringOfs(prinst, OFS_PARM0),temp); } -static void PF_h2spawn_temp (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2spawn_temp (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ed; ed = ED_Alloc(prinst); RETURN_EDICT(prinst, ed); } -void PF_Remove (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Remove (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ed; @@ -3411,7 +3397,7 @@ void PR_CheckEmptyString (char *s) PR_RunError ("Bad string"); } */ -void PF_precache_file (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_precache_file (progfuncs_t *prinst, struct globalvars_s *pr_globals) { // precache_file is only used to copy files with qcc, it does nothing G_INT(OFS_RETURN) = G_INT(OFS_PARM0); } @@ -3451,7 +3437,7 @@ void PF_precache_sound_Internal (progfuncs_t *prinst, char *s) } PR_BIError (prinst, "PF_precache_sound: overflow"); } -void PF_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_precache_sound (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; @@ -3513,7 +3499,7 @@ int PF_precache_model_Internal (progfuncs_t *prinst, char *s) PR_BIError (prinst, "PF_precache_model: overflow"); return 0; } -void PF_precache_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_precache_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; @@ -3524,7 +3510,7 @@ void PF_precache_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_precache_model_Internal(prinst, s); } -static void PF_h2precache_puzzle_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2precache_puzzle_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) { //qc/hc lacks string manipulation. char *shortname; char fullname[MAX_QPATH]; @@ -3534,14 +3520,14 @@ static void PF_h2precache_puzzle_model (progfuncs_t *prinst, struct globalvars_s PF_precache_model_Internal(prinst, fullname); } -static void PF_getmodelindex (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_getmodelindex (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; s = PR_GetStringOfs(prinst, OFS_PARM0); G_INT(OFS_RETURN) = PF_precache_model_Internal(prinst, s); } -void PF_precache_vwep_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_precache_vwep_model (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; char *s; @@ -3583,7 +3569,7 @@ void PF_precache_vwep_model (progfuncs_t *prinst, struct globalvars_s *pr_global } } -static void PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int size = 1024*1024*8; char *buffer = BZ_Malloc(size); @@ -3592,7 +3578,7 @@ static void PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *pr_globals) BZ_Free(buffer); } -static void PF_sv_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals) { wedict_t *ent; float dist; @@ -3608,7 +3594,7 @@ PF_walkmove float(float yaw, float dist) walkmove =============== */ -static void PF_walkmove (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_walkmove (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; float yaw, dist; @@ -3665,7 +3651,7 @@ PF_droptofloor void() droptofloor =============== */ -void PF_droptofloor (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_droptofloor (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; vec3_t end; @@ -3695,7 +3681,7 @@ void PF_droptofloor (progfuncs_t *prinst, struct globalvars_s *pr_globals) } } -void PF_applylightstyle(int style, char *val, int col) +void QCBUILTIN PF_applylightstyle(int style, char *val, int col) { client_t *client; int j; @@ -3761,7 +3747,7 @@ PF_lightstyle void(float style, string value [, float colour]) lightstyle =============== */ -void PF_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int style; char *val; @@ -3783,7 +3769,7 @@ void PF_lightstyle (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_applylightstyle(style, val, col); } -void PF_lightstylevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_lightstylevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int style; style = G_FLOAT(OFS_PARM0); @@ -3795,7 +3781,7 @@ void PF_lightstylevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = *sv.strings.lightstyles[style] - 'a'; } -void PF_lightstylestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_lightstylestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int style; float num; @@ -3836,7 +3822,7 @@ void PF_lightstylestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_checkbottom ============= */ -static void PF_checkbottom (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_checkbottom (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; @@ -3850,7 +3836,7 @@ static void PF_checkbottom (progfuncs_t *prinst, struct globalvars_s *pr_globals PF_pointcontents ============= */ -void PF_pointcontents (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_pointcontents (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *v; int cont; @@ -3883,7 +3869,7 @@ vector aim(entity, missilespeed) */ //cvar_t sv_aim = {"sv_aim", "0.93"}; cvar_t sv_aim = SCVAR("sv_aim", "2"); -void PF_aim (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_aim (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent, *check, *bestent; vec3_t start, dir, end, bestdir; @@ -3975,7 +3961,7 @@ PF_changeyaw This was a major timewaster in progs, so it was converted to C ============== */ -void PF_changeyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_changeyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; float ideal, current, move, speed; @@ -4013,7 +3999,7 @@ void PF_changeyaw (progfuncs_t *prinst, struct globalvars_s *pr_globals) } //void() changepitch = #63; -static void PF_changepitch (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_changepitch (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; float ideal, current, move, speed; @@ -4184,7 +4170,7 @@ client_t *Write_GetClient(void) } extern sizebuf_t csqcmsgbuffer; -void PF_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4225,7 +4211,7 @@ void PF_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -void PF_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4265,7 +4251,7 @@ void PF_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -void PF_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4305,7 +4291,7 @@ void PF_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -void PF_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4345,7 +4331,7 @@ void PF_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -void PF_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4385,7 +4371,7 @@ void PF_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -void PF_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4465,14 +4451,14 @@ void PF_WriteString_Internal (int target, char *str) #endif } -void PF_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str = PF_VarString(prinst, 1, pr_globals); PF_WriteString_Internal(G_FLOAT(OFS_PARM0), str); } -void PF_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (G_FLOAT(OFS_PARM0) == MSG_CSQC) { //csqc buffers are always written. @@ -4514,7 +4500,7 @@ void PF_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) //small wrapper function. //void(float target, string str, ...) WriteString2 = #33; -void PF_WriteString2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_WriteString2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int old; char *str; @@ -4537,68 +4523,68 @@ void PF_WriteString2 (progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_PARM1) = old; } -void PF_qtSingle_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteByte(MSG_PRERELONE, (qbyte)G_FLOAT(OFS_PARM1)); } -void PF_qtSingle_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteChar(MSG_PRERELONE, (char)G_FLOAT(OFS_PARM1)); } -void PF_qtSingle_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteShort(MSG_PRERELONE, (short)G_FLOAT(OFS_PARM1)); } -void PF_qtSingle_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteLong(MSG_PRERELONE, G_FLOAT(OFS_PARM1)); } -void PF_qtSingle_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteAngle(MSG_PRERELONE, G_FLOAT(OFS_PARM1)); } -void PF_qtSingle_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteCoord(MSG_PRERELONE, G_FLOAT(OFS_PARM1)); } -void PF_qtSingle_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteString(MSG_PRERELONE, PF_VarString(prinst, 1, pr_globals)); } -void PF_qtSingle_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtSingle_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteEntity(MSG_PRERELONE, (short)G_EDICTNUM(prinst, OFS_PARM1)); } -void PF_qtBroadcast_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteByte (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteByte(MSG_BROADCAST, (qbyte)G_FLOAT(OFS_PARM0)); } -void PF_qtBroadcast_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteChar (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteChar(MSG_BROADCAST, (char)G_FLOAT(OFS_PARM0)); } -void PF_qtBroadcast_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteShort (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteShort(MSG_BROADCAST, (short)G_FLOAT(OFS_PARM0)); } -void PF_qtBroadcast_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteLong (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteLong(MSG_BROADCAST, G_FLOAT(OFS_PARM0)); } -void PF_qtBroadcast_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteAngle (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteAngle(MSG_BROADCAST, G_FLOAT(OFS_PARM0)); } -void PF_qtBroadcast_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteCoord (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteCoord(MSG_BROADCAST, G_FLOAT(OFS_PARM0)); } -void PF_qtBroadcast_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteString (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteString(MSG_BROADCAST, PF_VarString(prinst, 0, pr_globals)); } -void PF_qtBroadcast_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_qtBroadcast_WriteEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { NPP_NQWriteEntity(MSG_BROADCAST, (short)G_EDICTNUM(prinst, OFS_PARM0)); } @@ -4755,7 +4741,7 @@ void PF_tempentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) int SV_ModelIndex (char *name); -void PF_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; int mdlindex; @@ -4806,7 +4792,7 @@ void PF_makestatic (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_setspawnparms ============== */ -void PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; int i; @@ -4833,7 +4819,7 @@ void PF_setspawnparms (progfuncs_t *prinst, struct globalvars_s *pr_globals) PF_changelevel ============== */ -void PF_changelevel (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_changelevel (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s, *spot; @@ -4863,7 +4849,7 @@ PF_logfrag logfrag (killer, killee) ============== */ -void PF_logfrag (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_logfrag (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent1, *ent2; int e1, e2; @@ -4954,7 +4940,7 @@ char *PF_infokey_Internal (int entnum, char *key) return value; } -void PF_infokey (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_infokey (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e; int e1; @@ -4978,7 +4964,7 @@ PF_multicast void(vector where, float set) multicast ============== */ -void PF_multicast (progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_multicast (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *o; int to; @@ -4990,7 +4976,7 @@ void PF_multicast (progfuncs_t *prinst, struct globalvars_s *pr_globals) } -static void PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Fixme (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i; qboolean printedheader = false; @@ -5022,32 +5008,13 @@ qboolean printedheader = false; PR_BIError (prinst, "builtin not implemented"); } -void PF_Ignore(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Ignore(progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_INT(OFS_RETURN) = 0; } -/* -============== -PF_logfrag - -logfrag (killer, killee) -============== -*/ -void PF_logstring (progfuncs_t *prinst, struct globalvars_s *pr_globals) -{ - char *s; - - s = PF_VarString(prinst, 0, pr_globals); - - if (sv_fraglogfile) - { - VFS_WRITE(sv_fraglogfile, s, strlen(s)); - VFS_FLUSH(sv_fraglogfile); - } -} #define PRSTR 0xa6ffb3d7 -void PF_newstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //mvdsv +static void QCBUILTIN PF_newstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //mvdsv { char *s; int len; @@ -5066,7 +5033,7 @@ void PF_newstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) //mvdsv RETURN_SSTRING(s+8); } -void PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *buf = PR_GetStringOfs(prinst, OFS_PARM0); char *add = PR_GetStringOfs(prinst, OFS_PARM1); int wantedlen = G_FLOAT(OFS_PARM2); @@ -5089,7 +5056,7 @@ void PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_INT(OFS_RETURN) = G_INT(OFS_PARM0); } -void PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *string = PR_GetStringOfs(prinst, OFS_PARM0), *s; static char buf[1024]; @@ -5102,7 +5069,7 @@ void PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) } #ifdef PEXT_BULLETENS -void PF_bulleten (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_bulleten (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int j; client_t *client; @@ -5129,7 +5096,7 @@ void PF_bulleten (progfuncs_t *prinst, struct globalvars_s *pr_globals) #ifdef SVCHAT void SV_Chat(char *filename, float starttag, edict_t *edict); -void PF_chat (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_chat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_Chat(PR_GetStringOfs(prinst, OFS_PARM0), G_FLOAT(OFS_PARM1), G_EDICT(prinst, OFS_PARM2)); } @@ -6246,7 +6213,7 @@ returns true if the extension is supported by the server checkextension(string extensionname, [entity client]) ================= */ -void PF_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) { lh_extension_t *ext = NULL; char *s = PR_GetStringOfs(prinst, OFS_PARM0); @@ -6299,7 +6266,7 @@ void PF_checkextension (progfuncs_t *prinst, struct globalvars_s *pr_globals) } -void PF_builtinsupported (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_builtinsupported (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s = PR_GetStringOfs(prinst, OFS_PARM0); @@ -6310,7 +6277,7 @@ void PF_builtinsupported (progfuncs_t *prinst, struct globalvars_s *pr_globals) //mvdsv builtins. -void PF_ExecuteCommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) //83 //void() exec; +void QCBUILTIN PF_ExecuteCommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) //83 //void() exec; { int old_other, old_self; // mod_consolecmd will be executed, so we need to store this @@ -6331,7 +6298,7 @@ string teamfield(.string field) ================= */ -void PF_teamfield (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_teamfield (progfuncs_t *prinst, struct globalvars_s *pr_globals) { pr_teamfield = G_INT(OFS_PARM0)+prinst->fieldadjust; } @@ -6344,7 +6311,7 @@ string substr(string str, float start, float len) ================= */ -void PF_substr (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_substr (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char dest[4096]; char *s; @@ -6385,7 +6352,7 @@ float str2byte (string str) ================= */ -void PF_str2byte (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_str2byte (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = (float) *PR_GetStringOfs(prinst, OFS_PARM0); } @@ -6398,7 +6365,7 @@ float str2short (string str) ================= */ -void PF_str2short (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_str2short (progfuncs_t *prinst, struct globalvars_s *pr_globals) { G_FLOAT(OFS_RETURN) = (float) LittleShort(*(short*)PR_GetStringOfs(prinst, OFS_PARM0)); } @@ -6411,7 +6378,7 @@ string readmcmd (string str) ================= */ -void PF_readcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_readcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; static char output[8000]; @@ -6451,7 +6418,7 @@ void redirectcmd (entity to, string str) ================= */ /* -void PF_redirectcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_redirectcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; int entnum; @@ -6473,7 +6440,7 @@ void PF_redirectcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals) SV_EndRedirect(); }*/ -void PF_calltimeofday (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_calltimeofday (progfuncs_t *prinst, struct globalvars_s *pr_globals) { date_t date; func_t f; @@ -6506,7 +6473,7 @@ if argument 'now' is set, frame is written instantly ================= */ -void PF_forcedemoframe (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_forcedemoframe (progfuncs_t *prinst, struct globalvars_s *pr_globals) { demo.forceFrame = 1; // if (G_FLOAT(OFS_PARM0) == 1) @@ -6523,7 +6490,7 @@ FIXME: check for null pointers first? ================= */ -void PF_MVDSV_strcpy (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_MVDSV_strcpy (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *src = PR_GetStringOfs(prinst, OFS_PARM1); char *dest = PR_GetStringOfs(prinst, OFS_PARM0); @@ -6554,7 +6521,7 @@ FIXME: check for null pointers first? ================= */ -void PF_MVDSV_strncpy (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_MVDSV_strncpy (progfuncs_t *prinst, struct globalvars_s *pr_globals) { strncpy(PR_GetStringOfs(prinst, OFS_PARM0), PR_GetStringOfs(prinst, OFS_PARM1), (int) G_FLOAT(OFS_PARM2)); } @@ -6568,7 +6535,7 @@ string strstr(string str, string sub) ================= */ -void PF_strstr (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_strstr (progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *str, *sub, *p; @@ -6634,7 +6601,7 @@ void log(string name, float console, string text) ================= */ -void PF_log(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_log(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char name[MAX_OSPATH], *text; vfsfile_t *file; @@ -6660,7 +6627,7 @@ void PF_log(progfuncs_t *prinst, struct globalvars_s *pr_globals) #ifdef Q2BSPS -void PF_OpenPortal (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_OpenPortal (progfuncs_t *prinst, struct globalvars_s *pr_globals) { if (sv.world.worldmodel->fromgame == fg_quake2) { @@ -6688,7 +6655,7 @@ void PF_OpenPortal (progfuncs_t *prinst, struct globalvars_s *pr_globals) //void(entity from, entity to) copyentity = #400 //copies data from one entity to another -static void PF_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *in, *out; @@ -6704,7 +6671,7 @@ static void PF_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) //entity(string field, string match) findchain = #402 //chained search for strings in entity fields -void PF_sv_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; char *s; @@ -6738,7 +6705,7 @@ void PF_sv_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) //entity(string field, float match) findchainfloat = #403 //chained search for float, int, and entity reference fields -void PF_sv_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; float s; @@ -6768,7 +6735,7 @@ void PF_sv_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) //entity(string field, float match) findchainflags = #450 //chained search for float, int, and entity reference fields -void PF_sv_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; int s; @@ -6798,7 +6765,7 @@ void PF_sv_findchainflags (progfuncs_t *prinst, struct globalvars_s *pr_globals) //void(vector dir) vectorvectors = #432 //Writes new values for v_forward, v_up, and v_right based on the given forward vector -static void PF_vectorvectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_vectorvectors (progfuncs_t *prinst, struct globalvars_s *pr_globals) { VectorCopy(G_VECTOR(OFS_PARM0), P_VEC(v_forward)); VectorNormalize(P_VEC(v_forward)); @@ -6809,7 +6776,7 @@ static void PF_vectorvectors (progfuncs_t *prinst, struct globalvars_s *pr_globa //void(entity e, string s) clientcommand = #440 //executes a command string as if it came from the specified client -void PF_clientcommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_clientcommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) { client_t *temp_client; int i; @@ -6841,7 +6808,7 @@ void PF_clientcommand (progfuncs_t *prinst, struct globalvars_s *pr_globals) -void PF_h2AdvanceFrame(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2AdvanceFrame(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *Ent; float Start,End,Result; @@ -6886,7 +6853,7 @@ void PF_h2AdvanceFrame(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = Result; } -void PF_h2RewindFrame(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2RewindFrame(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *Ent; float Start,End,Result; @@ -6920,7 +6887,7 @@ void PF_h2RewindFrame(progfuncs_t *prinst, struct globalvars_s *pr_globals) #define WF_CYCLE_WRAPPED 2 #define WF_LAST_FRAME 3 -void PF_h2advanceweaponframe (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2advanceweaponframe (progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *ent; float startframe,endframe; @@ -6989,7 +6956,7 @@ void PRH2_SetPlayerClass(client_t *cl, int classnum, qboolean fromqc) } } -void PF_h2setclass (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2setclass (progfuncs_t *prinst, struct globalvars_s *pr_globals) { float NewClass; int entnum; @@ -7018,7 +6985,7 @@ void PF_h2setclass (progfuncs_t *prinst, struct globalvars_s *pr_globals) client->sendinfo = true; } -void PF_h2v_factor(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2v_factor(progfuncs_t *prinst, struct globalvars_s *pr_globals) // returns (v_right * factor_x) + (v_forward * factor_y) + (v_up * factor_z) { float *range; @@ -7041,7 +7008,7 @@ void PF_h2v_factor(progfuncs_t *prinst, struct globalvars_s *pr_globals) VectorCopy (result, G_VECTOR(OFS_RETURN)); } -void PF_h2v_factorrange(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2v_factorrange(progfuncs_t *prinst, struct globalvars_s *pr_globals) // returns (v_right * factor_x) + (v_forward * factor_y) + (v_up * factor_z) { float num,*minv,*maxv; @@ -7073,7 +7040,7 @@ void PF_h2v_factorrange(progfuncs_t *prinst, struct globalvars_s *pr_globals) } char *T_GetString(int num); -void PF_h2plaque_draw(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2plaque_draw(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s; @@ -7116,7 +7083,7 @@ void PF_h2plaque_draw(progfuncs_t *prinst, struct globalvars_s *pr_globals) } } -static void PF_h2movestep (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2movestep (progfuncs_t *prinst, struct globalvars_s *pr_globals) { vec3_t v; edict_t *ent; @@ -7139,7 +7106,7 @@ static void PF_h2movestep (progfuncs_t *prinst, struct globalvars_s *pr_globals) pr_global_struct->self = oldself; } -void PF_h2concatv(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2concatv(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *in,*range; vec3_t result; @@ -7158,7 +7125,7 @@ void PF_h2concatv(progfuncs_t *prinst, struct globalvars_s *pr_globals) VectorCopy (result, G_VECTOR(OFS_RETURN)); } -void PF_h2matchAngleToSlope(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2matchAngleToSlope(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *actor; vec3_t v_forward, old_forward, old_right, new_angles2 = { 0, 0, 0 }; @@ -7190,7 +7157,7 @@ void PF_h2matchAngleToSlope(progfuncs_t *prinst, struct globalvars_s *pr_globals actor->v->angles[2] = (1-fabs(dot))*pitch*mod; } /*objective type stuff, this goes into a stat*/ -void PF_h2updateinfoplaque(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2updateinfoplaque(progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int idx = G_FLOAT(OFS_PARM0); int mode = G_FLOAT(OFS_PARM1); /*0=toggle, 1=force, 2=clear*/ @@ -7381,7 +7348,7 @@ void SV_RegisterH2CustomTents(void) h2customtents[ce_grey_smoke_100] = SV_CustomTEnt_Register("ce_grey_smoke_100", CTE_CUSTOMVELOCITY, NULL, 0, NULL, 0, 0, NULL); } } -void PF_h2starteffect(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2starteffect(progfuncs_t *prinst, struct globalvars_s *pr_globals) { // float *min, *max, *angle, *size; // float colour, wait, radius, frame, framelength, duration; @@ -7724,12 +7691,12 @@ void PF_h2starteffect(progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } -void PF_h2endeffect(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2endeffect(progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_DPrintf("Stop effect %i\n", (int)G_FLOAT(OFS_PARM0)); } -void PF_h2rain_go(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2rain_go(progfuncs_t *prinst, struct globalvars_s *pr_globals) { /* float *min = G_VECTOR(OFS_PARM0); @@ -7742,7 +7709,7 @@ void PF_h2rain_go(progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_DPrintf("rain go\n", (int)G_FLOAT(OFS_PARM0)); } -void PF_h2StopSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2StopSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int channel; edict_t *entity; @@ -7753,12 +7720,12 @@ void PF_h2StopSound(progfuncs_t *prinst, struct globalvars_s *pr_globals) SVQ1_StartSound (entity, channel, "", 1, 0, 0); } -void PF_h2updatesoundpos(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2updatesoundpos(progfuncs_t *prinst, struct globalvars_s *pr_globals) { Con_DPrintf("updatesoundpos\n"); } -void PF_h2whiteflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2whiteflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) { /* broadcast a stuffcmd, I guess, to flash the screen white @@ -7767,13 +7734,13 @@ void PF_h2whiteflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) Con_DPrintf("white flash\n", (int)G_FLOAT(OFS_PARM0)); } -void PF_h2getstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_h2getstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *s = T_GetString(G_FLOAT(OFS_PARM0)-1); RETURN_PSTRING(s); } -void PF_RegisterTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_RegisterTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int arg; int i; @@ -7834,7 +7801,7 @@ void PF_RegisterTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_FLOAT(OFS_RETURN) = i; } -void PF_CustomTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_CustomTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int type; int arg; @@ -7892,7 +7859,7 @@ void PF_CustomTEnt(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //float(string effectname) particleeffectnum (EXT_CSQC) -void PF_sv_particleeffectnum(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_particleeffectnum(progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef PEXT_CSQC #pragma message("PF_sv_particleeffectnum: which effect index values to use?") @@ -7903,7 +7870,7 @@ void PF_sv_particleeffectnum(progfuncs_t *prinst, struct globalvars_s *pr_global #endif } //void(float effectnum, entity ent, vector start, vector end) trailparticles (EXT_CSQC), -void PF_sv_trailparticles(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_trailparticles(progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef PEXT_CSQC int efnum; @@ -7947,7 +7914,7 @@ void PF_sv_trailparticles(progfuncs_t *prinst, struct globalvars_s *pr_globals) #endif } //void(float effectnum, vector origin [, vector dir, float count]) pointparticles (EXT_CSQC) -void PF_sv_pointparticles(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_pointparticles(progfuncs_t *prinst, struct globalvars_s *pr_globals) { #ifdef PEXT_CSQC int efnum = G_FLOAT(OFS_PARM0); @@ -8009,7 +7976,7 @@ typedef struct qcstate_s { } qcstate_t; qcstate_t *qcthreads; -void PR_RunThreads(void) +void PRSV_RunThreads(void) { struct globalvars_s *pr_globals; @@ -8041,7 +8008,7 @@ void PR_RunThreads(void) } } -void PR_ClearThreads(void) +static void PRSV_ClearThreads(void) { qcstate_t *state = qcthreads, *next; qcthreads = NULL; @@ -8056,7 +8023,7 @@ void PR_ClearThreads(void) } } -void PF_Sleep(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Sleep(progfuncs_t *prinst, struct globalvars_s *pr_globals) { qcstate_t *state; struct qcthread_s *thread; @@ -8077,7 +8044,7 @@ void PF_Sleep(progfuncs_t *prinst, struct globalvars_s *pr_globals) svprogfuncs->AbortStack(svprogfuncs); } -void PF_Fork(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_Fork(progfuncs_t *prinst, struct globalvars_s *pr_globals) { qcstate_t *state; struct qcthread_s *thread; @@ -8093,14 +8060,14 @@ void PF_Fork(progfuncs_t *prinst, struct globalvars_s *pr_globals) state->other = NUM_FOR_EDICT(svprogfuncs, PROG_TO_EDICT(svprogfuncs, pr_global_struct->other)); state->thread = thread; - PR_RunThreads(); + PRSV_RunThreads(); G_FLOAT(OFS_RETURN) = 0; } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_gunshot = #418; -void PF_te_gunshot(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_gunshot(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int count; if (*svprogfuncs->callargc >= 2) @@ -8110,7 +8077,7 @@ void PF_te_gunshot(progfuncs_t *prinst, struct globalvars_s *pr_globals) SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_GUNSHOT, count); } //DP_TE_QUADEFFECTS1 -void PF_te_gunshotquad(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_gunshotquad(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int count; if (*svprogfuncs->callargc >= 2) @@ -8122,25 +8089,25 @@ void PF_te_gunshotquad(progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_spike = #419; -void PF_te_spike(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_spike(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_SPIKE, 1); } //DP_TE_QUADEFFECTS1 -void PF_te_spikequad(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_spikequad(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TEDP_SPIKEQUAD, 1); } // FTE_TE_STANDARDEFFECTBUILTINS -void PF_te_lightningblood(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_lightningblood(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TEQW_LIGHTNINGBLOOD, 1); } // FTE_TE_STANDARDEFFECTBUILTINS -void PF_te_bloodqw(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_bloodqw(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int count; if (*svprogfuncs->callargc >= 2) @@ -8152,66 +8119,66 @@ void PF_te_bloodqw(progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_superspike = #420; -void PF_te_superspike(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_superspike(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_SUPERSPIKE, 1); } //DP_TE_QUADEFFECTS1 -void PF_te_superspikequad(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_superspikequad(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TEDP_SUPERSPIKEQUAD, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_explosion = #421; -void PF_te_explosion(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_explosion(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_EXPLOSION, 1); } //DP_TE_QUADEFFECTS1 -void PF_te_explosionquad(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_explosionquad(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TEDP_EXPLOSIONQUAD, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_tarexplosion = #422; -void PF_te_tarexplosion(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_tarexplosion(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_TAREXPLOSION, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_wizspike = #423; -void PF_te_wizspike(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_wizspike(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_WIZSPIKE, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_knightspike = #424; -void PF_te_knightspike(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_knightspike(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_KNIGHTSPIKE, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_lavasplash = #425; -void PF_te_lavasplash(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_lavasplash(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_LAVASPLASH, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org) te_teleport = #426; -void PF_te_teleport(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_teleport(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_TELEPORT, 1); } //DP_TE_STANDARDEFFECTBUILTINS //void(vector org, float color) te_explosion2 = #427; -void PF_te_explosion2(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_explosion2(progfuncs_t *prinst, struct globalvars_s *pr_globals) { //FIXME: QW doesn't support TE_EXPLOSION2... SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_EXPLOSION, 1); @@ -8219,34 +8186,34 @@ void PF_te_explosion2(progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_TE_STANDARDEFFECTBUILTINS //void(entity own, vector start, vector end) te_lightning1 = #428; -void PF_te_lightning1(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_lightning1(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_beam_tempentity(G_EDICTNUM(prinst, OFS_PARM0), G_VECTOR(OFS_PARM1), G_VECTOR(OFS_PARM2), TE_LIGHTNING1); } //DP_TE_STANDARDEFFECTBUILTINS //void(entity own, vector start, vector end) te_lightning2 = #429; -void PF_te_lightning2(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_lightning2(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_beam_tempentity(G_EDICTNUM(prinst, OFS_PARM0), G_VECTOR(OFS_PARM1), G_VECTOR(OFS_PARM2), TE_LIGHTNING2); } //DP_TE_STANDARDEFFECTBUILTINS //void(entity own, vector start, vector end) te_lightning3 = #430; -void PF_te_lightning3(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_lightning3(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_beam_tempentity(G_EDICTNUM(prinst, OFS_PARM0), G_VECTOR(OFS_PARM1), G_VECTOR(OFS_PARM2), TE_LIGHTNING3); } //DP_TE_STANDARDEFFECTBUILTINS //void(entity own, vector start, vector end) te_beam = #431; -void PF_te_beam(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_beam(progfuncs_t *prinst, struct globalvars_s *pr_globals) { SV_beam_tempentity(-1 -G_EDICTNUM(prinst, OFS_PARM0), G_VECTOR(OFS_PARM1), G_VECTOR(OFS_PARM2), TE_LIGHTNING2); } //DP_TE_SPARK -void PF_te_spark(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_spark(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); @@ -8285,14 +8252,14 @@ void PF_te_spark(progfuncs_t *prinst, struct globalvars_s *pr_globals) } // #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH) -void PF_te_smallflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_smallflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); SV_point_tempentity(org, TEDP_SMALLFLASH, 0); } // #417 void(vector org, float radius, float lifetime, vector color) te_customflash (DP_TE_CUSTOMFLASH) -void PF_te_customflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_customflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); @@ -8333,7 +8300,7 @@ void PF_te_customflash(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //#408 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube (DP_TE_PARTICLECUBE) -void PF_te_particlecube(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_particlecube(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *min = G_VECTOR(OFS_PARM0); float *max = G_VECTOR(OFS_PARM1); @@ -8389,7 +8356,7 @@ void PF_te_particlecube(progfuncs_t *prinst, struct globalvars_s *pr_globals) SV_Multicast(org, MULTICAST_PVS); } -void PF_te_explosionrgb(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_explosionrgb(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); float *colour = G_VECTOR(OFS_PARM0); @@ -8419,7 +8386,7 @@ void PF_te_explosionrgb(progfuncs_t *prinst, struct globalvars_s *pr_globals) SV_Multicast(org, MULTICAST_PVS); } -void PF_te_particlerain(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_particlerain(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *min = G_VECTOR(OFS_PARM0); float *max = G_VECTOR(OFS_PARM1); @@ -8473,7 +8440,7 @@ void PF_te_particlerain(progfuncs_t *prinst, struct globalvars_s *pr_globals) SV_Multicast(NULL, MULTICAST_ALL); } -void PF_te_particlesnow(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_particlesnow(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *min = G_VECTOR(OFS_PARM0); float *max = G_VECTOR(OFS_PARM1); @@ -8528,7 +8495,7 @@ void PF_te_particlesnow(progfuncs_t *prinst, struct globalvars_s *pr_globals) } // #406 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower (DP_TE_BLOODSHOWER) -void PF_te_bloodshower(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_bloodshower(progfuncs_t *prinst, struct globalvars_s *pr_globals) { // [vector] min [vector] max [coord] explosionspeed [short] count float *min = G_VECTOR(OFS_PARM0); @@ -8576,7 +8543,7 @@ void PF_te_bloodshower(progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_SV_EFFECT //void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; -static void PF_effect(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_effect(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); char *name = PR_GetStringOfs(prinst, OFS_PARM1); @@ -8590,14 +8557,14 @@ static void PF_effect(progfuncs_t *prinst, struct globalvars_s *pr_globals) //DP_TE_PLASMABURN //void(vector org) te_plasmaburn = #433; -void PF_te_plasmaburn(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_te_plasmaburn(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *org = G_VECTOR(OFS_PARM0); SV_point_tempentity(org, 75, 0); } -void PF_ForceInfoKey(progfuncs_t *prinst, struct globalvars_s *pr_globals) +void QCBUILTIN PF_ForceInfoKey(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e; int e1; @@ -8648,7 +8615,7 @@ setcolors(clientent, value) */ //from lh -void PF_setcolors (progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_setcolors (progfuncs_t *prinst, struct globalvars_s *pr_globals) { client_t *client; int entnum, i; @@ -8734,7 +8701,7 @@ static void ParamNegateFix ( float * xx, float * yy, int Zone ) xx[0] = x; yy[0] = y; } -void PF_ShowPic(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ShowPic(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *slot = PR_GetStringOfs(prinst, OFS_PARM0); char *picname = PR_GetStringOfs(prinst, OFS_PARM1); @@ -8774,7 +8741,7 @@ void PF_ShowPic(progfuncs_t *prinst, struct globalvars_s *pr_globals) } }; -void PF_HidePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_HidePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) { client_t *cl; char *slot = PR_GetStringOfs(prinst, OFS_PARM0); @@ -8804,7 +8771,7 @@ void PF_HidePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) }; -void PF_MovePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_MovePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *slot = PR_GetStringOfs(prinst, OFS_PARM0); float x = G_FLOAT(OFS_PARM1); @@ -8841,7 +8808,7 @@ void PF_MovePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) } }; -void PF_ChangePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_ChangePic(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *slot = PR_GetStringOfs(prinst, OFS_PARM0); char *newpic= PR_GetStringOfs(prinst, OFS_PARM1); @@ -8887,7 +8854,7 @@ int SV_TagForName(int modelindex, char *tagname) return Mod_TagNumForName(model, tagname); } -void PF_setattachment(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_setattachment(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e = G_EDICT(prinst, OFS_PARM0); edict_t *tagentity = G_EDICT(prinst, OFS_PARM1); @@ -8925,7 +8892,7 @@ void PF_setattachment(progfuncs_t *prinst, struct globalvars_s *pr_globals) } // #451 float(entity ent, string tagname) gettagindex (DP_MD3_TAGSINFO) -void PF_gettagindex(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_gettagindex(progfuncs_t *prinst, struct globalvars_s *pr_globals) { edict_t *e = G_EDICT(prinst, OFS_PARM0); char *tagname = PR_GetStringOfs(prinst, OFS_PARM1); @@ -8964,7 +8931,7 @@ static void EdictToTransform(edict_t *ed, float *trans) } // #452 vector(entity ent, float tagindex) gettaginfo (DP_MD3_TAGSINFO) -void PF_sv_gettaginfo(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_sv_gettaginfo(progfuncs_t *prinst, struct globalvars_s *pr_globals) { framestate_t fstate; float transtag[12]; @@ -9011,7 +8978,7 @@ void PF_sv_gettaginfo(progfuncs_t *prinst, struct globalvars_s *pr_globals) //the first implementation of this function was (float type, float num, string name) //it is now float num, float type, .field //EXT_CSQC_1 -void PF_clientstat(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_clientstat(progfuncs_t *prinst, struct globalvars_s *pr_globals) { #if 0 //this is the old code char *name = PF_VarString(prinst, 2, pr_globals); @@ -9022,7 +8989,7 @@ void PF_clientstat(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //EXT_CSQC_1 //void(float num, float type, string name) globalstat -void PF_globalstat(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_globalstat(progfuncs_t *prinst, struct globalvars_s *pr_globals) { char *name = PF_VarString(prinst, 2, pr_globals); #if 0 //this is the old code @@ -9033,7 +9000,7 @@ void PF_globalstat(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //EXT_CSQC_1 -void PF_runclientphys(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_runclientphys(progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int i, n; extern vec3_t player_maxs, player_mins; @@ -9256,7 +9223,7 @@ qboolean SV_RunFullQCMovement(client_t *client, usercmd_t *ucmd) //DP_QC_GETSURFACE // #434 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACE) -void PF_getsurfacenumpoints(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_getsurfacenumpoints(progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int surfnum; model_t *model; @@ -9278,7 +9245,7 @@ void PF_getsurfacenumpoints(progfuncs_t *prinst, struct globalvars_s *pr_globals G_FLOAT(OFS_RETURN) = model->surfaces[surfnum].mesh->numvertexes; } // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE) -void PF_getsurfacepoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_getsurfacepoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int surfnum, pointnum; model_t *model; @@ -9309,7 +9276,7 @@ void PF_getsurfacepoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) } } // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE) -void PF_getsurfacenormal(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_getsurfacenormal(progfuncs_t *prinst, struct globalvars_s *pr_globals) { unsigned int surfnum, pointnum; model_t *model; @@ -9370,7 +9337,7 @@ void PF_getsurfacetexture(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_INT(OFS_RETURN) = PR_TempString(prinst, surf->texinfo->texture->name); } // #438 float(entity e, vector p) getsurfacenearpoint (DP_QC_GETSURFACE) -void PF_getsurfacenearpoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_getsurfacenearpoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) { model_t *model; edict_t *ent; @@ -9452,14 +9419,14 @@ void PF_getsurfacenearpoint(progfuncs_t *prinst, struct globalvars_s *pr_globals } } // #439 vector(entity e, float s, vector p) getsurfaceclippedpoint (DP_QC_GETSURFACE) -void PF_getsurfaceclippedpoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_getsurfaceclippedpoint(progfuncs_t *prinst, struct globalvars_s *pr_globals) { } qbyte qcpvs[(MAX_MAP_LEAFS+7)/8]; //#240 float(vector viewpos, entity viewee) checkpvs (FTE_QC_CHECKPVS) //note: this requires a correctly setorigined entity. -void PF_checkpvs(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_checkpvs(progfuncs_t *prinst, struct globalvars_s *pr_globals) { float *viewpos = G_VECTOR(OFS_PARM0); edict_t *ent = G_EDICT(prinst, OFS_PARM1); @@ -9472,7 +9439,7 @@ void PF_checkpvs(progfuncs_t *prinst, struct globalvars_s *pr_globals) } //entity(string match [, float matchnum]) matchclient = #241; -void PF_matchclient(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_matchclient(progfuncs_t *prinst, struct globalvars_s *pr_globals) { int clnum=-1; char *name = PR_GetStringOfs(prinst, OFS_PARM0); @@ -9505,7 +9472,7 @@ void PF_matchclient(progfuncs_t *prinst, struct globalvars_s *pr_globals) G_INT(OFS_RETURN) = 0; //world } -void PF_SendPacket(progfuncs_t *prinst, struct globalvars_s *pr_globals) +static void QCBUILTIN PF_SendPacket(progfuncs_t *prinst, struct globalvars_s *pr_globals) { netadr_t to; char *address = PR_GetStringOfs(prinst, OFS_PARM0); diff --git a/engine/server/pr_q1qvm.c b/engine/server/pr_q1qvm.c index 4335c6af3..2830ce98f 100755 --- a/engine/server/pr_q1qvm.c +++ b/engine/server/pr_q1qvm.c @@ -478,7 +478,7 @@ static string_t Q1QVMPF_StringToProgs(progfuncs_t *prinst, char *str) return (string_t)(str - (char*)VM_MemoryBase(q1qvm)); } -static char *Q1QVMPF_StringToNative(progfuncs_t *prinst, string_t str) +static char *ASMCALL Q1QVMPF_StringToNative(progfuncs_t *prinst, string_t str) { return (char*)VM_MemoryBase(q1qvm) + str; } diff --git a/engine/server/progs.h b/engine/server/progs.h index 1a3424fb6..18cf59480 100644 --- a/engine/server/progs.h +++ b/engine/server/progs.h @@ -41,7 +41,7 @@ qboolean PR_KrimzonParseCommand(char *s); qboolean PR_UserCmd(char *cmd); qboolean PR_ConsoleCmd(void); -void PR_RunThreads(void); +void PRSV_RunThreads(void); #define PR_MAINPROGS 0 //this is a constant that should really be phased out. But seeing as QCLIB requires some sort of master progs due to extern funcs... diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index 600762cda..8530dd4c9 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -1802,7 +1802,7 @@ client_t *SVC_DirectConnect(void) break; case PROTOCOL_VERSION_FTE2: protextsupported2 = Q_atoi(Cmd_Argv(1)); - Con_DPrintf("Client supports 0x%x fte2 extensions\n", protextsupported); + Con_DPrintf("Client supports 0x%x fte2 extensions\n", protextsupported2); break; case PROTOCOL_VERSION_HUFFMAN: huffcrc = Q_atoi(Cmd_Argv(1)); @@ -3684,6 +3684,7 @@ void SV_InitLocal (void) extern cvar_t sv_wateraccelerate; extern cvar_t sv_friction; extern cvar_t sv_waterfriction; + extern cvar_t sv_sound_watersplash; extern cvar_t pr_allowbutton1; extern cvar_t pm_bunnyspeedcap; @@ -3754,6 +3755,7 @@ void SV_InitLocal (void) Cvar_Register (&sv_wateraccelerate, cvargroup_serverphysics); Cvar_Register (&sv_friction, cvargroup_serverphysics); Cvar_Register (&sv_waterfriction, cvargroup_serverphysics); + Cvar_Register (&sv_sound_watersplash, cvargroup_serverphysics); Cvar_Register (&sv_bigcoords, cvargroup_serverphysics); diff --git a/engine/server/sv_move.c b/engine/server/sv_move.c index 5a4586b38..4beb3630c 100644 --- a/engine/server/sv_move.c +++ b/engine/server/sv_move.c @@ -152,7 +152,7 @@ qboolean World_movestep (world_t *world, wedict_t *ent, vec3_t move, qboolean re if (trace.fraction == 1) { if ( ((int)ent->v->flags & FL_SWIM) && !(World_PointContents(world, trace.endpos) & FTECONTENTS_FLUID)) - return false; // swim monster left water + continue; // swim monster left water VectorCopy (trace.endpos, ent->v->origin); if (relink) diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 1e85518e8..1c2cac9c1 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -57,6 +57,7 @@ cvar_t sv_wateraccelerate = SCVAR( "sv_wateraccelerate", "10"); cvar_t sv_friction = SCVAR( "sv_friction", "4"); cvar_t sv_waterfriction = SCVAR( "sv_waterfriction", "4"); cvar_t sv_gameplayfix_noairborncorpse = SCVAR( "sv_gameplayfix_noairborncorpse", "0"); +cvar_t sv_sound_watersplash = CVAR( "sv_sound_watersplash", "misc/h2ohit1.wav"); cvar_t pm_ktjump = SCVARF("pm_ktjump", "0", CVAR_SERVERINFO); cvar_t pm_bunnyspeedcap = SCVARF("pm_bunnyspeedcap", "0", CVAR_SERVERINFO); @@ -1041,18 +1042,18 @@ static void SV_CheckWaterTransition (edict_t *ent) if (cont <= Q1CONTENTS_WATER) { - if (ent->v->watertype == Q1CONTENTS_EMPTY) + if (ent->v->watertype == Q1CONTENTS_EMPTY && *sv_sound_watersplash.string) { // just crossed into water - SVQ1_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1, 0); + SVQ1_StartSound (ent, 0, sv_sound_watersplash.string, 255, 1, 0); } ent->v->watertype = cont; ent->v->waterlevel = 1; } else { - if (ent->v->watertype != Q1CONTENTS_EMPTY) + if (ent->v->watertype != Q1CONTENTS_EMPTY && *sv_sound_watersplash.string) { // just crossed into open - SVQ1_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1, 0); + SVQ1_StartSound (ent, 0, sv_sound_watersplash.string, 255, 1, 0); } ent->v->watertype = Q1CONTENTS_EMPTY; ent->v->waterlevel = cont; @@ -1195,7 +1196,7 @@ static void SV_Physics_Step (edict_t *ent) else freefall = true; if (fl & FL_SWIM) - freefall = ent->v->waterlevel > 0; + freefall = ent->v->waterlevel <= 0; if (freefall) { hitsound = ent->v->velocity[2] < movevars.gravity*-0.1; @@ -2142,7 +2143,7 @@ qboolean SV_Physics (void) World_Physics_Frame(&sv.world, host_frametime, sv_gravity.value); #endif - PR_RunThreads(); + PRSV_RunThreads(); retouch = (pr_nqglobal_struct->force_retouch && *pr_nqglobal_struct->force_retouch); diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 1eb7c9ed2..5bcfe4248 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -96,7 +96,7 @@ cvar_t sv_realip_timeout = SCVAR("sv_realip_timeout", "10"); #ifdef VOICECHAT cvar_t sv_voip = CVARD("sv_voip", "1", "Enable reception of voice packets."); -cvar_t sv_voip_record = CVARD("sv_voip_record", "0", "Record voicechat into mvds. Requires player support."); +cvar_t sv_voip_record = CVARD("sv_voip_record", "0", "Record voicechat into mvds. Requires player support. 0=noone, 1=everyone, 2=spectators only"); cvar_t sv_voip_echo = CVARD("sv_voip_echo", "0", "Echo voice packets back to their sender, a debug/test setting."); #endif @@ -2094,6 +2094,16 @@ void SV_NextUpload (void) } #ifdef VOICECHAT +/* +Pivicy issues: +By sending voice chat to a server, you are unsure who might be listening. +Voice can be recorded to an mvd, potentially including voice. +Spectators tracvking you are able to hear team chat of your team. +You're never quite sure if anyone might join the server and your team before you finish saying a sentance. +You run the risk of sounds around you being recorded by quake, including but not limited to: TV channels, loved ones, phones, YouTube videos featuring certain moans. +Default on non-team games is to broadcast. +*/ + #define VOICE_RING_SIZE 512 /*POT*/ struct { @@ -2145,9 +2155,6 @@ void SV_VoiceReadPacket(void) ring->receiver[j] = 0; for (j = 0, cl = svs.clients; j < sv.allocated_client_slots; j++, cl++) { - if (cl == host_client && !sv_voip_echo.ival) - continue; - if (cl->state != cs_spawned && cl->state != cs_connected) continue; /*spectators may only talk to spectators*/ @@ -2189,7 +2196,7 @@ void SV_VoiceReadPacket(void) ring->receiver[cln>>3] |= 1<<(cln&3); } - if (sv.mvdrecording && sv_voip_record.ival) + if (sv.mvdrecording && sv_voip_record.ival && !(sv_voip_record.ival == 2 && !host_client->spectator)) { // non-team messages should be seen always, even if not tracking any player if (vt == VT_ALL && (!host_client->spectator || sv_spectalk.ival)) @@ -2244,14 +2251,23 @@ void SV_VoiceSendPacket(client_t *client, sizebuf_t *buf) ring = &voice.ring[(client->voice_read) & (VOICE_RING_SIZE-1)]; /*figure out if it was for us*/ + send = false; if (ring->receiver[clno>>3] & (1<<(clno&3))) send = true; else - send = false; + { + /*if you're spectating, you can hear whatever your tracked player can hear*/ + if (host_client->spectator && host_client->spec_track) + if (ring->receiver[(host_client->spec_track-1)>>3] & (1<<((host_client->spec_track-1)&3))) + send = true; + } if (client->voice_mute[ring->sender>>3] & (1<<(ring->sender&3))) send = false; + if (ring->sender == clno && !sv_voip_echo.ival) + send = false; + /*additional ways to block voice*/ if (client->download) send = false; @@ -6474,6 +6490,7 @@ void SV_UserInit (void) #ifdef VOICECHAT Cvar_Register (&sv_voip, cvargroup_serverpermissions); Cvar_Register (&sv_voip_echo, cvargroup_serverpermissions); + Cvar_Register (&sv_voip_record, cvargroup_serverpermissions); #endif #ifdef SERVERONLY Cvar_Register (&cl_rollspeed, "Prediction stuff");