DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
progsvm.h File Reference
#include <stddef.h>
#include "qtypes.h"
#include "qdefs.h"
#include "common.h"
#include "zone.h"
#include "pr_comp.h"
#include "progdefs.h"
#include "clprogdefs.h"
#include "prvm_offsets.h"
+ Include dependency graph for progsvm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  prvm_edict_private_t
 
struct  prvm_edict_t
 
union  prvm_eval_t
 
struct  prvm_prog_fieldoffsets_t
 
struct  prvm_prog_funcoffsets_t
 
struct  prvm_prog_garbagecollection_state_t
 
struct  prvm_prog_globaloffsets_t
 
struct  prvm_prog_t
 
struct  prvm_required_field_t
 
struct  prvm_stack_t
 
struct  prvm_stringbuffer_t
 

Macros

#define CLVM_prog   (&prvm_prog_list[PRVM_PROG_CLIENT])
 
#define KNOWNSTRINGFLAG_ENGINE   1
 
#define KNOWNSTRINGFLAG_GCMARK   2
 
#define KNOWNSTRINGFLAG_GCPRUNE   4
 
#define PROFILING
 
#define PRVM_alledictedict(ed, fieldname)
 
#define PRVM_alledictfloat(ed, fieldname)
 
#define PRVM_alledictfunction(ed, fieldname)
 
#define PRVM_alledictstring(ed, fieldname)
 
#define PRVM_alledictvector(ed, fieldname)
 
#define PRVM_allfunction(funcname)
 
#define PRVM_allglobaledict(fieldname)
 
#define PRVM_allglobalfloat(fieldname)
 
#define PRVM_allglobalfunction(fieldname)
 
#define PRVM_allglobalstring(fieldname)
 
#define PRVM_allglobalvector(fieldname)
 
#define PRVM_Alloc(buffersize)
 
#define PRVM_clientedictedict(ed, fieldname)
 
#define PRVM_clientedictfloat(ed, fieldname)
 
#define PRVM_clientedictfunction(ed, fieldname)
 
#define PRVM_clientedictstring(ed, fieldname)
 
#define PRVM_clientedictvector(ed, fieldname)
 
#define PRVM_clientfunction(funcname)
 
#define PRVM_clientglobaledict(fieldname)
 
#define PRVM_clientglobalfloat(fieldname)
 
#define PRVM_clientglobalfunction(fieldname)
 
#define PRVM_clientglobalstring(fieldname)
 
#define PRVM_clientglobalvector(fieldname)
 
#define PRVM_CSQC_SIMPLE   2
 
#define PRVM_DECLARE_clientfieldedict(x)
 
#define PRVM_DECLARE_clientfieldedict(x)
 
#define PRVM_DECLARE_clientfieldedict(x)
 
#define PRVM_DECLARE_clientfieldfloat(x)
 
#define PRVM_DECLARE_clientfieldfloat(x)
 
#define PRVM_DECLARE_clientfieldfloat(x)
 
#define PRVM_DECLARE_clientfieldfunction(x)
 
#define PRVM_DECLARE_clientfieldfunction(x)
 
#define PRVM_DECLARE_clientfieldfunction(x)
 
#define PRVM_DECLARE_clientfieldstring(x)
 
#define PRVM_DECLARE_clientfieldstring(x)
 
#define PRVM_DECLARE_clientfieldstring(x)
 
#define PRVM_DECLARE_clientfieldvector(x)
 
#define PRVM_DECLARE_clientfieldvector(x)
 
#define PRVM_DECLARE_clientfieldvector(x)
 
#define PRVM_DECLARE_clientfunction(x)
 
#define PRVM_DECLARE_clientfunction(x)
 
#define PRVM_DECLARE_clientfunction(x)
 
#define PRVM_DECLARE_clientglobaledict(x)
 
#define PRVM_DECLARE_clientglobaledict(x)
 
#define PRVM_DECLARE_clientglobaledict(x)
 
#define PRVM_DECLARE_clientglobalfloat(x)
 
#define PRVM_DECLARE_clientglobalfloat(x)
 
#define PRVM_DECLARE_clientglobalfloat(x)
 
#define PRVM_DECLARE_clientglobalfunction(x)
 
#define PRVM_DECLARE_clientglobalfunction(x)
 
#define PRVM_DECLARE_clientglobalfunction(x)
 
#define PRVM_DECLARE_clientglobalstring(x)
 
#define PRVM_DECLARE_clientglobalstring(x)
 
#define PRVM_DECLARE_clientglobalstring(x)
 
#define PRVM_DECLARE_clientglobalvector(x)
 
#define PRVM_DECLARE_clientglobalvector(x)
 
#define PRVM_DECLARE_clientglobalvector(x)
 
#define PRVM_DECLARE_field(x)
 
#define PRVM_DECLARE_field(x)
 
#define PRVM_DECLARE_field(x)
 
#define PRVM_DECLARE_function(x)
 
#define PRVM_DECLARE_function(x)
 
#define PRVM_DECLARE_function(x)
 
#define PRVM_DECLARE_global(x)
 
#define PRVM_DECLARE_global(x)
 
#define PRVM_DECLARE_global(x)
 
#define PRVM_DECLARE_menufieldedict(x)
 
#define PRVM_DECLARE_menufieldedict(x)
 
#define PRVM_DECLARE_menufieldedict(x)
 
#define PRVM_DECLARE_menufieldfloat(x)
 
#define PRVM_DECLARE_menufieldfloat(x)
 
#define PRVM_DECLARE_menufieldfloat(x)
 
#define PRVM_DECLARE_menufieldfunction(x)
 
#define PRVM_DECLARE_menufieldfunction(x)
 
#define PRVM_DECLARE_menufieldfunction(x)
 
#define PRVM_DECLARE_menufieldstring(x)
 
#define PRVM_DECLARE_menufieldstring(x)
 
#define PRVM_DECLARE_menufieldstring(x)
 
#define PRVM_DECLARE_menufieldvector(x)
 
#define PRVM_DECLARE_menufieldvector(x)
 
#define PRVM_DECLARE_menufieldvector(x)
 
#define PRVM_DECLARE_menufunction(x)
 
#define PRVM_DECLARE_menufunction(x)
 
#define PRVM_DECLARE_menufunction(x)
 
#define PRVM_DECLARE_menuglobaledict(x)
 
#define PRVM_DECLARE_menuglobaledict(x)
 
#define PRVM_DECLARE_menuglobaledict(x)
 
#define PRVM_DECLARE_menuglobalfloat(x)
 
#define PRVM_DECLARE_menuglobalfloat(x)
 
#define PRVM_DECLARE_menuglobalfloat(x)
 
#define PRVM_DECLARE_menuglobalfunction(x)
 
#define PRVM_DECLARE_menuglobalfunction(x)
 
#define PRVM_DECLARE_menuglobalfunction(x)
 
#define PRVM_DECLARE_menuglobalstring(x)
 
#define PRVM_DECLARE_menuglobalstring(x)
 
#define PRVM_DECLARE_menuglobalstring(x)
 
#define PRVM_DECLARE_menuglobalvector(x)
 
#define PRVM_DECLARE_menuglobalvector(x)
 
#define PRVM_DECLARE_menuglobalvector(x)
 
#define PRVM_DECLARE_serverfieldedict(x)
 
#define PRVM_DECLARE_serverfieldedict(x)
 
#define PRVM_DECLARE_serverfieldedict(x)
 
#define PRVM_DECLARE_serverfieldfloat(x)
 
#define PRVM_DECLARE_serverfieldfloat(x)
 
#define PRVM_DECLARE_serverfieldfloat(x)
 
#define PRVM_DECLARE_serverfieldfunction(x)
 
#define PRVM_DECLARE_serverfieldfunction(x)
 
#define PRVM_DECLARE_serverfieldfunction(x)
 
#define PRVM_DECLARE_serverfieldstring(x)
 
#define PRVM_DECLARE_serverfieldstring(x)
 
#define PRVM_DECLARE_serverfieldstring(x)
 
#define PRVM_DECLARE_serverfieldvector(x)
 
#define PRVM_DECLARE_serverfieldvector(x)
 
#define PRVM_DECLARE_serverfieldvector(x)
 
#define PRVM_DECLARE_serverfunction(x)
 
#define PRVM_DECLARE_serverfunction(x)
 
#define PRVM_DECLARE_serverfunction(x)
 
#define PRVM_DECLARE_serverglobaledict(x)
 
#define PRVM_DECLARE_serverglobaledict(x)
 
#define PRVM_DECLARE_serverglobaledict(x)
 
#define PRVM_DECLARE_serverglobalfloat(x)
 
#define PRVM_DECLARE_serverglobalfloat(x)
 
#define PRVM_DECLARE_serverglobalfloat(x)
 
#define PRVM_DECLARE_serverglobalfunction(x)
 
#define PRVM_DECLARE_serverglobalfunction(x)
 
#define PRVM_DECLARE_serverglobalfunction(x)
 
#define PRVM_DECLARE_serverglobalstring(x)
 
#define PRVM_DECLARE_serverglobalstring(x)
 
#define PRVM_DECLARE_serverglobalstring(x)
 
#define PRVM_DECLARE_serverglobalvector(x)
 
#define PRVM_DECLARE_serverglobalvector(x)
 
#define PRVM_DECLARE_serverglobalvector(x)
 
#define PRVM_drawedictedict(ed, fieldname)
 
#define PRVM_drawedictfloat(ed, fieldname)
 
#define PRVM_drawedictfunction(ed, fieldname)
 
#define PRVM_drawedictstring(ed, fieldname)
 
#define PRVM_drawedictvector(ed, fieldname)
 
#define PRVM_drawfunction(funcname)
 
#define PRVM_drawglobaledict(fieldname)
 
#define PRVM_drawglobalfloat(fieldname)
 
#define PRVM_drawglobalfunction(fieldname)
 
#define PRVM_drawglobalstring(fieldname)
 
#define PRVM_drawglobalvector(fieldname)
 
#define PRVM_E_FLOAT(e, o)
 
#define PRVM_E_INT(e, o)
 
#define PRVM_E_STRING(e, o)
 
#define PRVM_ED_FindFieldOffset_FromStruct(st, field)
 
#define PRVM_ED_FindGlobalOffset_FromStruct(st, field)
 
#define PRVM_EDICT(n)
 
#define PRVM_EDICT_MARK_SETORIGIN_CAUGHT   -2
 
#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN   -1
 
#define PRVM_EDICT_NUM(n)
 
#define PRVM_EDICT_TO_PROG(e)
 
#define PRVM_EDICTFIELDEDICT(ed, fieldoffset)
 
#define PRVM_EDICTFIELDFLOAT(ed, fieldoffset)
 
#define PRVM_EDICTFIELDFUNCTION(ed, fieldoffset)
 
#define PRVM_EDICTFIELDSTRING(ed, fieldoffset)
 
#define PRVM_EDICTFIELDVALUE(ed, fieldoffset)
 
#define PRVM_EDICTFIELDVECTOR(ed, fieldoffset)
 
#define PRVM_Free(buffer)
 
#define PRVM_G_EDICT(o)
 
#define PRVM_G_EDICTNUM(o)
 
#define PRVM_G_FLOAT(o)
 
#define PRVM_G_INT(o)
 
#define PRVM_G_STRING(o)
 
#define PRVM_G_VECTOR(o)
 
#define PRVM_gameedictedict(ed, fieldname)
 
#define PRVM_gameedictfloat(ed, fieldname)
 
#define PRVM_gameedictfunction(ed, fieldname)
 
#define PRVM_gameedictstring(ed, fieldname)
 
#define PRVM_gameedictvector(ed, fieldname)
 
#define PRVM_gamefunction(funcname)
 
#define PRVM_gameglobaledict(fieldname)
 
#define PRVM_gameglobalfloat(fieldname)
 
#define PRVM_gameglobalfunction(fieldname)
 
#define PRVM_gameglobalstring(fieldname)
 
#define PRVM_gameglobalvector(fieldname)
 
#define PRVM_GetProg(n)
 
#define PRVM_GLOBALFIELDEDICT(fieldoffset)
 
#define PRVM_GLOBALFIELDFLOAT(fieldoffset)
 
#define PRVM_GLOBALFIELDFUNCTION(fieldoffset)
 
#define PRVM_GLOBALFIELDSTRING(fieldoffset)
 
#define PRVM_GLOBALFIELDVALUE(fieldoffset)
 
#define PRVM_GLOBALFIELDVECTOR(fieldoffset)
 
#define PRVM_LOCALSTACK_SIZE   16384
 
#define PRVM_MAX_OPENFILES   256
 
#define PRVM_MAX_OPENSEARCHES   128
 
#define PRVM_MAX_STACK_DEPTH   1024
 
#define PRVM_menuedictedict(ed, fieldname)
 
#define PRVM_menuedictfloat(ed, fieldname)
 
#define PRVM_menuedictfunction(ed, fieldname)
 
#define PRVM_menuedictstring(ed, fieldname)
 
#define PRVM_menuedictvector(ed, fieldname)
 
#define PRVM_menufunction(funcname)
 
#define PRVM_menuglobaledict(fieldname)
 
#define PRVM_menuglobalfloat(fieldname)
 
#define PRVM_menuglobalfunction(fieldname)
 
#define PRVM_menuglobalstring(fieldname)
 
#define PRVM_menuglobalvector(fieldname)
 
#define PRVM_NEXT_EDICT(e)
 
#define PRVM_NUM_FOR_EDICT(e)
 
#define PRVM_OP_STATE   1
 
#define PRVM_PROG_TO_EDICT(n)
 
#define PRVM_ProgLoaded(n)
 
#define PRVM_serveredictedict(ed, fieldname)
 
#define PRVM_serveredictfloat(ed, fieldname)
 
#define PRVM_serveredictfunction(ed, fieldname)
 
#define PRVM_serveredictstring(ed, fieldname)
 
#define PRVM_serveredictvector(ed, fieldname)
 
#define PRVM_serverfunction(funcname)
 
#define PRVM_serverglobaledict(fieldname)
 
#define PRVM_serverglobalfloat(fieldname)
 
#define PRVM_serverglobalfunction(fieldname)
 
#define PRVM_serverglobalstring(fieldname)
 
#define PRVM_serverglobalvector(fieldname)
 
#define STRINGBUFFER_QCFLAGS   1
 
#define STRINGBUFFER_SAVED   1
 
#define STRINGBUFFER_TEMP   128
 
#define SVVM_prog   (&prvm_prog_list[PRVM_PROG_SERVER])
 

Typedefs

typedef void(* prvm_builtin_t) (struct prvm_prog_s *prog)
 

Enumerations

enum  prvm_prog_garbagecollection_state_stage_t {
  PRVM_GC_START = 0 , PRVM_GC_GLOBALS_MARK , PRVM_GC_FIELDS_MARK , PRVM_GC_KNOWNSTRINGS_SWEEP ,
  PRVM_GC_RESET
}
 
enum  prvm_progindex_t { PRVM_PROG_SERVER , PRVM_PROG_CLIENT , PRVM_PROG_MENU , PRVM_PROG_MAX }
 

Functions

void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage)
 
void CLVM_init_cmd (prvm_prog_t *prog)
 
void CLVM_reset_cmd (prvm_prog_t *prog)
 
const char * PRVM_AllocationOrigin (prvm_prog_t *prog)
 
int PRVM_AllocString (prvm_prog_t *prog, size_t bufferlength, char **pointer)
 
void PRVM_Breakpoint (prvm_prog_t *prog, int stack_index, const char *text)
 
void PRVM_CallProfile_f (struct cmd_state_s *cmd)
 
const char * PRVM_ChangeEngineString (prvm_prog_t *prog, int i, const char *s)
 
void PRVM_ChildProfile_f (struct cmd_state_s *cmd)
 
void PRVM_Crash (void)
 
prvm_edict_tPRVM_ED_Alloc (prvm_prog_t *prog)
 
void PRVM_ED_CallPostspawnFunction (prvm_prog_t *prog, prvm_edict_t *ent)
 
void PRVM_ED_CallPrespawnFunction (prvm_prog_t *prog, prvm_edict_t *ent)
 
qbool PRVM_ED_CallSpawnFunction (prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start)
 
qbool PRVM_ED_CanAlloc (prvm_prog_t *prog, prvm_edict_t *e)
 
void PRVM_ED_ClearEdict (prvm_prog_t *prog, prvm_edict_t *e)
 
mdef_tPRVM_ED_FieldAtOfs (prvm_prog_t *prog, unsigned int ofs)
 
mdef_tPRVM_ED_FindField (prvm_prog_t *prog, const char *name)
 
int PRVM_ED_FindFieldOffset (prvm_prog_t *prog, const char *name)
 
mfunction_tPRVM_ED_FindFunction (prvm_prog_t *prog, const char *name)
 
func_t PRVM_ED_FindFunctionOffset (prvm_prog_t *prog, const char *name)
 
mdef_tPRVM_ED_FindGlobal (prvm_prog_t *prog, const char *name)
 
prvm_eval_tPRVM_ED_FindGlobalEval (prvm_prog_t *prog, const char *name)
 
int PRVM_ED_FindGlobalOffset (prvm_prog_t *prog, const char *name)
 
void PRVM_ED_Free (prvm_prog_t *prog, prvm_edict_t *ed)
 
void PRVM_ED_LoadFromFile (prvm_prog_t *prog, const char *data)
 
const char * PRVM_ED_ParseEdict (prvm_prog_t *prog, const char *data, prvm_edict_t *ent, qbool saveload)
 
qbool PRVM_ED_ParseEpair (prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qbool parsebackslash)
 
void PRVM_ED_ParseGlobals (prvm_prog_t *prog, const char *data)
 
void PRVM_ED_Print (prvm_prog_t *prog, prvm_edict_t *ed, const char *wildcard_fieldname)
 
void PRVM_ED_PrintEdicts_f (struct cmd_state_s *cmd)
 
void PRVM_ED_PrintNum (prvm_prog_t *prog, int ent, const char *wildcard_fieldname)
 
void PRVM_ED_Write (prvm_prog_t *prog, struct qfile_s *f, prvm_edict_t *ed)
 
void PRVM_ED_WriteGlobals (prvm_prog_t *prog, struct qfile_s *f)
 
unsigned int PRVM_EDICT_NUM_ERROR (prvm_prog_t *prog, unsigned int n, const char *filename, int fileline)
 
void PRVM_ExplicitCoverageEvent (prvm_prog_t *prog, mfunction_t *func, int statement)
 
void PRVM_FreeString (prvm_prog_t *prog, int num)
 
prvm_prog_tPRVM_FriendlyProgFromString (const char *str)
 for console commands (prints error if name unknown and returns NULL, prints error if prog not loaded and returns NULL)
 
void PRVM_GarbageCollection (prvm_prog_t *prog)
 
const char * PRVM_GetString (prvm_prog_t *prog, int num)
 
char * PRVM_GlobalString (prvm_prog_t *prog, int ofs, char *line, size_t linelength)
 
char * PRVM_GlobalStringNoContents (prvm_prog_t *prog, int ofs, char *line, size_t linelength)
 
void PRVM_Init (void)
 
void PRVM_Init_Exec (prvm_prog_t *prog)
 
void PRVM_MEM_IncreaseEdicts (prvm_prog_t *prog)
 
void PRVM_PrintFunction_f (struct cmd_state_s *cmd)
 
void PRVM_PrintFunctionStatements (prvm_prog_t *prog, const char *name)
 
void PRVM_PrintState (prvm_prog_t *prog, int stack_index)
 
void PRVM_Profile (prvm_prog_t *prog, int maxfunctions, double mintime, int sortby)
 
void PRVM_Profile_f (struct cmd_state_s *cmd)
 
void PRVM_Prog_Init (prvm_prog_t *prog, struct cmd_state_s *cmd)
 Initializing a vm: Call InitProg with the num Set up the fields marked with [INIT] in the prog struct Load a program with LoadProgs NB: Load expects to be called right after Reset (which is called by Init)
 
void PRVM_Prog_Load (prvm_prog_t *prog, const char *filename, unsigned char *data, fs_offset_t size, void CheckRequiredFuncs(prvm_prog_t *prog, const char *filename), int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, prvm_required_field_t *required_global)
 
void PRVM_Prog_Reset (prvm_prog_t *prog)
 
prvm_prog_tPRVM_ProgFromString (const char *str)
 
int PRVM_SetEngineString (prvm_prog_t *prog, const char *s)
 
int PRVM_SetTempString (prvm_prog_t *prog, const char *s, size_t slen)
 Takes an strlen (not a buffer size).
 
void PRVM_ShortStackTrace (prvm_prog_t *prog, char *buf, size_t bufsize)
 
void PRVM_StackTrace (prvm_prog_t *prog)
 
char * PRVM_UglyValueString (prvm_prog_t *prog, etype_t type, prvm_eval_t *val, char *line, size_t linelength)
 
void PRVM_Watchpoint (prvm_prog_t *prog, int stack_index, const char *text, etype_t type, prvm_eval_t *o, prvm_eval_t *n)
 
void SVVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage)
 
void SVVM_init_cmd (prvm_prog_t *prog)
 
void SVVM_reset_cmd (prvm_prog_t *prog)
 
void VM_Cmd_Init (prvm_prog_t *prog)
 
void VM_Cmd_Reset (prvm_prog_t *prog)
 
void VM_FrameBlendFromFrameGroupBlend (struct frameblend_s *frameblend, const struct framegroupblend_s *framegroupblend, const struct model_s *model, double curtime)
 
void VM_GenerateFrameGroupBlend (prvm_prog_t *prog, struct framegroupblend_s *framegroupblend, const prvm_edict_t *ed)
 
void VM_RemoveEdictSkeleton (prvm_prog_t *prog, prvm_edict_t *ed)
 
void VM_UpdateEdictSkeleton (prvm_prog_t *prog, prvm_edict_t *ed, const struct model_s *edmodel, const struct frameblend_s *frameblend)
 
void VM_Warning (prvm_prog_t *prog, const char *fmt,...) DP_FUNC_PRINTF(2)
 

Variables

prvm_eval_t prvm_badvalue
 
prvm_prog_t prvm_prog_list [PRVM_PROG_MAX]
 
int prvm_type_size [8]
 for consistency : I think a goal of this sub-project is to make the new vm mostly independent from the old one, thus if it's necessary, I copy everything
 
prvm_builtin_t vm_cl_builtins []
 
const int vm_cl_numbuiltins
 
prvm_builtin_t vm_m_builtins []
 
const char * vm_m_extensions []
 
const int vm_m_numbuiltins
 
prvm_builtin_t vm_sv_builtins []
 
const char * vm_sv_extensions []
 client also uses this
 
const int vm_sv_numbuiltins
 

Macro Definition Documentation

◆ CLVM_prog

◆ KNOWNSTRINGFLAG_ENGINE

#define KNOWNSTRINGFLAG_ENGINE   1

◆ KNOWNSTRINGFLAG_GCMARK

#define KNOWNSTRINGFLAG_GCMARK   2

◆ KNOWNSTRINGFLAG_GCPRUNE

#define KNOWNSTRINGFLAG_GCPRUNE   4

Definition at line 512 of file progsvm.h.

Referenced by PRVM_GarbageCollection().

◆ PROFILING

#define PROFILING

Definition at line 47 of file progsvm.h.

◆ PRVM_alledictedict

#define PRVM_alledictedict ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDEDICT(ed, prog->fieldoffsets.fieldname))
#define PRVM_EDICTFIELDEDICT(ed, fieldoffset)
Definition progsvm.h:213

Definition at line 139 of file progsvm.h.

◆ PRVM_alledictfloat

#define PRVM_alledictfloat ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname))
#define PRVM_EDICTFIELDFLOAT(ed, fieldoffset)
Definition progsvm.h:210

Definition at line 136 of file progsvm.h.

◆ PRVM_alledictfunction

#define PRVM_alledictfunction ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFUNCTION(ed, prog->fieldoffsets.fieldname))
#define PRVM_EDICTFIELDFUNCTION(ed, fieldoffset)
Definition progsvm.h:214

Definition at line 140 of file progsvm.h.

◆ PRVM_alledictstring

#define PRVM_alledictstring ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDSTRING(ed, prog->fieldoffsets.fieldname))
#define PRVM_EDICTFIELDSTRING(ed, fieldoffset)
Definition progsvm.h:212

Definition at line 138 of file progsvm.h.

Referenced by PRVM_ED_CallSpawnFunction().

◆ PRVM_alledictvector

#define PRVM_alledictvector ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname))
#define PRVM_EDICTFIELDVECTOR(ed, fieldoffset)
Definition progsvm.h:211

Definition at line 137 of file progsvm.h.

◆ PRVM_allfunction

#define PRVM_allfunction ( funcname)
Value:
(prog->funcoffsets.funcname)

Definition at line 146 of file progsvm.h.

Referenced by PRVM_GameCommand(), uri_to_string_callback(), and VM_uri_get().

◆ PRVM_allglobaledict

#define PRVM_allglobaledict ( fieldname)
Value:
(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname))
#define PRVM_GLOBALFIELDEDICT(fieldoffset)
Definition progsvm.h:219

Definition at line 144 of file progsvm.h.

Referenced by CLVM_ExecuteProgram(), PRVM_ED_CallSpawnFunction(), SVVM_ExecuteProgram(), VM_error(), and VM_objerror().

◆ PRVM_allglobalfloat

#define PRVM_allglobalfloat ( fieldname)
Value:
(PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.fieldname))
#define PRVM_GLOBALFIELDFLOAT(fieldoffset)
Definition progsvm.h:216

Definition at line 141 of file progsvm.h.

Referenced by PRVM_ED_CallSpawnFunction().

◆ PRVM_allglobalfunction

#define PRVM_allglobalfunction ( fieldname)
Value:
(PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname))
#define PRVM_GLOBALFIELDFUNCTION(fieldoffset)
Definition progsvm.h:220

Definition at line 145 of file progsvm.h.

◆ PRVM_allglobalstring

#define PRVM_allglobalstring ( fieldname)
Value:
(PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname))
#define PRVM_GLOBALFIELDSTRING(fieldoffset)
Definition progsvm.h:218

Definition at line 143 of file progsvm.h.

◆ PRVM_allglobalvector

#define PRVM_allglobalvector ( fieldname)
Value:
(PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.fieldname))
#define PRVM_GLOBALFIELDVECTOR(fieldoffset)
Definition progsvm.h:217

Definition at line 142 of file progsvm.h.

◆ PRVM_Alloc

#define PRVM_Alloc ( buffersize)
Value:
Mem_Alloc(prog->progs_mempool, buffersize)
#define Mem_Alloc(pool, size)
Definition zone.h:92

Definition at line 818 of file progsvm.h.

Referenced by PRVM_AllocationOrigin(), PRVM_AllocString(), and PRVM_NewKnownString().

◆ PRVM_clientedictedict

#define PRVM_clientedictedict ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDEDICT(ed, prog->fieldoffsets.fieldname))

Definition at line 187 of file progsvm.h.

Referenced by CL_GetTagMatrix(), CL_movestep(), CL_TraceBox(), CL_TraceLine(), CL_TracePoint(), VM_CL_droptofloor(), and VM_CL_setattachment().

◆ PRVM_clientedictfloat

◆ PRVM_clientedictfunction

#define PRVM_clientedictfunction ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFUNCTION(ed, prog->fieldoffsets.fieldname))

Definition at line 188 of file progsvm.h.

Referenced by CL_VM_TransformView(), CSQC_Predraw(), CSQC_Think(), and PRVM_IsEdictRelevant().

◆ PRVM_clientedictstring

#define PRVM_clientedictstring ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDSTRING(ed, prog->fieldoffsets.fieldname))

Definition at line 186 of file progsvm.h.

Referenced by CL_VM_Init(), CLVM_count_edicts(), PRVM_IsEdictRelevant(), VM_CL_setmodel(), and VM_CL_setmodelindex().

◆ PRVM_clientedictvector

◆ PRVM_clientfunction

◆ PRVM_clientglobaledict

◆ PRVM_clientglobalfloat

◆ PRVM_clientglobalfunction

#define PRVM_clientglobalfunction ( fieldname)
Value:
(PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname))

Definition at line 193 of file progsvm.h.

◆ PRVM_clientglobalstring

#define PRVM_clientglobalstring ( fieldname)
Value:
(PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname))

Definition at line 191 of file progsvm.h.

Referenced by CL_VM_Init(), and VM_CL_gettaginfo().

◆ PRVM_clientglobalvector

◆ PRVM_CSQC_SIMPLE

#define PRVM_CSQC_SIMPLE   2

Definition at line 239 of file progsvm.h.

Referenced by CL_CheckRequiredFuncs(), CL_UpdateWorld(), PRVM_Prog_Load(), and SCR_DrawScreen().

◆ PRVM_DECLARE_clientfieldedict [1/3]

#define PRVM_DECLARE_clientfieldedict ( x)

Definition at line 284 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldedict [2/3]

#define PRVM_DECLARE_clientfieldedict ( x)

Definition at line 284 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldedict [3/3]

#define PRVM_DECLARE_clientfieldedict ( x)

Definition at line 284 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldfloat [1/3]

#define PRVM_DECLARE_clientfieldfloat ( x)

Definition at line 281 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldfloat [2/3]

#define PRVM_DECLARE_clientfieldfloat ( x)

Definition at line 281 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldfloat [3/3]

#define PRVM_DECLARE_clientfieldfloat ( x)

Definition at line 281 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldfunction [1/3]

#define PRVM_DECLARE_clientfieldfunction ( x)

Definition at line 285 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldfunction [2/3]

#define PRVM_DECLARE_clientfieldfunction ( x)

Definition at line 285 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldfunction [3/3]

#define PRVM_DECLARE_clientfieldfunction ( x)

Definition at line 285 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldstring [1/3]

#define PRVM_DECLARE_clientfieldstring ( x)

Definition at line 283 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldstring [2/3]

#define PRVM_DECLARE_clientfieldstring ( x)

Definition at line 283 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldstring [3/3]

#define PRVM_DECLARE_clientfieldstring ( x)

Definition at line 283 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldvector [1/3]

#define PRVM_DECLARE_clientfieldvector ( x)

Definition at line 282 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldvector [2/3]

#define PRVM_DECLARE_clientfieldvector ( x)

Definition at line 282 of file progsvm.h.

◆ PRVM_DECLARE_clientfieldvector [3/3]

#define PRVM_DECLARE_clientfieldvector ( x)

Definition at line 282 of file progsvm.h.

◆ PRVM_DECLARE_clientfunction [1/3]

#define PRVM_DECLARE_clientfunction ( x)

Definition at line 292 of file progsvm.h.

◆ PRVM_DECLARE_clientfunction [2/3]

#define PRVM_DECLARE_clientfunction ( x)

Definition at line 292 of file progsvm.h.

◆ PRVM_DECLARE_clientfunction [3/3]

#define PRVM_DECLARE_clientfunction ( x)

Definition at line 292 of file progsvm.h.

◆ PRVM_DECLARE_clientglobaledict [1/3]

#define PRVM_DECLARE_clientglobaledict ( x)

Definition at line 269 of file progsvm.h.

◆ PRVM_DECLARE_clientglobaledict [2/3]

#define PRVM_DECLARE_clientglobaledict ( x)

Definition at line 269 of file progsvm.h.

◆ PRVM_DECLARE_clientglobaledict [3/3]

#define PRVM_DECLARE_clientglobaledict ( x)

Definition at line 269 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalfloat [1/3]

#define PRVM_DECLARE_clientglobalfloat ( x)

Definition at line 266 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalfloat [2/3]

#define PRVM_DECLARE_clientglobalfloat ( x)

Definition at line 266 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalfloat [3/3]

#define PRVM_DECLARE_clientglobalfloat ( x)

Definition at line 266 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalfunction [1/3]

#define PRVM_DECLARE_clientglobalfunction ( x)

Definition at line 270 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalfunction [2/3]

#define PRVM_DECLARE_clientglobalfunction ( x)

Definition at line 270 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalfunction [3/3]

#define PRVM_DECLARE_clientglobalfunction ( x)

Definition at line 270 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalstring [1/3]

#define PRVM_DECLARE_clientglobalstring ( x)

Definition at line 268 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalstring [2/3]

#define PRVM_DECLARE_clientglobalstring ( x)

Definition at line 268 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalstring [3/3]

#define PRVM_DECLARE_clientglobalstring ( x)

Definition at line 268 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalvector [1/3]

#define PRVM_DECLARE_clientglobalvector ( x)

Definition at line 267 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalvector [2/3]

#define PRVM_DECLARE_clientglobalvector ( x)

Definition at line 267 of file progsvm.h.

◆ PRVM_DECLARE_clientglobalvector [3/3]

#define PRVM_DECLARE_clientglobalvector ( x)

Definition at line 267 of file progsvm.h.

◆ PRVM_DECLARE_field [1/3]

#define PRVM_DECLARE_field ( x)
Value:
int x;
GLint GLenum GLint x
Definition glquake.h:651

Definition at line 294 of file progsvm.h.

◆ PRVM_DECLARE_field [2/3]

#define PRVM_DECLARE_field ( x)

Definition at line 294 of file progsvm.h.

◆ PRVM_DECLARE_field [3/3]

#define PRVM_DECLARE_field ( x)

Definition at line 294 of file progsvm.h.

◆ PRVM_DECLARE_function [1/3]

#define PRVM_DECLARE_function ( x)

Definition at line 296 of file progsvm.h.

◆ PRVM_DECLARE_function [2/3]

#define PRVM_DECLARE_function ( x)

Definition at line 296 of file progsvm.h.

◆ PRVM_DECLARE_function [3/3]

#define PRVM_DECLARE_function ( x)
Value:
int x;

Definition at line 296 of file progsvm.h.

◆ PRVM_DECLARE_global [1/3]

#define PRVM_DECLARE_global ( x)

Definition at line 295 of file progsvm.h.

◆ PRVM_DECLARE_global [2/3]

#define PRVM_DECLARE_global ( x)
Value:
int x;

Definition at line 295 of file progsvm.h.

◆ PRVM_DECLARE_global [3/3]

#define PRVM_DECLARE_global ( x)

Definition at line 295 of file progsvm.h.

◆ PRVM_DECLARE_menufieldedict [1/3]

#define PRVM_DECLARE_menufieldedict ( x)

Definition at line 289 of file progsvm.h.

◆ PRVM_DECLARE_menufieldedict [2/3]

#define PRVM_DECLARE_menufieldedict ( x)

Definition at line 289 of file progsvm.h.

◆ PRVM_DECLARE_menufieldedict [3/3]

#define PRVM_DECLARE_menufieldedict ( x)

Definition at line 289 of file progsvm.h.

◆ PRVM_DECLARE_menufieldfloat [1/3]

#define PRVM_DECLARE_menufieldfloat ( x)

Definition at line 286 of file progsvm.h.

◆ PRVM_DECLARE_menufieldfloat [2/3]

#define PRVM_DECLARE_menufieldfloat ( x)

Definition at line 286 of file progsvm.h.

◆ PRVM_DECLARE_menufieldfloat [3/3]

#define PRVM_DECLARE_menufieldfloat ( x)

Definition at line 286 of file progsvm.h.

◆ PRVM_DECLARE_menufieldfunction [1/3]

#define PRVM_DECLARE_menufieldfunction ( x)

Definition at line 290 of file progsvm.h.

◆ PRVM_DECLARE_menufieldfunction [2/3]

#define PRVM_DECLARE_menufieldfunction ( x)

Definition at line 290 of file progsvm.h.

◆ PRVM_DECLARE_menufieldfunction [3/3]

#define PRVM_DECLARE_menufieldfunction ( x)

Definition at line 290 of file progsvm.h.

◆ PRVM_DECLARE_menufieldstring [1/3]

#define PRVM_DECLARE_menufieldstring ( x)

Definition at line 288 of file progsvm.h.

◆ PRVM_DECLARE_menufieldstring [2/3]

#define PRVM_DECLARE_menufieldstring ( x)

Definition at line 288 of file progsvm.h.

◆ PRVM_DECLARE_menufieldstring [3/3]

#define PRVM_DECLARE_menufieldstring ( x)

Definition at line 288 of file progsvm.h.

◆ PRVM_DECLARE_menufieldvector [1/3]

#define PRVM_DECLARE_menufieldvector ( x)

Definition at line 287 of file progsvm.h.

◆ PRVM_DECLARE_menufieldvector [2/3]

#define PRVM_DECLARE_menufieldvector ( x)

Definition at line 287 of file progsvm.h.

◆ PRVM_DECLARE_menufieldvector [3/3]

#define PRVM_DECLARE_menufieldvector ( x)

Definition at line 287 of file progsvm.h.

◆ PRVM_DECLARE_menufunction [1/3]

#define PRVM_DECLARE_menufunction ( x)

Definition at line 293 of file progsvm.h.

◆ PRVM_DECLARE_menufunction [2/3]

#define PRVM_DECLARE_menufunction ( x)

Definition at line 293 of file progsvm.h.

◆ PRVM_DECLARE_menufunction [3/3]

#define PRVM_DECLARE_menufunction ( x)

Definition at line 293 of file progsvm.h.

◆ PRVM_DECLARE_menuglobaledict [1/3]

#define PRVM_DECLARE_menuglobaledict ( x)

Definition at line 274 of file progsvm.h.

◆ PRVM_DECLARE_menuglobaledict [2/3]

#define PRVM_DECLARE_menuglobaledict ( x)

Definition at line 274 of file progsvm.h.

◆ PRVM_DECLARE_menuglobaledict [3/3]

#define PRVM_DECLARE_menuglobaledict ( x)

Definition at line 274 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalfloat [1/3]

#define PRVM_DECLARE_menuglobalfloat ( x)

Definition at line 271 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalfloat [2/3]

#define PRVM_DECLARE_menuglobalfloat ( x)

Definition at line 271 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalfloat [3/3]

#define PRVM_DECLARE_menuglobalfloat ( x)

Definition at line 271 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalfunction [1/3]

#define PRVM_DECLARE_menuglobalfunction ( x)

Definition at line 275 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalfunction [2/3]

#define PRVM_DECLARE_menuglobalfunction ( x)

Definition at line 275 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalfunction [3/3]

#define PRVM_DECLARE_menuglobalfunction ( x)

Definition at line 275 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalstring [1/3]

#define PRVM_DECLARE_menuglobalstring ( x)

Definition at line 273 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalstring [2/3]

#define PRVM_DECLARE_menuglobalstring ( x)

Definition at line 273 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalstring [3/3]

#define PRVM_DECLARE_menuglobalstring ( x)

Definition at line 273 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalvector [1/3]

#define PRVM_DECLARE_menuglobalvector ( x)

Definition at line 272 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalvector [2/3]

#define PRVM_DECLARE_menuglobalvector ( x)

Definition at line 272 of file progsvm.h.

◆ PRVM_DECLARE_menuglobalvector [3/3]

#define PRVM_DECLARE_menuglobalvector ( x)

Definition at line 272 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldedict [1/3]

#define PRVM_DECLARE_serverfieldedict ( x)

Definition at line 279 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldedict [2/3]

#define PRVM_DECLARE_serverfieldedict ( x)

Definition at line 279 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldedict [3/3]

#define PRVM_DECLARE_serverfieldedict ( x)

Definition at line 279 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldfloat [1/3]

#define PRVM_DECLARE_serverfieldfloat ( x)

Definition at line 276 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldfloat [2/3]

#define PRVM_DECLARE_serverfieldfloat ( x)

Definition at line 276 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldfloat [3/3]

#define PRVM_DECLARE_serverfieldfloat ( x)

Definition at line 276 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldfunction [1/3]

#define PRVM_DECLARE_serverfieldfunction ( x)

Definition at line 280 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldfunction [2/3]

#define PRVM_DECLARE_serverfieldfunction ( x)

Definition at line 280 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldfunction [3/3]

#define PRVM_DECLARE_serverfieldfunction ( x)

Definition at line 280 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldstring [1/3]

#define PRVM_DECLARE_serverfieldstring ( x)

Definition at line 278 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldstring [2/3]

#define PRVM_DECLARE_serverfieldstring ( x)

Definition at line 278 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldstring [3/3]

#define PRVM_DECLARE_serverfieldstring ( x)

Definition at line 278 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldvector [1/3]

#define PRVM_DECLARE_serverfieldvector ( x)

Definition at line 277 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldvector [2/3]

#define PRVM_DECLARE_serverfieldvector ( x)

Definition at line 277 of file progsvm.h.

◆ PRVM_DECLARE_serverfieldvector [3/3]

#define PRVM_DECLARE_serverfieldvector ( x)

Definition at line 277 of file progsvm.h.

◆ PRVM_DECLARE_serverfunction [1/3]

#define PRVM_DECLARE_serverfunction ( x)

Definition at line 291 of file progsvm.h.

◆ PRVM_DECLARE_serverfunction [2/3]

#define PRVM_DECLARE_serverfunction ( x)

Definition at line 291 of file progsvm.h.

◆ PRVM_DECLARE_serverfunction [3/3]

#define PRVM_DECLARE_serverfunction ( x)

Definition at line 291 of file progsvm.h.

◆ PRVM_DECLARE_serverglobaledict [1/3]

#define PRVM_DECLARE_serverglobaledict ( x)

Definition at line 264 of file progsvm.h.

◆ PRVM_DECLARE_serverglobaledict [2/3]

#define PRVM_DECLARE_serverglobaledict ( x)

Definition at line 264 of file progsvm.h.

◆ PRVM_DECLARE_serverglobaledict [3/3]

#define PRVM_DECLARE_serverglobaledict ( x)

Definition at line 264 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalfloat [1/3]

#define PRVM_DECLARE_serverglobalfloat ( x)

Definition at line 261 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalfloat [2/3]

#define PRVM_DECLARE_serverglobalfloat ( x)

Definition at line 261 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalfloat [3/3]

#define PRVM_DECLARE_serverglobalfloat ( x)

Definition at line 261 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalfunction [1/3]

#define PRVM_DECLARE_serverglobalfunction ( x)

Definition at line 265 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalfunction [2/3]

#define PRVM_DECLARE_serverglobalfunction ( x)

Definition at line 265 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalfunction [3/3]

#define PRVM_DECLARE_serverglobalfunction ( x)

Definition at line 265 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalstring [1/3]

#define PRVM_DECLARE_serverglobalstring ( x)

Definition at line 263 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalstring [2/3]

#define PRVM_DECLARE_serverglobalstring ( x)

Definition at line 263 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalstring [3/3]

#define PRVM_DECLARE_serverglobalstring ( x)

Definition at line 263 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalvector [1/3]

#define PRVM_DECLARE_serverglobalvector ( x)

Definition at line 262 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalvector [2/3]

#define PRVM_DECLARE_serverglobalvector ( x)

Definition at line 262 of file progsvm.h.

◆ PRVM_DECLARE_serverglobalvector [3/3]

#define PRVM_DECLARE_serverglobalvector ( x)

Definition at line 262 of file progsvm.h.

◆ PRVM_drawedictedict

#define PRVM_drawedictedict ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDEDICT(ed, prog->fieldoffsets.fieldname))

Definition at line 151 of file progsvm.h.

◆ PRVM_drawedictfloat

#define PRVM_drawedictfloat ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname))

Definition at line 148 of file progsvm.h.

◆ PRVM_drawedictfunction

#define PRVM_drawedictfunction ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFUNCTION(ed, prog->fieldoffsets.fieldname))

Definition at line 152 of file progsvm.h.

◆ PRVM_drawedictstring

#define PRVM_drawedictstring ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDSTRING(ed, prog->fieldoffsets.fieldname))

Definition at line 150 of file progsvm.h.

◆ PRVM_drawedictvector

#define PRVM_drawedictvector ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname))

Definition at line 149 of file progsvm.h.

◆ PRVM_drawfunction

#define PRVM_drawfunction ( funcname)
Value:
(prog->funcoffsets.funcname)

Definition at line 158 of file progsvm.h.

◆ PRVM_drawglobaledict

#define PRVM_drawglobaledict ( fieldname)
Value:
(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname))

Definition at line 156 of file progsvm.h.

◆ PRVM_drawglobalfloat

#define PRVM_drawglobalfloat ( fieldname)
Value:
(PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.fieldname))

Definition at line 153 of file progsvm.h.

Referenced by getdrawfont().

◆ PRVM_drawglobalfunction

#define PRVM_drawglobalfunction ( fieldname)
Value:
(PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname))

Definition at line 157 of file progsvm.h.

◆ PRVM_drawglobalstring

#define PRVM_drawglobalstring ( fieldname)
Value:
(PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname))

Definition at line 155 of file progsvm.h.

◆ PRVM_drawglobalvector

#define PRVM_drawglobalvector ( fieldname)
Value:
(PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.fieldname))

Definition at line 154 of file progsvm.h.

Referenced by getdrawfontscale().

◆ PRVM_E_FLOAT

#define PRVM_E_FLOAT ( e,
o )
Value:
(e->fields.fp[o])

Definition at line 891 of file progsvm.h.

Referenced by VM_findchainflags(), VM_findchainfloat(), VM_findflags(), VM_findfloat(), and VM_SV_UpdateCustomStats().

◆ PRVM_E_INT

#define PRVM_E_INT ( e,
o )
Value:
(e->fields.ip[o])

Definition at line 892 of file progsvm.h.

◆ PRVM_E_STRING

#define PRVM_E_STRING ( e,
o )
Value:
(PRVM_GetString(prog, e->fields.ip[o]))
const char * PRVM_GetString(prvm_prog_t *prog, int num)

Definition at line 894 of file progsvm.h.

Referenced by VM_find(), VM_findchain(), and VM_SV_UpdateCustomStats().

◆ PRVM_ED_FindFieldOffset_FromStruct

#define PRVM_ED_FindFieldOffset_FromStruct ( st,
field )
Value:
prog->fieldoffsets . field = ((int *)(&((st *)NULL)-> field ) - ((int *)NULL))
#define NULL
Definition qtypes.h:12

Definition at line 841 of file progsvm.h.

Referenced by SV_VM_Setup().

◆ PRVM_ED_FindGlobalOffset_FromStruct

#define PRVM_ED_FindGlobalOffset_FromStruct ( st,
field )
Value:
prog->globaloffsets . field = ((int *)(&((st *)NULL)-> field ) - ((int *)NULL))

Definition at line 842 of file progsvm.h.

Referenced by SV_VM_Setup().

◆ PRVM_EDICT

#define PRVM_EDICT ( n)
Value:
(((unsigned)(n) < (unsigned int)prog->max_edicts) ? (unsigned int)(n) : PRVM_EDICT_NUM_ERROR(prog, (unsigned int)(n), __FILE__, __LINE__))
#define n(x, y)
static int(ZEXPORT *qz_inflate)(z_stream *strm
unsigned int PRVM_EDICT_NUM_ERROR(prvm_prog_t *prog, unsigned int n, const char *filename, int fileline)

Definition at line 866 of file progsvm.h.

Referenced by CSQC_ReadEntities().

◆ PRVM_EDICT_MARK_SETORIGIN_CAUGHT

#define PRVM_EDICT_MARK_SETORIGIN_CAUGHT   -2

Definition at line 79 of file progsvm.h.

Referenced by SV_Impact(), VM_CL_setorigin(), and VM_SV_setorigin().

◆ PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN

#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN   -1

Definition at line 78 of file progsvm.h.

Referenced by SV_Impact(), VM_CL_setorigin(), and VM_SV_setorigin().

◆ PRVM_EDICT_NUM

◆ PRVM_EDICT_TO_PROG

◆ PRVM_EDICTFIELDEDICT

#define PRVM_EDICTFIELDEDICT ( ed,
fieldoffset )
Value:
(PRVM_EDICTFIELDVALUE(ed, fieldoffset)->edict)
#define PRVM_EDICTFIELDVALUE(ed, fieldoffset)
Definition progsvm.h:209

Definition at line 213 of file progsvm.h.

Referenced by PRVM_IsEdictReferenced(), VM_CL_findbox(), VM_CL_findradius(), VM_findchain(), VM_findchainflags(), VM_findchainfloat(), VM_SV_findbox(), and VM_SV_findradius().

◆ PRVM_EDICTFIELDFLOAT

#define PRVM_EDICTFIELDFLOAT ( ed,
fieldoffset )
Value:
(PRVM_EDICTFIELDVALUE(ed, fieldoffset)->_float)

Definition at line 210 of file progsvm.h.

◆ PRVM_EDICTFIELDFUNCTION

#define PRVM_EDICTFIELDFUNCTION ( ed,
fieldoffset )
Value:
(PRVM_EDICTFIELDVALUE(ed, fieldoffset)->function)

Definition at line 214 of file progsvm.h.

◆ PRVM_EDICTFIELDSTRING

#define PRVM_EDICTFIELDSTRING ( ed,
fieldoffset )
Value:
(PRVM_EDICTFIELDVALUE(ed, fieldoffset)->string)

Definition at line 212 of file progsvm.h.

Referenced by PRVM_IsStringReferenced().

◆ PRVM_EDICTFIELDVALUE

#define PRVM_EDICTFIELDVALUE ( ed,
fieldoffset )
Value:
((fieldoffset) < 0 ? Con_Printf("Invalid fieldoffset at %s:%i\n", __FILE__, __LINE__), &prvm_badvalue : (prvm_eval_t *)((ed)->fields.fp + (fieldoffset)))
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
prvm_eval_t prvm_badvalue
Definition prvm_edict.c:31

Definition at line 209 of file progsvm.h.

Referenced by PRVM_UpdateBreakpoints(), and while().

◆ PRVM_EDICTFIELDVECTOR

#define PRVM_EDICTFIELDVECTOR ( ed,
fieldoffset )
Value:
(PRVM_EDICTFIELDVALUE(ed, fieldoffset)->vector)

Definition at line 211 of file progsvm.h.

◆ PRVM_Free

#define PRVM_Free ( buffer)
Value:
GLuint buffer
Definition glquake.h:630
#define Mem_Free(mem)
Definition zone.h:96

Definition at line 819 of file progsvm.h.

Referenced by BufStr_Del(), PRVM_FreeString(), VM_fclose(), and VM_search_end().

◆ PRVM_G_EDICT

◆ PRVM_G_EDICTNUM

◆ PRVM_G_FLOAT

#define PRVM_G_FLOAT ( o)
Value:
(prog->globals.fp[o])

Definition at line 882 of file progsvm.h.

Referenced by CL_VM_DrawHud(), CL_VM_Event_Sound(), CL_VM_Init(), CL_VM_InputEvent(), CL_VM_UpdateView(), CSQC_ReadEntities(), EntityFrameCSQC_WriteFrame(), MP_Draw(), PRVM_ConsoleCommand(), SV_CheckContentsTransition(), SV_MarkWriteEntityStateToClient(), uri_to_string_callback(), VM_acos(), VM_altstr_count(), VM_altstr_get(), VM_altstr_ins(), VM_altstr_set(), VM_argv(), VM_argv_end_index(), VM_argv_start_index(), VM_asin(), VM_atan(), VM_atan2(), VM_bitshift(), VM_bound(), VM_buf_copy(), VM_buf_create(), VM_buf_cvarlist(), VM_buf_del(), VM_buf_getsize(), VM_buf_implode(), VM_buf_loadfile(), VM_buf_sort(), VM_buf_writefile(), VM_bufstr_add(), VM_bufstr_find(), VM_bufstr_free(), VM_bufstr_get(), VM_bufstr_set(), VM_ceil(), VM_checkextension(), VM_chr(), VM_chr2str(), VM_cin_getstate(), VM_cin_open(), VM_cin_setstate(), VM_CL_ambientsound(), VM_CL_boxparticles(), VM_CL_checkbottom(), VM_CL_checkpvs(), VM_CL_droptofloor(), VM_CL_effect(), VM_CL_findradius(), VM_CL_frameduration(), VM_CL_frameforname(), VM_CL_GetEntity(), VM_CL_getinputstate(), VM_CL_getlight(), VM_CL_getplayerkey(), VM_CL_getstatf(), VM_CL_getstati(), VM_CL_getstats(), VM_CL_gettagindex(), VM_CL_gettaginfo(), VM_CL_InitParticleSpawner(), VM_CL_isdemo(), VM_CL_lightstyle(), VM_CL_modelnameforindex(), VM_CL_particle(), VM_CL_particleeffectnum(), VM_CL_ParticleTheme(), VM_CL_ParticleThemeFree(), VM_CL_ParticleThemeSave(), VM_CL_pointcontents(), VM_CL_pointparticles(), VM_CL_pointsound(), VM_CL_precache_model(), VM_CL_R_AddDynamicLight(), VM_CL_R_AddEntities(), VM_CL_R_PolygonBegin(), VM_CL_R_PolygonVertex(), VM_CL_R_SetView(), VM_CL_ReadAngle(), VM_CL_ReadByte(), VM_CL_ReadChar(), VM_CL_ReadCoord(), VM_CL_ReadFloat(), VM_CL_ReadLong(), VM_CL_ReadShort(), VM_CL_setcursormode(), VM_CL_setmodelindex(), VM_CL_setpause(), VM_CL_setsensitivityscale(), VM_CL_skel_build(), VM_CL_skel_copybones(), VM_CL_skel_create(), VM_CL_skel_delete(), VM_CL_skel_find_bone(), VM_CL_skel_get_boneabs(), VM_CL_skel_get_bonename(), VM_CL_skel_get_boneparent(), VM_CL_skel_get_bonerel(), VM_CL_skel_get_numbones(), VM_CL_skel_mul_bone(), VM_CL_skel_mul_bones(), VM_CL_skel_set_bone(), VM_CL_sound(), VM_CL_SpawnParticle(), VM_CL_SpawnParticleDelayed(), VM_CL_te_blood(), VM_CL_te_bloodshower(), VM_CL_te_customflash(), VM_CL_te_explosion2(), VM_CL_te_flamejet(), VM_CL_te_particlecube(), VM_CL_te_particlerain(), VM_CL_te_particlesnow(), VM_CL_te_spark(), VM_CL_tracebox(), VM_CL_traceline(), VM_CL_trailparticles(), VM_CL_V_CalcRefdef(), VM_CL_videoplaying(), VM_CL_walkmove(), VM_clientcount(), VM_clientstate(), VM_cos(), VM_crc16(), VM_cvar(), VM_cvar_type(), VM_drawcharacter(), VM_drawcolorcodedstring(), VM_drawfill(), VM_drawline(), VM_drawpic(), VM_drawrotpic(), VM_drawsetcliparea(), VM_drawstring(), VM_drawsubpic(), VM_entityfieldname(), VM_entityfieldtype(), VM_etof(), VM_fabs(), VM_fclose(), VM_fgets(), VM_findchainflags(), VM_findchainfloat(), VM_findflags(), VM_findfloat(), VM_findfont(), VM_findkeysforcommand(), VM_floor(), VM_fopen(), VM_fputs(), VM_ftoe(), VM_ftos(), VM_gecko_create(), VM_gecko_keyevent(), VM_getentityfieldstring(), VM_getkeybind(), VM_getostype(), VM_getsoundtime(), VM_getsurfaceclippedpoint(), VM_getsurfacenearpoint(), VM_getsurfacenormal(), VM_getsurfacenumpoints(), VM_getsurfacenumtriangles(), VM_getsurfacepoint(), VM_getsurfacepointattribute(), VM_getsurfacetexture(), VM_getsurfacetriangle(), VM_gettime(), VM_iscachedpic(), VM_isfunction(), VM_isserver(), VM_itof(), VM_keynumtostring(), VM_loadfont(), VM_loadfromfile(), VM_localsound(), VM_log(), VM_M_crypto_getidstatus(), VM_M_crypto_getmyidfp(), VM_M_crypto_getmyidstatus(), VM_M_crypto_getmykeyfp(), VM_M_getgamedirinfo(), VM_M_getkeydest(), VM_M_getmousetarget(), VM_M_getresolution(), VM_M_getserverlistindexforkey(), VM_M_getserverlistnumber(), VM_M_getserverliststat(), VM_M_getserverliststring(), VM_M_refreshserverlist(), VM_M_setkeydest(), VM_M_setmousetarget(), VM_M_setserverlistmasknumber(), VM_M_setserverlistmaskstring(), VM_M_setserverlistsort(), VM_M_WriteAngle(), VM_M_WriteByte(), VM_M_WriteChar(), VM_M_WriteCoord(), VM_M_WriteDest(), VM_M_WriteLong(), VM_M_WriteShort(), VM_matchpattern(), VM_max(), VM_min(), VM_modulo(), VM_netaddress_resolve(), VM_nudgeoutofsolid(), VM_numentityfields(), VM_physics_enable(), VM_pow(), VM_precache_pic(), VM_putentityfieldstring(), VM_random(), VM_registercvar(), VM_rint(), VM_search_begin(), VM_search_end(), VM_search_getfilename(), VM_search_getsize(), VM_setbindmaps(), VM_setkeybind(), VM_sin(), VM_soundlength(), VM_sprint(), VM_sqrt(), VM_stof(), VM_str2chr(), VM_strconv(), VM_strftime(), VM_stringtokeynum(), VM_stringwidth(), VM_strlen(), VM_strlennocol(), VM_strncasecmp(), VM_strncmp(), VM_strpad(), VM_strstrofs(), VM_substring(), VM_SV_AddStat(), VM_SV_ambientsound(), VM_SV_checkbottom(), VM_SV_checkpvs(), VM_SV_clienttype(), VM_SV_droptofloor(), VM_SV_effect(), VM_SV_findradius(), VM_SV_frameduration(), VM_SV_frameforname(), VM_SV_gettagindex(), VM_SV_gettaginfo(), VM_SV_lightstyle(), VM_SV_modelnameforindex(), VM_SV_MoveToGoal(), VM_SV_particle(), VM_SV_particleeffectnum(), VM_SV_pointcontents(), VM_SV_pointparticles(), VM_SV_pointsound(), VM_SV_precache_sound(), VM_SV_setcolor(), VM_SV_setmodelindex(), VM_SV_setpause(), VM_SV_skel_build(), VM_SV_skel_copybones(), VM_SV_skel_create(), VM_SV_skel_delete(), VM_SV_skel_find_bone(), VM_SV_skel_get_boneabs(), VM_SV_skel_get_bonename(), VM_SV_skel_get_boneparent(), VM_SV_skel_get_bonerel(), VM_SV_skel_get_numbones(), VM_SV_skel_mul_bone(), VM_SV_skel_mul_bones(), VM_SV_skel_set_bone(), VM_SV_sound(), VM_SV_te_blood(), VM_SV_te_bloodshower(), VM_SV_te_customflash(), VM_SV_te_explosion2(), VM_SV_te_flamejet(), VM_SV_te_particlecube(), VM_SV_te_particlerain(), VM_SV_te_particlesnow(), VM_SV_te_spark(), VM_SV_tracebox(), VM_SV_traceline(), VM_SV_trailparticles(), VM_SV_walkmove(), VM_SV_WriteAngle(), VM_SV_WriteByte(), VM_SV_WriteChar(), VM_SV_WriteCoord(), VM_SV_WriteLong(), VM_SV_WritePicture(), VM_SV_WriteShort(), VM_tan(), VM_tokenize(), VM_tokenize_console(), VM_tokenizebyseparator(), VM_uri_get(), VM_vectoyaw(), VM_vlen(), VM_wasfreed(), VM_writetofile(), and WriteDest().

◆ PRVM_G_INT

#define PRVM_G_INT ( o)
Value:
(prog->globals.ip[o])

Definition at line 883 of file progsvm.h.

Referenced by CL_VM_Event_Sound(), CL_VM_Init(), CL_VM_Parse_CenterPrint(), CL_VM_Parse_Print(), CL_VM_Parse_StuffCmd(), CSQC_ReadEntities(), EntityFrameCSQC_WriteFrame(), PRVM_ConsoleCommand(), PRVM_GameCommand(), SV_ReadClientMessage(), uri_to_string_callback(), VM_altstr_get(), VM_altstr_ins(), VM_altstr_prepare(), VM_altstr_set(), VM_argv(), VM_buf_implode(), VM_bufstr_add(), VM_bufstr_get(), VM_chr(), VM_chr2str(), VM_CL_findbox(), VM_CL_findradius(), VM_CL_getextresponse(), VM_CL_getplayerkey(), VM_CL_getstats(), VM_CL_modelnameforindex(), VM_CL_ReadPicture(), VM_CL_ReadString(), VM_CL_serverkey(), VM_CL_skel_get_bonename(), VM_cvar_defstring(), VM_cvar_description(), VM_cvar_string(), VM_digest_hex(), VM_entityfieldname(), VM_etos(), VM_fgets(), VM_find(), VM_findchain(), VM_findchainflags(), VM_findchainfloat(), VM_findflags(), VM_findfloat(), VM_findkeysforcommand(), VM_ftoe(), VM_ftos(), VM_getentityfieldstring(), VM_getkeybind(), VM_getsurfacetexture(), VM_infoadd(), VM_infoget(), VM_itof(), VM_keynumtostring(), VM_M_crypto_getencryptlevel(), VM_M_crypto_getidfp(), VM_M_crypto_getkeyfp(), VM_M_crypto_getmyidfp(), VM_M_crypto_getmykeyfp(), VM_M_getgamedirinfo(), VM_M_getserverlistnumber(), VM_M_getserverliststring(), VM_netaddress_resolve(), VM_precache_file(), VM_precache_pic(), VM_precache_sound(), VM_search_getfilename(), VM_sprintf(), VM_strcat(), VM_strconv(), VM_strdecolorize(), VM_strftime(), VM_strireplace(), VM_strpad(), VM_strreplace(), VM_strtolower(), VM_strtoupper(), VM_strunzone(), VM_strzone(), VM_substring(), VM_SV_AddStat(), VM_SV_findbox(), VM_SV_findradius(), VM_SV_getextresponse(), VM_SV_modelnameforindex(), VM_SV_precache_model(), VM_SV_serverkey(), VM_SV_skel_get_bonename(), VM_uncolorstring(), VM_uri_escape(), VM_uri_get(), VM_uri_unescape(), VM_vtos(), and VM_whichpack().

◆ PRVM_G_STRING

#define PRVM_G_STRING ( o)
Value:
(PRVM_GetString(prog, prog->globals.ip[o]))

Definition at line 887 of file progsvm.h.

Referenced by VM_altstr_count(), VM_altstr_get(), VM_altstr_ins(), VM_altstr_prepare(), VM_altstr_set(), VM_buf_create(), VM_buf_cvarlist(), VM_buf_implode(), VM_buf_loadfile(), VM_bufstr_add(), VM_bufstr_find(), VM_bufstr_set(), VM_callfunction(), VM_changelevel(), VM_checkextension(), VM_cin_close(), VM_cin_getstate(), VM_cin_open(), VM_cin_restart(), VM_cin_setstate(), VM_CL_ambientsound(), VM_CL_effect(), VM_CL_frameforname(), VM_CL_getplayerkey(), VM_CL_gettagindex(), VM_CL_lightstyle(), VM_CL_loadcubemap(), VM_CL_particleeffectnum(), VM_CL_pointsound(), VM_CL_precache_model(), VM_CL_R_AddDynamicLight(), VM_CL_R_PolygonBegin(), VM_CL_registercmd(), VM_CL_serverkey(), VM_CL_setattachment(), VM_CL_setmodel(), VM_CL_skel_find_bone(), VM_CL_sound(), VM_cvar_set(), VM_digest_hex(), VM_drawcolorcodedstring(), VM_drawpic(), VM_drawrotpic(), VM_drawstring(), VM_drawsubpic(), VM_find(), VM_findchain(), VM_findfont(), VM_findkeysforcommand(), VM_fopen(), VM_freepic(), VM_getimagesize(), VM_infoadd(), VM_infoget(), VM_isfunction(), VM_loadfont(), VM_loadfromdata(), VM_loadfromfile(), VM_localsound(), VM_M_crypto_getencryptlevel(), VM_M_crypto_getidfp(), VM_M_crypto_getidstatus(), VM_M_crypto_getkeyfp(), VM_M_getserverlistindexforkey(), VM_M_registercommand(), VM_M_setserverlistmaskstring(), VM_M_WriteString(), VM_matchpattern(), VM_netaddress_resolve(), VM_parseentitydata(), VM_precache_pic(), VM_precache_sound(), VM_putentityfieldstring(), VM_registercvar(), VM_search_begin(), VM_setkeybind(), VM_soundlength(), VM_sprintf(), VM_str2chr(), VM_strdecolorize(), VM_stringtokeynum(), VM_stringwidth(), VM_strireplace(), VM_strlen(), VM_strlennocol(), VM_strncasecmp(), VM_strncmp(), VM_strreplace(), VM_strstrofs(), VM_strtolower(), VM_strtoupper(), VM_substring(), VM_SV_ambientsound(), VM_SV_clientcommand(), VM_SV_effect(), VM_SV_frameforname(), VM_SV_gettagindex(), VM_SV_lightstyle(), VM_SV_particleeffectnum(), VM_SV_pointsound(), VM_SV_precache_model(), VM_SV_precache_sound(), VM_SV_registercommand(), VM_SV_serverkey(), VM_SV_setattachment(), VM_SV_setmodel(), VM_SV_skel_find_bone(), VM_SV_sound(), VM_SV_WritePicture(), VM_SV_WriteString(), VM_SV_WriteUnterminatedString(), VM_tokenize(), VM_tokenize_console(), VM_tokenizebyseparator(), VM_uncolorstring(), VM_uri_get(), VM_VarString(), and VM_whichpack().

◆ PRVM_G_VECTOR

#define PRVM_G_VECTOR ( o)
Value:
(&prog->globals.fp[o])

Definition at line 886 of file progsvm.h.

Referenced by CL_VM_DrawHud(), CL_VM_Event_Sound(), CL_VM_TransformView(), SV_Physics_Step(), VM_CL_ambientsound(), VM_CL_boxparticles(), VM_CL_checkpvs(), VM_CL_effect(), VM_CL_findbox(), VM_CL_findradius(), VM_CL_GetEntity(), VM_CL_getlight(), VM_CL_getmousepos(), VM_CL_gettaginfo(), VM_CL_makevectors(), VM_CL_particle(), VM_CL_pointcontents(), VM_CL_pointparticles(), VM_CL_pointsound(), VM_CL_project(), VM_CL_R_AddDynamicLight(), VM_CL_R_PolygonVertex(), VM_CL_R_SetView(), VM_CL_RotateMoves(), VM_CL_setlistener(), VM_CL_setorigin(), VM_CL_setsize(), VM_CL_skel_get_boneabs(), VM_CL_skel_get_bonerel(), VM_CL_skel_mul_bone(), VM_CL_skel_mul_bones(), VM_CL_skel_set_bone(), VM_CL_SpawnParticle(), VM_CL_SpawnParticleDelayed(), VM_CL_te_beam(), VM_CL_te_blood(), VM_CL_te_bloodshower(), VM_CL_te_customflash(), VM_CL_te_explosion(), VM_CL_te_explosion2(), VM_CL_te_explosionquad(), VM_CL_te_explosionrgb(), VM_CL_te_flamejet(), VM_CL_te_gunshot(), VM_CL_te_gunshotquad(), VM_CL_te_knightspike(), VM_CL_te_lavasplash(), VM_CL_te_lightning1(), VM_CL_te_lightning2(), VM_CL_te_lightning3(), VM_CL_te_particlecube(), VM_CL_te_particlerain(), VM_CL_te_particlesnow(), VM_CL_te_plasmaburn(), VM_CL_te_smallflash(), VM_CL_te_spark(), VM_CL_te_spike(), VM_CL_te_spikequad(), VM_CL_te_superspike(), VM_CL_te_superspikequad(), VM_CL_te_tarexplosion(), VM_CL_te_teleport(), VM_CL_te_wizspike(), VM_CL_tracebox(), VM_CL_traceline(), VM_CL_trailparticles(), VM_CL_unproject(), VM_drawcharacter(), VM_drawcolorcodedstring(), VM_drawfill(), VM_drawline(), VM_drawpic(), VM_drawrotpic(), VM_drawstring(), VM_drawsubpic(), VM_gecko_get_texture_extent(), VM_getbindmaps(), VM_getimagesize(), VM_getsurfaceclippedpoint(), VM_getsurfacenearpoint(), VM_getsurfacenormal(), VM_getsurfacepoint(), VM_getsurfacepointattribute(), VM_getsurfacetriangle(), VM_M_getmousepos(), VM_M_getresolution(), VM_makevectors(), VM_normalize(), VM_physics_addforce(), VM_physics_addtorque(), VM_randomvec(), VM_setbindmaps(), VM_stov(), VM_stringwidth(), VM_SV_aim(), VM_SV_ambientsound(), VM_SV_checkpvs(), VM_SV_effect(), VM_SV_findbox(), VM_SV_findradius(), VM_SV_getlight(), VM_SV_gettaginfo(), VM_SV_particle(), VM_SV_pointcontents(), VM_SV_pointparticles(), VM_SV_pointsound(), VM_SV_setorigin(), VM_SV_setsize(), VM_SV_skel_get_boneabs(), VM_SV_skel_get_bonerel(), VM_SV_skel_mul_bone(), VM_SV_skel_mul_bones(), VM_SV_skel_set_bone(), VM_SV_te_beam(), VM_SV_te_blood(), VM_SV_te_bloodshower(), VM_SV_te_customflash(), VM_SV_te_explosion(), VM_SV_te_explosion2(), VM_SV_te_explosionquad(), VM_SV_te_explosionrgb(), VM_SV_te_flamejet(), VM_SV_te_gunshot(), VM_SV_te_gunshotquad(), VM_SV_te_knightspike(), VM_SV_te_lavasplash(), VM_SV_te_lightning1(), VM_SV_te_lightning2(), VM_SV_te_lightning3(), VM_SV_te_particlecube(), VM_SV_te_particlerain(), VM_SV_te_particlesnow(), VM_SV_te_plasmaburn(), VM_SV_te_smallflash(), VM_SV_te_spark(), VM_SV_te_spike(), VM_SV_te_spikequad(), VM_SV_te_superspike(), VM_SV_te_superspikequad(), VM_SV_te_tarexplosion(), VM_SV_te_teleport(), VM_SV_te_wizspike(), VM_SV_tracebox(), VM_SV_traceline(), VM_SV_trailparticles(), VM_vectoangles(), VM_vectorvectors(), VM_vectoyaw(), VM_vlen(), and VM_vtos().

◆ PRVM_gameedictedict

#define PRVM_gameedictedict ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDEDICT(ed, prog->fieldoffsets.fieldname))

Definition at line 163 of file progsvm.h.

Referenced by R_DrawEntityBBoxes().

◆ PRVM_gameedictfloat

#define PRVM_gameedictfloat ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname))

Definition at line 160 of file progsvm.h.

Referenced by animatemodel(), VM_changepitch(), VM_changeyaw(), VM_GenerateFrameGroupBlend(), VM_UpdateEdictSkeleton(), and while().

◆ PRVM_gameedictfunction

#define PRVM_gameedictfunction ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFUNCTION(ed, prog->fieldoffsets.fieldname))

Definition at line 164 of file progsvm.h.

Referenced by while().

◆ PRVM_gameedictstring

#define PRVM_gameedictstring ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDSTRING(ed, prog->fieldoffsets.fieldname))

Definition at line 162 of file progsvm.h.

Referenced by VM_SV_droptofloor().

◆ PRVM_gameedictvector

#define PRVM_gameedictvector ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname))

Definition at line 161 of file progsvm.h.

Referenced by VM_changepitch(), VM_changeyaw(), and VM_SV_droptofloor().

◆ PRVM_gamefunction

#define PRVM_gamefunction ( funcname)
Value:
(prog->funcoffsets.funcname)

Definition at line 170 of file progsvm.h.

◆ PRVM_gameglobaledict

#define PRVM_gameglobaledict ( fieldname)
Value:
(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname))

Definition at line 168 of file progsvm.h.

Referenced by PRVM_ConsoleCommand(), VM_changeyaw(), VM_ClearTraceGlobals(), VM_SetTraceGlobals(), and while().

◆ PRVM_gameglobalfloat

#define PRVM_gameglobalfloat ( fieldname)
Value:
(PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.fieldname))

Definition at line 165 of file progsvm.h.

Referenced by PRVM_ConsoleCommand(), VM_ClearTraceGlobals(), VM_SetTraceGlobals(), and while().

◆ PRVM_gameglobalfunction

#define PRVM_gameglobalfunction ( fieldname)
Value:
(PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname))

Definition at line 169 of file progsvm.h.

◆ PRVM_gameglobalstring

#define PRVM_gameglobalstring ( fieldname)
Value:
(PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname))

Definition at line 167 of file progsvm.h.

Referenced by VM_ClearTraceGlobals(), and VM_SetTraceGlobals().

◆ PRVM_gameglobalvector

#define PRVM_gameglobalvector ( fieldname)
Value:
(PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.fieldname))

Definition at line 166 of file progsvm.h.

Referenced by VM_ClearTraceGlobals(), VM_makevectors(), VM_SetTraceGlobals(), and VM_vectorvectors().

◆ PRVM_GetProg

#define PRVM_GetProg ( n)
Value:
prvm_prog_t prvm_prog_list[PRVM_PROG_MAX]
Definition prvm_edict.c:27

Definition at line 764 of file progsvm.h.

Referenced by PRVM_Crash().

◆ PRVM_GLOBALFIELDEDICT

#define PRVM_GLOBALFIELDEDICT ( fieldoffset)
Value:
(PRVM_GLOBALFIELDVALUE(fieldoffset)->edict)
#define PRVM_GLOBALFIELDVALUE(fieldoffset)
Definition progsvm.h:215

Definition at line 219 of file progsvm.h.

Referenced by PRVM_MarkReferencedEdicts().

◆ PRVM_GLOBALFIELDFLOAT

#define PRVM_GLOBALFIELDFLOAT ( fieldoffset)
Value:
(PRVM_GLOBALFIELDVALUE(fieldoffset)->_float)

Definition at line 216 of file progsvm.h.

Referenced by Cvar_UpdateAutoCvar().

◆ PRVM_GLOBALFIELDFUNCTION

#define PRVM_GLOBALFIELDFUNCTION ( fieldoffset)
Value:
(PRVM_GLOBALFIELDVALUE(fieldoffset)->function)

Definition at line 220 of file progsvm.h.

◆ PRVM_GLOBALFIELDSTRING

#define PRVM_GLOBALFIELDSTRING ( fieldoffset)
Value:
(PRVM_GLOBALFIELDVALUE(fieldoffset)->string)

Definition at line 218 of file progsvm.h.

Referenced by Cvar_UpdateAutoCvar(), and PRVM_IsStringReferenced().

◆ PRVM_GLOBALFIELDVALUE

#define PRVM_GLOBALFIELDVALUE ( fieldoffset)
Value:
((fieldoffset) < 0 ? Con_Printf("Invalid fieldoffset at %s:%i\n", __FILE__, __LINE__), &prvm_badvalue : (prvm_eval_t *)(prog->globals.fp + (fieldoffset)))

Definition at line 215 of file progsvm.h.

Referenced by PRVM_Global_f(), PRVM_Prog_Load(), PRVM_UpdateBreakpoints(), and while().

◆ PRVM_GLOBALFIELDVECTOR

#define PRVM_GLOBALFIELDVECTOR ( fieldoffset)
Value:
(PRVM_GLOBALFIELDVALUE(fieldoffset)->vector)

Definition at line 217 of file progsvm.h.

Referenced by Cvar_UpdateAutoCvar().

◆ PRVM_LOCALSTACK_SIZE

#define PRVM_LOCALSTACK_SIZE   16384

Definition at line 249 of file progsvm.h.

Referenced by PRVM_EnterFunction().

◆ PRVM_MAX_OPENFILES

#define PRVM_MAX_OPENFILES   256

◆ PRVM_MAX_OPENSEARCHES

#define PRVM_MAX_OPENSEARCHES   128

◆ PRVM_MAX_STACK_DEPTH

#define PRVM_MAX_STACK_DEPTH   1024

Definition at line 248 of file progsvm.h.

Referenced by PRVM_EnterFunction().

◆ PRVM_menuedictedict

#define PRVM_menuedictedict ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDEDICT(ed, prog->fieldoffsets.fieldname))

Definition at line 199 of file progsvm.h.

◆ PRVM_menuedictfloat

#define PRVM_menuedictfloat ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname))

Definition at line 196 of file progsvm.h.

◆ PRVM_menuedictfunction

#define PRVM_menuedictfunction ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFUNCTION(ed, prog->fieldoffsets.fieldname))

Definition at line 200 of file progsvm.h.

◆ PRVM_menuedictstring

#define PRVM_menuedictstring ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDSTRING(ed, prog->fieldoffsets.fieldname))

Definition at line 198 of file progsvm.h.

◆ PRVM_menuedictvector

#define PRVM_menuedictvector ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname))

Definition at line 197 of file progsvm.h.

◆ PRVM_menufunction

#define PRVM_menufunction ( funcname)
Value:
(prog->funcoffsets.funcname)

Definition at line 206 of file progsvm.h.

Referenced by MP_Draw(), MP_GetServerListEntryCategory(), MP_Init(), MP_KeyEvent(), MP_NewMap(), MP_Shutdown(), and MP_ToggleMenu().

◆ PRVM_menuglobaledict

#define PRVM_menuglobaledict ( fieldname)
Value:
(PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname))

Definition at line 204 of file progsvm.h.

◆ PRVM_menuglobalfloat

#define PRVM_menuglobalfloat ( fieldname)
Value:
(PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.fieldname))

Definition at line 201 of file progsvm.h.

◆ PRVM_menuglobalfunction

#define PRVM_menuglobalfunction ( fieldname)
Value:
(PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname))

Definition at line 205 of file progsvm.h.

◆ PRVM_menuglobalstring

#define PRVM_menuglobalstring ( fieldname)
Value:
(PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname))

Definition at line 203 of file progsvm.h.

◆ PRVM_menuglobalvector

#define PRVM_menuglobalvector ( fieldname)
Value:
(PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.fieldname))

Definition at line 202 of file progsvm.h.

◆ PRVM_NEXT_EDICT

#define PRVM_NEXT_EDICT ( e)

◆ PRVM_NUM_FOR_EDICT

◆ PRVM_OP_STATE

#define PRVM_OP_STATE   1

Definition at line 238 of file progsvm.h.

Referenced by CL_VM_Init(), SV_VM_Setup(), and while().

◆ PRVM_PROG_TO_EDICT

◆ PRVM_ProgLoaded

#define PRVM_ProgLoaded ( n)
Value:
(PRVM_GetProg(n)->loaded)
#define PRVM_GetProg(n)
Definition progsvm.h:764

Definition at line 765 of file progsvm.h.

◆ PRVM_serveredictedict

◆ PRVM_serveredictfloat

#define PRVM_serveredictfloat ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname))

Definition at line 172 of file progsvm.h.

Referenced by PHYS_TestEntityPosition(), PRVM_IsEdictRelevant(), R_DrawEntityBBoxes_Callback(), SV_AirMove(), SV_ApplyClientMove(), SV_CanSeeBox(), SV_CheckContentsTransition(), SV_CheckWater(), SV_CheckWaterTransition(), SV_CleanupEnts(), SV_Color_f(), SV_CreateBaseline(), SV_DisableCheats_c(), SV_ExecuteClientMoves(), SV_FixCheckBottom(), SV_Fly_f(), SV_FlyMove(), SV_GenericHitSuperContentsMask(), SV_GetEntityMatrix(), SV_GetExtendedTagInfo(), SV_GetModelFromEdict(), SV_GetPitchSign(), SV_GetTagIndex(), SV_GetTagMatrix(), SV_Give_f(), SV_God_f(), SV_Gravity(), SV_Impact(), SV_Kill_f(), SV_LinkEdict(), SV_LinkEdict_TouchAreaGrid(), SV_movestep(), SV_NewChaseDir(), SV_Noclip_f(), SV_Notarget_f(), SV_Physics_ClientEntity(), SV_Physics_ClientEntity_NoThink(), SV_Physics_ClientEntity_PostThink(), SV_Physics_ClientMove(), SV_Physics_Entity(), SV_Physics_Pusher(), SV_Physics_Step(), SV_Physics_Toss(), SV_PlayerPhysics(), SV_PModel_f(), SV_PointSuperContents(), SV_PrepareEntityForSending(), SV_PushEntity(), SV_PushMove(), SV_RunThink(), SV_Savegame_f(), SV_Say(), SV_SendServerinfo(), SV_SetIdealPitch(), SV_SpawnServer(), SV_StartDemoRecording(), SV_StepDirection(), SV_StopDemoRecording(), SV_Trace_Toss(), SV_TraceBox(), SV_TraceLine(), SV_TracePoint(), SV_UpdateToReliableMessages(), SV_Viewframe_f(), SV_Viewmodel_f(), SV_Viewnext_f(), SV_Viewprev_f(), SV_WalkMove(), SV_WaterJump(), SV_WriteClientdataToMessage(), SVVM_count_edicts(), SVVM_free_edict(), SVVM_init_edict(), SVVM_load_edict(), VM_physics_addforce(), VM_physics_addtorque(), VM_physics_enable(), VM_SV_aim(), VM_SV_checkclient(), VM_SV_droptofloor(), VM_SV_findradius(), VM_SV_makestatic(), VM_SV_MoveToGoal(), VM_SV_newcheckclient(), VM_SV_setattachment(), VM_SV_setcolor(), VM_SV_setmodel(), VM_SV_setmodelindex(), VM_SV_walkmove(), and World_LinkEdict().

◆ PRVM_serveredictfunction

◆ PRVM_serveredictstring

◆ PRVM_serveredictvector

#define PRVM_serveredictvector ( ed,
fieldname )
Value:
(PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname))

Definition at line 173 of file progsvm.h.

Referenced by DropPunchAngle(), PHYS_NudgeOutOfSolid(), PHYS_TestEntityPosition(), PHYS_UnstickEntityReturnOffset(), SetMinMaxSize(), SV_Accelerate(), SV_AirAccelerate(), SV_AirMove(), SV_ApplyClientMove(), SV_CanSeeBox(), SV_CheckBottom(), SV_CheckVelocity(), SV_CheckWater(), SV_CheckWaterTransition(), SV_CreateBaseline(), SV_EntitiesInBox(), SV_FlyMove(), SV_GetEntityMatrix(), SV_Impact(), SV_LinkEdict(), SV_LinkEdict_TouchAreaGrid_Call(), SV_movestep(), SV_NewChaseDir(), SV_NudgeOutOfSolid_PivotIsKnownGood(), SV_Physics_ClientEntity(), SV_Physics_ClientEntity_NoThink(), SV_Physics_ClientEntity_PostThink(), SV_Physics_ClientMove(), SV_Physics_Entity(), SV_Physics_Follow(), SV_Physics_Step(), SV_Physics_Toss(), SV_PlayerPhysics(), SV_PointSuperContents(), SV_PrepareEntityForSending(), SV_PushEntity(), SV_PushMove(), SV_SetIdealPitch(), SV_Spawn_f(), SV_SpawnServer(), SV_StartSound(), SV_StepDirection(), SV_Trace_Toss(), SV_TraceBox(), SV_TraceLine(), SV_TracePoint(), SV_UnstickEntity(), SV_UserFriction(), SV_WalkMove(), SV_WallFriction(), SV_WaterJump(), SV_WaterMove(), SV_WriteClientdataToMessage(), SV_WriteDemoMessage(), SV_WriteEntitiesToClient(), SVVM_free_edict(), VM_CL_checkpvs(), VM_getsurfaceclippedpoint(), VM_SV_aim(), VM_SV_checkclient(), VM_SV_checkpvs(), VM_SV_droptofloor(), VM_SV_findradius(), VM_SV_makestatic(), VM_SV_newcheckclient(), and VM_SV_setorigin().

◆ PRVM_serverfunction

◆ PRVM_serverglobaledict

◆ PRVM_serverglobalfloat

◆ PRVM_serverglobalfunction

#define PRVM_serverglobalfunction ( fieldname)
Value:
(PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname))

Definition at line 181 of file progsvm.h.

◆ PRVM_serverglobalstring

#define PRVM_serverglobalstring ( fieldname)

◆ PRVM_serverglobalvector

#define PRVM_serverglobalvector ( fieldname)
Value:
(PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.fieldname))

Definition at line 178 of file progsvm.h.

Referenced by SV_Impact(), SV_LinkEdict_TouchAreaGrid_Call(), VM_SV_aim(), and VM_SV_gettaginfo().

◆ STRINGBUFFER_QCFLAGS

#define STRINGBUFFER_QCFLAGS   1

Definition at line 497 of file progsvm.h.

Referenced by SV_Savegame_to(), and VM_buf_create().

◆ STRINGBUFFER_SAVED

#define STRINGBUFFER_SAVED   1

Definition at line 496 of file progsvm.h.

Referenced by SV_Loadgame_f(), and SV_Savegame_to().

◆ STRINGBUFFER_TEMP

#define STRINGBUFFER_TEMP   128

Definition at line 498 of file progsvm.h.

Referenced by BufStr_FindCreateReplace(), and SV_Loadgame_f().

◆ SVVM_prog

#define SVVM_prog   (&prvm_prog_list[PRVM_PROG_SERVER])

Definition at line 766 of file progsvm.h.

Referenced by CLVM_ExecuteProgram(), DropPunchAngle(), EntityFrame4_WriteFrame(), EntityFrame5_WriteFrame(), EntityFrame_WriteFrame(), EntityFrameCSQC_LostAllFrames(), EntityFrameCSQC_WriteFrame(), EntityFrameQuake_WriteFrame(), EntityState5_WriteUpdate(), EntityState_WriteUpdate(), getmatrix(), getmodel(), NetConn_BuildStatusResponse(), PHYS_NudgeOutOfSolid(), PHYS_TraceBox(), PRVM_Crash(), PRVM_GarbageCollection(), PRVM_IsEdictReferenced(), PRVM_IsEdictRelevant(), PRVM_ProgFromString(), R_DrawEntityBBoxes(), R_RenderScene(), Sbar_ShowFPS(), SV_Accelerate(), SV_AirAccelerate(), SV_AirMove(), SV_ApplyClientMove(), SV_CanSeeBox(), SV_CheckBottom(), SV_CheckContentsTransition(), SV_CheckVelocity(), SV_CheckWater(), SV_CheckWaterTransition(), SV_CleanupEnts(), SV_Color_f(), SV_ConnectClient(), SV_CreateBaseline(), SV_DisableCheats_c(), SV_DropClient(), SV_Ent_Create_f(), SV_Ent_Remove_All_f(), SV_Ent_Remove_f(), SV_EntitiesInBox(), SV_ExecuteClientMoves(), SV_FixCheckBottom(), SV_Fly_f(), SV_FlyMove(), SV_Frame(), SV_GenericHitSuperContentsMask(), SV_GetModelFromEdict(), SV_Give_f(), SV_God_f(), SV_Gravity(), SV_Impact(), SV_Kill_f(), SV_LinkEdict(), SV_LinkEdict_TouchAreaGrid(), SV_LinkEdict_TouchAreaGrid_Call(), SV_Loadgame_f(), SV_MarkWriteEntityStateToClient(), SV_movestep(), SV_Name(), SV_NewChaseDir(), SV_Noclip_f(), SV_Notarget_f(), SV_NudgeOutOfSolid_PivotIsKnownGood(), SV_Physics(), SV_Physics_ClientEntity(), SV_Physics_ClientEntity_NoThink(), SV_Physics_ClientEntity_PostThink(), SV_Physics_ClientEntity_PreThink(), SV_Physics_ClientMove(), SV_Physics_Entity(), SV_Physics_Follow(), SV_Physics_Pusher(), SV_Physics_Step(), SV_Physics_Toss(), SV_Playermodel_f(), SV_PlayerPhysics(), SV_Playerskin_f(), SV_PModel_f(), SV_PointSuperContents(), SV_PrepareEntitiesForSending(), SV_PrepareEntityForSending(), SV_PushEntity(), SV_PushMove(), SV_ReadClientMessage(), SV_ReadClientMove(), SV_RunThink(), SV_Savegame_f(), SV_Savegame_to(), SV_SaveSpawnparms(), SV_Say(), SV_SendServerinfo(), SV_SetIdealPitch(), SV_Spawn_f(), SV_SpawnServer(), SV_StartDemoRecording(), SV_StartSound(), SV_Status_f(), SV_StepDirection(), SV_StopDemoRecording(), SV_ThreadFunc(), SV_TraceBox(), SV_TraceLine(), SV_TracePoint(), SV_UnstickEntity(), SV_UpdateToReliableMessages(), SV_UserFriction(), SV_Viewframe_f(), SV_Viewmodel_f(), SV_Viewnext_f(), SV_Viewprev_f(), SV_VM_ConsoleCommand(), SV_VM_Setup(), SV_VM_Shutdown(), SV_WalkMove(), SV_WallFriction(), SV_WaterJump(), SV_WaterMove(), SV_WriteClientdataToMessage(), SV_WriteDemoMessage(), SV_WriteEntitiesToClient(), SVVM_ExecuteProgram(), VM_getsoundtime(), VM_nudgeoutofsolid(), and VM_SV_UpdateCustomStats().

Typedef Documentation

◆ prvm_builtin_t

typedef void(* prvm_builtin_t) (struct prvm_prog_s *prog)

Definition at line 256 of file progsvm.h.

Enumeration Type Documentation

◆ prvm_prog_garbagecollection_state_stage_t

Enumerator
PRVM_GC_START 
PRVM_GC_GLOBALS_MARK 
PRVM_GC_FIELDS_MARK 
PRVM_GC_KNOWNSTRINGS_SWEEP 
PRVM_GC_RESET 

Definition at line 514 of file progsvm.h.

515{
516 PRVM_GC_START = 0,
521}
@ PRVM_GC_START
Definition progsvm.h:516
@ PRVM_GC_RESET
Definition progsvm.h:520
@ PRVM_GC_KNOWNSTRINGS_SWEEP
Definition progsvm.h:519
@ PRVM_GC_GLOBALS_MARK
Definition progsvm.h:517
@ PRVM_GC_FIELDS_MARK
Definition progsvm.h:518

◆ prvm_progindex_t

Enumerator
PRVM_PROG_SERVER 
PRVM_PROG_CLIENT 
PRVM_PROG_MENU 
PRVM_PROG_MAX 

Definition at line 752 of file progsvm.h.

753{
758}
@ PRVM_PROG_SERVER
Definition progsvm.h:754
@ PRVM_PROG_CLIENT
Definition progsvm.h:755
@ PRVM_PROG_MAX
Definition progsvm.h:757
@ PRVM_PROG_MENU
Definition progsvm.h:756

Function Documentation

◆ CLVM_ExecuteProgram()

void CLVM_ExecuteProgram ( prvm_prog_t * prog,
func_t fnum,
const char * errormessage )

Definition at line 1086 of file prvm_exec.c.

1087{
1088 mstatement_t *st, *startst;
1089 mfunction_t *func, *enterfunc;
1090 prvm_edict_t *ed;
1091 prvm_eval_t *ptr;
1092 int jumpcount, cachedpr_trace, exitdepth;
1093 int restorevm_tempstringsbuf_cursize;
1094 double calltime;
1095 double tm, starttm;
1096 prvm_vec_t tempfloat;
1099
1100 calltime = Sys_DirtyTime();
1101
1102 if (!fnum || fnum >= (unsigned int)prog->numfunctions)
1103 {
1106 prog->error_cmd("CLVM_ExecuteProgram: %s", errormessage);
1107 }
1108
1109 func = &prog->functions[fnum];
1110
1111 // after executing this function, delete all tempstrings it created
1112 restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
1113
1114 prog->trace = prvm_traceqc.integer;
1115
1116 // we know we're done when pr_depth drops to this
1117 exitdepth = prog->depth;
1118
1119// make a stack frame
1120 st = &prog->statements[PRVM_EnterFunction(prog, func)];
1121 // save the starting statement pointer for profiling
1122 // (when the function exits or jumps, the (st - startst) integer value is
1123 // added to the function's profile counter)
1124 startst = st;
1125 starttm = calltime;
1126 // instead of counting instructions, we count jumps
1127 jumpcount = 0;
1128 // add one to the callcount of this function because otherwise engine-called functions aren't counted
1129 if (prog->xfunction->callcount++ == 0 && (prvm_coverage.integer & 1))
1131
1132chooseexecprogram:
1133 cachedpr_trace = prog->trace;
1134 if (prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0)
1135 {
1136#define PRVMSLOWINTERPRETER 1
1138 {
1139#define PRVMTIMEPROFILING 1
1140#include "prvm_execprogram.h"
1141#undef PRVMTIMEPROFILING
1142 }
1143 else
1144 {
1145#include "prvm_execprogram.h"
1146 }
1147#undef PRVMSLOWINTERPRETER
1148 }
1149 else
1150 {
1152 {
1153#define PRVMTIMEPROFILING 1
1154#include "prvm_execprogram.h"
1155#undef PRVMTIMEPROFILING
1156 }
1157 else
1158 {
1159#include "prvm_execprogram.h"
1160 }
1161 }
1162
1163cleanup:
1164 if (developer_insane.integer && prog->tempstringsbuf.cursize > restorevm_tempstringsbuf_cursize)
1165 Con_DPrintf("CLVM_ExecuteProgram: %s used %i bytes of tempstrings\n", PRVM_GetString(prog, prog->functions[fnum].s_name), prog->tempstringsbuf.cursize - restorevm_tempstringsbuf_cursize);
1166 // delete tempstrings created by this function
1167 prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
1168
1169 tm = Sys_DirtyTime() - calltime;if (tm < 0 || tm >= 1800) tm = 0;
1170 func->totaltime += tm;
1171
1172 if (prog == SVVM_prog)
1174}
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
entity self
cvar_t developer_insane
Definition host.c:50
@ ev_void
Definition pr_comp.h:29
#define PRVM_allglobaledict(fieldname)
Definition progsvm.h:144
void PRVM_ED_Print(prvm_prog_t *prog, prvm_edict_t *ed, const char *wildcard_fieldname)
Definition prvm_edict.c:657
#define SVVM_prog
Definition progsvm.h:766
cvar_t prvm_coverage
Definition prvm_edict.c:39
#define CACHE_UNCHANGING()
Definition prvm_exec.c:954
cvar_t prvm_timeprofiling
Definition prvm_edict.c:38
#define CACHE_CHANGING(DECLARE)
Definition prvm_exec.c:971
static void PRVM_FunctionCoverageEvent(prvm_prog_t *prog, mfunction_t *func)
Definition prvm_exec.c:919
static int PRVM_EnterFunction(prvm_prog_t *prog, mfunction_t *f)
Definition prvm_exec.c:799
#define DO_DECLARE(t)
Definition prvm_exec.c:980
cvar_t prvm_traceqc
Definition prvm_edict.c:35
float prvm_vec_t
Definition qtypes.h:55
void SV_FlushBroadcastMessages(void)
Definition sv_send.c:1371
int integer
Definition cvar.h:73
double callcount
Definition pr_comp.h:453
int32_t s_name
Definition pr_comp.h:460
double totaltime
Definition pr_comp.h:454
mfunction_t * functions
Definition progsvm.h:541
void(* error_cmd)(const char *format,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
[INIT]
Definition progsvm.h:747
etype_t watch_field_type
Definition progsvm.h:617
int numfunctions
Definition progsvm.h:566
int break_statement
Definition progsvm.h:610
etype_t watch_global_type
Definition progsvm.h:613
mstatement_t * statements
Definition progsvm.h:547
sizebuf_t tempstringsbuf
buffer for storing all tempstrings created during one invocation of ExecuteProgram
Definition progsvm.h:644
mfunction_t * xfunction
Definition progsvm.h:620
int cursize
Definition common.h:54
double Sys_DirtyTime(void)
Definition sys_shared.c:417

References prvm_prog_t::break_statement, CACHE_CHANGING, CACHE_UNCHANGING, mfunction_t::callcount, Con_DPrintf(), sizebuf_t::cursize, prvm_prog_t::depth, developer_insane, DO_DECLARE, prvm_prog_t::error_cmd, ev_void, prvm_prog_t::functions, cvar_t::integer, NULL, prvm_prog_t::numfunctions, PRVM_allglobaledict, prvm_coverage, PRVM_ED_Print(), PRVM_EnterFunction(), PRVM_FunctionCoverageEvent(), PRVM_GetString(), PRVM_PROG_TO_EDICT, prvm_timeprofiling, prvm_traceqc, mfunction_t::s_name, self, prvm_prog_t::statements, SV_FlushBroadcastMessages(), SVVM_prog, Sys_DirtyTime(), prvm_prog_t::tempstringsbuf, mfunction_t::totaltime, prvm_prog_t::trace, prvm_prog_t::watch_field_type, prvm_prog_t::watch_global_type, and prvm_prog_t::xfunction.

Referenced by CL_VM_Init().

◆ CLVM_init_cmd()

void CLVM_init_cmd ( prvm_prog_t * prog)

Definition at line 5656 of file clvm_cmds.c.

5657{
5658 VM_Cmd_Init(prog);
5659 prog->polygonbegin_model = NULL;
5660 prog->polygonbegin_guess2d = 0;
5661}
void VM_Cmd_Init(prvm_prog_t *prog)
Definition prvm_cmds.c:5265
struct model_s * polygonbegin_model
this tracks the last polygonbegin's choice of CL_Mesh_CSQC or CL_Mesh_UI for this polygon
Definition progsvm.h:654
qbool polygonbegin_guess2d
indicates if polygonbegin should be interpreted as 2d (clearscene sets this to false,...
Definition progsvm.h:661

References NULL, prvm_prog_t::polygonbegin_guess2d, prvm_prog_t::polygonbegin_model, and VM_Cmd_Init().

Referenced by CL_VM_Init().

◆ CLVM_reset_cmd()

void CLVM_reset_cmd ( prvm_prog_t * prog)

Definition at line 5663 of file clvm_cmds.c.

5664{
5665 World_End(&cl.world);
5666 VM_Cmd_Reset(prog);
5667 prog->polygonbegin_model = NULL;
5668 prog->polygonbegin_guess2d = 0;
5669}
client_state_t cl
Definition cl_main.c:117
void VM_Cmd_Reset(prvm_prog_t *prog)
Definition prvm_cmds.c:5274
world_t world
Definition client.h:1122
void World_End(world_t *world)
Definition world.c:69

References cl, NULL, prvm_prog_t::polygonbegin_guess2d, prvm_prog_t::polygonbegin_model, VM_Cmd_Reset(), client_state_t::world, and World_End().

Referenced by CL_VM_Init().

◆ PRVM_AllocationOrigin()

const char * PRVM_AllocationOrigin ( prvm_prog_t * prog)

Definition at line 223 of file prvm_edict.c.

224{
225 char *buf = NULL;
226 if(prog->leaktest_active)
227 if(prog->depth > 0) // actually in QC code and not just parsing the entities block of a map/savegame
228 {
229 // bones_was_here: this is the smallest 64 multiple that avoids truncation in Xonotic (was 256)
230 buf = (char *)PRVM_Alloc(448);
231 PRVM_ShortStackTrace(prog, buf, 448);
232 }
233 return buf;
234}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glquake.h:657
#define PRVM_Alloc(buffersize)
Definition progsvm.h:818
void PRVM_ShortStackTrace(prvm_prog_t *prog, char *buf, size_t bufsize)
Definition prvm_exec.c:464
qbool leaktest_active
Definition progsvm.h:711

References buf, prvm_prog_t::depth, prvm_prog_t::leaktest_active, NULL, PRVM_Alloc, and PRVM_ShortStackTrace().

Referenced by PRVM_AllocString(), PRVM_ED_ClearEdict(), VM_buf_create(), VM_fopen(), and VM_search_begin().

◆ PRVM_AllocString()

int PRVM_AllocString ( prvm_prog_t * prog,
size_t bufferlength,
char ** pointer )

Definition at line 3459 of file prvm_edict.c.

3460{
3461 int i;
3462 char *s;
3463 if (!bufferlength)
3464 {
3465 if (pointer)
3466 *pointer = NULL;
3467 return 0;
3468 }
3469 for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++)
3470 if (!prog->knownstrings[i])
3471 break;
3472 s = (char *)PRVM_Alloc(bufferlength);
3474 if(prog->leaktest_active)
3476 if (pointer)
3477 *pointer = (char *)(prog->knownstrings[i]);
3478 return PRVM_KNOWNSTRINGBASE + i;
3479}
GLenum GLvoid ** pointer
Definition glquake.h:714
#define KNOWNSTRINGFLAG_GCMARK
Definition progsvm.h:511
static void PRVM_NewKnownString(prvm_prog_t *prog, int i, int flags, const char *s)
#define PRVM_KNOWNSTRINGBASE
const char * PRVM_AllocationOrigin(prvm_prog_t *prog)
Definition prvm_edict.c:223
int i
const char ** knownstrings
Definition progsvm.h:591
const char ** knownstrings_origin
Definition progsvm.h:593
int firstfreeknownstring
this is updated whenever a string is removed or added (simple optimization of the free string search)
Definition progsvm.h:590

References prvm_prog_t::firstfreeknownstring, i, KNOWNSTRINGFLAG_GCMARK, prvm_prog_t::knownstrings, prvm_prog_t::knownstrings_origin, prvm_prog_t::leaktest_active, NULL, pointer, PRVM_Alloc, PRVM_AllocationOrigin(), PRVM_KNOWNSTRINGBASE, and PRVM_NewKnownString().

Referenced by PRVM_ED_CallSpawnFunction(), PRVM_ED_ParseEpair(), and VM_strzone().

◆ PRVM_Breakpoint()

void PRVM_Breakpoint ( prvm_prog_t * prog,
int stack_index,
const char * text )

Definition at line 3000 of file prvm_edict.c.

3001{
3002 char vabuf[1024];
3003 Con_Printf("PRVM_Breakpoint: %s\n", text);
3004 PRVM_PrintState(prog, stack_index);
3006 SV_Savegame_to(prog, va(vabuf, sizeof(vabuf), "breakpoint-%s.dmp", prog->name));
3007}
char * va(char *buf, size_t buflen, const char *format,...)
Definition common.c:972
void PRVM_PrintState(prvm_prog_t *prog, int stack_index)
Definition prvm_exec.c:726
cvar_t prvm_breakpointdump
Definition prvm_edict.c:45
void SV_Savegame_to(prvm_prog_t *prog, const char *name)
Definition sv_save.c:35
const char * name
name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
Definition progsvm.h:700

References Con_Printf(), cvar_t::integer, prvm_prog_t::name, prvm_breakpointdump, PRVM_PrintState(), SV_Savegame_to(), and va().

Referenced by PRVM_Watchpoint(), and while().

◆ PRVM_CallProfile_f()

void PRVM_CallProfile_f ( struct cmd_state_s * cmd)

Referenced by PRVM_Init().

◆ PRVM_ChangeEngineString()

const char * PRVM_ChangeEngineString ( prvm_prog_t * prog,
int i,
const char * s )

Definition at line 3345 of file prvm_edict.c.

3346{
3347 const char *old;
3349 if (i < 0 || i >= prog->numknownstrings)
3350 prog->error_cmd("PRVM_ChangeEngineString: string index %i is out of bounds", i);
3351 else if ((prog->knownstrings_flags[i] & KNOWNSTRINGFLAG_ENGINE) == 0)
3352 prog->error_cmd("PRVM_ChangeEngineString: string index %i is not an engine string", i);
3353 old = prog->knownstrings[i];
3354 prog->knownstrings[i] = s;
3355 return old;
3356}
#define KNOWNSTRINGFLAG_ENGINE
Definition progsvm.h:510
unsigned char * knownstrings_flags
Definition progsvm.h:592
int numknownstrings
Definition progsvm.h:587

References prvm_prog_t::error_cmd, i, KNOWNSTRINGFLAG_ENGINE, prvm_prog_t::knownstrings, prvm_prog_t::knownstrings_flags, prvm_prog_t::numknownstrings, and PRVM_KNOWNSTRINGBASE.

Referenced by Cvar_UpdateAutoCvar().

◆ PRVM_ChildProfile_f()

void PRVM_ChildProfile_f ( struct cmd_state_s * cmd)

Referenced by PRVM_Init().

◆ PRVM_Crash()

void PRVM_Crash ( void )

Definition at line 750 of file prvm_exec.c.

751{
752 prvm_prog_t *prog;
753 char vabuf[1024];
754 int i;
755
756 // determine which program crashed
757 for (i = 0; i < PRVM_PROG_MAX; ++i)
758 if (PRVM_GetProg(i)->loaded && PRVM_GetProg(i)->depth > 0)
759 break;
760 if (i >= PRVM_PROG_MAX)
761 return; // none of them crashed
762 prog = PRVM_GetProg(i);
763
764 Con_Printf("QuakeC crash report for %s:\n", prog->name);
765 PRVM_PrintState(prog, 0);
766
767 // don't call graceful shutdown on crash
768 if (prog == SVVM_prog)
770 else if (prog == CLVM_prog)
772
773 if(prvm_errordump.integer && (prog == SVVM_prog || prog == CLVM_prog))
774 {
775 // make a savegame
776 SV_Savegame_to(prog, va(vabuf, sizeof(vabuf), "crash-%s.dmp", prog->name));
777 }
778
779 // dump the stack so host_error can shutdown functions
780 // and free memory, unset prog->loaded, etc
781 PRVM_Prog_Reset(prog);
782}
void CSQC_Shutdown()
GLint GLenum GLsizei GLsizei GLsizei depth
Definition glquake.h:648
#define PRVM_clientfunction(funcname)
Definition progsvm.h:194
#define CLVM_prog
Definition progsvm.h:767
void PRVM_Prog_Reset(prvm_prog_t *prog)
#define PRVM_serverfunction(funcname)
Definition progsvm.h:182
void PRVM_PrintState(prvm_prog_t *prog, int stack_index)
Definition prvm_exec.c:726
cvar_t prvm_errordump
Definition prvm_edict.c:44
void SV_Shutdown(void)
Definition sv_main.c:2128

References CLVM_prog, Con_Printf(), CSQC_Shutdown(), depth, i, cvar_t::integer, prvm_prog_t::name, PRVM_clientfunction, prvm_errordump, PRVM_GetProg, PRVM_PrintState(), PRVM_PROG_MAX, PRVM_Prog_Reset(), PRVM_serverfunction, SV_Savegame_to(), SV_Shutdown(), SVVM_prog, and va().

Referenced by Host_Error(), and MVM_error_cmd().

◆ PRVM_ED_Alloc()

prvm_edict_t * PRVM_ED_Alloc ( prvm_prog_t * prog)

Definition at line 269 of file prvm_edict.c.

270{
271 int i;
272 prvm_edict_t *e;
273
274 // the client qc dont need maxclients
275 // thus it doesnt need to use svs.maxclients
276 // AK: changed i=svs.maxclients+1
277 // AK: changed so the edict 0 wont spawn -> used as reserved/world entity
278 // although the menu/client has no world
279 for (i = prog->reserved_edicts + 1;i < prog->num_edicts;i++)
280 {
281 e = PRVM_EDICT_NUM(i);
282 if(PRVM_ED_CanAlloc(prog, e))
283 {
284 PRVM_ED_ClearEdict (prog, e);
285 return e;
286 }
287 }
288
289 if (i == prog->limit_edicts)
290 prog->error_cmd("%s: PRVM_ED_Alloc: no free edicts", prog->name);
291
292 prog->num_edicts++;
293 if (prog->num_edicts >= prog->max_edicts)
295
296 e = PRVM_EDICT_NUM(i);
297
298 PRVM_ED_ClearEdict(prog, e);
299 return e;
300}
void PRVM_ED_ClearEdict(prvm_prog_t *prog, prvm_edict_t *e)
Definition prvm_edict.c:210
void PRVM_MEM_IncreaseEdicts(prvm_prog_t *prog)
Definition prvm_edict.c:105
qbool PRVM_ED_CanAlloc(prvm_prog_t *prog, prvm_edict_t *e)
Definition prvm_edict.c:243
int num_edicts
copies of some vars that were former read from sv
Definition progsvm.h:671
int limit_edicts
used instead of the constant MAX_EDICTS
Definition progsvm.h:675
int max_edicts
number of edicts for which space has been (should be) allocated
Definition progsvm.h:673
int reserved_edicts
number of reserved edicts (allocated from 1)
Definition progsvm.h:678

References prvm_prog_t::error_cmd, i, prvm_prog_t::limit_edicts, prvm_prog_t::max_edicts, prvm_prog_t::name, prvm_prog_t::num_edicts, PRVM_ED_CanAlloc(), PRVM_ED_ClearEdict(), PRVM_EDICT_NUM, PRVM_MEM_IncreaseEdicts(), and prvm_prog_t::reserved_edicts.

Referenced by CSQC_ReadEntities(), PRVM_ED_LoadFromFile(), SV_Ent_Create_f(), VM_CL_spawn(), and VM_spawn().

◆ PRVM_ED_CallPostspawnFunction()

void PRVM_ED_CallPostspawnFunction ( prvm_prog_t * prog,
prvm_edict_t * ent )

Definition at line 1484 of file prvm_edict.c.

1485{
1486 if(!ent->free)
1487 if (PRVM_serverfunction(SV_OnEntityPostSpawnFunction))
1488 {
1489 // self = ent
1492 prog->ExecuteProgram(prog, PRVM_serverfunction(SV_OnEntityPostSpawnFunction), "QC function SV_OnEntityPostSpawnFunction is missing");
1493 }
1494}
float time
#define PRVM_serverglobaledict(fieldname)
Definition progsvm.h:180
#define PRVM_EDICT_TO_PROG(e)
Definition progsvm.h:875
#define PRVM_serverglobalfloat(fieldname)
Definition progsvm.h:177
server_t sv
local server
Definition sv_main.c:223
qbool free
true if this edict is unused
Definition progsvm.h:93
void(* ExecuteProgram)(struct prvm_prog_s *prog, func_t fnum, const char *errormessage)
pointer to one of the *VM_ExecuteProgram functions
Definition progsvm.h:749
double time
Definition server.h:76

References prvm_prog_t::ExecuteProgram, prvm_edict_t::free, PRVM_EDICT_TO_PROG, PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, self, sv, server_t::time, and time.

Referenced by PRVM_ED_LoadFromFile(), and SV_Ent_Create_f().

◆ PRVM_ED_CallPrespawnFunction()

void PRVM_ED_CallPrespawnFunction ( prvm_prog_t * prog,
prvm_edict_t * ent )

Definition at line 1389 of file prvm_edict.c.

1390{
1391 if (PRVM_serverfunction(SV_OnEntityPreSpawnFunction))
1392 {
1393 // self = ent
1396 prog->ExecuteProgram(prog, PRVM_serverfunction(SV_OnEntityPreSpawnFunction), "QC function SV_OnEntityPreSpawnFunction is missing");
1397 }
1398}

References prvm_prog_t::ExecuteProgram, PRVM_EDICT_TO_PROG, PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, self, sv, server_t::time, and time.

Referenced by PRVM_ED_LoadFromFile(), and SV_Ent_Create_f().

◆ PRVM_ED_CallSpawnFunction()

qbool PRVM_ED_CallSpawnFunction ( prvm_prog_t * prog,
prvm_edict_t * ent,
const char * data,
const char * start )

Definition at line 1400 of file prvm_edict.c.

1401{
1402 const char *funcname;
1403 mfunction_t *func;
1404 prvm_eval_t *fulldata = NULL;
1405 char vabuf[1024];
1406
1407//
1408// immediately call spawn function, but only if there is a self global and a classname
1409//
1410 if (!ent->free)
1411 {
1412 if (!PRVM_alledictstring(ent, classname))
1413 {
1414 Con_Print("No classname for:\n");
1415 PRVM_ED_Print(prog, ent, NULL);
1416 PRVM_ED_Free (prog, ent);
1417 return false;
1418 }
1419 /*
1420 * This is required for FTE compatibility (FreeCS).
1421 * It copies the key/value pairs themselves into a
1422 * global for QC to parse on its own.
1423 */
1424 else if (data && start)
1425 {
1426 if((fulldata = PRVM_ED_FindGlobalEval(prog, "__fullspawndata")))
1427 {
1428 const char *in;
1429 char *spawndata;
1430 fulldata->string = PRVM_AllocString(prog, data - start + 1, &spawndata);
1431 for(in = start; in < data; )
1432 {
1433 char c = *in++;
1434 if(c == '\n')
1435 *spawndata++ = '\t';
1436 else
1437 *spawndata++ = c;
1438 }
1439 *spawndata = 0;
1440 }
1441 }
1442
1443 // look for the spawn function
1444 funcname = PRVM_GetString(prog, PRVM_alledictstring(ent, classname));
1445 func = PRVM_ED_FindFunction (prog, va(vabuf, sizeof(vabuf), "spawnfunc_%s", funcname));
1446 if(!func)
1447 if(!PRVM_allglobalfloat(require_spawnfunc_prefix))
1448 func = PRVM_ED_FindFunction (prog, funcname);
1449
1450 if (!func)
1451 {
1452 // check for OnEntityNoSpawnFunction
1453 if (PRVM_serverfunction(SV_OnEntityNoSpawnFunction))
1454 {
1455 // self = ent
1458 prog->ExecuteProgram(prog, PRVM_serverfunction(SV_OnEntityNoSpawnFunction), "QC function SV_OnEntityNoSpawnFunction is missing");
1459 }
1460 else
1461 {
1462
1463 Con_DPrint("No spawn function for:\n");
1464 if (developer.integer > 0) // don't confuse non-developers with errors
1465 PRVM_ED_Print(prog, ent, NULL);
1466
1467 PRVM_ED_Free (prog, ent);
1468 return false; // not included in "inhibited" count
1469 }
1470 }
1471 else
1472 {
1473 // self = ent
1476 prog->ExecuteProgram(prog, func - prog->functions, "");
1477 }
1478 return true;
1479 }
1480 PRVM_ED_Free(prog, ent);
1481 return false;
1482}
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
Definition console.c:1531
string classname
GLsizeiptr const GLvoid * data
Definition glquake.h:639
cvar_t developer
Definition host.c:48
#define PRVM_alledictstring(ed, fieldname)
Definition progsvm.h:138
#define PRVM_allglobalfloat(fieldname)
Definition progsvm.h:141
mfunction_t * PRVM_ED_FindFunction(prvm_prog_t *prog, const char *name)
Definition prvm_edict.c:425
int PRVM_AllocString(prvm_prog_t *prog, size_t bufferlength, char **pointer)
const char * PRVM_GetString(prvm_prog_t *prog, int num)
prvm_eval_t * PRVM_ED_FindGlobalEval(prvm_prog_t *prog, const char *name)
Definition prvm_edict.c:414
void PRVM_ED_Free(prvm_prog_t *prog, prvm_edict_t *ed)
Definition prvm_edict.c:314
void PRVM_ED_Print(prvm_prog_t *prog, prvm_edict_t *ed, const char *wildcard_fieldname)
Definition prvm_edict.c:657
prvm_int_t string
Definition progsvm.h:62

References classname, Con_DPrint(), Con_Print(), data, developer, prvm_prog_t::ExecuteProgram, prvm_edict_t::free, prvm_prog_t::functions, cvar_t::integer, NULL, PRVM_alledictstring, PRVM_allglobaledict, PRVM_allglobalfloat, PRVM_AllocString(), PRVM_ED_FindFunction(), PRVM_ED_FindGlobalEval(), PRVM_ED_Free(), PRVM_ED_Print(), PRVM_EDICT_TO_PROG, PRVM_GetString(), PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, self, prvm_eval_t::string, sv, server_t::time, time, and va().

Referenced by PRVM_ED_LoadFromFile(), and SV_Ent_Create_f().

◆ PRVM_ED_CanAlloc()

qbool PRVM_ED_CanAlloc ( prvm_prog_t * prog,
prvm_edict_t * e )

Definition at line 243 of file prvm_edict.c.

244{
245 if(!e->free)
246 return false;
248 return true;
250 return false; // never allow reuse in same frame (causes networking trouble)
252 return true;
253 if(host.realtime > e->freetime + 1)
254 return true;
255 return false; // entity slot still blocked because the entity was freed less than one second ago
256}
host_static_t host
Definition host.c:41
cvar_t prvm_reuseedicts_neverinsameframe
Definition prvm_edict.c:47
static double prvm_reuseedicts_always_allow
Definition prvm_edict.c:59
cvar_t prvm_reuseedicts_startuptime
Definition prvm_edict.c:46
float value
Definition cvar.h:74
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
Definition host.h:46
double freetime
sv.time when the object was freed (to prevent early reuse which could mess up client interpolation or...
Definition progsvm.h:96
double starttime
system time when PRVM_Prog_Load was called
Definition progsvm.h:538

References prvm_edict_t::free, prvm_edict_t::freetime, host, cvar_t::integer, prvm_reuseedicts_always_allow, prvm_reuseedicts_neverinsameframe, prvm_reuseedicts_startuptime, host_static_t::realtime, prvm_prog_t::starttime, and cvar_t::value.

Referenced by PRVM_ED_Alloc(), and SV_Physics().

◆ PRVM_ED_ClearEdict()

void PRVM_ED_ClearEdict ( prvm_prog_t * prog,
prvm_edict_t * e )

Definition at line 210 of file prvm_edict.c.

211{
212 memset(e->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
213 e->free = false;
218
219 // AK: Let the init_edict function determine if something needs to be initialized
220 prog->init_edict(prog, e);
221}
const char * allocation_origin
place in the code where it was allocated (for the leak detector)
Definition progsvm.h:87
prvm_vec_t * fp
Definition progsvm.h:102
union prvm_edict_t::@30 fields
union prvm_edict_t::@29 priv
prvm_edict_private_t * required
Definition progsvm.h:101
int entityfields
number of vec_t fields in progs (some variables are 3)
Definition progsvm.h:548
void(* init_edict)(struct prvm_prog_s *prog, prvm_edict_t *edict)
[INIT] used by PRVM_ED_ClearEdict
Definition progsvm.h:737

References prvm_edict_private_t::allocation_origin, prvm_prog_t::entityfields, prvm_edict_t::fields, prvm_edict_t::fp, prvm_edict_t::free, prvm_edict_t::freetime, host, prvm_prog_t::init_edict, Mem_Free, prvm_edict_t::priv, PRVM_AllocationOrigin(), host_static_t::realtime, and prvm_edict_t::required.

Referenced by PRVM_ED_Alloc(), SV_ConnectClient(), SV_DropClient(), SV_Ent_Remove_All_f(), SV_Ent_Remove_f(), and SV_SpawnServer().

◆ PRVM_ED_FieldAtOfs()

mdef_t * PRVM_ED_FieldAtOfs ( prvm_prog_t * prog,
unsigned int ofs )

Definition at line 357 of file prvm_edict.c.

358{
359 mdef_t *def;
360 int i;
361
362 for (i = 0;i < prog->numfielddefs;i++)
363 {
364 def = &prog->fielddefs[i];
365 if (def->ofs == ofs)
366 return def;
367 }
368 return NULL;
369}
prvm_uint_t ofs
uint32_t ofs
Definition pr_comp.h:416
int numfielddefs
Definition progsvm.h:565
mdef_t * fielddefs
Definition progsvm.h:545

References prvm_prog_t::fielddefs, i, NULL, prvm_prog_t::numfielddefs, mdef_t::ofs, and ofs.

Referenced by PRVM_UglyValueString(), PRVM_ValueString(), and while().

◆ PRVM_ED_FindField()

mdef_t * PRVM_ED_FindField ( prvm_prog_t * prog,
const char * name )

Definition at line 376 of file prvm_edict.c.

377{
378 mdef_t *def;
379 int i;
380
381 for (i = 0;i < prog->numfielddefs;i++)
382 {
383 def = &prog->fielddefs[i];
384 if (!strcmp(PRVM_GetString(prog, def->s_name), name))
385 return def;
386 }
387 return NULL;
388}
const GLchar * name
Definition glquake.h:601
int32_t s_name
Definition pr_comp.h:417

References prvm_prog_t::fielddefs, i, name, NULL, prvm_prog_t::numfielddefs, PRVM_GetString(), and mdef_t::s_name.

Referenced by PRVM_ED_EdictGet_f(), PRVM_ED_EdictSet_f(), PRVM_ED_FindFieldOffset(), PRVM_ED_ParseEdict(), PRVM_ED_ParseEpair(), PRVM_UpdateBreakpoints(), and SV_Ent_Create_f().

◆ PRVM_ED_FindFieldOffset()

int PRVM_ED_FindFieldOffset ( prvm_prog_t * prog,
const char * name )

Definition at line 134 of file prvm_edict.c.

135{
136 mdef_t *d;
137 d = PRVM_ED_FindField(prog, field);
138 if (!d)
139 return -1;
140 return d->ofs;
141}
mdef_t * PRVM_ED_FindField(prvm_prog_t *prog, const char *name)
Definition prvm_edict.c:376

References mdef_t::ofs, and PRVM_ED_FindField().

◆ PRVM_ED_FindFunction()

mfunction_t * PRVM_ED_FindFunction ( prvm_prog_t * prog,
const char * name )

Definition at line 425 of file prvm_edict.c.

426{
427 mfunction_t *func;
428 int i;
429
430 for (i = 0;i < prog->numfunctions;i++)
431 {
432 func = &prog->functions[i];
433 if (!strcmp(PRVM_GetString(prog, func->s_name), name))
434 return func;
435 }
436 return NULL;
437}

References prvm_prog_t::functions, i, name, NULL, prvm_prog_t::numfunctions, PRVM_GetString(), and mfunction_t::s_name.

Referenced by CL_CheckRequiredFuncs(), MP_CheckRequiredFuncs(), PRVM_ED_CallSpawnFunction(), PRVM_ED_FindFunctionOffset(), PRVM_ED_ParseEpair(), PRVM_PrintFunctionStatements(), PRVM_UpdateBreakpoints(), VM_callfunction(), and VM_isfunction().

◆ PRVM_ED_FindFunctionOffset()

func_t PRVM_ED_FindFunctionOffset ( prvm_prog_t * prog,
const char * name )

Definition at line 152 of file prvm_edict.c.

153{
154 mfunction_t *f;
155 f = PRVM_ED_FindFunction(prog, function);
156 if (!f)
157 return 0;
158 return (func_t)(f - prog->functions);
159}
unsigned int func_t
Definition pr_comp.h:26
float f

References f, prvm_prog_t::functions, and PRVM_ED_FindFunction().

◆ PRVM_ED_FindGlobal()

mdef_t * PRVM_ED_FindGlobal ( prvm_prog_t * prog,
const char * name )

Definition at line 395 of file prvm_edict.c.

396{
397 mdef_t *def;
398 int i;
399
400 for (i = 0;i < prog->numglobaldefs;i++)
401 {
402 def = &prog->globaldefs[i];
403 if (!strcmp(PRVM_GetString(prog, def->s_name), name))
404 return def;
405 }
406 return NULL;
407}
mdef_t * globaldefs
Definition progsvm.h:546
int numglobaldefs
Definition progsvm.h:564

References prvm_prog_t::globaldefs, i, name, NULL, prvm_prog_t::numglobaldefs, PRVM_GetString(), and mdef_t::s_name.

Referenced by PRVM_ED_FindGlobalEval(), PRVM_ED_FindGlobalOffset(), PRVM_ED_GlobalGet_f(), PRVM_ED_ParseGlobals(), PRVM_Global_f(), PRVM_GlobalSet_f(), and PRVM_UpdateBreakpoints().

◆ PRVM_ED_FindGlobalEval()

prvm_eval_t * PRVM_ED_FindGlobalEval ( prvm_prog_t * prog,
const char * name )

Definition at line 414 of file prvm_edict.c.

415{
416 mdef_t *def = PRVM_ED_FindGlobal(prog, name);
417 return def ? (prvm_eval_t *) &prog->globals.fp[def->ofs] : NULL;
418}
mdef_t * PRVM_ED_FindGlobal(prvm_prog_t *prog, const char *name)
Definition prvm_edict.c:395
prvm_vec_t * fp
Definition progsvm.h:580
union prvm_prog_t::@31 globals

References prvm_prog_t::fp, prvm_prog_t::globals, name, NULL, mdef_t::ofs, and PRVM_ED_FindGlobal().

Referenced by PRVM_ED_CallSpawnFunction().

◆ PRVM_ED_FindGlobalOffset()

int PRVM_ED_FindGlobalOffset ( prvm_prog_t * prog,
const char * name )

Definition at line 143 of file prvm_edict.c.

144{
145 mdef_t *d;
146 d = PRVM_ED_FindGlobal(prog, global);
147 if (!d)
148 return -1;
149 return d->ofs;
150}

References mdef_t::ofs, and PRVM_ED_FindGlobal().

◆ PRVM_ED_Free()

void PRVM_ED_Free ( prvm_prog_t * prog,
prvm_edict_t * ed )

Definition at line 314 of file prvm_edict.c.

315{
316 // dont delete the null entity (world) or reserved edicts
317 if (ed - prog->edicts <= prog->reserved_edicts)
318 return;
319
320 prog->free_edict(prog, ed);
321
322 ed->free = true;
323 ed->freetime = host.realtime;
325 {
328 }
329}
void(* free_edict)(struct prvm_prog_s *prog, prvm_edict_t *ed)
[INIT] used by PRVM_ED_Free
Definition progsvm.h:738
prvm_edict_t * edicts
Definition progsvm.h:680

References prvm_edict_private_t::allocation_origin, prvm_prog_t::edicts, prvm_edict_t::free, prvm_prog_t::free_edict, prvm_edict_t::freetime, host, Mem_Free, NULL, prvm_edict_t::priv, host_static_t::realtime, prvm_edict_t::required, and prvm_prog_t::reserved_edicts.

Referenced by PRVM_ED_CallSpawnFunction(), PRVM_ED_LoadFromFile(), SV_Ent_Create_f(), SV_Ent_Remove_All_f(), SV_Ent_Remove_f(), VM_CL_makestatic(), VM_objerror(), VM_remove(), and VM_SV_makestatic().

◆ PRVM_ED_LoadFromFile()

void PRVM_ED_LoadFromFile ( prvm_prog_t * prog,
const char * data )

Definition at line 1511 of file prvm_edict.c.

1512{
1513 prvm_edict_t *ent;
1514 const char *start;
1515 int parsed, inhibited, spawned, died;
1516
1517 parsed = 0;
1518 inhibited = 0;
1519 spawned = 0;
1520 died = 0;
1521
1523
1524 // parse ents
1525 while (1)
1526 {
1527 start = data;
1528
1529 // parse the opening brace
1530 if (!COM_ParseToken_Simple(&data, false, false, true))
1531 break;
1532 if (com_token[0] != '{')
1533 prog->error_cmd("PRVM_ED_LoadFromFile: %s: found %s when expecting {", prog->name, com_token);
1534
1535 // CHANGED: this is not conform to PR_LoadFromFile
1536 if(prog->loadintoworld)
1537 {
1538 prog->loadintoworld = false;
1539 ent = PRVM_EDICT_NUM(0);
1540 }
1541 else
1542 ent = PRVM_ED_Alloc(prog);
1543
1544 // clear it
1545 if (ent != prog->edicts) // hack
1546 memset (ent->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
1547
1548 data = PRVM_ED_ParseEdict (prog, data, ent, false);
1549 parsed++;
1550
1551 // remove the entity ?
1552 if(!prog->load_edict(prog, ent))
1553 {
1554 PRVM_ED_Free(prog, ent);
1555 inhibited++;
1556 continue;
1557 }
1558
1560
1561 if(ent->free)
1562 {
1563 inhibited++;
1564 continue;
1565 }
1566
1567 SV_LinkEdict(ent);
1568
1569 if(!PRVM_ED_CallSpawnFunction(prog, ent, data, start))
1570 continue;
1571
1573
1574 spawned++;
1575 if (ent->free)
1576 died++;
1577 }
1578
1579 Con_DPrintf("%s: %i new entities parsed, %i new inhibited, %i (%i new) spawned (whereas %i removed self, %i stayed)\n", prog->name, parsed, inhibited, prog->num_edicts, spawned, died, spawned - died);
1580
1582}
char com_token[MAX_INPUTLINE]
Definition common.c:39
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
Definition common.c:463
void PRVM_ED_CallPostspawnFunction(prvm_prog_t *prog, prvm_edict_t *ent)
const char * PRVM_ED_ParseEdict(prvm_prog_t *prog, const char *data, prvm_edict_t *ent, qbool saveload)
qbool PRVM_ED_CallSpawnFunction(prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start)
void PRVM_ED_CallPrespawnFunction(prvm_prog_t *prog, prvm_edict_t *ent)
prvm_edict_t * PRVM_ED_Alloc(prvm_prog_t *prog)
Definition prvm_edict.c:269
void SV_LinkEdict(prvm_edict_t *ent)
Definition sv_phys.c:804
qbool loadintoworld
Definition progsvm.h:707
qbool(* load_edict)(struct prvm_prog_s *prog, prvm_edict_t *ent)
[INIT] used by PRVM_ED_LoadFromFile
Definition progsvm.h:742

References COM_ParseToken_Simple(), com_token, Con_DPrintf(), data, prvm_prog_t::edicts, prvm_prog_t::entityfields, prvm_prog_t::error_cmd, prvm_edict_t::fields, prvm_edict_t::fp, prvm_edict_t::free, host, prvm_prog_t::load_edict, prvm_prog_t::loadintoworld, prvm_prog_t::name, prvm_prog_t::num_edicts, PRVM_ED_Alloc(), PRVM_ED_CallPostspawnFunction(), PRVM_ED_CallPrespawnFunction(), PRVM_ED_CallSpawnFunction(), PRVM_ED_Free(), PRVM_ED_ParseEdict(), PRVM_EDICT_NUM, prvm_reuseedicts_always_allow, host_static_t::realtime, and SV_LinkEdict().

Referenced by SV_SpawnServer(), VM_loadfromdata(), and VM_loadfromfile().

◆ PRVM_ED_ParseEdict()

const char * PRVM_ED_ParseEdict ( prvm_prog_t * prog,
const char * data,
prvm_edict_t * ent,
qbool saveload )

Definition at line 1281 of file prvm_edict.c.

1282{
1283 mdef_t *key;
1284 qbool anglehack;
1285 qbool init = false;
1286 qbool parsebackslash = true;
1287 char keyname[256];
1288 size_t n;
1289
1290// go through all the dictionary pairs
1291 while (1)
1292 {
1293 // parse key
1294 if (!COM_ParseToken_Simple(&data, false, false, true))
1295 prog->error_cmd("PRVM_ED_ParseEdict: EOF without closing brace");
1297 Con_Printf("Key: \"%s\"", com_token);
1298 if (com_token[0] == '}')
1299 break;
1300
1301 // anglehack is to allow QuakeEd to write single scalar angles
1302 // and allow them to be turned into vectors. (FIXME...)
1303 if (!strcmp(com_token, "angle"))
1304 {
1305 dp_strlcpy (com_token, "angles", sizeof(com_token));
1306 anglehack = true;
1307 }
1308 else
1309 anglehack = false;
1310
1311 // FIXME: change light to _light to get rid of this hack
1312 if (!strcmp(com_token, "light"))
1313 dp_strlcpy (com_token, "light_lev", sizeof(com_token)); // hack for single light def
1314
1315 n = dp_strlcpy (keyname, com_token, sizeof(keyname));
1316
1317 // another hack to fix keynames with trailing spaces
1318 while (n && keyname[n-1] == ' ')
1319 {
1320 keyname[n-1] = 0;
1321 n--;
1322 }
1323
1324 // Check if escape parsing is disabled for this key (see cvar description).
1325 // Escapes are always used in savegames and DP_QC_ENTITYSTRING for compatibility.
1326 if (!saveload)
1327 {
1328 const char *cvarpos = sv_entfields_noescapes.string;
1329
1330 while (COM_ParseToken_Console(&cvarpos))
1331 {
1332 if (strcmp(com_token, keyname) == 0)
1333 {
1334 parsebackslash = false;
1335 break;
1336 }
1337 }
1338 }
1339
1340 // parse value
1341 // If loading a save, unescape characters (they're escaped when saving).
1342 // Otherwise, load them as they are (BSP compilers don't support escaping).
1343 if (!COM_ParseToken_Simple(&data, false, parsebackslash, true))
1344 prog->error_cmd("PRVM_ED_ParseEdict: EOF without closing brace");
1346 Con_Printf(" \"%s\"\n", com_token);
1347
1348 if (com_token[0] == '}')
1349 prog->error_cmd("PRVM_ED_ParseEdict: closing brace without data");
1350
1351 init = true;
1352
1353 // ignore attempts to set key "" (this problem occurs in nehahra neh1m8.bsp)
1354 if (!keyname[0])
1355 continue;
1356
1357// keynames with a leading underscore are used for utility comments,
1358// and are immediately discarded by quake
1359 if (keyname[0] == '_')
1360 continue;
1361
1362 key = PRVM_ED_FindField (prog, keyname);
1363 if (!key)
1364 {
1365 Con_DPrintf("%s: '%s' is not a field\n", prog->name, keyname);
1366 continue;
1367 }
1368
1369 if (anglehack)
1370 {
1371 char temp[32];
1372 dp_strlcpy (temp, com_token, sizeof(temp));
1373 dpsnprintf (com_token, sizeof(com_token), "0 %s 0", temp);
1374 }
1375
1376 if (!PRVM_ED_ParseEpair(prog, ent, key, com_token, false))
1377 prog->error_cmd("PRVM_ED_ParseEdict: parse error");
1378 }
1379
1380 if (!init)
1381 {
1382 ent->free = true;
1383 ent->freetime = host.realtime;
1384 }
1385
1386 return data;
1387}
qbool COM_ParseToken_Console(const char **datapointer)
Definition common.c:819
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:997
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
cvar_t developer_entityparsing
Definition host.c:53
qbool PRVM_ED_ParseEpair(prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qbool parsebackslash)
Definition prvm_edict.c:991
cvar_t sv_entfields_noescapes
Definition prvm_edict.c:56
bool qbool
Definition qtypes.h:9
const char * string
Definition cvar.h:71

References COM_ParseToken_Console(), COM_ParseToken_Simple(), com_token, Con_DPrintf(), Con_Printf(), data, developer_entityparsing, dp_strlcpy, dpsnprintf(), prvm_prog_t::error_cmd, prvm_edict_t::free, prvm_edict_t::freetime, host, cvar_t::integer, n, prvm_prog_t::name, PRVM_ED_FindField(), PRVM_ED_ParseEpair(), host_static_t::realtime, cvar_t::string, and sv_entfields_noescapes.

Referenced by PRVM_ED_LoadFromFile(), SV_Loadgame_f(), and VM_parseentitydata().

◆ PRVM_ED_ParseEpair()

qbool PRVM_ED_ParseEpair ( prvm_prog_t * prog,
prvm_edict_t * ent,
mdef_t * key,
const char * s,
qbool parsebackslash )

Definition at line 991 of file prvm_edict.c.

992{
993 int i, l;
994 char *new_p;
995 mdef_t *def;
996 prvm_eval_t *val;
997 mfunction_t *func;
998
999 if (ent)
1000 val = (prvm_eval_t *)(ent->fields.fp + key->ofs);
1001 else
1002 val = (prvm_eval_t *)(prog->globals.fp + key->ofs);
1003 switch (key->type & ~DEF_SAVEGLOBAL)
1004 {
1005 case ev_string:
1006 l = (int)strlen(s) + 1;
1007 val->string = PRVM_AllocString(prog, l, &new_p);
1008 for (i = 0;i < l;i++)
1009 {
1010 if (s[i] == '\\' && s[i+1] && parsebackslash)
1011 {
1012 i++;
1013 if (s[i] == 'n')
1014 *new_p++ = '\n';
1015 else if (s[i] == 'r')
1016 *new_p++ = '\r';
1017 else
1018 *new_p++ = s[i];
1019 }
1020 else
1021 *new_p++ = s[i];
1022 }
1023 break;
1024
1025 case ev_float:
1026 while (*s && ISWHITESPACE(*s))
1027 s++;
1028 val->_float = atof(s);
1029 break;
1030
1031 case ev_vector:
1032 for (i = 0;i < 3;i++)
1033 {
1034 while (*s && ISWHITESPACE(*s))
1035 s++;
1036 if (!*s)
1037 break;
1038 val->vector[i] = atof(s);
1039 while (!ISWHITESPACE(*s))
1040 s++;
1041 if (!*s)
1042 break;
1043 }
1044 break;
1045
1046 case ev_entity:
1047 while (*s && ISWHITESPACE(*s))
1048 s++;
1049 i = atoi(s);
1050 if (i >= prog->limit_edicts)
1051 Con_Printf("PRVM_ED_ParseEpair: ev_entity reference too large (edict %u >= MAX_EDICTS %u) on %s\n", (unsigned int)i, prog->limit_edicts, prog->name);
1052 while (i >= prog->max_edicts)
1054 // if IncreaseEdicts was called the base pointer needs to be updated
1055 if (ent)
1056 val = (prvm_eval_t *)(ent->fields.fp + key->ofs);
1058 break;
1059
1060 case ev_field:
1061 if (*s != '.')
1062 {
1063 Con_DPrintf("PRVM_ED_ParseEpair: Bogus field name %s in %s\n", s, prog->name);
1064 return false;
1065 }
1066 def = PRVM_ED_FindField(prog, s + 1);
1067 if (!def)
1068 {
1069 Con_DPrintf("PRVM_ED_ParseEpair: Can't find field %s in %s\n", s, prog->name);
1070 return false;
1071 }
1072 val->_int = def->ofs;
1073 break;
1074
1075 case ev_function:
1076 func = PRVM_ED_FindFunction(prog, s);
1077 if (!func)
1078 {
1079 Con_Printf("PRVM_ED_ParseEpair: Can't find function %s in %s\n", s, prog->name);
1080 return false;
1081 }
1082 val->function = func - prog->functions;
1083 break;
1084
1085 default:
1086 Con_Printf("PRVM_ED_ParseEpair: Unknown key->type %i for key \"%s\" on %s\n", key->type, PRVM_GetString(prog, key->s_name), prog->name);
1087 return false;
1088 }
1089 return true;
1090}
float strlen(string s)
#define DEF_SAVEGLOBAL
Definition pr_comp.h:421
@ ev_function
Definition pr_comp.h:29
@ ev_vector
Definition pr_comp.h:29
@ ev_entity
Definition pr_comp.h:29
@ ev_field
Definition pr_comp.h:29
@ ev_string
Definition pr_comp.h:29
@ ev_float
Definition pr_comp.h:29
#define ISWHITESPACE(ch)
Definition qdefs.h:184
uint32_t type
Definition pr_comp.h:414
prvm_vec_t _float
Definition progsvm.h:63
prvm_vec_t vector[3]
Definition progsvm.h:64
prvm_int_t _int
Definition progsvm.h:67
prvm_int_t function
Definition progsvm.h:65
prvm_int_t edict
Definition progsvm.h:69

References prvm_eval_t::_float, prvm_eval_t::_int, Con_DPrintf(), Con_Printf(), DEF_SAVEGLOBAL, prvm_eval_t::edict, ev_entity, ev_field, ev_float, ev_function, ev_string, ev_vector, prvm_edict_t::fields, prvm_edict_t::fp, prvm_prog_t::fp, prvm_eval_t::function, prvm_prog_t::functions, prvm_prog_t::globals, i, int(), ISWHITESPACE, prvm_prog_t::limit_edicts, prvm_prog_t::max_edicts, prvm_prog_t::name, mdef_t::ofs, PRVM_AllocString(), PRVM_ED_FindField(), PRVM_ED_FindFunction(), PRVM_EDICT_NUM, PRVM_EDICT_TO_PROG, PRVM_GetString(), PRVM_MEM_IncreaseEdicts(), mdef_t::s_name, prvm_eval_t::string, strlen(), mdef_t::type, and prvm_eval_t::vector.

Referenced by PRVM_ED_EdictSet_f(), PRVM_ED_ParseEdict(), PRVM_ED_ParseGlobals(), PRVM_GlobalSet_f(), SV_Ent_Create_f(), and VM_putentityfieldstring().

◆ PRVM_ED_ParseGlobals()

void PRVM_ED_ParseGlobals ( prvm_prog_t * prog,
const char * data )

Definition at line 940 of file prvm_edict.c.

941{
942 char keyname[MAX_INPUTLINE];
943 mdef_t *key;
944
945 while (1)
946 {
947 // parse key
948 if (!COM_ParseToken_Simple(&data, false, false, true))
949 prog->error_cmd("PRVM_ED_ParseGlobals: EOF without closing brace");
950 if (com_token[0] == '}')
951 break;
952
954 Con_Printf("Key: \"%s\"", com_token);
955
956 dp_strlcpy (keyname, com_token, sizeof(keyname));
957
958 // parse value
959 if (!COM_ParseToken_Simple(&data, false, true, true))
960 prog->error_cmd("PRVM_ED_ParseGlobals: EOF without closing brace");
961
963 Con_Printf(" \"%s\"\n", com_token);
964
965 if (com_token[0] == '}')
966 prog->error_cmd("PRVM_ED_ParseGlobals: closing brace without data");
967
968 key = PRVM_ED_FindGlobal (prog, keyname);
969 if (!key)
970 {
971 Con_DPrintf("'%s' is not a global on %s\n", keyname, prog->name);
972 continue;
973 }
974
975 if (!PRVM_ED_ParseEpair(prog, NULL, key, com_token, true))
976 prog->error_cmd("PRVM_ED_ParseGlobals: parse error");
977 }
978}
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
Definition qdefs.h:94

References COM_ParseToken_Simple(), com_token, Con_DPrintf(), Con_Printf(), data, developer_entityparsing, dp_strlcpy, prvm_prog_t::error_cmd, cvar_t::integer, MAX_INPUTLINE, prvm_prog_t::name, NULL, PRVM_ED_FindGlobal(), and PRVM_ED_ParseEpair().

Referenced by SV_Loadgame_f().

◆ PRVM_ED_Print()

void PRVM_ED_Print ( prvm_prog_t * prog,
prvm_edict_t * ed,
const char * wildcard_fieldname )

Definition at line 657 of file prvm_edict.c.

658{
659 size_t l;
660 mdef_t *d;
661 prvm_eval_t *val;
662 int i, j;
663 const char *name;
664 int type;
665 char tempstring[MAX_INPUTLINE], tempstring2[260]; // temporary string buffers
666 char valuebuf[MAX_INPUTLINE];
667
668 if (ed->free)
669 {
670 Con_Printf("%s: FREE\n",prog->name);
671 return;
672 }
673
674 tempstring[0] = 0;
675 dpsnprintf(tempstring, sizeof(tempstring), "\n%s EDICT %i:\n", prog->name, PRVM_NUM_FOR_EDICT(ed));
676 for (i = 1;i < prog->numfielddefs;i++)
677 {
678 d = &prog->fielddefs[i];
679 name = PRVM_GetString(prog, d->s_name);
680 if(strlen(name) > 1 && name[strlen(name)-2] == '_' && (name[strlen(name)-1] == 'x' || name[strlen(name)-1] == 'y' || name[strlen(name)-1] == 'z'))
681 continue; // skip _x, _y, _z vars
682
683 // Check Field Name Wildcard
684 if(wildcard_fieldname)
685 if( !matchpattern(name, wildcard_fieldname, 1) )
686 // Didn't match; skip
687 continue;
688
689 val = (prvm_eval_t *)(ed->fields.fp + d->ofs);
690
691 // if the value is still all 0, skip the field
692 type = d->type & ~DEF_SAVEGLOBAL;
693
694 for (j=0 ; j<prvm_type_size[type] ; j++)
695 if (val->ivector[j])
696 break;
697 if (j == prvm_type_size[type])
698 continue;
699
700 if (strlen(name) > sizeof(tempstring2)-4)
701 {
702 memcpy (tempstring2, name, sizeof(tempstring2)-4);
703 tempstring2[sizeof(tempstring2)-4] = tempstring2[sizeof(tempstring2)-3] = tempstring2[sizeof(tempstring2)-2] = '.';
704 tempstring2[sizeof(tempstring2)-1] = 0;
705 name = tempstring2;
706 }
707 dp_strlcat(tempstring, name, sizeof(tempstring));
708 for (l = strlen(name);l < 14;l++)
709 dp_strlcat(tempstring, " ", sizeof(tempstring));
710 dp_strlcat(tempstring, " ", sizeof(tempstring));
711
712 name = PRVM_ValueString(prog, (etype_t)d->type, val, valuebuf, sizeof(valuebuf));
713 if (strlen(name) > sizeof(tempstring2)-4)
714 {
715 memcpy (tempstring2, name, sizeof(tempstring2)-4);
716 tempstring2[sizeof(tempstring2)-4] = tempstring2[sizeof(tempstring2)-3] = tempstring2[sizeof(tempstring2)-2] = '.';
717 tempstring2[sizeof(tempstring2)-1] = 0;
718 name = tempstring2;
719 }
720 dp_strlcat(tempstring, name, sizeof(tempstring));
721 dp_strlcat(tempstring, "\n", sizeof(tempstring));
722 if (strlen(tempstring) >= sizeof(tempstring)/2)
723 {
724 Con_Print(tempstring);
725 tempstring[0] = 0;
726 }
727 }
728 if (tempstring[0])
729 Con_Print(tempstring);
730}
#define dp_strlcat(dst, src, dsize)
Definition common.h:304
int matchpattern(const char *in, const char *pattern, int caseinsensitive)
Definition filematch.c:16
GLenum type
Definition glquake.h:656
etype_t
Definition pr_comp.h:29
int prvm_type_size[8]
for consistency : I think a goal of this sub-project is to make the new vm mostly independent from th...
Definition prvm_edict.c:29
static char * PRVM_ValueString(prvm_prog_t *prog, etype_t type, prvm_eval_t *val, char *line, size_t linelength)
Definition prvm_edict.c:447
prvm_int_t ivector[3]
Definition progsvm.h:66

References Con_Print(), Con_Printf(), dp_strlcat, dpsnprintf(), prvm_prog_t::fielddefs, prvm_edict_t::fields, prvm_edict_t::fp, prvm_edict_t::free, i, prvm_eval_t::ivector, matchpattern(), MAX_INPUTLINE, name, prvm_prog_t::name, prvm_prog_t::numfielddefs, mdef_t::ofs, PRVM_GetString(), PRVM_NUM_FOR_EDICT, prvm_type_size, PRVM_ValueString(), mdef_t::s_name, strlen(), mdef_t::type, and type.

Referenced by CLVM_ExecuteProgram(), PRVM_ED_CallSpawnFunction(), PRVM_ED_PrintNum(), PRVM_LeakTest(), SVVM_ExecuteProgram(), VM_error(), and VM_objerror().

◆ PRVM_ED_PrintEdicts_f()

void PRVM_ED_PrintEdicts_f ( struct cmd_state_s * cmd)

◆ PRVM_ED_PrintNum()

void PRVM_ED_PrintNum ( prvm_prog_t * prog,
int ent,
const char * wildcard_fieldname )

Definition at line 788 of file prvm_edict.c.

789{
790 PRVM_ED_Print(prog, PRVM_EDICT_NUM(ent), wildcard_fieldname);
791}

References PRVM_ED_Print(), and PRVM_EDICT_NUM.

Referenced by PRVM_ED_PrintEdict_f(), PRVM_ED_PrintEdicts_f(), and VM_eprint().

◆ PRVM_ED_Write()

void PRVM_ED_Write ( prvm_prog_t * prog,
struct qfile_s * f,
prvm_edict_t * ed )

Referenced by SV_Savegame_to(), and VM_writetofile().

◆ PRVM_ED_WriteGlobals()

void PRVM_ED_WriteGlobals ( prvm_prog_t * prog,
struct qfile_s * f )

Referenced by SV_Savegame_to().

◆ PRVM_EDICT_NUM_ERROR()

unsigned int PRVM_EDICT_NUM_ERROR ( prvm_prog_t * prog,
unsigned int n,
const char * filename,
int fileline )

Definition at line 3275 of file prvm_edict.c.

3276{
3277 prog->error_cmd("PRVM_EDICT_NUM: %s: bad number %i (called at %s:%i)", prog->name, n, filename, fileline);
3278 return 0;
3279}

References prvm_prog_t::error_cmd, n, and prvm_prog_t::name.

◆ PRVM_ExplicitCoverageEvent()

void PRVM_ExplicitCoverageEvent ( prvm_prog_t * prog,
mfunction_t * func,
int statement )

Definition at line 924 of file prvm_exec.c.

925{
926 char vabuf[128];
927 ++prog->explicit_covered;
928 Con_Printf("prvm_coverage: %s just executed a coverage() statement at %s for the first time. Coverage: %.2f%%.\n", prog->name, PRVM_WhereAmI(vabuf, sizeof(vabuf), prog, func, statement), prog->explicit_covered * 100.0 / prog->numexplicitcoveragestatements);
929}
static const char * PRVM_WhereAmI(char *buf, size_t bufsize, prvm_prog_t *prog, mfunction_t *func, int statement)
Definition prvm_exec.c:907
int explicit_covered
Definition progsvm.h:576
int numexplicitcoveragestatements
Definition progsvm.h:577

References Con_Printf(), prvm_prog_t::explicit_covered, prvm_prog_t::name, prvm_prog_t::numexplicitcoveragestatements, and PRVM_WhereAmI().

Referenced by VM_coverage().

◆ PRVM_FreeString()

void PRVM_FreeString ( prvm_prog_t * prog,
int num )

Definition at line 3481 of file prvm_edict.c.

3482{
3483 if (num == 0)
3484 prog->error_cmd("PRVM_FreeString %s: attempt to free a NULL string", prog->name);
3485 else if (num >= 0 && num < prog->stringssize)
3486 prog->error_cmd("PRVM_FreeString %s: attempt to free a constant string", prog->name);
3487 else if (num >= PRVM_KNOWNSTRINGBASE && num < PRVM_KNOWNSTRINGBASE + prog->numknownstrings)
3488 {
3489 num = num - PRVM_KNOWNSTRINGBASE;
3490 if (!prog->knownstrings[num])
3491 prog->error_cmd("PRVM_FreeString %s: attempt to free a non-existent or already freed string", prog->name);
3492 if (!prog->knownstrings_flags[num])
3493 prog->error_cmd("PRVM_FreeString %s: attempt to free a string owned by the engine", prog->name);
3494 PRVM_Free((char *)prog->knownstrings[num]);
3495 if(prog->leaktest_active)
3496 if(prog->knownstrings_origin[num])
3497 PRVM_Free((char *)prog->knownstrings_origin[num]);
3498 prog->knownstrings[num] = NULL;
3499 prog->knownstrings_flags[num] = 0;
3500 prog->firstfreeknownstring = min(prog->firstfreeknownstring, num);
3501 }
3502 else
3503 prog->error_cmd("PRVM_FreeString %s: invalid string offset %i", prog->name, num);
3504}
#define min(A, B)
Definition mathlib.h:37
#define PRVM_Free(buffer)
Definition progsvm.h:819

References prvm_prog_t::error_cmd, prvm_prog_t::firstfreeknownstring, prvm_prog_t::knownstrings, prvm_prog_t::knownstrings_flags, prvm_prog_t::knownstrings_origin, prvm_prog_t::leaktest_active, min, prvm_prog_t::name, NULL, PRVM_Free, and PRVM_KNOWNSTRINGBASE.

Referenced by VM_strunzone().

◆ PRVM_FriendlyProgFromString()

prvm_prog_t * PRVM_FriendlyProgFromString ( const char * str)

for console commands (prints error if name unknown and returns NULL, prints error if prog not loaded and returns NULL)

Definition at line 184 of file prvm_edict.c.

185{
186 prvm_prog_t *prog = PRVM_ProgFromString(str);
187 if (!prog)
188 {
189 Con_Printf("%s: unknown program name\n", str);
190 return NULL;
191 }
192 if (!prog->loaded)
193 {
194 Con_Printf("%s: program is not loaded\n", str);
195 return NULL;
196 }
197 return prog;
198}
prvm_prog_t * PRVM_ProgFromString(const char *str)
Definition prvm_edict.c:166
qbool loaded
used to indicate whether a prog is loaded
Definition progsvm.h:710

References Con_Printf(), prvm_prog_t::loaded, NULL, and PRVM_ProgFromString().

Referenced by PRVM_Breakpoint_f(), PRVM_CallProfile_f(), PRVM_ChildProfile_f(), PRVM_ED_Count_f(), PRVM_ED_EdictGet_f(), PRVM_ED_EdictSet_f(), PRVM_ED_GlobalGet_f(), PRVM_ED_PrintEdict_f(), PRVM_ED_PrintEdicts_f(), PRVM_EdictWatchpoint_f(), PRVM_Fields_f(), PRVM_GameCommand(), PRVM_Global_f(), PRVM_Globals_f(), PRVM_GlobalSet_f(), PRVM_GlobalWatchpoint_f(), PRVM_PrintFunction_f(), and PRVM_Profile_f().

◆ PRVM_GarbageCollection()

void PRVM_GarbageCollection ( prvm_prog_t * prog)

Definition at line 3757 of file prvm_edict.c.

3758{
3762 return;
3763 // philosophy:
3764 // we like to limit how much scanning we do so it doesn't put a significant
3765 // burden on the cpu, so each of these are not complete scans, we also like
3766 // to have consistent cpu usage so we do a bit of work on each category of
3767 // leaked object every frame
3768 switch (gc->stage)
3769 {
3770 case PRVM_GC_START:
3771 gc->stage++;
3772 break;
3774 for (; gc->globals_mark_progress < prog->numglobaldefs && (limit--) > 0; gc->globals_mark_progress++)
3775 {
3776 mdef_t *d = &prog->globaldefs[gc->globals_mark_progress];
3777 switch (d->type)
3778 {
3779 case ev_string:
3780 {
3781 prvm_int_t s = prog->globals.ip[d->ofs];
3782 if (s & PRVM_KNOWNSTRINGBASE)
3783 {
3785 if (!prog->knownstrings[num])
3786 {
3787 // invalid
3788 Con_DPrintf("PRVM_GarbageCollection: Found bogus strzone reference in global %i (global name: \"%s\"), erasing reference", d->ofs, PRVM_GetString(prog, d->s_name));
3789 prog->globals.ip[d->ofs] = 0;
3790 continue;
3791 }
3793 }
3794 }
3795 break;
3796 default:
3797 break;
3798 }
3799 }
3800 if (gc->globals_mark_progress >= prog->numglobaldefs)
3801 gc->stage++;
3802 break;
3804 for (; gc->fields_mark_progress < prog->numfielddefs && limit > 0;)
3805 {
3806 mdef_t *d = &prog->fielddefs[gc->fields_mark_progress];
3807 switch (d->type)
3808 {
3809 case ev_string:
3810 //for (gc-> entityindex = 0; entityindex < prog->num_edicts; entityindex++)
3811 for (;gc->fields_mark_progress_entity < prog->num_edicts && (limit--) > 0;gc->fields_mark_progress_entity++)
3812 {
3813 int entityindex = gc->fields_mark_progress_entity;
3814 prvm_int_t s = prog->edictsfields.ip[entityindex * prog->entityfields + d->ofs];
3815 if (s & PRVM_KNOWNSTRINGBASE)
3816 {
3818 if (!prog->knownstrings[num])
3819 {
3820 // invalid
3821 Con_DPrintf("PRVM_GarbageCollection: Found bogus strzone reference in edict %i field %i (field name: \"%s\"), erasing reference", entityindex, d->ofs, PRVM_GetString(prog, d->s_name));
3822 prog->edictsfields.ip[entityindex * prog->entityfields + d->ofs] = 0;
3823 continue;
3824 }
3826 }
3827 }
3828 if (gc->fields_mark_progress_entity >= prog->num_edicts)
3829 {
3832 }
3833 break;
3834 default:
3837 break;
3838 }
3839 }
3840 if (gc->fields_mark_progress >= prog->numfielddefs)
3841 gc->stage++;
3842 break;
3844 // free any strzone'd strings that are not marked
3846 {
3847 gc->stage++;
3848 break;
3849 }
3850 for (;gc->knownstrings_sweep_progress < prog->numknownstrings && (limit--) > 0;gc->knownstrings_sweep_progress++)
3851 {
3852 int num = gc->knownstrings_sweep_progress;
3853 if (prog->knownstrings[num] && (prog->knownstrings_flags[num] & (KNOWNSTRINGFLAG_GCMARK | KNOWNSTRINGFLAG_ENGINE)) == 0)
3854 {
3856 {
3857 // string has been marked for pruning two passes in a row
3859 Con_DPrintf("prvm_garbagecollection_notify: %s: freeing unreferenced string %i: \"%s\"\n", prog->name, num, prog->knownstrings[num]);
3860 Mem_Free((char *)prog->knownstrings[num]);
3861 prog->knownstrings[num] = NULL;
3862 prog->knownstrings_flags[num] = 0;
3863 prog->firstfreeknownstring = min(prog->firstfreeknownstring, num);
3864 }
3865 else
3866 {
3867 // mark it for pruning next pass
3869 }
3870 }
3871 }
3873 gc->stage++;
3874 break;
3875 case PRVM_GC_RESET:
3876 default:
3877 memset(gc, 0, sizeof(*gc));
3878// Con_Printf("%s%s GC: reset @ %f frametime %f scan_limit per frame %i\n", prog == SVVM_prog ? "^6" : "^5", prog->name, host.realtime, prog == SVVM_prog ? sv.frametime : cl.realframetime, limit);
3879 }
3880}
#define KNOWNSTRINGFLAG_GCPRUNE
Definition progsvm.h:512
cvar_t prvm_garbagecollection_notify
Definition prvm_edict.c:49
cvar_t prvm_garbagecollection_enable
Definition prvm_edict.c:48
cvar_t prvm_garbagecollection_scan_limit
At 50k in Xonotic with 8 bots scans take about: 24s server, 25s menu, 9s client.
Definition prvm_edict.c:53
cvar_t prvm_garbagecollection_strings
Definition prvm_edict.c:54
int32_t prvm_int_t
Definition qtypes.h:56
double realframetime
Definition client.h:871
union prvm_prog_t::@32 edictsfields
prvm_int_t * ip
Definition progsvm.h:581
prvm_prog_garbagecollection_state_t gc
garbage collection status
Definition progsvm.h:599
double frametime
Definition server.h:77

References cl, Con_DPrintf(), prvm_prog_t::edictsfields, prvm_prog_t::entityfields, ev_string, prvm_prog_t::fielddefs, prvm_prog_garbagecollection_state_t::fields_mark_progress, prvm_prog_garbagecollection_state_t::fields_mark_progress_entity, prvm_prog_t::firstfreeknownstring, server_t::frametime, prvm_prog_t::gc, prvm_prog_t::globaldefs, prvm_prog_t::globals, prvm_prog_garbagecollection_state_t::globals_mark_progress, cvar_t::integer, prvm_prog_t::ip, KNOWNSTRINGFLAG_ENGINE, KNOWNSTRINGFLAG_GCMARK, KNOWNSTRINGFLAG_GCPRUNE, prvm_prog_t::knownstrings, prvm_prog_t::knownstrings_flags, prvm_prog_garbagecollection_state_t::knownstrings_sweep_progress, Mem_Free, min, prvm_prog_t::name, NULL, prvm_prog_t::num_edicts, prvm_prog_t::numfielddefs, prvm_prog_t::numglobaldefs, prvm_prog_t::numknownstrings, mdef_t::ofs, prvm_garbagecollection_enable, prvm_garbagecollection_notify, prvm_garbagecollection_scan_limit, prvm_garbagecollection_strings, PRVM_GC_FIELDS_MARK, PRVM_GC_GLOBALS_MARK, PRVM_GC_KNOWNSTRINGS_SWEEP, PRVM_GC_RESET, PRVM_GC_START, PRVM_GetString(), PRVM_KNOWNSTRINGBASE, client_state_t::realframetime, mdef_t::s_name, prvm_prog_garbagecollection_state_t::stage, sv, SVVM_prog, and mdef_t::type.

Referenced by CL_VM_DrawHud(), CL_VM_UpdateView(), MP_Draw(), and SV_Physics().

◆ PRVM_GetString()

const char * PRVM_GetString ( prvm_prog_t * prog,
int num )

Definition at line 3283 of file prvm_edict.c.

3284{
3285 if (num < 0)
3286 {
3287 // invalid
3289 VM_Warning(prog, "PRVM_GetString: Invalid string offset (%i < 0)\n", num);
3290 return "";
3291 }
3292 else if (num < prog->stringssize)
3293 {
3294 // constant string from progs.dat
3295 return prog->strings + num;
3296 }
3297 else if (num <= prog->stringssize + prog->tempstringsbuf.maxsize)
3298 {
3299 // tempstring returned by engine to QC (becomes invalid after returning to engine)
3300 num -= prog->stringssize;
3301 if (num < prog->tempstringsbuf.cursize)
3302 return (char *)prog->tempstringsbuf.data + num;
3303 else
3304 {
3306 VM_Warning(prog, "PRVM_GetString: Invalid temp-string offset (%i >= %i prog->tempstringsbuf.cursize)\n", num, prog->tempstringsbuf.cursize);
3307 return "";
3308 }
3309 }
3310 else if (num & PRVM_KNOWNSTRINGBASE)
3311 {
3312 // allocated string
3313 num = num - PRVM_KNOWNSTRINGBASE;
3314 if (num >= 0 && num < prog->numknownstrings)
3315 {
3316 if (!prog->knownstrings[num])
3317 {
3319 VM_Warning(prog, "PRVM_GetString: Invalid zone-string offset (%i has been freed)\n", num);
3320 return "";
3321 }
3322 // refresh the garbage collection on the string - this guards
3323 // against a certain sort of repeated migration to earlier
3324 // points in the scan that could otherwise result in the string
3325 // being freed for being unused
3326 prog->knownstrings_flags[num] = (prog->knownstrings_flags[num] & ~KNOWNSTRINGFLAG_GCPRUNE) | KNOWNSTRINGFLAG_GCMARK;
3327 return prog->knownstrings[num];
3328 }
3329 else
3330 {
3332 VM_Warning(prog, "PRVM_GetString: Invalid zone-string offset (%i >= %i)\n", num, prog->numknownstrings);
3333 return "";
3334 }
3335 }
3336 else
3337 {
3338 // invalid string offset
3340 VM_Warning(prog, "PRVM_GetString: Invalid constant-string offset (%i >= %i prog->stringssize)\n", num, prog->stringssize);
3341 return "";
3342 }
3343}
void VM_Warning(prvm_prog_t *prog, const char *fmt,...) DP_FUNC_PRINTF(2)
Definition prvm_cmds.c:25
cvar_t prvm_stringdebug
Definition prvm_edict.c:55
int stringssize
Definition progsvm.h:544
char * strings
Definition progsvm.h:543
unsigned char * data
Definition common.h:52
int maxsize
Definition common.h:53

References sizebuf_t::cursize, sizebuf_t::data, cvar_t::integer, KNOWNSTRINGFLAG_GCMARK, prvm_prog_t::knownstrings, prvm_prog_t::knownstrings_flags, sizebuf_t::maxsize, prvm_prog_t::numknownstrings, PRVM_KNOWNSTRINGBASE, prvm_stringdebug, prvm_prog_t::strings, prvm_prog_t::stringssize, prvm_prog_t::tempstringsbuf, and VM_Warning().

Referenced by CLVM_ExecuteProgram(), FindViewthing(), NetConn_BuildStatusResponse(), PRVM_CallProfile(), PRVM_ED_CallSpawnFunction(), PRVM_ED_FindField(), PRVM_ED_FindFunction(), PRVM_ED_FindGlobal(), PRVM_ED_ParseEpair(), PRVM_ED_Print(), PRVM_ED_Write(), PRVM_ED_WriteGlobals(), PRVM_Fields_f(), PRVM_FunctionCoverageEvent(), PRVM_GarbageCollection(), PRVM_Globals_f(), PRVM_GlobalString(), PRVM_GlobalStringNoContents(), PRVM_IsEdictReferenced(), PRVM_IsEdictRelevant(), PRVM_MarkReferencedEdicts(), PRVM_PrintStatement(), PRVM_Profile(), PRVM_Prog_Load(), PRVM_ShortStackTrace(), PRVM_StackTrace(), PRVM_UglyValueString(), PRVM_ValueString(), PRVM_WhereAmI(), SV_CheckVelocity(), SV_Ent_Remove_All_f(), SV_Ent_Remove_f(), SV_PrepareEntityForSending(), SV_Savegame_to(), SV_SendServerinfo(), SV_SpawnServer(), SV_Status_f(), SV_UnstickEntity(), SV_UpdateToReliableMessages(), SV_WriteClientdataToMessage(), SVVM_ExecuteProgram(), VM_error(), VM_objerror(), VM_SV_droptofloor(), and while().

◆ PRVM_GlobalString()

char * PRVM_GlobalString ( prvm_prog_t * prog,
int ofs,
char * line,
size_t linelength )

Definition at line 602 of file prvm_edict.c.

603{
604 char *s;
605 //size_t i;
606 mdef_t *def;
607 prvm_eval_t *val;
608 char valuebuf[MAX_INPUTLINE];
609
610 val = (prvm_eval_t *)&prog->globals.fp[ofs];
611 def = PRVM_ED_GlobalAtOfs(prog, ofs);
612 if (!def)
613 dpsnprintf (line, linelength, "GLOBAL%i", ofs);
614 else
615 {
616 s = PRVM_ValueString (prog, (etype_t)def->type, val, valuebuf, sizeof(valuebuf));
617 dpsnprintf (line, linelength, "%s (=%s)", PRVM_GetString(prog, def->s_name), s);
618 }
619
620 //i = strlen(line);
621 //for ( ; i<20 ; i++)
622 // strcat (line," ");
623 //strcat (line," ");
624
625 return line;
626}
static mdef_t * PRVM_ED_GlobalAtOfs(prvm_prog_t *prog, unsigned int ofs)
Definition prvm_edict.c:338

References dpsnprintf(), prvm_prog_t::fp, prvm_prog_t::globals, MAX_INPUTLINE, ofs, PRVM_ED_GlobalAtOfs(), PRVM_GetString(), PRVM_ValueString(), mdef_t::s_name, and mdef_t::type.

Referenced by PRVM_PrintStatement().

◆ PRVM_GlobalStringNoContents()

char * PRVM_GlobalStringNoContents ( prvm_prog_t * prog,
int ofs,
char * line,
size_t linelength )

Definition at line 628 of file prvm_edict.c.

629{
630 //size_t i;
631 mdef_t *def;
632
633 def = PRVM_ED_GlobalAtOfs(prog, ofs);
634 if (!def)
635 dpsnprintf (line, linelength, "GLOBAL%i", ofs);
636 else
637 dpsnprintf (line, linelength, "%s", PRVM_GetString(prog, def->s_name));
638
639 //i = strlen(line);
640 //for ( ; i<20 ; i++)
641 // strcat (line," ");
642 //strcat (line," ");
643
644 return line;
645}

References dpsnprintf(), ofs, PRVM_ED_GlobalAtOfs(), PRVM_GetString(), and mdef_t::s_name.

◆ PRVM_Init()

void PRVM_Init ( void )

Definition at line 3198 of file prvm_edict.c.

3199{
3200 unsigned int i;
3201
3202 Cmd_AddCommand(CF_SHARED, "prvm_edict", PRVM_ED_PrintEdict_f, "print all data about an entity number in the selected VM (server, client, menu)");
3203 Cmd_AddCommand(CF_SHARED, "prvm_edicts", PRVM_ED_PrintEdicts_f, "prints all data about all entities in the selected VM (server, client, menu)");
3204 Cmd_AddCommand(CF_SHARED, "prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
3205 Cmd_AddCommand(CF_SHARED, "prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
3206 Cmd_AddCommand(CF_SHARED, "prvm_childprofile", PRVM_ChildProfile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu), sorted by time taken in function with child calls");
3207 Cmd_AddCommand(CF_SHARED, "prvm_callprofile", PRVM_CallProfile_f, "prints execution statistics about the most time consuming QuakeC calls from the engine in the selected VM (server, client, menu)");
3208 Cmd_AddCommand(CF_SHARED, "prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
3209 Cmd_AddCommand(CF_SHARED, "prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
3210 Cmd_AddCommand(CF_SHARED, "prvm_global", PRVM_Global_f, "prints value of a specified global variable in the selected VM (server, client, menu)");
3211 Cmd_AddCommand(CF_SHARED, "prvm_globalset", PRVM_GlobalSet_f, "sets value of a specified global variable in the selected VM (server, client, menu)");
3212 Cmd_AddCommand(CF_SHARED, "prvm_edictset", PRVM_ED_EdictSet_f, "changes value of a specified property of a specified entity in the selected VM (server, client, menu)");
3213 Cmd_AddCommand(CF_SHARED, "prvm_edictget", PRVM_ED_EdictGet_f, "retrieves the value of a specified property of a specified entity in the selected VM (server, client menu) into a cvar or to the console");
3214 Cmd_AddCommand(CF_SHARED, "prvm_globalget", PRVM_ED_GlobalGet_f, "retrieves the value of a specified global variable in the selected VM (server, client menu) into a cvar or to the console");
3215 Cmd_AddCommand(CF_SHARED, "prvm_printfunction", PRVM_PrintFunction_f, "prints a disassembly (QuakeC instructions) of the specified function in the selected VM (server, client, menu)");
3216 Cmd_AddCommand(CF_SHARED, "cl_cmd", PRVM_GameCommand_Client_f, "calls the client QC function GameCommand with the supplied string as argument");
3217 Cmd_AddCommand(CF_SHARED, "menu_cmd", PRVM_GameCommand_Menu_f, "calls the menu QC function GameCommand with the supplied string as argument");
3218 Cmd_AddCommand(CF_SHARED, "sv_cmd", PRVM_GameCommand_Server_f, "calls the server QC function GameCommand with the supplied string as argument");
3219 Cmd_AddCommand(CF_SHARED, "prvm_breakpoint", PRVM_Breakpoint_f, "marks a statement or function as breakpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear breakpoint");
3220 Cmd_AddCommand(CF_SHARED, "prvm_globalwatchpoint", PRVM_GlobalWatchpoint_f, "marks a global as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
3221 Cmd_AddCommand(CF_SHARED, "prvm_edictwatchpoint", PRVM_EdictWatchpoint_f, "marks an entity field as watchpoint (when this is executed, a stack trace is printed); to actually halt and investigate state, combine this with a gdb breakpoint on PRVM_Breakpoint, or with prvm_breakpointdump; run with just progs name to clear watchpoint");
3222
3243
3244 // COMMANDLINEOPTION: PRVM: -norunaway disables the runaway loop check (it might be impossible to exit DarkPlaces if used!)
3245 prvm_runawaycheck = !Sys_CheckParm("-norunaway");
3246
3247 //VM_Cmd_Init();
3248
3249 // LadyHavoc: report supported extensions
3250 Con_DPrintf("\nQuakeC extensions for server and client:");
3251 for (i = 0; vm_sv_extensions[i]; i++)
3253 Con_DPrintf("\n");
3254#ifdef CONFIG_MENU
3255 Con_DPrintf("\nQuakeC extensions for menu:");
3256 for (i = 0; vm_m_extensions[i]; i++)
3257 Con_DPrintf(" %s", vm_m_extensions[i]);
3258 Con_DPrintf("\n");
3259#endif
3260}
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_SHARED
Definition cmd.h:67
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599
const char * vm_m_extensions[]
Definition mvm_cmds.c:13
void PRVM_Profile_f(struct cmd_state_s *cmd)
void PRVM_ChildProfile_f(struct cmd_state_s *cmd)
const char * vm_sv_extensions[]
client also uses this
Definition svvm_cmds.c:11
void PRVM_CallProfile_f(struct cmd_state_s *cmd)
void PRVM_PrintFunction_f(struct cmd_state_s *cmd)
static void PRVM_GameCommand_Client_f(cmd_state_t *cmd)
static void PRVM_EdictWatchpoint_f(cmd_state_t *cmd)
static void PRVM_Global_f(cmd_state_t *cmd)
cvar_t prvm_coverage
Definition prvm_edict.c:39
static void PRVM_ED_EdictSet_f(cmd_state_t *cmd)
cvar_t prvm_gameplayfix_div0is0
Definition prvm_edict.c:57
static void PRVM_GlobalSet_f(cmd_state_t *cmd)
static void PRVM_GlobalWatchpoint_f(cmd_state_t *cmd)
cvar_t prvm_timeprofiling
Definition prvm_edict.c:38
cvar_t prvm_language
Definition prvm_edict.c:33
static void PRVM_GameCommand_Menu_f(cmd_state_t *cmd)
static void PRVM_ED_PrintEdict_f(cmd_state_t *cmd)
Definition prvm_edict.c:832
static void PRVM_ED_GlobalGet_f(cmd_state_t *cmd)
void PRVM_ED_PrintEdicts_f(cmd_state_t *cmd)
Definition prvm_edict.c:800
cvar_t prvm_leaktest
Definition prvm_edict.c:41
qbool prvm_runawaycheck
Definition prvm_edict.c:60
static void PRVM_Fields_f(cmd_state_t *cmd)
cvar_t prvm_statementprofiling
Definition prvm_edict.c:37
static void PRVM_Globals_f(cmd_state_t *cmd)
cvar_t prvm_backtraceforwarnings
Definition prvm_edict.c:40
static void PRVM_ED_Count_f(cmd_state_t *cmd)
Definition prvm_edict.c:871
cvar_t prvm_leaktest_follow_targetname
Definition prvm_edict.c:42
cvar_t prvm_traceqc
Definition prvm_edict.c:35
cvar_t prvm_leaktest_ignore_classnames
Definition prvm_edict.c:43
static void PRVM_Breakpoint_f(cmd_state_t *cmd)
static void PRVM_GameCommand_Server_f(cmd_state_t *cmd)
cvar_t prvm_errordump
Definition prvm_edict.c:44
static void PRVM_ED_EdictGet_f(cmd_state_t *cmd)
int Sys_CheckParm(const char *parm)
Definition sys_shared.c:327

References CF_SHARED, Cmd_AddCommand(), Con_DPrintf(), Cvar_RegisterVariable(), i, prvm_backtraceforwarnings, PRVM_Breakpoint_f(), prvm_breakpointdump, PRVM_CallProfile_f(), PRVM_ChildProfile_f(), prvm_coverage, PRVM_ED_Count_f(), PRVM_ED_EdictGet_f(), PRVM_ED_EdictSet_f(), PRVM_ED_GlobalGet_f(), PRVM_ED_PrintEdict_f(), PRVM_ED_PrintEdicts_f(), PRVM_EdictWatchpoint_f(), prvm_errordump, PRVM_Fields_f(), PRVM_GameCommand_Client_f(), PRVM_GameCommand_Menu_f(), PRVM_GameCommand_Server_f(), prvm_gameplayfix_div0is0, prvm_garbagecollection_enable, prvm_garbagecollection_notify, prvm_garbagecollection_scan_limit, prvm_garbagecollection_strings, PRVM_Global_f(), PRVM_Globals_f(), PRVM_GlobalSet_f(), PRVM_GlobalWatchpoint_f(), prvm_language, prvm_leaktest, prvm_leaktest_follow_targetname, prvm_leaktest_ignore_classnames, PRVM_PrintFunction_f(), PRVM_Profile_f(), prvm_reuseedicts_neverinsameframe, prvm_reuseedicts_startuptime, prvm_runawaycheck, prvm_statementprofiling, prvm_stringdebug, prvm_timeprofiling, prvm_traceqc, sv_entfields_noescapes, Sys_CheckParm(), vm_m_extensions, and vm_sv_extensions.

Referenced by Host_Init().

◆ PRVM_Init_Exec()

void PRVM_Init_Exec ( prvm_prog_t * prog)

Definition at line 892 of file prvm_exec.c.

893{
894 // dump the stack
895 prog->depth = 0;
896 prog->localstack_used = 0;
897 // reset the string table
898 // nothing here yet
899}
int localstack_used
Definition progsvm.h:629

References prvm_prog_t::depth, and prvm_prog_t::localstack_used.

Referenced by PRVM_Prog_Load().

◆ PRVM_MEM_IncreaseEdicts()

void PRVM_MEM_IncreaseEdicts ( prvm_prog_t * prog)

Definition at line 105 of file prvm_edict.c.

106{
107 int i;
108
109 if(prog->max_edicts >= prog->limit_edicts)
110 return;
111
112 prog->begin_increase_edicts(prog);
113
114 // increase edicts
115 prog->max_edicts = min(prog->max_edicts + 256, prog->limit_edicts);
116
117 prog->entityfieldsarea = prog->entityfields * prog->max_edicts;
118 prog->edictsfields.fp = (prvm_vec_t*)Mem_Realloc(prog->progs_mempool, (void *)prog->edictsfields.fp, prog->entityfieldsarea * sizeof(prvm_vec_t));
119 prog->edictprivate = (void *)Mem_Realloc(prog->progs_mempool, (void *)prog->edictprivate, prog->max_edicts * prog->edictprivate_size);
120
121 //set e and v pointers
122 for(i = 0; i < prog->max_edicts; i++)
123 {
124 prog->edicts[i].priv.required = (prvm_edict_private_t *)((unsigned char *)prog->edictprivate + i * prog->edictprivate_size);
125 prog->edicts[i].fields.fp = prog->edictsfields.fp + i * prog->entityfields;
126 }
127
128 prog->end_increase_edicts(prog);
129}
int entityfieldsarea
LadyHavoc: equal to max_edicts * entityfields (for bounds checking)
Definition progsvm.h:549
void * edictprivate
Definition progsvm.h:686
int edictprivate_size
size of the engine private struct
Definition progsvm.h:689
void(* begin_increase_edicts)(struct prvm_prog_s *prog)
[INIT] used by PRVM_MEM_Increase_Edicts
Definition progsvm.h:734
mempool_t * progs_mempool
all memory allocations related to this vm_prog (code, edicts, strings)
Definition progsvm.h:602
void(* end_increase_edicts)(struct prvm_prog_s *prog)
[INIT]
Definition progsvm.h:735
#define Mem_Realloc(pool, data, size)
Definition zone.h:94

References prvm_prog_t::begin_increase_edicts, prvm_prog_t::edictprivate, prvm_prog_t::edictprivate_size, prvm_prog_t::edicts, prvm_prog_t::edictsfields, prvm_prog_t::end_increase_edicts, prvm_prog_t::entityfields, prvm_prog_t::entityfieldsarea, prvm_edict_t::fields, prvm_edict_t::fp, prvm_prog_t::fp, i, prvm_prog_t::limit_edicts, prvm_prog_t::max_edicts, Mem_Realloc, min, prvm_edict_t::priv, prvm_prog_t::progs_mempool, and prvm_edict_t::required.

Referenced by PRVM_ED_Alloc(), PRVM_ED_ParseEpair(), and SV_Loadgame_f().

◆ PRVM_PrintFunction_f()

void PRVM_PrintFunction_f ( struct cmd_state_s * cmd)

Referenced by PRVM_Init().

◆ PRVM_PrintFunctionStatements()

void PRVM_PrintFunctionStatements ( prvm_prog_t * prog,
const char * name )

Definition at line 374 of file prvm_exec.c.

375{
376 int i, firststatement, endstatement;
377 mfunction_t *func;
378 func = PRVM_ED_FindFunction (prog, name);
379 if (!func)
380 {
381 Con_Printf("%s progs: no function named %s\n", prog->name, name);
382 return;
383 }
384 firststatement = func->first_statement;
385 if (firststatement < 0)
386 {
387 Con_Printf("%s progs: function %s is builtin #%i\n", prog->name, name, -firststatement);
388 return;
389 }
390
391 // find the end statement
392 endstatement = prog->numstatements;
393 for (i = 0;i < prog->numfunctions;i++)
394 if (endstatement > prog->functions[i].first_statement && firststatement < prog->functions[i].first_statement)
395 endstatement = prog->functions[i].first_statement;
396
397 // now print the range of statements
398 Con_Printf("%s progs: disassembly of function %s (statements %i-%i, locals %i-%i):\n", prog->name, name, firststatement, endstatement, func->parm_start, func->parm_start + func->locals - 1);
399 prog->xfunction = func;
400 for (i = firststatement;i < endstatement;i++)
401 {
402 PRVM_PrintStatement(prog, prog->statements + i);
403 if (!(prvm_coverage.integer & 4))
404 prog->statement_profile[i] = 0;
405 }
406 if (prvm_coverage.integer & 4)
407 Con_Printf("Collecting statement coverage, not flushing statement profile.\n");
408}
mfunction_t * PRVM_ED_FindFunction(prvm_prog_t *prog, const char *name)
Definition prvm_edict.c:425
static void PRVM_PrintStatement(prvm_prog_t *prog, mstatement_t *s)
Definition prvm_exec.c:329
int32_t first_statement
Definition pr_comp.h:444
int32_t locals
Definition pr_comp.h:446
int32_t parm_start
Definition pr_comp.h:445
double * statement_profile
only incremented if prvm_statementprofiling is on
Definition progsvm.h:573
int numstatements
Definition progsvm.h:563

References Con_Printf(), mfunction_t::first_statement, prvm_prog_t::functions, i, cvar_t::integer, mfunction_t::locals, name, prvm_prog_t::name, prvm_prog_t::numfunctions, prvm_prog_t::numstatements, mfunction_t::parm_start, prvm_coverage, PRVM_ED_FindFunction(), PRVM_PrintStatement(), prvm_prog_t::statement_profile, prvm_prog_t::statements, and prvm_prog_t::xfunction.

Referenced by PRVM_PrintFunction_f().

◆ PRVM_PrintState()

void PRVM_PrintState ( prvm_prog_t * prog,
int stack_index )

Definition at line 726 of file prvm_exec.c.

727{
728 int i;
729 mfunction_t *func = prog->xfunction;
730 int st = prog->xstatement;
731 if (stack_index > 0 && stack_index <= prog->depth)
732 {
733 func = prog->stack[prog->depth - stack_index].f;
734 st = prog->stack[prog->depth - stack_index].s;
735 }
736 if (prog->statestring)
737 {
738 Con_Printf("Caller-provided information: %s\n", prog->statestring);
739 }
740 if (func)
741 {
742 for (i = -7; i <= 0;i++)
743 if (st + i >= func->first_statement)
744 PRVM_PrintStatement(prog, prog->statements + st + i);
745 }
746 PRVM_StackTrace(prog);
747}
void PRVM_StackTrace(prvm_prog_t *prog)
Definition prvm_exec.c:436
const char * statestring
printed together with backtraces
Definition progsvm.h:717
prvm_stack_t stack[PRVM_MAX_STACK_DEPTH+1]
stacktrace writes into stack[MAX_STACK_DEPTH] thus increase the array, so depth wont be overwritten
Definition progsvm.h:625
int xstatement
Definition progsvm.h:621
mfunction_t * f
Definition progsvm.h:53

References Con_Printf(), depth, prvm_prog_t::depth, prvm_stack_t::f, mfunction_t::first_statement, i, PRVM_PrintStatement(), PRVM_StackTrace(), prvm_stack_t::s, prvm_prog_t::stack, prvm_prog_t::statements, prvm_prog_t::statestring, prvm_prog_t::xfunction, and prvm_prog_t::xstatement.

Referenced by PRVM_Breakpoint(), PRVM_Crash(), and VM_Warning().

◆ PRVM_Profile()

void PRVM_Profile ( prvm_prog_t * prog,
int maxfunctions,
double mintime,
int sortby )

Definition at line 539 of file prvm_exec.c.

540{
541 mfunction_t *f, *best;
542 int i, num;
543 double max;
544
546 mintime *= 10000000; // count each statement as about 0.1µs
547
549 Con_Printf( "%s Profile:\n[CallCount] [Time] [BuiltinTm] [Statement] [BuiltinCt] [TimeTotal] [StmtTotal] [BltnTotal] [self]\n", prog->name );
550 // 12345678901 12345678901 12345678901 12345678901 12345678901 12345678901 12345678901 123.45%
551 else
552 Con_Printf( "%s Profile:\n[CallCount] [Statement] [BuiltinCt] [StmtTotal] [BltnTotal] [self]\n", prog->name );
553 // 12345678901 12345678901 12345678901 12345678901 12345678901 123.45%
554
555 num = 0;
556 do
557 {
558 max = 0;
559 best = NULL;
560 for (i=0 ; i<prog->numfunctions ; i++)
561 {
562 f = &prog->functions[i];
564 {
565 if(sortby)
566 {
567 if(f->first_statement < 0)
568 {
569 if (max < f->tprofile)
570 {
571 max = f->tprofile;
572 best = f;
573 }
574 }
575 else
576 {
577 if (max < f->tprofile_total)
578 {
579 max = f->tprofile_total;
580 best = f;
581 }
582 }
583 }
584 else
585 {
586 if (max < f->tprofile + f->tbprofile)
587 {
588 max = f->tprofile + f->tbprofile;
589 best = f;
590 }
591 }
592 }
593 else
594 {
595 if(sortby)
596 {
597 if (max < f->profile_total + f->builtinsprofile_total + f->callcount)
598 {
599 max = f->profile_total + f->builtinsprofile_total + f->callcount;
600 best = f;
601 }
602 }
603 else
604 {
605 if (max < f->profile + f->builtinsprofile + f->callcount)
606 {
607 max = f->profile + f->builtinsprofile + f->callcount;
608 best = f;
609 }
610 }
611 }
612 }
613 if (best)
614 {
615 if (num < maxfunctions && max > mintime)
616 {
618 {
619 if (best->first_statement < 0)
620 Con_Printf("%11.0f %11.6f ------------- builtin ------------- %11.6f ----------- builtin ----------- %s\n", best->callcount, best->tprofile, best->tprofile, PRVM_GetString(prog, best->s_name));
621 // %11.6f 12345678901 12345678901 12345678901 %11.6f 12345678901 12345678901 123.45%
622 else
623 Con_Printf("%11.0f %11.6f %11.6f %11.0f %11.0f %11.6f %11.0f %11.0f %6.2f%% %s\n", best->callcount, best->tprofile, best->tbprofile, best->profile, best->builtinsprofile, best->tprofile_total, best->profile_total, best->builtinsprofile_total, (best->tprofile_total > 0) ? ((best->tprofile) * 100.0 / (best->tprofile_total)) : -99.99, PRVM_GetString(prog, best->s_name));
624 }
625 else
626 {
627 if (best->first_statement < 0)
628 Con_Printf("%11.0f ----------------------- builtin ----------------------- %s\n", best->callcount, PRVM_GetString(prog, best->s_name));
629 // 12345678901 12345678901 12345678901 12345678901 123.45%
630 else
631 Con_Printf("%11.0f %11.0f %11.0f %11.0f %11.0f %6.2f%% %s\n", best->callcount, best->profile, best->builtinsprofile, best->profile_total, best->builtinsprofile_total, (best->profile + best->builtinsprofile) * 100.0 / (best->profile_total + best->builtinsprofile_total), PRVM_GetString(prog, best->s_name));
632 }
633 }
634 num++;
635 best->profile = 0;
636 best->tprofile = 0;
637 best->tbprofile = 0;
638 best->builtinsprofile = 0;
639 best->profile_total = 0;
640 best->tprofile_total = 0;
641 best->builtinsprofile_total = 0;
642 best->callcount = 0;
643 }
644 } while (best);
645}
#define max(A, B)
Definition mathlib.h:38
double tbprofile
Definition pr_comp.h:450
double builtinsprofile
Definition pr_comp.h:452
double profile
Definition pr_comp.h:451
double builtinsprofile_total
Definition pr_comp.h:457
double tprofile_total
Definition pr_comp.h:455
double tprofile
Definition pr_comp.h:449
double profile_total
Definition pr_comp.h:456

References mfunction_t::builtinsprofile, mfunction_t::builtinsprofile_total, mfunction_t::callcount, Con_Printf(), f, mfunction_t::first_statement, prvm_prog_t::functions, i, cvar_t::integer, max, prvm_prog_t::name, NULL, prvm_prog_t::numfunctions, mfunction_t::profile, mfunction_t::profile_total, PRVM_GetString(), prvm_timeprofiling, mfunction_t::s_name, mfunction_t::tbprofile, mfunction_t::tprofile, and mfunction_t::tprofile_total.

Referenced by PRVM_ChildProfile_f(), PRVM_Profile_f(), and while().

◆ PRVM_Profile_f()

void PRVM_Profile_f ( struct cmd_state_s * cmd)

Referenced by PRVM_Init().

◆ PRVM_Prog_Init()

void PRVM_Prog_Init ( prvm_prog_t * prog,
struct cmd_state_s * cmd )

Initializing a vm: Call InitProg with the num Set up the fields marked with [INIT] in the prog struct Load a program with LoadProgs NB: Load expects to be called right after Reset (which is called by Init)

Referenced by CL_VM_Init(), MP_Init(), and SV_VM_Setup().

◆ PRVM_Prog_Load()

void PRVM_Prog_Load ( prvm_prog_t * prog,
const char * filename,
unsigned char * data,
fs_offset_t size,
void CheckRequiredFuncsprvm_prog_t *prog, const char *filename,
int numrequiredfields,
prvm_required_field_t * required_field,
int numrequiredglobals,
prvm_required_field_t * required_global )

Definition at line 2024 of file prvm_edict.c.

2025{
2026 int i;
2027 dprograms_t *dprograms;
2028
2029 dstatement16_t *instatements16;
2030 dstatement32_t *instatements32;
2031 ddef16_t *infielddefs16;
2032 ddef32_t *infielddefs32;
2033 ddef16_t *inglobaldefs16;
2034 ddef32_t *inglobaldefs32;
2035
2036 int *inglobals;
2037 dfunction_t *infunctions;
2038 char *instrings;
2039 fs_offset_t filesize;
2040 int requiredglobalspace;
2041 opcode_t op;
2042 int a;
2043 int b;
2044 int c;
2045 union
2046 {
2047 unsigned int i;
2048 float f;
2049 }
2050 u;
2051 unsigned int d;
2052 char vabuf[1024];
2053 char vabuf2[1024];
2054 cvar_t *cvar;
2055 int structtype = 0;
2056 int max_safe_edicts;
2057
2058 if (prog->loaded)
2059 prog->error_cmd("%s: there is already a %s program loaded!", __func__, prog->name);
2060
2061 Host_LockSession(); // all progs can use the session cvar
2062 Crypto_LoadKeys(); // all progs might use the keys at init time
2063
2064 if (data)
2065 {
2066 dprograms = (dprograms_t *) data;
2067 filesize = size;
2068 }
2069 else
2070 dprograms = (dprograms_t *)FS_LoadFile (filename, prog->progs_mempool, false, &filesize);
2071 if (dprograms == NULL || filesize < (fs_offset_t)sizeof(dprograms_t))
2072 prog->error_cmd("%s: couldn't load \"%s\" for %s", __func__, filename, prog->name);
2073 // TODO bounds check header fields (e.g. numstatements), they must never go behind end of file
2074
2075 prog->profiletime = Sys_DirtyTime();
2076 prog->starttime = host.realtime;
2077
2078 requiredglobalspace = 0;
2079 for (i = 0;i < numrequiredglobals;i++)
2080 requiredglobalspace += required_global[i].type == ev_vector ? 3 : 1;
2081
2082 prog->filecrc = CRC_Block((unsigned char *)dprograms, filesize);
2083
2084// byte swap the header
2085 prog->progs_version = LittleLong(dprograms->version);
2086 prog->progs_crc = LittleLong(dprograms->crc);
2087 if (prog->progs_version == 7)
2088 {
2089 dprograms_v7_t *v7 = (dprograms_v7_t*)dprograms;
2090 structtype = LittleLong(v7->secondaryversion);
2091 if (structtype == PROG_SECONDARYVERSION16 ||
2092 structtype == PROG_SECONDARYVERSION32) // barely supported
2093 Con_Printf(CON_WARN "WARNING: %s: %s targets FTEQW, for which support is incomplete. Proceed at your own risk.\n", prog->name, filename);
2094 else
2095 prog->error_cmd("%s: %s targets unknown engine", prog->name, filename);
2096
2097 if (v7->numbodylessfuncs != 0 || v7->numtypes != 0 || v7->blockscompressed != 0)
2098 prog->error_cmd("%s: %s uses unsupported features.", prog->name, filename);
2099 }
2100 else if (prog->progs_version != PROG_VERSION)
2101 prog->error_cmd("%s: %s has wrong version number (%i should be %i)", prog->name, filename, prog->progs_version, PROG_VERSION);
2102 instatements16 = (dstatement16_t *)((unsigned char *)dprograms + LittleLong(dprograms->ofs_statements));
2103 instatements32 = (dstatement32_t *)instatements16;
2104 prog->progs_numstatements = LittleLong(dprograms->numstatements);
2105 inglobaldefs16 = (ddef16_t *)((unsigned char *)dprograms + LittleLong(dprograms->ofs_globaldefs));
2106 inglobaldefs32 = (ddef32_t *)inglobaldefs16;
2107 prog->progs_numglobaldefs = LittleLong(dprograms->numglobaldefs);
2108 infielddefs16 = (ddef16_t *)((unsigned char *)dprograms + LittleLong(dprograms->ofs_fielddefs));
2109 infielddefs32 = (ddef32_t *)infielddefs16;
2110 prog->progs_numfielddefs = LittleLong(dprograms->numfielddefs);
2111 infunctions = (dfunction_t *)((unsigned char *)dprograms + LittleLong(dprograms->ofs_functions));
2112 prog->progs_numfunctions = LittleLong(dprograms->numfunctions);
2113 instrings = (char *)((unsigned char *)dprograms + LittleLong(dprograms->ofs_strings));
2114 prog->progs_numstrings = LittleLong(dprograms->numstrings);
2115 inglobals = (int *)((unsigned char *)dprograms + LittleLong(dprograms->ofs_globals));
2116 prog->progs_numglobals = LittleLong(dprograms->numglobals);
2117 prog->progs_entityfields = LittleLong(dprograms->entityfields);
2118
2119 prog->numstatements = prog->progs_numstatements;
2120 prog->numglobaldefs = prog->progs_numglobaldefs;
2121 prog->numfielddefs = prog->progs_numfielddefs;
2122 prog->numfunctions = prog->progs_numfunctions;
2123 prog->numstrings = prog->progs_numstrings;
2124 prog->numglobals = prog->progs_numglobals;
2125 prog->entityfields = prog->progs_entityfields;
2126
2127 if (LittleLong(dprograms->ofs_strings) + prog->progs_numstrings > (int)filesize)
2128 prog->error_cmd("%s: %s strings go past end of file", prog->name, filename);
2129 prog->strings = (char *)Mem_Alloc(prog->progs_mempool, prog->progs_numstrings);
2130 memcpy(prog->strings, instrings, prog->progs_numstrings);
2131 prog->stringssize = prog->progs_numstrings;
2132
2133 prog->numknownstrings = 0;
2134 prog->maxknownstrings = 0;
2135 prog->knownstrings = NULL;
2136 prog->knownstrings_flags = NULL;
2137
2139
2140 // we need to expand the globaldefs and fielddefs to include engine defs
2141 prog->globaldefs = (mdef_t *)Mem_Alloc(prog->progs_mempool, (prog->progs_numglobaldefs + numrequiredglobals) * sizeof(mdef_t));
2142 prog->globals.fp = (prvm_vec_t *)Mem_Alloc(prog->progs_mempool, (prog->progs_numglobals + requiredglobalspace + 2) * sizeof(prvm_vec_t));
2143 // + 2 is because of an otherwise occurring overrun in RETURN instruction
2144 // when trying to return the last or second-last global
2145 // (RETURN always returns a vector, there is no RETURN_F instruction)
2146 prog->fielddefs = (mdef_t *)Mem_Alloc(prog->progs_mempool, (prog->progs_numfielddefs + numrequiredfields) * sizeof(mdef_t));
2147 // we need to convert the statements to our memory format
2149 // allocate space for profiling statement usage
2150 prog->statement_profile = (double *)Mem_Alloc(prog->progs_mempool, prog->progs_numstatements * sizeof(*prog->statement_profile));
2151 prog->explicit_profile = (double *)Mem_Alloc(prog->progs_mempool, prog->progs_numstatements * sizeof(*prog->statement_profile));
2152 // functions need to be converted to the memory format
2154
2155 for (i = 0;i < prog->progs_numfunctions;i++)
2156 {
2157 prog->functions[i].first_statement = LittleLong(infunctions[i].first_statement);
2158 prog->functions[i].parm_start = LittleLong(infunctions[i].parm_start);
2159 prog->functions[i].s_name = LittleLong(infunctions[i].s_name);
2160 prog->functions[i].s_file = LittleLong(infunctions[i].s_file);
2161 prog->functions[i].numparms = LittleLong(infunctions[i].numparms);
2162 prog->functions[i].locals = LittleLong(infunctions[i].locals);
2163 memcpy(prog->functions[i].parm_size, infunctions[i].parm_size, sizeof(infunctions[i].parm_size));
2164 if(prog->functions[i].first_statement >= prog->numstatements)
2165 prog->error_cmd("%s: out of bounds function statement (function %d) in %s", __func__, i, prog->name);
2166 // TODO bounds check parm_start, s_name, s_file, numparms, locals, parm_size
2167 }
2168
2169 // copy the globaldefs to the new globaldefs list
2170 switch(structtype)
2171 {
2173 for (i=0 ; i<prog->numglobaldefs ; i++)
2174 {
2175 prog->globaldefs[i].type = LittleLong(inglobaldefs32[i].type);
2176 prog->globaldefs[i].ofs = LittleLong(inglobaldefs32[i].ofs);
2177 prog->globaldefs[i].s_name = LittleLong(inglobaldefs32[i].s_name);
2178 // TODO bounds check ofs, s_name
2179 }
2180 break;
2181 default:
2182 for (i=0 ; i<prog->numglobaldefs ; i++)
2183 {
2184 prog->globaldefs[i].type = (unsigned short)LittleShort(inglobaldefs16[i].type);
2185 prog->globaldefs[i].ofs = (unsigned short)LittleShort(inglobaldefs16[i].ofs);
2186 prog->globaldefs[i].s_name = LittleLong(inglobaldefs16[i].s_name);
2187 // TODO bounds check ofs, s_name
2188 }
2189 break;
2190 }
2191
2192 // append the required globals
2193 for (i = 0;i < numrequiredglobals;i++)
2194 {
2195 prog->globaldefs[prog->numglobaldefs].type = required_global[i].type;
2196 prog->globaldefs[prog->numglobaldefs].ofs = prog->numglobals;
2197 prog->globaldefs[prog->numglobaldefs].s_name = PRVM_SetEngineString(prog, required_global[i].name);
2198 if (prog->globaldefs[prog->numglobaldefs].type == ev_vector)
2199 prog->numglobals += 3;
2200 else
2201 prog->numglobals++;
2202 prog->numglobaldefs++;
2203 }
2204
2205 // copy the progs fields to the new fields list
2206 switch(structtype)
2207 {
2209 for (i = 0;i < prog->numfielddefs;i++)
2210 {
2211 prog->fielddefs[i].type = LittleLong(infielddefs32[i].type);
2212 if (prog->fielddefs[i].type & DEF_SAVEGLOBAL)
2213 prog->error_cmd("%s: prog->fielddefs[i].type & DEF_SAVEGLOBAL in %s", __func__, prog->name);
2214 prog->fielddefs[i].ofs = LittleLong(infielddefs32[i].ofs);
2215 prog->fielddefs[i].s_name = LittleLong(infielddefs32[i].s_name);
2216 // TODO bounds check ofs, s_name
2217 }
2218 break;
2219 default:
2220 for (i = 0;i < prog->numfielddefs;i++)
2221 {
2222 prog->fielddefs[i].type = (unsigned short)LittleShort(infielddefs16[i].type);
2223 if (prog->fielddefs[i].type & DEF_SAVEGLOBAL)
2224 prog->error_cmd("%s: prog->fielddefs[i].type & DEF_SAVEGLOBAL in %s", __func__, prog->name);
2225 prog->fielddefs[i].ofs = (unsigned short)LittleShort(infielddefs16[i].ofs);
2226 prog->fielddefs[i].s_name = LittleLong(infielddefs16[i].s_name);
2227 // TODO bounds check ofs, s_name
2228 }
2229 break;
2230 }
2231
2232 // append the required fields
2233 for (i = 0;i < numrequiredfields;i++)
2234 {
2235 prog->fielddefs[prog->numfielddefs].type = required_field[i].type;
2236 prog->fielddefs[prog->numfielddefs].ofs = prog->entityfields;
2237 prog->fielddefs[prog->numfielddefs].s_name = PRVM_SetEngineString(prog, required_field[i].name);
2238 if (prog->fielddefs[prog->numfielddefs].type == ev_vector)
2239 prog->entityfields += 3;
2240 else
2241 prog->entityfields++;
2242 prog->numfielddefs++;
2243 }
2244
2245 // LadyHavoc: TODO: reorder globals to match engine struct
2246 // LadyHavoc: TODO: reorder fields to match engine struct
2247#define remapglobal(index) (index)
2248#define remapfield(index) (index)
2249
2250 // copy globals
2251 // FIXME: LadyHavoc: this uses a crude way to identify integer constants, rather than checking for matching globaldefs and checking their type
2252 for (i = 0;i < prog->progs_numglobals;i++)
2253 {
2254 u.i = LittleLong(inglobals[i]);
2255 // most globals are 0, we only need to deal with the ones that are not
2256 if (u.i)
2257 {
2258 d = u.i & 0xFF800000;
2259 if ((d == 0xFF800000) || (d == 0))
2260 {
2261 // Looks like an integer (expand to int64)
2262 prog->globals.ip[remapglobal(i)] = u.i;
2263 }
2264 else
2265 {
2266 // Looks like a float (expand to double)
2267 prog->globals.fp[remapglobal(i)] = u.f;
2268 }
2269 }
2270 }
2271
2272 // copy, remap globals in statements, bounds check
2273 for (i = 0;i < prog->progs_numstatements;i++)
2274 {
2275 switch(structtype)
2276 {
2278 op = (opcode_t)LittleLong(instatements32[i].op);
2279 a = (unsigned int)LittleLong(instatements32[i].a);
2280 b = (unsigned int)LittleLong(instatements32[i].b);
2281 c = (unsigned int)LittleLong(instatements32[i].c);
2282 break;
2283 default:
2284 op = (opcode_t)LittleShort(instatements16[i].op);
2285 a = (unsigned short)LittleShort(instatements16[i].a);
2286 b = (unsigned short)LittleShort(instatements16[i].b);
2287 c = (unsigned short)LittleShort(instatements16[i].c);
2288 break;
2289 }
2290 switch (op)
2291 {
2292 case OP_IF:
2293 case OP_IFNOT:
2294 b = (short)b;
2295 if (a >= prog->progs_numglobals || b + i < 0 || b + i >= prog->progs_numstatements)
2296 prog->error_cmd("%s: out of bounds IF/IFNOT (statement %d) in %s", __func__, i, prog->name);
2297 if (c)
2298 Con_DPrintf("%s: unexpected offset on binary opcode in %s\n", __func__, prog->name);
2299 prog->statements[i].op = op;
2300 prog->statements[i].operand[0] = remapglobal(a);
2301 prog->statements[i].operand[1] = b;
2302 prog->statements[i].operand[2] = -1;
2303 break;
2304 case OP_GOTO:
2305 a = (short)a;
2307 prog->error_cmd("%s: out of bounds GOTO (statement %d) in %s", __func__, i, prog->name);
2308 if (b || c)
2309 Con_DPrintf("%s: unexpected offset on unary opcode in %s\n", __func__, prog->name);
2310 prog->statements[i].op = op;
2311 prog->statements[i].operand[0] = a;
2312 prog->statements[i].operand[1] = -1;
2313 prog->statements[i].operand[2] = -1;
2314 break;
2315 default:
2316 Con_DPrintf("%s: unknown opcode %d at statement %d in %s\n", __func__, (int)op, i, prog->name);
2317
2318 //make sure its something well defined.
2319 prog->statements[i].op = OP_BOUNDCHECK;
2320 prog->statements[i].operand[0] = 0;
2321 prog->statements[i].operand[1] =
2322 prog->statements[i].operand[2] = op;
2323 break;
2324 // global global global
2325 case OP_ADD_I:
2326 case OP_ADD_FI:
2327 case OP_ADD_IF:
2328 case OP_SUB_I:
2329 case OP_SUB_FI:
2330 case OP_SUB_IF:
2331 case OP_CONV_ITOF:
2332 case OP_CONV_FTOI:
2333 case OP_LOAD_I:
2334 case OP_BITAND_I:
2335 case OP_BITOR_I:
2336 case OP_MUL_I:
2337 case OP_DIV_I:
2338 case OP_EQ_I:
2339 case OP_NE_I:
2340 case OP_NOT_I:
2341 case OP_DIV_VF:
2342 case OP_LE_I:
2343 case OP_GE_I:
2344 case OP_LT_I:
2345 case OP_GT_I:
2346 case OP_LE_IF:
2347 case OP_GE_IF:
2348 case OP_LT_IF:
2349 case OP_GT_IF:
2350 case OP_LE_FI:
2351 case OP_GE_FI:
2352 case OP_LT_FI:
2353 case OP_GT_FI:
2354 case OP_EQ_IF:
2355 case OP_EQ_FI:
2356 case OP_MUL_IF:
2357 case OP_MUL_FI:
2358 case OP_MUL_VI:
2359 case OP_DIV_IF:
2360 case OP_DIV_FI:
2361 case OP_BITAND_IF:
2362 case OP_BITOR_IF:
2363 case OP_BITAND_FI:
2364 case OP_BITOR_FI:
2365 case OP_AND_I:
2366 case OP_OR_I:
2367 case OP_AND_IF:
2368 case OP_OR_IF:
2369 case OP_AND_FI:
2370 case OP_OR_FI:
2371 case OP_NE_IF:
2372 case OP_NE_FI:
2373 case OP_GSTOREP_I:
2374 case OP_GSTOREP_F:
2375 case OP_GSTOREP_ENT:
2376 case OP_GSTOREP_FLD:
2377 case OP_GSTOREP_S:
2378 case OP_GSTOREP_FNC:
2379 case OP_GSTOREP_V:
2380// case OP_GADDRESS:
2381 case OP_GLOAD_I:
2382 case OP_GLOAD_F:
2383 case OP_GLOAD_FLD:
2384 case OP_GLOAD_ENT:
2385 case OP_GLOAD_S:
2386 case OP_GLOAD_FNC:
2387 case OP_BOUNDCHECK:
2388 case OP_GLOAD_V:
2389 case OP_ADD_F:
2390 case OP_ADD_V:
2391 case OP_SUB_F:
2392 case OP_SUB_V:
2393 case OP_MUL_F:
2394 case OP_MUL_V:
2395 case OP_MUL_FV:
2396 case OP_MUL_VF:
2397 case OP_DIV_F:
2398 case OP_BITAND_F:
2399 case OP_BITOR_F:
2400 case OP_GE_F:
2401 case OP_LE_F:
2402 case OP_GT_F:
2403 case OP_LT_F:
2404 case OP_AND_F:
2405 case OP_OR_F:
2406 case OP_EQ_F:
2407 case OP_EQ_V:
2408 case OP_EQ_S:
2409 case OP_EQ_E:
2410 case OP_EQ_FNC:
2411 case OP_NE_F:
2412 case OP_NE_V:
2413 case OP_NE_S:
2414 case OP_NE_E:
2415 case OP_NE_FNC:
2416 case OP_ADDRESS:
2417 case OP_LOAD_F:
2418 case OP_LOAD_FLD:
2419 case OP_LOAD_ENT:
2420 case OP_LOAD_S:
2421 case OP_LOAD_FNC:
2422 case OP_LOAD_V:
2423 case OP_LOAD_P:
2424 case OP_ADD_PIW:
2425 case OP_GLOBALADDRESS:
2426 case OP_LOADA_F:
2427 case OP_LOADA_V:
2428 case OP_LOADA_S:
2429 case OP_LOADA_ENT:
2430 case OP_LOADA_FLD:
2431 case OP_LOADA_FNC:
2432 case OP_LOADA_I:
2433 case OP_LOADP_F:
2434 case OP_LOADP_V:
2435 case OP_LOADP_S:
2436 case OP_LOADP_ENT:
2437 case OP_LOADP_FLD:
2438 case OP_LOADP_FNC:
2439 case OP_LOADP_I:
2440 case OP_STOREP_F:
2441 case OP_STOREP_ENT:
2442 case OP_STOREP_FLD:
2443 case OP_STOREP_S:
2444 case OP_STOREP_FNC:
2445 case OP_STOREP_V:
2446 case OP_STOREP_I:
2447 case OP_RSHIFT_I:
2448 case OP_LSHIFT_I:
2449 case OP_LE_U:
2450 case OP_LT_U:
2451 case OP_DIV_U:
2452 case OP_RSHIFT_U:
2453 if (a >= prog->progs_numglobals || b >= prog->progs_numglobals || c >= prog->progs_numglobals)
2454 prog->error_cmd("%s: out of bounds global index (statement %d)", __func__, i);
2455 prog->statements[i].op = op;
2456 prog->statements[i].operand[0] = remapglobal(a);
2457 prog->statements[i].operand[1] = remapglobal(b);
2458 prog->statements[i].operand[2] = remapglobal(c);
2459 break;
2460 // global none global
2461 case OP_NOT_F:
2462 case OP_NOT_V:
2463 case OP_NOT_S:
2464 case OP_NOT_FNC:
2465 case OP_NOT_ENT:
2466 if (a >= prog->progs_numglobals || c >= prog->progs_numglobals)
2467 prog->error_cmd("%s: out of bounds global index (statement %d) in %s", __func__, i, prog->name);
2468 if (b)
2469 Con_DPrintf("%s: unexpected offset on binary opcode in %s\n", __func__, prog->name);
2470 prog->statements[i].op = op;
2471 prog->statements[i].operand[0] = remapglobal(a);
2472 prog->statements[i].operand[1] = -1;
2473 prog->statements[i].operand[2] = remapglobal(c);
2474 break;
2475 // global global none
2476 case OP_STORE_F:
2477 case OP_STORE_ENT:
2478 case OP_STORE_FLD:
2479 case OP_STORE_S:
2480 case OP_STORE_FNC:
2481 case OP_STORE_V:
2482 case OP_STORE_I:
2483 case OP_STORE_P:
2484 case OP_STATE:
2485 if (a >= prog->progs_numglobals || b >= prog->progs_numglobals)
2486 prog->error_cmd("%s: out of bounds global index (statement %d) in %s", __func__, i, prog->name);
2487 if (c)
2488 Con_DPrintf("%s: unexpected offset on binary opcode in %s\n", __func__, prog->name);
2489 prog->statements[i].op = op;
2490 prog->statements[i].operand[0] = remapglobal(a);
2491 prog->statements[i].operand[1] = remapglobal(b);
2492 prog->statements[i].operand[2] = -1;
2493 break;
2494 // 1 global
2495 case OP_CALL0:
2496 if ( a < prog->progs_numglobals)
2497 if ( prog->globals.ip[remapglobal(a)] >= 0 )
2498 if ( prog->globals.ip[remapglobal(a)] < prog->progs_numfunctions )
2499 if ( prog->functions[prog->globals.ip[remapglobal(a)]].first_statement == -642 )
2501 case OP_CALL1:
2502 case OP_CALL2:
2503 case OP_CALL3:
2504 case OP_CALL4:
2505 case OP_CALL5:
2506 case OP_CALL6:
2507 case OP_CALL7:
2508 case OP_CALL8:
2509 case OP_DONE:
2510 case OP_RETURN:
2511 if ( a >= prog->progs_numglobals)
2512 prog->error_cmd("%s: out of bounds global index (statement %d) in %s", __func__, i, prog->name);
2513 if (b || c) //Spike -- added this check just as a diagnostic...
2514 Con_DPrintf("%s: unexpected offset on call opcode in %s. Hexen2 format is not supported\n", __func__, prog->name);
2515 prog->statements[i].op = op;
2516 prog->statements[i].operand[0] = remapglobal(a);
2517 prog->statements[i].operand[1] = -1;
2518 prog->statements[i].operand[2] = -1;
2519 break;
2520 }
2521 }
2522 if(prog->numstatements < 1)
2523 {
2524 prog->error_cmd("%s: empty program in %s", __func__, prog->name);
2525 }
2526 else switch(prog->statements[prog->numstatements - 1].op)
2527 {
2528 case OP_RETURN:
2529 case OP_GOTO:
2530 case OP_DONE:
2531 break;
2532 default:
2533 prog->error_cmd("%s: program may fall off the edge (does not end with RETURN, GOTO or DONE) in %s", __func__, prog->name);
2534 break;
2535 }
2536
2537 // we're done with the file now
2538 if(!data)
2539 Mem_Free(dprograms);
2540 dprograms = NULL;
2541
2542 prog->flag = 0;
2543 // expected to not return (call prog->error_cmd) if checks fail
2544 CheckRequiredFuncs(prog, filename);
2545
2546 PRVM_LoadLNO(prog, filename);
2547
2548 PRVM_Init_Exec(prog);
2549
2551 // in CSQC we really shouldn't be able to change how stuff works... sorry for now
2552 // later idea: include a list of authorized .po file checksums with the csprogs
2553 {
2554 qbool deftrans = prog == CLVM_prog;
2555 const char *realfilename = (prog != CLVM_prog ? filename : csqc_progname.string);
2556 if(deftrans) // once we have dotranslate_ strings, ALWAYS use the opt-in method!
2557 {
2558 for (i=0 ; i<prog->numglobaldefs ; i++)
2559 {
2560 const char *name;
2561 name = PRVM_GetString(prog, prog->globaldefs[i].s_name);
2562 if((prog->globaldefs[i].type & ~DEF_SAVEGLOBAL) == ev_string)
2563 if(name && !strncmp(name, "dotranslate_", 12))
2564 {
2565 deftrans = false;
2566 break;
2567 }
2568 }
2569 }
2570 if(!strcmp(prvm_language.string, "dump"))
2571 {
2572 qfile_t *f = FS_OpenRealFile(va(vabuf, sizeof(vabuf), "%s.pot", realfilename), "w", false);
2573 Con_Printf("Dumping to %s.pot\n", realfilename);
2574 if(f)
2575 {
2576 for (i=0 ; i<prog->numglobaldefs ; i++)
2577 {
2578 const char *name;
2579 name = PRVM_GetString(prog, prog->globaldefs[i].s_name);
2580 if(deftrans ? (!name || strncmp(name, "notranslate_", 12)) : (name && !strncmp(name, "dotranslate_", 12)))
2581 if((prog->globaldefs[i].type & ~DEF_SAVEGLOBAL) == ev_string)
2582 {
2584 const char *value = PRVM_GetString(prog, val->string);
2585 if(*value)
2586 {
2587 char buf[MAX_INPUTLINE];
2589 FS_Printf(f, "msgid \"%s\"\nmsgstr \"\"\n\n", buf);
2590 }
2591 }
2592 }
2593 FS_Close(f);
2594 }
2595 }
2596 else
2597 {
2598 po_t *po = PRVM_PO_Load(
2599 va(vabuf, sizeof(vabuf), "%s.%s.po", realfilename, prvm_language.string),
2600 va(vabuf2, sizeof(vabuf2), "common.%s.po", prvm_language.string),
2601 prog->progs_mempool);
2602 if(po)
2603 {
2604 for (i=0 ; i<prog->numglobaldefs ; i++)
2605 {
2606 const char *name;
2607 name = PRVM_GetString(prog, prog->globaldefs[i].s_name);
2608 if(deftrans ? (!name || strncmp(name, "notranslate_", 12)) : (name && !strncmp(name, "dotranslate_", 12)))
2609 if((prog->globaldefs[i].type & ~DEF_SAVEGLOBAL) == ev_string)
2610 {
2612 const char *value = PRVM_GetString(prog, val->string);
2613 if(*value)
2614 {
2615 value = PRVM_PO_Lookup(po, value);
2616 if(value)
2617 val->string = PRVM_SetEngineString(prog, value);
2618 }
2619 }
2620 }
2621 }
2622 }
2623 }
2624
2625 for (cvar = prog->console_cmd->cvars->vars; cvar; cvar = cvar->next)
2626 cvar->globaldefindex[prog - prvm_prog_list] = -1;
2627
2628 for (i=0 ; i<prog->numglobaldefs ; i++)
2629 {
2630 const char *name;
2631 name = PRVM_GetString(prog, prog->globaldefs[i].s_name);
2632 //Con_Printf("found var %s\n", name);
2633 if(name
2634 && !strncmp(name, "autocvar_", 9)
2635 && !(strlen(name) > 1 && name[strlen(name)-2] == '_' && (name[strlen(name)-1] == 'x' || name[strlen(name)-1] == 'y' || name[strlen(name)-1] == 'z'))
2636 )
2637 {
2639 cvar = Cvar_FindVar(prog->console_cmd->cvars, name + 9, prog->console_cmd->cvars_flagsmask);
2640 //Con_Printf("%s: autocvar global %s in %s, processing...\n", __func__, name, prog->name);
2641 if(!cvar)
2642 {
2643 const char *value;
2644 char buf[128];
2645 int prec[3];
2646 float f;
2647 Con_DPrintf("%s: no cvar for autocvar global %s in %s, creating...\n", __func__, name, prog->name);
2648 switch(prog->globaldefs[i].type & ~DEF_SAVEGLOBAL)
2649 {
2650 case ev_float:
2651 if((float)((int)(val->_float)) == val->_float)
2652 dpsnprintf(buf, sizeof(buf), "%i", (int)(val->_float));
2653 else
2654 {
2655 // ftos_slow
2656 f = val->_float;
2657 for (int precision = 7; precision <= 9; ++precision) {
2658 dpsnprintf(buf, sizeof(buf), "%.*g", precision, f);
2659 if ((float)atof(buf) == f) {
2660 break;
2661 }
2662 }
2663 }
2664 value = buf;
2665 break;
2666 case ev_vector:
2667 for (i = 0; i < 3; ++i)
2668 {
2669 prec[i] = 9;
2670 f = val->vector[i];
2671 for (int precision = 7; precision <= 9; ++precision) {
2672 dpsnprintf(buf, sizeof(buf), "%.*g", precision, f);
2673 if ((float)atof(buf) == f) {
2674 prec[i] = precision;
2675 break;
2676 }
2677 }
2678 }
2679 dpsnprintf(buf, sizeof(buf), "%.*g %.*g %.*g", prec[0], val->vector[0], prec[1], val->vector[1], prec[2], val->vector[2]);
2680 value = buf;
2681 break;
2682 case ev_string:
2683 value = PRVM_GetString(prog, val->string);
2684 break;
2685 default:
2686 Con_Printf("%s: invalid type of autocvar global %s in %s\n", __func__, name, prog->name);
2687 goto fail;
2688 }
2689 cvar = Cvar_Get(prog->console_cmd->cvars, name + 9, value, prog->console_cmd->cvars_flagsmask, NULL);
2690 if((prog->globaldefs[i].type & ~DEF_SAVEGLOBAL) == ev_string)
2691 {
2692 val->string = PRVM_SetEngineString(prog, cvar->string);
2693 cvar->globaldefindex_stringno[prog - prvm_prog_list] = val->string;
2694 }
2695 if(!cvar)
2696 prog->error_cmd("%s: could not create cvar for autocvar global %s in %s", __func__, name, prog->name);
2697 cvar->globaldefindex[prog - prvm_prog_list] = i;
2698 }
2699 else if((cvar->flags & CF_PRIVATE) == 0)
2700 {
2701 // MUST BE SYNCED WITH cvar.c Cvar_Set
2702 int j;
2703 const char *s;
2704 switch(prog->globaldefs[i].type & ~DEF_SAVEGLOBAL)
2705 {
2706 case ev_float:
2707 val->_float = cvar->value;
2708 break;
2709 case ev_vector:
2710 s = cvar->string;
2711 VectorClear(val->vector);
2712 for (j = 0;j < 3;j++)
2713 {
2714 while (*s && ISWHITESPACE(*s))
2715 s++;
2716 if (!*s)
2717 break;
2718 val->vector[j] = atof(s);
2719 while (!ISWHITESPACE(*s))
2720 s++;
2721 if (!*s)
2722 break;
2723 }
2724 break;
2725 case ev_string:
2726 val->string = PRVM_SetEngineString(prog, cvar->string);
2727 cvar->globaldefindex_stringno[prog - prvm_prog_list] = val->string;
2728 break;
2729 default:
2730 Con_Printf("%s: invalid type of autocvar global %s in %s\n", __func__, name, prog->name);
2731 goto fail;
2732 }
2733 cvar->globaldefindex[prog - prvm_prog_list] = i;
2734 }
2735 else
2736 Con_Printf("%s: private cvar for autocvar global %s in %s\n", __func__, name, prog->name);
2737 }
2738fail:
2739 ;
2740 }
2741
2742 prog->loaded = true;
2743
2745
2746 // set flags & mdef_ts in prog
2747
2748 PRVM_FindOffsets(prog);
2749
2750 // Do not allow more than 2^31 total entityfields. Achieve this by limiting maximum edict count.
2751 // TODO: For PRVM_64, this can be relaxes. May require changing some types away from int.
2752 max_safe_edicts = ((1 << 31) - prog->numglobals) / prog->entityfields;
2753 if (prog->limit_edicts > max_safe_edicts)
2754 {
2755 Con_Printf("%s: reducing maximum entity count to %d to avoid address overflow in %s\n", __func__, max_safe_edicts, prog->name);
2756 prog->limit_edicts = max_safe_edicts;
2757 }
2758
2759 prog->init_cmd(prog);
2760
2761 // init mempools
2762 PRVM_MEM_Alloc(prog);
2763
2764 Con_Printf("%s: program loaded (crc %i, size %iK)%s\n", prog->name, prog->filecrc, (int)(filesize/1024),
2765 prog == CLVM_prog ? (prog->flag & PRVM_CSQC_SIMPLE ? " CSQC_SIMPLE" : " EXT_CSQC") : "");
2766
2767 // Inittime is at least the time when this function finished. However,
2768 // later events may bump it.
2769 prog->inittime = host.realtime;
2770}
cvar_t csqc_progname
Definition cl_main.c:35
#define CF_PRIVATE
cvar should not be $ expanded or sent to the server under any circumstances (rcon_password,...
Definition cmd.h:59
unsigned short CRC_Block(const unsigned char *data, size_t size)
Definition com_crc16.c:75
#define LittleShort(l)
Definition common.h:90
#define LittleLong(l)
Definition common.h:92
#define CON_WARN
Definition console.h:101
void Crypto_LoadKeys(void)
Definition crypto.c:855
vector size
cvar_t * Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, unsigned flags, const char *newdescription)
allocates a cvar by name and returns its address, or merely sets its value if it already exists.
Definition cvar.c:695
cvar_t * Cvar_FindVar(cvar_state_t *cvars, const char *var_name, unsigned neededflags)
Definition cvar.c:36
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
Definition fs.c:3540
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
Definition fs.c:2901
int FS_Close(qfile_t *file)
Definition fs.c:2970
int FS_Printf(qfile_t *file, const char *format,...)
Definition fs.c:3273
int64_t fs_offset_t
Definition fs.h:37
GLsizei const GLfloat * value
Definition glquake.h:740
void Host_LockSession(void)
Definition host.c:330
#define VectorClear(a)
Definition mathlib.h:97
float cvar(string name)
#define PROG_VERSION
Definition pr_comp.h:476
opcode_t
Definition pr_comp.h:46
@ OP_SUB_FI
Definition pr_comp.h:194
@ OP_STOREP_S
Definition pr_comp.h:93
@ OP_NE_E
Definition pr_comp.h:67
@ OP_LOADA_ENT
Definition pr_comp.h:235
@ OP_AND_I
Definition pr_comp.h:284
@ OP_LE_FI
Definition pr_comp.h:261
@ OP_ADD_I
Definition pr_comp.h:189
@ OP_GSTOREP_FLD
Definition pr_comp.h:296
@ OP_STORE_V
Definition pr_comp.h:85
@ OP_GSTOREP_FNC
Definition pr_comp.h:298
@ OP_RSHIFT_U
Definition pr_comp.h:333
@ OP_SUB_F
Definition pr_comp.h:55
@ OP_LOAD_ENT
Definition pr_comp.h:78
@ OP_LOAD_F
Definition pr_comp.h:75
@ OP_LT_FI
Definition pr_comp.h:263
@ OP_GE_I
Definition pr_comp.h:252
@ OP_DIV_I
Definition pr_comp.h:213
@ OP_LT_I
Definition pr_comp.h:253
@ OP_IF
Definition pr_comp.h:104
@ OP_LOAD_FLD
Definition pr_comp.h:79
@ OP_MUL_VI
Definition pr_comp.h:276
@ OP_BITOR_F
Definition pr_comp.h:121
@ OP_STOREP_V
Definition pr_comp.h:92
@ OP_GLOAD_ENT
Definition pr_comp.h:304
@ OP_GLOAD_F
Definition pr_comp.h:302
@ OP_EQ_FI
Definition pr_comp.h:267
@ OP_GSTOREP_I
Definition pr_comp.h:293
@ OP_MUL_VF
Definition pr_comp.h:51
@ OP_ADD_IF
Definition pr_comp.h:191
@ OP_GLOAD_FLD
Definition pr_comp.h:303
@ OP_NOT_I
Definition pr_comp.h:221
@ OP_LOADA_I
Definition pr_comp.h:238
@ OP_GSTOREP_F
Definition pr_comp.h:294
@ OP_CALL8
Definition pr_comp.h:114
@ OP_CONV_ITOF
Definition pr_comp.h:197
@ OP_DIV_F
Definition pr_comp.h:52
@ OP_GT_F
Definition pr_comp.h:73
@ OP_DIV_IF
Definition pr_comp.h:278
@ OP_MUL_I
Definition pr_comp.h:212
@ OP_OR_FI
Definition pr_comp.h:289
@ OP_CALL6
Definition pr_comp.h:112
@ OP_ADD_V
Definition pr_comp.h:54
@ OP_STOREP_ENT
Definition pr_comp.h:94
@ OP_STOREP_FNC
Definition pr_comp.h:96
@ OP_AND_IF
Definition pr_comp.h:286
@ OP_CALL5
Definition pr_comp.h:111
@ OP_LOADP_V
Definition pr_comp.h:244
@ OP_NE_FNC
Definition pr_comp.h:68
@ OP_NE_S
Definition pr_comp.h:66
@ OP_BITOR_FI
Definition pr_comp.h:283
@ OP_LT_IF
Definition pr_comp.h:258
@ OP_STORE_P
Definition pr_comp.h:240
@ OP_CONV_FTOI
Definition pr_comp.h:198
@ OP_LOADA_FNC
Definition pr_comp.h:237
@ OP_LOADP_ENT
Definition pr_comp.h:246
@ OP_STORE_I
Definition pr_comp.h:185
@ OP_SUB_V
Definition pr_comp.h:56
@ OP_BITAND_FI
Definition pr_comp.h:282
@ OP_NOT_ENT
Definition pr_comp.h:102
@ OP_GSTOREP_S
Definition pr_comp.h:297
@ OP_GLOAD_I
Definition pr_comp.h:301
@ OP_OR_IF
Definition pr_comp.h:287
@ OP_STOREP_I
Definition pr_comp.h:205
@ OP_DIV_FI
Definition pr_comp.h:279
@ OP_EQ_FNC
Definition pr_comp.h:62
@ OP_LE_U
Definition pr_comp.h:330
@ OP_STOREP_FLD
Definition pr_comp.h:95
@ OP_MUL_FV
Definition pr_comp.h:50
@ OP_LOAD_P
Definition pr_comp.h:241
@ OP_NE_V
Definition pr_comp.h:65
@ OP_STORE_FLD
Definition pr_comp.h:88
@ OP_GLOBALADDRESS
Definition pr_comp.h:229
@ OP_ADD_PIW
Definition pr_comp.h:230
@ OP_CALL1
Definition pr_comp.h:107
@ OP_EQ_I
Definition pr_comp.h:214
@ OP_EQ_V
Definition pr_comp.h:59
@ OP_STORE_ENT
Definition pr_comp.h:87
@ OP_MUL_IF
Definition pr_comp.h:274
@ OP_GSTOREP_ENT
Definition pr_comp.h:295
@ OP_GT_IF
Definition pr_comp.h:259
@ OP_NE_IF
Definition pr_comp.h:290
@ OP_ADD_F
Definition pr_comp.h:53
@ OP_LT_F
Definition pr_comp.h:72
@ OP_RSHIFT_I
Definition pr_comp.h:226
@ OP_LOADP_S
Definition pr_comp.h:245
@ OP_MUL_FI
Definition pr_comp.h:275
@ OP_LOADA_F
Definition pr_comp.h:232
@ OP_GE_F
Definition pr_comp.h:71
@ OP_GE_IF
Definition pr_comp.h:257
@ OP_DIV_U
Definition pr_comp.h:332
@ OP_LE_I
Definition pr_comp.h:251
@ OP_LE_F
Definition pr_comp.h:70
@ OP_LOADP_I
Definition pr_comp.h:249
@ OP_BITAND_F
Definition pr_comp.h:120
@ OP_LE_IF
Definition pr_comp.h:256
@ OP_ADD_FI
Definition pr_comp.h:190
@ OP_GE_FI
Definition pr_comp.h:262
@ OP_AND_F
Definition pr_comp.h:117
@ OP_CALL0
Definition pr_comp.h:106
@ OP_LOADP_FLD
Definition pr_comp.h:247
@ OP_NE_F
Definition pr_comp.h:64
@ OP_NOT_F
Definition pr_comp.h:99
@ OP_STORE_S
Definition pr_comp.h:86
@ OP_LOAD_S
Definition pr_comp.h:77
@ OP_OR_I
Definition pr_comp.h:285
@ OP_CALL4
Definition pr_comp.h:110
@ OP_EQ_E
Definition pr_comp.h:61
@ OP_DIV_VF
Definition pr_comp.h:223
@ OP_STOREP_F
Definition pr_comp.h:91
@ OP_SUB_IF
Definition pr_comp.h:195
@ OP_LSHIFT_I
Definition pr_comp.h:227
@ OP_CALL2
Definition pr_comp.h:108
@ OP_GLOAD_V
Definition pr_comp.h:314
@ OP_MUL_V
Definition pr_comp.h:49
@ OP_GLOAD_S
Definition pr_comp.h:305
@ OP_LOADA_FLD
Definition pr_comp.h:236
@ OP_SUB_I
Definition pr_comp.h:193
@ OP_NE_FI
Definition pr_comp.h:291
@ OP_LOADP_F
Definition pr_comp.h:243
@ OP_STATE
Definition pr_comp.h:115
@ OP_GT_I
Definition pr_comp.h:254
@ OP_LOAD_I
Definition pr_comp.h:203
@ OP_LOADA_V
Definition pr_comp.h:233
@ OP_LOADA_S
Definition pr_comp.h:234
@ OP_CALL3
Definition pr_comp.h:109
@ OP_RETURN
Definition pr_comp.h:98
@ OP_OR_F
Definition pr_comp.h:118
@ OP_ADDRESS
Definition pr_comp.h:82
@ OP_EQ_IF
Definition pr_comp.h:266
@ OP_BITAND_I
Definition pr_comp.h:209
@ OP_EQ_F
Definition pr_comp.h:58
@ OP_DONE
Definition pr_comp.h:47
@ OP_NOT_V
Definition pr_comp.h:100
@ OP_BOUNDCHECK
Definition pr_comp.h:307
@ OP_AND_FI
Definition pr_comp.h:288
@ OP_GSTOREP_V
Definition pr_comp.h:299
@ OP_EQ_S
Definition pr_comp.h:60
@ OP_BITOR_IF
Definition pr_comp.h:281
@ OP_LOAD_FNC
Definition pr_comp.h:80
@ OP_NE_I
Definition pr_comp.h:215
@ OP_GT_FI
Definition pr_comp.h:264
@ OP_NOT_FNC
Definition pr_comp.h:103
@ OP_LOAD_V
Definition pr_comp.h:76
@ OP_GOTO
Definition pr_comp.h:116
@ OP_GLOAD_FNC
Definition pr_comp.h:306
@ OP_BITAND_IF
Definition pr_comp.h:280
@ OP_CALL7
Definition pr_comp.h:113
@ OP_STORE_FNC
Definition pr_comp.h:89
@ OP_LT_U
Definition pr_comp.h:331
@ OP_BITOR_I
Definition pr_comp.h:210
@ OP_MUL_F
Definition pr_comp.h:48
@ OP_LOADP_FNC
Definition pr_comp.h:248
@ OP_NOT_S
Definition pr_comp.h:101
@ OP_STORE_F
Definition pr_comp.h:84
@ OP_IFNOT
Definition pr_comp.h:105
#define PROG_SECONDARYVERSION32
Definition pr_comp.h:521
#define PROG_SECONDARYVERSION16
Definition pr_comp.h:520
void PRVM_Init_Exec(prvm_prog_t *prog)
Definition prvm_exec.c:892
#define PRVM_CSQC_SIMPLE
Definition progsvm.h:239
static po_t * PRVM_PO_Load(const char *filename, const char *filename2, mempool_t *pool)
static void PRVM_FindOffsets(prvm_prog_t *prog)
#define remapglobal(index)
int PRVM_SetEngineString(prvm_prog_t *prog, const char *s)
static const char * PRVM_PO_Lookup(po_t *po, const char *str)
static void PRVM_MEM_Alloc(prvm_prog_t *prog)
Definition prvm_edict.c:70
static void PRVM_LoadLNO(prvm_prog_t *prog, const char *progname)
static void PRVM_PO_UnparseString(char *out, const char *in, size_t outsize)
prvm_prog_t prvm_prog_list[PRVM_PROG_MAX]
Definition prvm_edict.c:27
static void PRVM_UpdateBreakpoints(prvm_prog_t *prog)
dp_FragColor b
ret a
Definition cvar.h:66
uint32_t numstrings
Definition pr_comp.h:496
uint32_t numstatements
Definition pr_comp.h:484
uint32_t numfielddefs
Definition pr_comp.h:490
int32_t crc
Definition pr_comp.h:480
uint32_t numglobals
Definition pr_comp.h:499
uint32_t numglobaldefs
Definition pr_comp.h:487
uint32_t ofs_strings
Definition pr_comp.h:495
uint32_t ofs_globals
Definition pr_comp.h:498
uint32_t ofs_statements
Definition pr_comp.h:483
int32_t version
Definition pr_comp.h:479
uint32_t ofs_fielddefs
Definition pr_comp.h:489
uint32_t ofs_functions
Definition pr_comp.h:492
uint32_t entityfields
Definition pr_comp.h:501
uint32_t ofs_globaldefs
Definition pr_comp.h:486
uint32_t numfunctions
Definition pr_comp.h:493
uint32_t numbodylessfuncs
Definition pr_comp.h:513
uint32_t blockscompressed
Definition pr_comp.h:517
uint32_t numtypes
Definition pr_comp.h:516
int32_t secondaryversion
Definition pr_comp.h:519
int32_t s_file
Definition pr_comp.h:461
uint8_t parm_size[MAX_PARMS]
Definition pr_comp.h:464
int32_t numparms
Definition pr_comp.h:463
opcode_t op
Definition pr_comp.h:470
int operand[3]
Definition pr_comp.h:471
int progs_numglobals
Definition progsvm.h:559
unsigned short filecrc
Definition progsvm.h:631
int progs_numfunctions
Definition progsvm.h:557
int progs_numglobaldefs
Definition progsvm.h:555
int progs_entityfields
Definition progsvm.h:560
int progs_crc
Definition progsvm.h:553
int progs_numstatements
Definition progsvm.h:554
double inittime
system time when QC initialization code finished (any entity created before is not a leak)
Definition progsvm.h:539
int numstrings
Definition progsvm.h:567
int progs_version
Definition progsvm.h:552
unsigned flag
flag - used to store general flags like PRVM_GE_SELF, etc.
Definition progsvm.h:703
double * explicit_profile
only incremented if prvm_statementprofiling is on
Definition progsvm.h:575
int progs_numstrings
Definition progsvm.h:558
int numglobals
Definition progsvm.h:568
int progs_numfielddefs
Definition progsvm.h:556
memexpandablearray_t stringbuffersarray
Definition progsvm.h:596
struct cmd_state_s * console_cmd
points to the relevant console command interpreter for this vm (cmd_local or &cmd_server),...
Definition progsvm.h:641
void(* init_cmd)(struct prvm_prog_s *prog)
[INIT] used by PRVM_InitProg
Definition progsvm.h:744
int maxknownstrings
Definition progsvm.h:586
double profiletime
system time when last PRVM_CallProfile was called (or PRVM_Prog_Load initially)
Definition progsvm.h:540
void Mem_ExpandableArray_NewArray(memexpandablearray_t *l, mempool_t *mempool, size_t recordsize, int numrecordsperarray)
Definition zone.c:675

References prvm_eval_t::_float, a, b, dprograms_v7_t::blockscompressed, buf, CF_PRIVATE, CLVM_prog, Con_DPrintf(), Con_Printf(), CON_WARN, prvm_prog_t::console_cmd, dprograms_t::crc, CRC_Block(), Crypto_LoadKeys(), csqc_progname, cvar(), Cvar_FindVar(), Cvar_Get(), data, DEF_SAVEGLOBAL, dpsnprintf(), dprograms_t::entityfields, prvm_prog_t::entityfields, prvm_prog_t::error_cmd, ev_float, ev_string, ev_vector, prvm_prog_t::explicit_profile, f, prvm_prog_t::fielddefs, prvm_prog_t::filecrc, mfunction_t::first_statement, prvm_prog_t::flag, prvm_prog_t::fp, FS_Close(), FS_LoadFile(), FS_OpenRealFile(), FS_Printf(), prvm_prog_t::functions, prvm_prog_t::globaldefs, prvm_prog_t::globals, host, Host_LockSession(), i, prvm_prog_t::init_cmd, prvm_prog_t::inittime, int(), prvm_prog_t::ip, ISWHITESPACE, prvm_prog_t::knownstrings, prvm_prog_t::knownstrings_flags, prvm_prog_t::limit_edicts, LittleLong, LittleShort, prvm_prog_t::loaded, mfunction_t::locals, MAX_INPUTLINE, prvm_prog_t::maxknownstrings, Mem_Alloc, Mem_ExpandableArray_NewArray(), Mem_Free, name, prvm_prog_t::name, NULL, dprograms_v7_t::numbodylessfuncs, prvm_prog_t::numexplicitcoveragestatements, dprograms_t::numfielddefs, prvm_prog_t::numfielddefs, dprograms_t::numfunctions, prvm_prog_t::numfunctions, dprograms_t::numglobaldefs, prvm_prog_t::numglobaldefs, dprograms_t::numglobals, prvm_prog_t::numglobals, prvm_prog_t::numknownstrings, mfunction_t::numparms, dprograms_t::numstatements, prvm_prog_t::numstatements, dprograms_t::numstrings, prvm_prog_t::numstrings, dprograms_v7_t::numtypes, mdef_t::ofs, ofs, dprograms_t::ofs_fielddefs, dprograms_t::ofs_functions, dprograms_t::ofs_globaldefs, dprograms_t::ofs_globals, dprograms_t::ofs_statements, dprograms_t::ofs_strings, mstatement_t::op, OP_ADD_F, OP_ADD_FI, OP_ADD_I, OP_ADD_IF, OP_ADD_PIW, OP_ADD_V, OP_ADDRESS, OP_AND_F, OP_AND_FI, OP_AND_I, OP_AND_IF, OP_BITAND_F, OP_BITAND_FI, OP_BITAND_I, OP_BITAND_IF, OP_BITOR_F, OP_BITOR_FI, OP_BITOR_I, OP_BITOR_IF, OP_BOUNDCHECK, OP_CALL0, OP_CALL1, OP_CALL2, OP_CALL3, OP_CALL4, OP_CALL5, OP_CALL6, OP_CALL7, OP_CALL8, OP_CONV_FTOI, OP_CONV_ITOF, OP_DIV_F, OP_DIV_FI, OP_DIV_I, OP_DIV_IF, OP_DIV_U, OP_DIV_VF, OP_DONE, OP_EQ_E, OP_EQ_F, OP_EQ_FI, OP_EQ_FNC, OP_EQ_I, OP_EQ_IF, OP_EQ_S, OP_EQ_V, OP_GE_F, OP_GE_FI, OP_GE_I, OP_GE_IF, OP_GLOAD_ENT, OP_GLOAD_F, OP_GLOAD_FLD, OP_GLOAD_FNC, OP_GLOAD_I, OP_GLOAD_S, OP_GLOAD_V, OP_GLOBALADDRESS, OP_GOTO, OP_GSTOREP_ENT, OP_GSTOREP_F, OP_GSTOREP_FLD, OP_GSTOREP_FNC, OP_GSTOREP_I, OP_GSTOREP_S, OP_GSTOREP_V, OP_GT_F, OP_GT_FI, OP_GT_I, OP_GT_IF, OP_IF, OP_IFNOT, OP_LE_F, OP_LE_FI, OP_LE_I, OP_LE_IF, OP_LE_U, OP_LOAD_ENT, OP_LOAD_F, OP_LOAD_FLD, OP_LOAD_FNC, OP_LOAD_I, OP_LOAD_P, OP_LOAD_S, OP_LOAD_V, OP_LOADA_ENT, OP_LOADA_F, OP_LOADA_FLD, OP_LOADA_FNC, OP_LOADA_I, OP_LOADA_S, OP_LOADA_V, OP_LOADP_ENT, OP_LOADP_F, OP_LOADP_FLD, OP_LOADP_FNC, OP_LOADP_I, OP_LOADP_S, OP_LOADP_V, OP_LSHIFT_I, OP_LT_F, OP_LT_FI, OP_LT_I, OP_LT_IF, OP_LT_U, OP_MUL_F, OP_MUL_FI, OP_MUL_FV, OP_MUL_I, OP_MUL_IF, OP_MUL_V, OP_MUL_VF, OP_MUL_VI, OP_NE_E, OP_NE_F, OP_NE_FI, OP_NE_FNC, OP_NE_I, OP_NE_IF, OP_NE_S, OP_NE_V, OP_NOT_ENT, OP_NOT_F, OP_NOT_FNC, OP_NOT_I, OP_NOT_S, OP_NOT_V, OP_OR_F, OP_OR_FI, OP_OR_I, OP_OR_IF, OP_RETURN, OP_RSHIFT_I, OP_RSHIFT_U, OP_STATE, OP_STORE_ENT, OP_STORE_F, OP_STORE_FLD, OP_STORE_FNC, OP_STORE_I, OP_STORE_P, OP_STORE_S, OP_STORE_V, OP_STOREP_ENT, OP_STOREP_F, OP_STOREP_FLD, OP_STOREP_FNC, OP_STOREP_I, OP_STOREP_S, OP_STOREP_V, OP_SUB_F, OP_SUB_FI, OP_SUB_I, OP_SUB_IF, OP_SUB_V, mstatement_t::operand, dfunction_t::parm_size, mfunction_t::parm_size, mfunction_t::parm_start, prvm_prog_t::profiletime, PROG_SECONDARYVERSION16, PROG_SECONDARYVERSION32, PROG_VERSION, prvm_prog_t::progs_crc, prvm_prog_t::progs_entityfields, prvm_prog_t::progs_mempool, prvm_prog_t::progs_numfielddefs, prvm_prog_t::progs_numfunctions, prvm_prog_t::progs_numglobaldefs, prvm_prog_t::progs_numglobals, prvm_prog_t::progs_numstatements, prvm_prog_t::progs_numstrings, prvm_prog_t::progs_version, PRVM_CSQC_SIMPLE, PRVM_FindOffsets(), PRVM_GetString(), PRVM_GLOBALFIELDVALUE, PRVM_Init_Exec(), prvm_language, PRVM_LoadLNO(), PRVM_MEM_Alloc(), PRVM_PO_Load(), PRVM_PO_Lookup(), PRVM_PO_UnparseString(), prvm_prog_list, PRVM_SetEngineString(), PRVM_UpdateBreakpoints(), host_static_t::realtime, remapglobal, mfunction_t::s_file, mdef_t::s_name, mfunction_t::s_name, dprograms_v7_t::secondaryversion, size, prvm_prog_t::starttime, prvm_prog_t::statement_profile, prvm_prog_t::statements, cvar_t::string, prvm_eval_t::string, prvm_prog_t::stringbuffersarray, prvm_prog_t::strings, prvm_prog_t::stringssize, strlen(), Sys_DirtyTime(), mdef_t::type, prvm_required_field_t::type, type, va(), value, prvm_eval_t::vector, VectorClear, and dprograms_t::version.

Referenced by CL_VM_Init(), MP_Init(), and SV_VM_Setup().

◆ PRVM_Prog_Reset()

void PRVM_Prog_Reset ( prvm_prog_t * prog)

Definition at line 1944 of file prvm_edict.c.

1945{
1946 if (prog->loaded)
1947 {
1948 if(prog->tempstringsbuf.cursize)
1950 prog->tempstringsbuf.cursize = 0;
1951 PRVM_LeakTest(prog);
1952 prog->reset_cmd(prog);
1954 if(prog->po)
1955 PRVM_PO_Destroy((po_t *) prog->po);
1956 }
1957 memset(prog,0,sizeof(prvm_prog_t));
1958 prog->break_statement = -1;
1959 prog->watch_global_type = ev_void;
1960 prog->watch_field_type = ev_void;
1961}
void PRVM_LeakTest(prvm_prog_t *prog)
static void PRVM_PO_Destroy(po_t *po)
void(* reset_cmd)(struct prvm_prog_s *prog)
[INIT] used by PRVM_ResetProg
Definition progsvm.h:745
void * po
translation buffer (only needs to be freed on unloading progs, type is private to prvm_edict....
Definition progsvm.h:714
#define Mem_FreePool(pool)
Definition zone.h:105

References prvm_prog_t::break_statement, sizebuf_t::cursize, sizebuf_t::data, ev_void, prvm_prog_t::loaded, Mem_Free, Mem_FreePool, prvm_prog_t::po, prvm_prog_t::progs_mempool, PRVM_LeakTest(), PRVM_PO_Destroy(), prvm_prog_t::reset_cmd, prvm_prog_t::tempstringsbuf, prvm_prog_t::watch_field_type, and prvm_prog_t::watch_global_type.

Referenced by CL_VM_ShutDown(), MP_Shutdown(), PRVM_Crash(), PRVM_Prog_Init(), and SV_VM_Shutdown().

◆ PRVM_ProgFromString()

prvm_prog_t * PRVM_ProgFromString ( const char * str)

Definition at line 166 of file prvm_edict.c.

167{
168 if (!strcmp(str, "server"))
169 return SVVM_prog;
170 if (!strcmp(str, "client"))
171 return CLVM_prog;
172#ifdef CONFIG_MENU
173 if (!strcmp(str, "menu"))
174 return MVM_prog;
175#endif
176 return NULL;
177}

References CLVM_prog, NULL, and SVVM_prog.

Referenced by PRVM_Breakpoint_f(), PRVM_EdictWatchpoint_f(), PRVM_FriendlyProgFromString(), and PRVM_GlobalWatchpoint_f().

◆ PRVM_SetEngineString()

int PRVM_SetEngineString ( prvm_prog_t * prog,
const char * s )

Definition at line 3390 of file prvm_edict.c.

3391{
3392 int i;
3393 if (!s)
3394 return 0;
3395 if (s >= prog->strings && s <= prog->strings + prog->stringssize)
3396 prog->error_cmd("PRVM_SetEngineString: s in prog->strings area");
3397 // if it's in the tempstrings area, use a reserved range
3398 // (otherwise we'd get millions of useless string offsets cluttering the database)
3399 if (s >= (char *)prog->tempstringsbuf.data && s < (char *)prog->tempstringsbuf.data + prog->tempstringsbuf.maxsize)
3400 return prog->stringssize + (s - (char *)prog->tempstringsbuf.data);
3401 // see if it's a known string address
3402 for (i = 0;i < prog->numknownstrings;i++)
3403 if (prog->knownstrings[i] == s)
3404 return PRVM_KNOWNSTRINGBASE + i;
3405 // new unknown engine string
3407 Con_DPrintf("new engine string %p = \"%s\"\n", (void *)s, s);
3408 for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++)
3409 if (!prog->knownstrings[i])
3410 break;
3412 return PRVM_KNOWNSTRINGBASE + i;
3413}

References Con_DPrintf(), sizebuf_t::data, developer_insane, prvm_prog_t::error_cmd, prvm_prog_t::firstfreeknownstring, i, cvar_t::integer, KNOWNSTRINGFLAG_ENGINE, KNOWNSTRINGFLAG_GCMARK, prvm_prog_t::knownstrings, sizebuf_t::maxsize, prvm_prog_t::numknownstrings, PRVM_KNOWNSTRINGBASE, PRVM_NewKnownString(), prvm_prog_t::strings, prvm_prog_t::stringssize, and prvm_prog_t::tempstringsbuf.

Referenced by CL_VM_Init(), PRVM_Prog_Load(), PRVM_SetTempString(), SV_Name(), SV_Playermodel_f(), SV_Playerskin_f(), SV_SpawnServer(), SV_UpdateToReliableMessages(), SVVM_init_edict(), VM_CL_modelnameforindex(), VM_CL_setmodel(), VM_CL_setmodelindex(), VM_SV_modelnameforindex(), VM_SV_setmodel(), and VM_SV_setmodelindex().

◆ PRVM_SetTempString()

int PRVM_SetTempString ( prvm_prog_t * prog,
const char * s,
size_t slen )

Takes an strlen (not a buffer size).

Definition at line 3423 of file prvm_edict.c.

3424{
3425 size_t size;
3426 char *t;
3427
3428 if (!s || slen >= VM_TEMPSTRING_MAXSIZE)
3429 return 0;
3430 size = slen + 1;
3432 Con_DPrintf("PRVM_SetTempString %s: cursize %i, new tempstring size %lu\n", prog->name, prog->tempstringsbuf.cursize, (unsigned long)size);
3433 if ((size_t)prog->tempstringsbuf.maxsize < prog->tempstringsbuf.cursize + size)
3434 {
3435 sizebuf_t old = prog->tempstringsbuf;
3436 if (prog->tempstringsbuf.cursize + size >= 1<<28)
3437 prog->error_cmd("PRVM_SetTempString %s: ran out of tempstring memory! (refusing to grow tempstring buffer over 256MB, cursize %i, new tempstring size %lu)\n", prog->name, prog->tempstringsbuf.cursize, (unsigned long)size);
3438 prog->tempstringsbuf.maxsize = max(prog->tempstringsbuf.maxsize, 65536);
3439 while ((size_t)prog->tempstringsbuf.maxsize < prog->tempstringsbuf.cursize + size)
3440 prog->tempstringsbuf.maxsize *= 2;
3441 if (prog->tempstringsbuf.maxsize != old.maxsize || prog->tempstringsbuf.data == NULL)
3442 {
3443 Con_DPrintf("PRVM_SetTempString %s: enlarging tempstrings buffer (%iKB -> %iKB)\n", prog->name, old.maxsize/1024, prog->tempstringsbuf.maxsize/1024);
3444 prog->tempstringsbuf.data = (unsigned char *) Mem_Alloc(prog->progs_mempool, prog->tempstringsbuf.maxsize);
3445 if (old.data)
3446 {
3447 if (old.cursize)
3448 memcpy(prog->tempstringsbuf.data, old.data, old.cursize);
3449 Mem_Free(old.data);
3450 }
3451 }
3452 }
3453 t = (char *)prog->tempstringsbuf.data + prog->tempstringsbuf.cursize;
3454 memcpy(t, s, size);
3455 prog->tempstringsbuf.cursize += size;
3456 return PRVM_SetEngineString(prog, t);
3457}
#define VM_TEMPSTRING_MAXSIZE
Definition prvm_cmds.h:215

References Con_DPrintf(), sizebuf_t::cursize, sizebuf_t::data, developer_insane, prvm_prog_t::error_cmd, cvar_t::integer, max, sizebuf_t::maxsize, Mem_Alloc, Mem_Free, prvm_prog_t::name, NULL, prvm_prog_t::progs_mempool, PRVM_SetEngineString(), size, prvm_prog_t::tempstringsbuf, and VM_TEMPSTRING_MAXSIZE.

Referenced by CL_VM_Event_Sound(), CL_VM_Parse_CenterPrint(), CL_VM_Parse_Print(), CL_VM_Parse_StuffCmd(), PRVM_ConsoleCommand(), PRVM_GameCommand(), SV_ReadClientMessage(), uri_to_string_callback(), VM_altstr_get(), VM_altstr_ins(), VM_altstr_prepare(), VM_altstr_set(), VM_buf_implode(), VM_bufstr_get(), VM_chr(), VM_chr2str(), VM_CL_getextresponse(), VM_CL_getplayerkey(), VM_CL_getstats(), VM_CL_gettaginfo(), VM_CL_ReadPicture(), VM_CL_ReadString(), VM_CL_serverkey(), VM_CL_skel_get_bonename(), VM_cvar_defstring(), VM_cvar_description(), VM_cvar_string(), VM_digest_hex(), VM_entityfieldname(), VM_etos(), VM_fgets(), VM_findkeysforcommand(), VM_ftos(), VM_getentityfieldstring(), VM_getkeybind(), VM_getsurfacetexture(), VM_infoadd(), VM_infoget(), VM_keynumtostring(), VM_M_crypto_getencryptlevel(), VM_M_crypto_getidfp(), VM_M_crypto_getkeyfp(), VM_M_crypto_getmyidfp(), VM_M_crypto_getmykeyfp(), VM_M_getgamedirinfo(), VM_M_getserverliststring(), VM_netaddress_resolve(), VM_search_getfilename(), VM_SetTraceGlobals(), VM_sprintf(), VM_strcat(), VM_strconv(), VM_strdecolorize(), VM_strftime(), VM_strireplace(), VM_strpad(), VM_strreplace(), VM_strtolower(), VM_strtoupper(), VM_substring(), VM_SV_getextresponse(), VM_SV_gettaginfo(), VM_SV_serverkey(), VM_SV_skel_get_bonename(), VM_tokenize(), VM_tokenize_console(), VM_tokenizebyseparator(), VM_uncolorstring(), VM_uri_escape(), VM_uri_unescape(), VM_vtos(), and VM_whichpack().

◆ PRVM_ShortStackTrace()

void PRVM_ShortStackTrace ( prvm_prog_t * prog,
char * buf,
size_t bufsize )

Definition at line 464 of file prvm_exec.c.

465{
466 mfunction_t *f;
467 int i;
468 char vabuf[1024];
469 char *p;
470
471 if(prog)
472 {
473 i = dpsnprintf(buf, bufsize, "(%s) ", prog->name);
474 p = buf + max(0, i);
475 }
476 else
477 {
478 dp_strlcpy(buf, "<NO PROG>", bufsize);
479 return;
480 }
481
482 prog->stack[prog->depth].s = prog->xstatement;
483 prog->stack[prog->depth].f = prog->xfunction;
484 for (i = prog->depth;i > 0;i--)
485 {
486 f = prog->stack[i].f;
487 p = dp_stpecpy(
488 p,
489 buf + bufsize,
490 f
491 ? va(vabuf, sizeof(vabuf), "%s:%s(%i) ", PRVM_GetString(prog, f->s_file), PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement)
492 : "<NULL> "
493 );
494 if (p == buf + bufsize)
495 break;
496 }
497}
char * dp_stpecpy(char *dst, char *end, const char *src)
Chain-copies a string with truncation and efficiency (compared to strlcat()).
Definition common.c:1373

References buf, prvm_prog_t::depth, dp_stpecpy(), dp_strlcpy, dpsnprintf(), f, prvm_stack_t::f, i, max, prvm_prog_t::name, PRVM_GetString(), prvm_stack_t::s, prvm_prog_t::stack, va(), prvm_prog_t::xfunction, and prvm_prog_t::xstatement.

Referenced by PRVM_AllocationOrigin().

◆ PRVM_StackTrace()

void PRVM_StackTrace ( prvm_prog_t * prog)

Definition at line 436 of file prvm_exec.c.

437{
438 mfunction_t *f;
439 int i;
440
441 prog->stack[prog->depth].s = prog->xstatement;
442 prog->stack[prog->depth].f = prog->xfunction;
443 for (i = prog->depth;i > 0;i--)
444 {
445 f = prog->stack[i].f;
446
447 if (!f)
448 Con_Print("<NULL FUNCTION>\n");
449 else
450 {
451 if (prog->statement_linenums)
452 {
453 if (prog->statement_columnnums)
454 Con_Printf("%12s:%i:%i : %s : statement %i\n", PRVM_GetString(prog, f->s_file), prog->statement_linenums[prog->stack[i].s], prog->statement_columnnums[prog->stack[i].s], PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
455 else
456 Con_Printf("%12s:%i : %s : statement %i\n", PRVM_GetString(prog, f->s_file), prog->statement_linenums[prog->stack[i].s], PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
457 }
458 else
459 Con_Printf("%12s : %s : statement %i\n", PRVM_GetString(prog, f->s_file), PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement);
460 }
461 }
462}
int * statement_linenums
NULL if not available.
Definition progsvm.h:570
int * statement_columnnums
NULL if not available.
Definition progsvm.h:571

References Con_Print(), Con_Printf(), prvm_prog_t::depth, f, prvm_stack_t::f, i, PRVM_GetString(), prvm_stack_t::s, prvm_prog_t::stack, prvm_prog_t::statement_columnnums, prvm_prog_t::statement_linenums, prvm_prog_t::xfunction, and prvm_prog_t::xstatement.

Referenced by PRVM_PrintState(), and VM_stackdump().

◆ PRVM_UglyValueString()

char * PRVM_UglyValueString ( prvm_prog_t * prog,
etype_t type,
prvm_eval_t * val,
char * line,
size_t linelength )

Definition at line 513 of file prvm_edict.c.

514{
515 int i;
516 const char *s;
517 mdef_t *def;
518 mfunction_t *f;
519
520 type = (etype_t)((int)type & ~DEF_SAVEGLOBAL);
521
522 switch (type)
523 {
524 case ev_string:
525 // Parse the string a bit to turn special characters
526 // (like newline, specifically) into escape codes,
527 // this fixes saving games from various mods
528 s = PRVM_GetString (prog, val->string);
529 for (i = 0;i < (int)linelength - 2 && *s;)
530 {
531 if (*s == '\n')
532 {
533 line[i++] = '\\';
534 line[i++] = 'n';
535 }
536 else if (*s == '\r')
537 {
538 line[i++] = '\\';
539 line[i++] = 'r';
540 }
541 else if (*s == '\\')
542 {
543 line[i++] = '\\';
544 line[i++] = '\\';
545 }
546 else if (*s == '"')
547 {
548 line[i++] = '\\';
549 line[i++] = '"';
550 }
551 else
552 line[i++] = *s;
553 s++;
554 }
555 line[i] = '\0';
556 break;
557 case ev_entity:
558 i = val->edict;
559 dpsnprintf (line, linelength, "%i", i);
560 break;
561 case ev_function:
562 if ((unsigned int)val->function < (unsigned int)prog->progs_numfunctions)
563 {
564 f = prog->functions + val->function;
565 dp_strlcpy (line, PRVM_GetString (prog, f->s_name), linelength);
566 }
567 else
568 dpsnprintf (line, linelength, "bad function %" PRVM_PRIi " (invalid!)", val->function);
569 break;
570 case ev_field:
571 def = PRVM_ED_FieldAtOfs ( prog, val->_int );
572 if (def != NULL)
573 dpsnprintf (line, linelength, ".%s", PRVM_GetString(prog, def->s_name));
574 else
575 dpsnprintf (line, linelength, "field %" PRVM_PRIi "(invalid!)", val->_int );
576 break;
577 case ev_void:
578 dpsnprintf (line, linelength, "void");
579 break;
580 case ev_float:
581 dpsnprintf (line, linelength, PRVM_FLOAT_LOSSLESS_FORMAT, val->_float);
582 break;
583 case ev_vector:
584 dpsnprintf (line, linelength, PRVM_VECTOR_LOSSLESS_FORMAT, val->vector[0], val->vector[1], val->vector[2]);
585 break;
586 default:
587 dpsnprintf (line, linelength, "bad type %i", type);
588 break;
589 }
590
591 return line;
592}
#define PRVM_VECTOR_LOSSLESS_FORMAT
Definition progs.h:37
#define PRVM_FLOAT_LOSSLESS_FORMAT
Definition progs.h:36
mdef_t * PRVM_ED_FieldAtOfs(prvm_prog_t *prog, unsigned int ofs)
Definition prvm_edict.c:357
#define PRVM_PRIi
Definition qtypes.h:58

References prvm_eval_t::_float, prvm_eval_t::_int, DEF_SAVEGLOBAL, dp_strlcpy, dpsnprintf(), prvm_eval_t::edict, ev_entity, ev_field, ev_float, ev_function, ev_string, ev_vector, ev_void, f, prvm_eval_t::function, prvm_prog_t::functions, i, int(), NULL, prvm_prog_t::progs_numfunctions, PRVM_ED_FieldAtOfs(), PRVM_FLOAT_LOSSLESS_FORMAT, PRVM_GetString(), PRVM_PRIi, PRVM_VECTOR_LOSSLESS_FORMAT, mdef_t::s_name, prvm_eval_t::string, type, and prvm_eval_t::vector.

Referenced by PRVM_ED_EdictGet_f(), PRVM_ED_GlobalGet_f(), PRVM_ED_Write(), PRVM_ED_WriteGlobals(), PRVM_Watchpoint(), and VM_getentityfieldstring().

◆ PRVM_Watchpoint()

void PRVM_Watchpoint ( prvm_prog_t * prog,
int stack_index,
const char * text,
etype_t type,
prvm_eval_t * o,
prvm_eval_t * n )

Definition at line 3009 of file prvm_edict.c.

3010{
3011 size_t sz = sizeof(prvm_vec_t) * ((type & ~DEF_SAVEGLOBAL) == ev_vector ? 3 : 1);
3012 if (memcmp(o, n, sz))
3013 {
3014 char buf[1024];
3015 char valuebuf_o[128];
3016 char valuebuf_n[128];
3017 PRVM_UglyValueString(prog, type, o, valuebuf_o, sizeof(valuebuf_o));
3018 PRVM_UglyValueString(prog, type, n, valuebuf_n, sizeof(valuebuf_n));
3019 dpsnprintf(buf, sizeof(buf), "%s: %s -> %s", text, valuebuf_o, valuebuf_n);
3020 PRVM_Breakpoint(prog, stack_index, buf);
3021 memcpy(o, n, sz);
3022 }
3023}
char * PRVM_UglyValueString(prvm_prog_t *prog, etype_t type, prvm_eval_t *val, char *line, size_t linelength)
Definition prvm_edict.c:513
void PRVM_Breakpoint(prvm_prog_t *prog, int stack_index, const char *text)

References buf, DEF_SAVEGLOBAL, dpsnprintf(), ev_vector, n, PRVM_Breakpoint(), PRVM_UglyValueString(), and type.

Referenced by while().

◆ SVVM_ExecuteProgram()

void SVVM_ExecuteProgram ( prvm_prog_t * prog,
func_t fnum,
const char * errormessage )

Definition at line 1183 of file prvm_exec.c.

1187{
1188 mstatement_t *st, *startst;
1189 mfunction_t *func, *enterfunc;
1190 prvm_edict_t *ed;
1191 prvm_eval_t *ptr;
1192 int jumpcount, cachedpr_trace, exitdepth;
1193 int restorevm_tempstringsbuf_cursize;
1194 double calltime;
1195 double tm, starttm;
1196 prvm_vec_t tempfloat;
1199
1200 calltime = Sys_DirtyTime();
1201
1202 if (!fnum || fnum >= (unsigned int)prog->numfunctions)
1203 {
1206 prog->error_cmd("SVVM_ExecuteProgram: %s", errormessage);
1207 }
1208
1209 func = &prog->functions[fnum];
1210
1211 // after executing this function, delete all tempstrings it created
1212 restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
1213
1214 prog->trace = prvm_traceqc.integer;
1215
1216 // we know we're done when pr_depth drops to this
1217 exitdepth = prog->depth;
1218
1219// make a stack frame
1220 st = &prog->statements[PRVM_EnterFunction(prog, func)];
1221 // save the starting statement pointer for profiling
1222 // (when the function exits or jumps, the (st - startst) integer value is
1223 // added to the function's profile counter)
1224 startst = st;
1225 starttm = calltime;
1226 // instead of counting instructions, we count jumps
1227 jumpcount = 0;
1228 // add one to the callcount of this function because otherwise engine-called functions aren't counted
1229 if (prog->xfunction->callcount++ == 0 && (prvm_coverage.integer & 1))
1231
1232chooseexecprogram:
1233 cachedpr_trace = prog->trace;
1234 if (prog->trace || prog->watch_global_type != ev_void || prog->watch_field_type != ev_void || prog->break_statement >= 0)
1235 {
1236#define PRVMSLOWINTERPRETER 1
1238 {
1239#define PRVMTIMEPROFILING 1
1240#include "prvm_execprogram.h"
1241#undef PRVMTIMEPROFILING
1242 }
1243 else
1244 {
1245#include "prvm_execprogram.h"
1246 }
1247#undef PRVMSLOWINTERPRETER
1248 }
1249 else
1250 {
1252 {
1253#define PRVMTIMEPROFILING 1
1254#include "prvm_execprogram.h"
1255#undef PRVMTIMEPROFILING
1256 }
1257 else
1258 {
1259#include "prvm_execprogram.h"
1260 }
1261 }
1262
1263cleanup:
1264 if (developer_insane.integer && prog->tempstringsbuf.cursize > restorevm_tempstringsbuf_cursize)
1265 Con_DPrintf("SVVM_ExecuteProgram: %s used %i bytes of tempstrings\n", PRVM_GetString(prog, prog->functions[fnum].s_name), prog->tempstringsbuf.cursize - restorevm_tempstringsbuf_cursize);
1266 // delete tempstrings created by this function
1267 prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
1268
1269 tm = Sys_DirtyTime() - calltime;if (tm < 0 || tm >= 1800) tm = 0;
1270 func->totaltime += tm;
1271
1272 if (prog == SVVM_prog)
1274}

References prvm_prog_t::break_statement, CACHE_CHANGING, CACHE_UNCHANGING, mfunction_t::callcount, Con_DPrintf(), sizebuf_t::cursize, prvm_prog_t::depth, developer_insane, DO_DECLARE, prvm_prog_t::error_cmd, ev_void, prvm_prog_t::functions, cvar_t::integer, NULL, prvm_prog_t::numfunctions, PRVM_allglobaledict, prvm_coverage, PRVM_ED_Print(), PRVM_EnterFunction(), PRVM_FunctionCoverageEvent(), PRVM_GetString(), PRVM_PROG_TO_EDICT, prvm_timeprofiling, prvm_traceqc, mfunction_t::s_name, self, prvm_prog_t::statements, SV_FlushBroadcastMessages(), SVVM_prog, Sys_DirtyTime(), prvm_prog_t::tempstringsbuf, mfunction_t::totaltime, prvm_prog_t::trace, prvm_prog_t::watch_field_type, prvm_prog_t::watch_global_type, and prvm_prog_t::xfunction.

Referenced by SV_VM_Setup().

◆ SVVM_init_cmd()

void SVVM_init_cmd ( prvm_prog_t * prog)

Definition at line 3918 of file svvm_cmds.c.

3919{
3920 VM_Cmd_Init(prog);
3921}

References VM_Cmd_Init().

Referenced by SV_VM_Setup().

◆ SVVM_reset_cmd()

void SVVM_reset_cmd ( prvm_prog_t * prog)

Definition at line 3923 of file svvm_cmds.c.

3924{
3925 World_End(&sv.world);
3926 VM_Cmd_Reset(prog);
3927}
world_t world
collision culling data
Definition server.h:106

References sv, VM_Cmd_Reset(), server_t::world, and World_End().

Referenced by SV_VM_Setup().

◆ VM_Cmd_Init()

void VM_Cmd_Init ( prvm_prog_t * prog)

Definition at line 5265 of file prvm_cmds.c.

5266{
5267 // only init the stuff for the current prog
5268 VM_Files_Init(prog);
5269 VM_Search_Init(prog);
5270}
static void VM_Search_Init(prvm_prog_t *prog)
Definition prvm_cmds.c:3135
void VM_Files_Init(prvm_prog_t *prog)
Definition prvm_cmds.c:1856

References VM_Files_Init(), and VM_Search_Init().

Referenced by CLVM_init_cmd(), MVM_init_cmd(), and SVVM_init_cmd().

◆ VM_Cmd_Reset()

void VM_Cmd_Reset ( prvm_prog_t * prog)

Definition at line 5274 of file prvm_cmds.c.

5275{
5277 VM_Search_Reset(prog);
5278 VM_Files_CloseAll(prog);
5279 animatemodel_reset(prog);
5280}
void CL_PurgeOwner(int owner)
Definition cl_video.c:411
#define MENUOWNER
Definition cl_video.h:11
static void VM_Search_Reset(prvm_prog_t *prog)
Definition prvm_cmds.c:3142
static void animatemodel_reset(prvm_prog_t *prog)
Definition prvm_cmds.c:6127
void VM_Files_CloseAll(prvm_prog_t *prog)
Definition prvm_cmds.c:1863

References animatemodel_reset(), CL_PurgeOwner(), MENUOWNER, VM_Files_CloseAll(), and VM_Search_Reset().

Referenced by CLVM_reset_cmd(), MVM_reset_cmd(), and SVVM_reset_cmd().

◆ VM_FrameBlendFromFrameGroupBlend()

void VM_FrameBlendFromFrameGroupBlend ( struct frameblend_s * frameblend,
const struct framegroupblend_s * framegroupblend,
const struct model_s * model,
double curtime )

◆ VM_GenerateFrameGroupBlend()

◆ VM_RemoveEdictSkeleton()

void VM_RemoveEdictSkeleton ( prvm_prog_t * prog,
prvm_edict_t * ed )

Definition at line 261 of file prvm_cmds.c.

262{
263 if (ed->priv.server->skeleton.relativetransforms)
264 Mem_Free(ed->priv.server->skeleton.relativetransforms);
265 memset(&ed->priv.server->skeleton, 0, sizeof(ed->priv.server->skeleton));
266}
struct edict_engineprivate_s * server
FIXME: this server pointer really means world, not server (it is used by both server qc and client qc...
Definition progsvm.h:106

References Mem_Free, prvm_edict_t::priv, and prvm_edict_t::server.

Referenced by CLVM_free_edict(), SVVM_free_edict(), and VM_UpdateEdictSkeleton().

◆ VM_UpdateEdictSkeleton()

void VM_UpdateEdictSkeleton ( prvm_prog_t * prog,
prvm_edict_t * ed,
const struct model_s * edmodel,
const struct frameblend_s * frameblend )

◆ VM_Warning()

void VM_Warning ( prvm_prog_t * prog,
const char * fmt,
... )

Definition at line 25 of file prvm_cmds.c.

26{
27 va_list argptr;
28 char msg[MAX_INPUTLINE];
29 static double recursive = -1;
30 int outfd = sys.outfd;
31
32 // set output to stderr
33 sys.outfd = fileno(stderr);
34
35 va_start(argptr,fmt);
36 dpvsnprintf(msg,sizeof(msg),fmt,argptr);
37 va_end(argptr);
38
39 Con_Printf(CON_WARN "%s VM warning: %s", prog->name, msg);
40
41 // TODO: either add a cvar/cmd to control the state dumping or replace some of the calls with Con_Printf [9/13/2006 Black]
42 if(prvm_backtraceforwarnings.integer && recursive != host.realtime) // NOTE: this compares to the time, just in case if PRVM_PrintState causes a Host_Error and keeps recursive set
43 {
44 recursive = host.realtime;
45 PRVM_PrintState(prog, 0);
46 recursive = -1;
47 }
48
49 // restore configured outfd
50 sys.outfd = outfd;
51}
int dpvsnprintf(char *buffer, size_t buffersize, const char *format, va_list args)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:1010
cvar_t prvm_backtraceforwarnings
Definition prvm_edict.c:40
int outfd
Definition sys.h:149
sys_t sys
Definition sys_shared.c:42

References Con_Printf(), CON_WARN, dpvsnprintf(), host, cvar_t::integer, MAX_INPUTLINE, prvm_prog_t::name, sys_t::outfd, prvm_backtraceforwarnings, PRVM_PrintState(), host_static_t::realtime, and sys.

Referenced by PRVM_GetString(), VM_bprint(), VM_buf_copy(), VM_buf_cvarlist(), VM_buf_del(), VM_buf_getsize(), VM_buf_implode(), VM_buf_loadfile(), VM_buf_sort(), VM_buf_writefile(), VM_bufstr_add(), VM_bufstr_find(), VM_bufstr_free(), VM_bufstr_get(), VM_bufstr_set(), VM_changelevel(), VM_changepitch(), VM_changeyaw(), VM_CL_checkpvs(), VM_CL_copyentity(), VM_CL_droptofloor(), VM_CL_getstatf(), VM_CL_getstati(), VM_CL_getstats(), VM_CL_gettagindex(), VM_CL_gettaginfo(), VM_CL_lightstyle(), VM_CL_makestatic(), VM_CL_ParticleTheme(), VM_CL_ParticleThemeFree(), VM_CL_ParticleThemeSave(), VM_CL_pointsound(), VM_CL_precache_model(), VM_CL_R_PolygonEnd(), VM_CL_R_PolygonVertex(), VM_CL_R_SetView(), VM_CL_ResetParticle(), VM_CL_setattachment(), VM_CL_setmodel(), VM_CL_setmodelindex(), VM_CL_setorigin(), VM_CL_setsize(), VM_CL_sound(), VM_CL_SpawnParticle(), VM_CL_SpawnParticleDelayed(), VM_CL_tracetoss(), VM_CL_walkmove(), VM_cvar_set(), VM_drawcharacter(), VM_drawcolorcodedstring(), VM_drawfill(), VM_drawpic(), VM_drawrotpic(), VM_drawstring(), VM_drawsubpic(), VM_entityfieldname(), VM_entityfieldtype(), VM_fclose(), VM_fgets(), VM_fopen(), VM_fputs(), VM_getentityfieldstring(), VM_getsoundtime(), VM_gettime(), VM_loadfont(), VM_loadfromfile(), VM_localsound(), VM_M_getserverlistnumber(), VM_M_getserverliststat(), VM_M_getserverliststring(), VM_M_setserverlistmasknumber(), VM_M_setserverlistmaskstring(), VM_matchpattern(), VM_modulo(), VM_nudgeoutofsolid(), VM_physics_addforce(), VM_physics_addtorque(), VM_physics_enable(), VM_precache_sound(), VM_putentityfieldstring(), VM_registercvar(), VM_remove(), VM_search_begin(), VM_search_end(), VM_search_getfilename(), VM_search_getsize(), VM_sprint(), VM_sprintf(), VM_SV_AddStat(), VM_SV_aim(), VM_SV_centerprint(), VM_SV_checkpvs(), VM_SV_copyentity(), VM_SV_dropclient(), VM_SV_droptofloor(), VM_SV_effect(), VM_SV_gettagindex(), VM_SV_gettaginfo(), VM_SV_makestatic(), VM_SV_modelnameforindex(), VM_SV_pointsound(), VM_SV_setattachment(), VM_SV_setmodel(), VM_SV_setmodelindex(), VM_SV_setorigin(), VM_SV_setsize(), VM_SV_sound(), VM_SV_sprint(), VM_SV_stuffcmd(), VM_SV_tracetoss(), VM_SV_walkmove(), VM_uri_get(), VM_VarString(), VM_writetofile(), while(), and WriteDest().

Variable Documentation

◆ prvm_badvalue

prvm_eval_t prvm_badvalue
extern

Definition at line 31 of file prvm_edict.c.

◆ prvm_prog_list

◆ prvm_type_size

int prvm_type_size[8]
extern

for consistency : I think a goal of this sub-project is to make the new vm mostly independent from the old one, thus if it's necessary, I copy everything

Definition at line 29 of file prvm_edict.c.

29{1,sizeof(string_t)/4,1,3,1,1,sizeof(func_t)/4,sizeof(void *)/4};
int string_t
Definition pr_comp.h:27

Referenced by PRVM_ED_Print(), PRVM_ED_Write(), PRVM_Fields_f(), and VM_getentityfieldstring().

◆ vm_cl_builtins

prvm_builtin_t vm_cl_builtins[]
extern

Definition at line 5003 of file clvm_cmds.c.

5003 {
5004NULL, // #0 NULL function (not callable) (QUAKE)
5005VM_CL_makevectors, // #1 void(vector ang) makevectors (QUAKE)
5006VM_CL_setorigin, // #2 void(entity e, vector o) setorigin (QUAKE)
5007VM_CL_setmodel, // #3 void(entity e, string m) setmodel (QUAKE)
5008VM_CL_setsize, // #4 void(entity e, vector min, vector max) setsize (QUAKE)
5009NULL, // #5 void(entity e, vector min, vector max) setabssize (QUAKE)
5010VM_break, // #6 void() break (QUAKE)
5011VM_random, // #7 float() random (QUAKE)
5012VM_CL_sound, // #8 void(entity e, float chan, string samp, float volume, float atten[, float pitchchange[, float flags]]) sound (QUAKE)
5013VM_normalize, // #9 vector(vector v) normalize (QUAKE)
5014VM_error, // #10 void(string e) error (QUAKE)
5015VM_objerror, // #11 void(string e) objerror (QUAKE)
5016VM_vlen, // #12 float(vector v) vlen (QUAKE)
5017VM_vectoyaw, // #13 float(vector v) vectoyaw (QUAKE)
5018VM_CL_spawn, // #14 entity() spawn (QUAKE)
5019VM_remove, // #15 void(entity e) remove (QUAKE)
5020VM_CL_traceline, // #16 void(vector v1, vector v2, float tryents, entity ignoreentity) traceline (QUAKE)
5021NULL, // #17 entity() checkclient (QUAKE)
5022VM_find, // #18 entity(entity start, .string fld, string match) find (QUAKE)
5023VM_precache_sound, // #19 void(string s) precache_sound (QUAKE)
5024VM_CL_precache_model, // #20 void(string s) precache_model (QUAKE)
5025NULL, // #21 void(entity client, string s, ...) stuffcmd (QUAKE)
5026VM_CL_findradius, // #22 entity(vector org, float rad) findradius (QUAKE)
5027NULL, // #23 void(string s, ...) bprint (QUAKE)
5028NULL, // #24 void(entity client, string s, ...) sprint (QUAKE)
5029VM_dprint, // #25 void(string s, ...) dprint (QUAKE)
5030VM_ftos, // #26 string(float f) ftos (QUAKE)
5031VM_vtos, // #27 string(vector v) vtos (QUAKE)
5032VM_coredump, // #28 void() coredump (QUAKE)
5033VM_traceon, // #29 void() traceon (QUAKE)
5034VM_traceoff, // #30 void() traceoff (QUAKE)
5035VM_eprint, // #31 void(entity e) eprint (QUAKE)
5036VM_CL_walkmove, // #32 float(float yaw, float dist[, float settrace]) walkmove (QUAKE)
5037NULL, // #33 (QUAKE)
5038VM_CL_droptofloor, // #34 float() droptofloor (QUAKE)
5039VM_CL_lightstyle, // #35 void(float style, string value) lightstyle (QUAKE)
5040VM_rint, // #36 float(float v) rint (QUAKE)
5041VM_floor, // #37 float(float v) floor (QUAKE)
5042VM_ceil, // #38 float(float v) ceil (QUAKE)
5043NULL, // #39 (QUAKE)
5044VM_CL_checkbottom, // #40 float(entity e) checkbottom (QUAKE)
5045VM_CL_pointcontents, // #41 float(vector v) pointcontents (QUAKE)
5046NULL, // #42 (QUAKE)
5047VM_fabs, // #43 float(float f) fabs (QUAKE)
5048NULL, // #44 vector(entity e, float speed) aim (QUAKE)
5049VM_cvar, // #45 float(string s) cvar (QUAKE)
5050VM_localcmd, // #46 void(string s) localcmd (QUAKE)
5051VM_nextent, // #47 entity(entity e) nextent (QUAKE)
5052VM_CL_particle, // #48 void(vector o, vector d, float color, float count) particle (QUAKE)
5053VM_changeyaw, // #49 void() ChangeYaw (QUAKE)
5054NULL, // #50 (QUAKE)
5055VM_vectoangles, // #51 vector(vector v) vectoangles (QUAKE)
5056NULL, // #52 void(float to, float f) WriteByte (QUAKE)
5057NULL, // #53 void(float to, float f) WriteChar (QUAKE)
5058NULL, // #54 void(float to, float f) WriteShort (QUAKE)
5059NULL, // #55 void(float to, float f) WriteLong (QUAKE)
5060NULL, // #56 void(float to, float f) WriteCoord (QUAKE)
5061NULL, // #57 void(float to, float f) WriteAngle (QUAKE)
5062NULL, // #58 void(float to, string s) WriteString (QUAKE)
5063NULL, // #59 (QUAKE)
5064VM_sin, // #60 float(float f) sin (DP_QC_SINCOSSQRTPOW)
5065VM_cos, // #61 float(float f) cos (DP_QC_SINCOSSQRTPOW)
5066VM_sqrt, // #62 float(float f) sqrt (DP_QC_SINCOSSQRTPOW)
5067VM_changepitch, // #63 void(entity ent) changepitch (DP_QC_CHANGEPITCH)
5068VM_CL_tracetoss, // #64 void(entity e, entity ignore) tracetoss (DP_QC_TRACETOSS)
5069VM_etos, // #65 string(entity ent) etos (DP_QC_ETOS)
5070NULL, // #66 (QUAKE)
5071NULL, // #67 void(float step) movetogoal (QUAKE)
5072VM_precache_file, // #68 string(string s) precache_file (QUAKE)
5073VM_CL_makestatic, // #69 void(entity e) makestatic (QUAKE)
5074NULL, // #70 void(string s) changelevel (QUAKE)
5075NULL, // #71 (QUAKE)
5076VM_cvar_set, // #72 void(string var, string val) cvar_set (QUAKE)
5077NULL, // #73 void(entity client, strings) centerprint (QUAKE)
5078VM_CL_ambientsound, // #74 void(vector pos, string samp, float vol, float atten) ambientsound (QUAKE)
5079VM_CL_precache_model, // #75 string(string s) precache_model2 (QUAKE)
5080VM_precache_sound, // #76 string(string s) precache_sound2 (QUAKE)
5081VM_precache_file, // #77 string(string s) precache_file2 (QUAKE)
5082NULL, // #78 void(entity e) setspawnparms (QUAKE)
5083NULL, // #79 void(entity killer, entity killee) logfrag (QUAKEWORLD)
5084NULL, // #80 string(entity e, string keyname) infokey (QUAKEWORLD)
5085VM_stof, // #81 float(string s) stof (FRIK_FILE)
5086NULL, // #82 void(vector where, float set) multicast (QUAKEWORLD)
5087NULL, // #83 (QUAKE)
5088NULL, // #84 (QUAKE)
5089NULL, // #85 (QUAKE)
5090NULL, // #86 (QUAKE)
5091NULL, // #87 (QUAKE)
5092NULL, // #88 (QUAKE)
5093NULL, // #89 (QUAKE)
5094VM_CL_tracebox, // #90 void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox (DP_QC_TRACEBOX)
5095VM_randomvec, // #91 vector() randomvec (DP_QC_RANDOMVEC)
5096VM_CL_getlight, // #92 vector(vector org) getlight (DP_QC_GETLIGHT)
5097VM_registercvar, // #93 float(string name, string value) registercvar (DP_REGISTERCVAR)
5098VM_min, // #94 float(float a, floats) min (DP_QC_MINMAXBOUND)
5099VM_max, // #95 float(float a, floats) max (DP_QC_MINMAXBOUND)
5100VM_bound, // #96 float(float minimum, float val, float maximum) bound (DP_QC_MINMAXBOUND)
5101VM_pow, // #97 float(float f, float f) pow (DP_QC_SINCOSSQRTPOW)
5102VM_findfloat, // #98 entity(entity start, .float fld, float match) findfloat (DP_QC_FINDFLOAT)
5103VM_checkextension, // #99 float(string s) checkextension (the basis of the extension system)
5104// FrikaC and Telejano range #100-#199
5105NULL, // #100
5106NULL, // #101
5107NULL, // #102
5108NULL, // #103
5109NULL, // #104
5110NULL, // #105
5111NULL, // #106
5112NULL, // #107
5113NULL, // #108
5114NULL, // #109
5115VM_fopen, // #110 float(string filename, float mode) fopen (FRIK_FILE)
5116VM_fclose, // #111 void(float fhandle) fclose (FRIK_FILE)
5117VM_fgets, // #112 string(float fhandle) fgets (FRIK_FILE)
5118VM_fputs, // #113 void(float fhandle, string s) fputs (FRIK_FILE)
5119VM_strlen, // #114 float(string s) strlen (FRIK_FILE)
5120VM_strcat, // #115 string(string s, string...) strcat (FRIK_FILE)
5121VM_substring, // #116 string(string s, float start, float length) substring (FRIK_FILE)
5122VM_stov, // #117 vector(string) stov (FRIK_FILE)
5123VM_strzone, // #118 string(string s) strzone (FRIK_FILE)
5124VM_strunzone, // #119 void(string s) strunzone (FRIK_FILE)
5125NULL, // #120
5126NULL, // #121
5127NULL, // #122
5128NULL, // #123
5129NULL, // #124
5130NULL, // #125
5131NULL, // #126
5132NULL, // #127
5133NULL, // #128
5134NULL, // #129
5135NULL, // #130
5136NULL, // #131
5137NULL, // #132
5138NULL, // #133
5139NULL, // #134
5140NULL, // #135
5141NULL, // #136
5142NULL, // #137
5143NULL, // #138
5144NULL, // #139
5145NULL, // #140
5146NULL, // #141
5147NULL, // #142
5148NULL, // #143
5149NULL, // #144
5150NULL, // #145
5151NULL, // #146
5152NULL, // #147
5153NULL, // #148
5154NULL, // #149
5155NULL, // #150
5156NULL, // #151
5157NULL, // #152
5158NULL, // #153
5159NULL, // #154
5160NULL, // #155
5161NULL, // #156
5162NULL, // #157
5163NULL, // #158
5164NULL, // #159
5165NULL, // #160
5166NULL, // #161
5167NULL, // #162
5168NULL, // #163
5169NULL, // #164
5170NULL, // #165
5171NULL, // #166
5172NULL, // #167
5173NULL, // #168
5174NULL, // #169
5175NULL, // #170
5176NULL, // #171
5177NULL, // #172
5178NULL, // #173
5179NULL, // #174
5180NULL, // #175
5181NULL, // #176
5182VM_localsound, // #177
5183NULL, // #178
5184NULL, // #179
5185NULL, // #180
5186NULL, // #181
5187NULL, // #182
5188NULL, // #183
5189NULL, // #184
5190NULL, // #185
5191NULL, // #186
5192NULL, // #187
5193NULL, // #188
5194NULL, // #189
5195NULL, // #190
5196NULL, // #191
5197NULL, // #192
5198NULL, // #193
5199NULL, // #194
5200NULL, // #195
5201NULL, // #196
5202NULL, // #197
5203NULL, // #198
5204NULL, // #199
5205// FTEQW range #200-#299
5206NULL, // #200
5207NULL, // #201
5208NULL, // #202
5209NULL, // #203
5210NULL, // #204
5211NULL, // #205
5212NULL, // #206
5213NULL, // #207
5214NULL, // #208
5215NULL, // #209
5216NULL, // #210
5217NULL, // #211
5218NULL, // #212
5219NULL, // #213
5220NULL, // #214
5221NULL, // #215
5222NULL, // #216
5223NULL, // #217
5224VM_bitshift, // #218 float(float number, float quantity) bitshift (EXT_BITSHIFT)
5225NULL, // #219
5226NULL, // #220
5227VM_strstrofs, // #221 float(string str, string sub[, float startpos]) strstrofs (FTE_STRINGS)
5228VM_str2chr, // #222 float(string str, float ofs) str2chr (FTE_STRINGS)
5229VM_chr2str, // #223 string(float c, ...) chr2str (FTE_STRINGS)
5230VM_strconv, // #224 string(float ccase, float calpha, float cnum, string s, ...) strconv (FTE_STRINGS)
5231VM_strpad, // #225 string(float chars, string s, ...) strpad (FTE_STRINGS)
5232VM_infoadd, // #226 string(string info, string key, string value, ...) infoadd (FTE_STRINGS)
5233VM_infoget, // #227 string(string info, string key) infoget (FTE_STRINGS)
5234VM_strncmp, // #228 float(string s1, string s2, float len) strncmp (FTE_STRINGS)
5235VM_strncasecmp, // #229 float(string s1, string s2) strcasecmp (FTE_STRINGS)
5236VM_strncasecmp, // #230 float(string s1, string s2, float len) strncasecmp (FTE_STRINGS)
5237NULL, // #231
5238NULL, // #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
5239NULL, // #233
5240NULL, // #234
5241NULL, // #235
5242NULL, // #236
5243NULL, // #237
5244NULL, // #238
5245NULL, // #239
5246VM_CL_checkpvs, // #240
5247NULL, // #241
5248NULL, // #242
5249NULL, // #243
5250NULL, // #244
5251VM_modulo, // #245
5252NULL, // #246
5253NULL, // #247
5254NULL, // #248
5255NULL, // #249
5256NULL, // #250
5257NULL, // #251
5258NULL, // #252
5259NULL, // #253
5260NULL, // #254
5261NULL, // #255
5262NULL, // #256
5263NULL, // #257
5264NULL, // #258
5265NULL, // #259
5266NULL, // #260
5267NULL, // #261
5268NULL, // #262
5269VM_CL_skel_create, // #263 float(float modlindex) skel_create = #263; // (FTE_CSQC_SKELETONOBJECTS) create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex.
5270VM_CL_skel_build, // #264 float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // (FTE_CSQC_SKELETONOBJECTS) blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
5271VM_CL_skel_get_numbones, // #265 float(float skel) skel_get_numbones = #265; // (FTE_CSQC_SKELETONOBJECTS) returns how many bones exist in the created skeleton
5272VM_CL_skel_get_bonename, // #266 string(float skel, float bonenum) skel_get_bonename = #266; // (FTE_CSQC_SKELETONOBJECTS) returns name of bone (as a tempstring)
5273VM_CL_skel_get_boneparent, // #267 float(float skel, float bonenum) skel_get_boneparent = #267; // (FTE_CSQC_SKELETONOBJECTS) returns parent num for supplied bonenum, -1 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
5274VM_CL_skel_find_bone, // #268 float(float skel, string tagname) skel_find_bone = #268; // (FTE_CSQC_SKELETONOBJECTS) get number of bone with specified name, 0 on failure, tagindex (bonenum+1) on success, same as using gettagindex on the modelindex
5275VM_CL_skel_get_bonerel, // #269 vector(float skel, float bonenum) skel_get_bonerel = #269; // (FTE_CSQC_SKELETONOBJECTS) get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
5276VM_CL_skel_get_boneabs, // #270 vector(float skel, float bonenum) skel_get_boneabs = #270; // (FTE_CSQC_SKELETONOBJECTS) get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
5277VM_CL_skel_set_bone, // #271 void(float skel, float bonenum, vector org) skel_set_bone = #271; // (FTE_CSQC_SKELETONOBJECTS) set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
5278VM_CL_skel_mul_bone, // #272 void(float skel, float bonenum, vector org) skel_mul_bone = #272; // (FTE_CSQC_SKELETONOBJECTS) transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
5279VM_CL_skel_mul_bones, // #273 void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // (FTE_CSQC_SKELETONOBJECTS) transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
5280VM_CL_skel_copybones, // #274 void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // (FTE_CSQC_SKELETONOBJECTS) copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
5281VM_CL_skel_delete, // #275 void(float skel) skel_delete = #275; // (FTE_CSQC_SKELETONOBJECTS) deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
5282VM_CL_frameforname, // #276 float(float modlindex, string framename) frameforname = #276; // (FTE_CSQC_SKELETONOBJECTS) finds number of a specified frame in the animation, returns -1 if no match found
5283VM_CL_frameduration, // #277 float(float modlindex, float framenum) frameduration = #277; // (FTE_CSQC_SKELETONOBJECTS) returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
5284NULL, // #278
5285NULL, // #279
5286NULL, // #280
5287NULL, // #281
5288NULL, // #282
5289NULL, // #283
5290NULL, // #284
5291NULL, // #285
5292NULL, // #286
5293NULL, // #287
5294NULL, // #288
5295NULL, // #289
5296NULL, // #290
5297NULL, // #291
5298NULL, // #292
5299NULL, // #293
5300NULL, // #294
5301NULL, // #295
5302NULL, // #296
5303NULL, // #297
5304NULL, // #298
5305NULL, // #299
5306// CSQC range #300-#399
5307VM_CL_R_ClearScene, // #300 void() clearscene (EXT_CSQC)
5308VM_CL_R_AddEntities, // #301 void(float mask) addentities (EXT_CSQC)
5309VM_CL_R_AddEntity, // #302 void(entity ent) addentity (EXT_CSQC)
5310VM_CL_R_SetView, // #303 float(float property, ...) setproperty (EXT_CSQC)
5311VM_CL_R_RenderScene, // #304 void() renderscene (EXT_CSQC)
5312VM_CL_R_AddDynamicLight, // #305 void(vector org, float radius, vector lightcolours) adddynamiclight (EXT_CSQC)
5313VM_CL_R_PolygonBegin, // #306 void(string texturename, float flag, float is2d[NYI: , float lines]) R_BeginPolygon
5314VM_CL_R_PolygonVertex, // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex
5315VM_CL_R_PolygonEnd, // #308 void() R_EndPolygon
5316VM_CL_R_SetView, // #309 float(float property) getproperty (EXT_CSQC)
5317VM_CL_unproject, // #310 vector (vector v) cs_unproject (EXT_CSQC)
5318VM_CL_project, // #311 vector (vector v) cs_project (EXT_CSQC)
5319NULL, // #312
5320NULL, // #313
5321NULL, // #314
5322VM_drawline, // #315 void(float width, vector pos1, vector pos2, float flag) drawline (EXT_CSQC)
5323VM_iscachedpic, // #316 float(string name) iscachedpic (EXT_CSQC)
5324VM_precache_pic, // #317 string(string name, float trywad) precache_pic (EXT_CSQC)
5325VM_getimagesize, // #318 vector(string picname) draw_getimagesize (EXT_CSQC)
5326VM_freepic, // #319 void(string name) freepic (EXT_CSQC)
5327VM_drawcharacter, // #320 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter (EXT_CSQC)
5328VM_drawstring, // #321 float(vector position, string text, vector scale, vector rgb, float alpha[, float flag]) drawstring (EXT_CSQC, DP_CSQC)
5329VM_drawpic, // #322 float(vector position, string pic, vector size, vector rgb, float alpha[, float flag]) drawpic (EXT_CSQC)
5330VM_drawfill, // #323 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill (EXT_CSQC)
5331VM_drawsetcliparea, // #324 void(float x, float y, float width, float height) drawsetcliparea
5332VM_drawresetcliparea, // #325 void(void) drawresetcliparea
5333VM_drawcolorcodedstring, // #326 float drawcolorcodedstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) (EXT_CSQC)
5334VM_stringwidth, // #327 // FIXME is this okay?
5335VM_drawsubpic, // #328 // FIXME is this okay?
5336VM_drawrotpic, // #329 // FIXME is this okay?
5337VM_CL_getstatf, // #330 float(float stnum) getstatf (EXT_CSQC)
5338VM_CL_getstati, // #331 float(float stnum) getstati (EXT_CSQC)
5339VM_CL_getstats, // #332 string(float firststnum) getstats (EXT_CSQC)
5340VM_CL_setmodelindex, // #333 void(entity e, float mdlindex) setmodelindex (EXT_CSQC)
5341VM_CL_modelnameforindex, // #334 string(float mdlindex) modelnameforindex (EXT_CSQC)
5342VM_CL_particleeffectnum, // #335 float(string effectname) particleeffectnum (EXT_CSQC)
5343VM_CL_trailparticles, // #336 void(entity ent, float effectnum, vector start, vector end) trailparticles (EXT_CSQC)
5344VM_CL_pointparticles, // #337 void(float effectnum, vector origin [, vector dir, float count]) pointparticles (EXT_CSQC)
5345VM_centerprint, // #338 void(string s, ...) centerprint (EXT_CSQC)
5346VM_print, // #339 void(string s, ...) print (EXT_CSQC, DP_SV_PRINT)
5347VM_keynumtostring, // #340 string(float keynum) keynumtostring (EXT_CSQC)
5348VM_stringtokeynum, // #341 float(string keyname) stringtokeynum (EXT_CSQC)
5349VM_getkeybind, // #342 string(float keynum[, float bindmap]) getkeybind (EXT_CSQC)
5350VM_CL_setcursormode, // #343 void(float usecursor) setcursormode (DP_CSQC)
5351VM_CL_getmousepos, // #344 vector() getmousepos (DP_CSQC)
5352VM_CL_getinputstate, // #345 float(float framenum) getinputstate (EXT_CSQC)
5353VM_CL_setsensitivityscale, // #346 void(float sens) setsensitivityscale (EXT_CSQC)
5354VM_CL_runplayerphysics, // #347 void() runstandardplayerphysics (EXT_CSQC)
5355VM_CL_getplayerkey, // #348 string(float playernum, string keyname) getplayerkeyvalue (EXT_CSQC)
5356VM_CL_isdemo, // #349 float() isdemo (EXT_CSQC)
5357VM_isserver, // #350 float() isserver (EXT_CSQC)
5358VM_CL_setlistener, // #351 void(vector origin, vector forward, vector right, vector up) SetListener (EXT_CSQC)
5359VM_CL_registercmd, // #352 void(string cmdname) registercommand (EXT_CSQC)
5360VM_wasfreed, // #353 float(entity ent) wasfreed (EXT_CSQC) (should be availabe on server too)
5361VM_CL_serverkey, // #354 string(string key) serverkey (EXT_CSQC)
5362VM_CL_videoplaying, // #355
5363VM_findfont, // #356 float(string fontname) loadfont (DP_GFX_FONTS)
5364VM_loadfont, // #357 float(string fontname, string fontmaps, string sizes, float slot) loadfont (DP_GFX_FONTS)
5365VM_CL_loadcubemap, // #358 void(string cubemapname) loadcubemap (DP_GFX_)
5366NULL, // #359
5367VM_CL_ReadByte, // #360 float() ReadByte (EXT_CSQC)
5368VM_CL_ReadChar, // #361 float() ReadChar (EXT_CSQC)
5369VM_CL_ReadShort, // #362 float() ReadShort (EXT_CSQC)
5370VM_CL_ReadLong, // #363 float() ReadLong (EXT_CSQC)
5371VM_CL_ReadCoord, // #364 float() ReadCoord (EXT_CSQC)
5372VM_CL_ReadAngle, // #365 float() ReadAngle (EXT_CSQC)
5373VM_CL_ReadString, // #366 string() ReadString (EXT_CSQC)
5374VM_CL_ReadFloat, // #367 float() ReadFloat (EXT_CSQC)
5375NULL, // #368
5376NULL, // #369
5377NULL, // #370
5378NULL, // #371
5379NULL, // #372
5380NULL, // #373
5381NULL, // #374
5382NULL, // #375
5383NULL, // #376
5384NULL, // #377
5385NULL, // #378
5386NULL, // #379
5387NULL, // #380
5388NULL, // #381
5389NULL, // #382
5390NULL, // #383
5391NULL, // #384
5392NULL, // #385
5393NULL, // #386
5394NULL, // #387
5395NULL, // #388
5396NULL, // #389
5397NULL, // #390
5398NULL, // #391
5399NULL, // #392
5400NULL, // #393
5401NULL, // #394
5402NULL, // #395
5403NULL, // #396
5404NULL, // #397
5405NULL, // #398
5406NULL, // #399
5407// LadyHavoc's range #400-#499
5408VM_CL_copyentity, // #400 void(entity from, entity to) copyentity (DP_QC_COPYENTITY)
5409NULL, // #401 void(entity ent, float colors) setcolor (DP_QC_SETCOLOR)
5410VM_findchain, // #402 entity(.string fld, string match) findchain (DP_QC_FINDCHAIN)
5411VM_findchainfloat, // #403 entity(.float fld, float match) findchainfloat (DP_QC_FINDCHAINFLOAT)
5412VM_CL_effect, // #404 void(vector org, string modelname, float startframe, float endframe, float framerate) effect (DP_SV_EFFECT)
5413VM_CL_te_blood, // #405 void(vector org, vector velocity, float howmany) te_blood (DP_TE_BLOOD)
5414VM_CL_te_bloodshower, // #406 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower (DP_TE_BLOODSHOWER)
5415VM_CL_te_explosionrgb, // #407 void(vector org, vector color) te_explosionrgb (DP_TE_EXPLOSIONRGB)
5416VM_CL_te_particlecube, // #408 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube (DP_TE_PARTICLECUBE)
5417VM_CL_te_particlerain, // #409 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain (DP_TE_PARTICLERAIN)
5418VM_CL_te_particlesnow, // #410 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow (DP_TE_PARTICLESNOW)
5419VM_CL_te_spark, // #411 void(vector org, vector vel, float howmany) te_spark (DP_TE_SPARK)
5420VM_CL_te_gunshotquad, // #412 void(vector org) te_gunshotquad (DP_QUADEFFECTS1)
5421VM_CL_te_spikequad, // #413 void(vector org) te_spikequad (DP_QUADEFFECTS1)
5422VM_CL_te_superspikequad, // #414 void(vector org) te_superspikequad (DP_QUADEFFECTS1)
5423VM_CL_te_explosionquad, // #415 void(vector org) te_explosionquad (DP_QUADEFFECTS1)
5424VM_CL_te_smallflash, // #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH)
5425VM_CL_te_customflash, // #417 void(vector org, float radius, float lifetime, vector color) te_customflash (DP_TE_CUSTOMFLASH)
5426VM_CL_te_gunshot, // #418 void(vector org) te_gunshot (DP_TE_STANDARDEFFECTBUILTINS)
5427VM_CL_te_spike, // #419 void(vector org) te_spike (DP_TE_STANDARDEFFECTBUILTINS)
5428VM_CL_te_superspike, // #420 void(vector org) te_superspike (DP_TE_STANDARDEFFECTBUILTINS)
5429VM_CL_te_explosion, // #421 void(vector org) te_explosion (DP_TE_STANDARDEFFECTBUILTINS)
5430VM_CL_te_tarexplosion, // #422 void(vector org) te_tarexplosion (DP_TE_STANDARDEFFECTBUILTINS)
5431VM_CL_te_wizspike, // #423 void(vector org) te_wizspike (DP_TE_STANDARDEFFECTBUILTINS)
5432VM_CL_te_knightspike, // #424 void(vector org) te_knightspike (DP_TE_STANDARDEFFECTBUILTINS)
5433VM_CL_te_lavasplash, // #425 void(vector org) te_lavasplash (DP_TE_STANDARDEFFECTBUILTINS)
5434VM_CL_te_teleport, // #426 void(vector org) te_teleport (DP_TE_STANDARDEFFECTBUILTINS)
5435VM_CL_te_explosion2, // #427 void(vector org, float colorstart, float colorlength) te_explosion2 (DP_TE_STANDARDEFFECTBUILTINS)
5436VM_CL_te_lightning1, // #428 void(entity own, vector start, vector end) te_lightning1 (DP_TE_STANDARDEFFECTBUILTINS)
5437VM_CL_te_lightning2, // #429 void(entity own, vector start, vector end) te_lightning2 (DP_TE_STANDARDEFFECTBUILTINS)
5438VM_CL_te_lightning3, // #430 void(entity own, vector start, vector end) te_lightning3 (DP_TE_STANDARDEFFECTBUILTINS)
5439VM_CL_te_beam, // #431 void(entity own, vector start, vector end) te_beam (DP_TE_STANDARDEFFECTBUILTINS)
5440VM_vectorvectors, // #432 void(vector dir) vectorvectors (DP_QC_VECTORVECTORS)
5441VM_CL_te_plasmaburn, // #433 void(vector org) te_plasmaburn (DP_TE_PLASMABURN)
5442VM_getsurfacenumpoints, // #434 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACE)
5443VM_getsurfacepoint, // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE)
5444VM_getsurfacenormal, // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE)
5445VM_getsurfacetexture, // #437 string(entity e, float s) getsurfacetexture (DP_QC_GETSURFACE)
5446VM_getsurfacenearpoint, // #438 float(entity e, vector p) getsurfacenearpoint (DP_QC_GETSURFACE)
5447VM_getsurfaceclippedpoint, // #439 vector(entity e, float s, vector p) getsurfaceclippedpoint (DP_QC_GETSURFACE)
5448NULL, // #440 void(entity e, string s) clientcommand (KRIMZON_SV_PARSECLIENTCOMMAND)
5449VM_tokenize, // #441 float(string s) tokenize (KRIMZON_SV_PARSECLIENTCOMMAND)
5450VM_argv, // #442 string(float n) argv (KRIMZON_SV_PARSECLIENTCOMMAND)
5451VM_CL_setattachment, // #443 void(entity e, entity tagentity, string tagname) setattachment (DP_GFX_QUAKE3MODELTAGS)
5452VM_search_begin, // #444 float(string pattern, float caseinsensitive, float quiet) search_begin (DP_QC_FS_SEARCH)
5453VM_search_end, // #445 void(float handle) search_end (DP_QC_FS_SEARCH)
5454VM_search_getsize, // #446 float(float handle) search_getsize (DP_QC_FS_SEARCH)
5455VM_search_getfilename, // #447 string(float handle, float num) search_getfilename (DP_QC_FS_SEARCH)
5456VM_cvar_string, // #448 string(string s) cvar_string (DP_QC_CVAR_STRING)
5457VM_findflags, // #449 entity(entity start, .float fld, float match) findflags (DP_QC_FINDFLAGS)
5458VM_findchainflags, // #450 entity(.float fld, float match) findchainflags (DP_QC_FINDCHAINFLAGS)
5459VM_CL_gettagindex, // #451 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO)
5460VM_CL_gettaginfo, // #452 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO)
5461NULL, // #453 void(entity clent) dropclient (DP_SV_DROPCLIENT)
5462NULL, // #454 entity() spawnclient (DP_SV_BOTCLIENT)
5463NULL, // #455 float(entity clent) clienttype (DP_SV_BOTCLIENT)
5464NULL, // #456 void(float to, string s) WriteUnterminatedString (DP_SV_WRITEUNTERMINATEDSTRING)
5465VM_CL_te_flamejet, // #457 void(vector org, vector vel, float howmany) te_flamejet (DP_TE_FLAMEJET)
5466NULL, // #458
5467VM_ftoe, // #459 entity(float num) entitybyindex (DP_QC_EDICT_NUM)
5468VM_buf_create, // #460 float() buf_create (DP_QC_STRINGBUFFERS)
5469VM_buf_del, // #461 void(float bufhandle) buf_del (DP_QC_STRINGBUFFERS)
5470VM_buf_getsize, // #462 float(float bufhandle) buf_getsize (DP_QC_STRINGBUFFERS)
5471VM_buf_copy, // #463 void(float bufhandle_from, float bufhandle_to) buf_copy (DP_QC_STRINGBUFFERS)
5472VM_buf_sort, // #464 void(float bufhandle, float sortpower, float backward) buf_sort (DP_QC_STRINGBUFFERS)
5473VM_buf_implode, // #465 string(float bufhandle, string glue) buf_implode (DP_QC_STRINGBUFFERS)
5474VM_bufstr_get, // #466 string(float bufhandle, float string_index) bufstr_get (DP_QC_STRINGBUFFERS)
5475VM_bufstr_set, // #467 void(float bufhandle, float string_index, string str) bufstr_set (DP_QC_STRINGBUFFERS)
5476VM_bufstr_add, // #468 float(float bufhandle, string str, float order) bufstr_add (DP_QC_STRINGBUFFERS)
5477VM_bufstr_free, // #469 void(float bufhandle, float string_index) bufstr_free (DP_QC_STRINGBUFFERS)
5478NULL, // #470 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
5479VM_asin, // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
5480VM_acos, // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
5481VM_atan, // #473 float(float t) VM_atan (DP_QC_ASINACOSATANATAN2TAN)
5482VM_atan2, // #474 float(float c, float s) VM_atan2 (DP_QC_ASINACOSATANATAN2TAN)
5483VM_tan, // #475 float(float a) VM_tan (DP_QC_ASINACOSATANATAN2TAN)
5484VM_strlennocol, // #476 float(string s) : DRESK - String Length (not counting color codes) (DP_QC_STRINGCOLORFUNCTIONS)
5485VM_strdecolorize, // #477 string(string s) : DRESK - Decolorized String (DP_QC_STRINGCOLORFUNCTIONS)
5486VM_strftime, // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME)
5487VM_tokenizebyseparator, // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR)
5488VM_strtolower, // #480 string(string s) VM_strtolower (DP_QC_STRING_CASE_FUNCTIONS)
5489VM_strtoupper, // #481 string(string s) VM_strtoupper (DP_QC_STRING_CASE_FUNCTIONS)
5490VM_cvar_defstring, // #482 string(string s) cvar_defstring (DP_QC_CVAR_DEFSTRING)
5491VM_CL_pointsound, // #483 void(vector origin, string sample, float volume, float attenuation) pointsound (DP_SV_POINTSOUND)
5492VM_strreplace, // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
5493VM_strireplace, // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
5494VM_getsurfacepointattribute,// #486 vector(entity e, float s, float n, float a) getsurfacepointattribute
5495VM_gecko_create, // #487 float gecko_create( string name )
5496VM_gecko_destroy, // #488 void gecko_destroy( string name )
5497VM_gecko_navigate, // #489 void gecko_navigate( string name, string URI )
5498VM_gecko_keyevent, // #490 float gecko_keyevent( string name, float key, float eventtype )
5499VM_gecko_movemouse, // #491 void gecko_mousemove( string name, float x, float y )
5500VM_gecko_resize, // #492 void gecko_resize( string name, float w, float h )
5501VM_gecko_get_texture_extent, // #493 vector gecko_get_texture_extent( string name )
5502VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
5503VM_cvar_type, // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
5504VM_numentityfields, // #496 float() numentityfields = #496; (QP_QC_ENTITYDATA)
5505VM_entityfieldname, // #497 string(float fieldnum) entityfieldname = #497; (DP_QC_ENTITYDATA)
5506VM_entityfieldtype, // #498 float(float fieldnum) entityfieldtype = #498; (DP_QC_ENTITYDATA)
5507VM_getentityfieldstring, // #499 string(float fieldnum, entity ent) getentityfieldstring = #499; (DP_QC_ENTITYDATA)
5508VM_putentityfieldstring, // #500 float(float fieldnum, entity ent, string s) putentityfieldstring = #500; (DP_QC_ENTITYDATA)
5509VM_CL_ReadPicture, // #501 string() ReadPicture = #501;
5510VM_CL_boxparticles, // #502 void(float effectnum, entity own, vector origin_from, vector origin_to, vector dir_from, vector dir_to, float count) boxparticles (DP_CSQC_BOXPARTICLES)
5511VM_whichpack, // #503 string(string) whichpack = #503;
5512VM_CL_GetEntity, // #504 float(float entitynum, float fldnum) getentity = #504; vector(float entitynum, float fldnum) getentityvec = #504;
5513NULL, // #505
5514NULL, // #506
5515NULL, // #507
5516NULL, // #508
5517NULL, // #509
5518VM_uri_escape, // #510 string(string in) uri_escape = #510;
5519VM_uri_unescape, // #511 string(string in) uri_unescape = #511;
5520VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT)
5521VM_uri_get, // #513 float(string uri, float id, [string post_contenttype, string post_delim, [float buf]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
5522VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
5523VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
5524VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
5525VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
5526VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
5527VM_gettime, // #519 float(float timer) gettime = #519; (DP_QC_GETTIME)
5528VM_keynumtostring, // #520 string keynumtostring(float keynum)
5529VM_findkeysforcommand, // #521 string findkeysforcommand(string command[, float bindmap])
5530VM_CL_InitParticleSpawner, // #522 void(float max_themes) initparticlespawner (DP_CSQC_SPAWNPARTICLE)
5531VM_CL_ResetParticle, // #523 void() resetparticle (DP_CSQC_SPAWNPARTICLE)
5532VM_CL_ParticleTheme, // #524 void(float theme) particletheme (DP_CSQC_SPAWNPARTICLE)
5533VM_CL_ParticleThemeSave, // #525 void() particlethemesave, void(float theme) particlethemeupdate (DP_CSQC_SPAWNPARTICLE)
5534VM_CL_ParticleThemeFree, // #526 void() particlethemefree (DP_CSQC_SPAWNPARTICLE)
5535VM_CL_SpawnParticle, // #527 float(vector org, vector vel, [float theme]) particle (DP_CSQC_SPAWNPARTICLE)
5536VM_CL_SpawnParticleDelayed, // #528 float(vector org, vector vel, float delay, float collisiondelay, [float theme]) delayedparticle (DP_CSQC_SPAWNPARTICLE)
5537VM_loadfromdata, // #529
5538VM_loadfromfile, // #530
5539VM_CL_setpause, // #531 float(float ispaused) setpause = #531 (DP_CSQC_SETPAUSE)
5540VM_log, // #532
5541VM_getsoundtime, // #533 float(entity e, float channel) getsoundtime = #533; (DP_SND_GETSOUNDTIME)
5542VM_soundlength, // #534 float(string sample) soundlength = #534; (DP_SND_GETSOUNDTIME)
5543VM_buf_loadfile, // #535 float(string filename, float bufhandle) buf_loadfile (DP_QC_STRINGBUFFERS_EXT_WIP)
5544VM_buf_writefile, // #536 float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
5545VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule, float startpos) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
5546VM_matchpattern, // #538 float(string s, string pattern, float matchrule) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
5547NULL, // #539
5548VM_physics_enable, // #540 void(entity e, float physics_enabled) physics_enable = #540; (DP_PHYSICS_ODE)
5549VM_physics_addforce, // #541 void(entity e, vector force, vector relative_ofs) physics_addforce = #541; (DP_PHYSICS_ODE)
5550VM_physics_addtorque, // #542 void(entity e, vector torque) physics_addtorque = #542; (DP_PHYSICS_ODE)
5551NULL, // #543
5552NULL, // #544
5553NULL, // #545
5554NULL, // #546
5555NULL, // #547
5556NULL, // #548
5557NULL, // #549
5558NULL, // #550
5559NULL, // #551
5560NULL, // #552
5561NULL, // #553
5562NULL, // #554
5563NULL, // #555
5564NULL, // #556
5565NULL, // #557
5566NULL, // #558
5567NULL, // #559
5568NULL, // #560
5569NULL, // #561
5570NULL, // #562
5571NULL, // #563
5572NULL, // #564
5573NULL, // #565
5574VM_CL_findbox, // #566 entity(vector mins, vector maxs) findbox = #566; (DP_QC_FINDBOX)
5575VM_nudgeoutofsolid, // #567 float(entity ent) nudgeoutofsolid = #567; (DP_QC_NUDGEOUTOFSOLID)
5576NULL, // #568
5577NULL, // #569
5578NULL, // #570
5579NULL, // #571
5580NULL, // #572
5581NULL, // #573
5582NULL, // #574
5583NULL, // #575
5584NULL, // #576
5585NULL, // #577
5586NULL, // #578
5587NULL, // #579
5588NULL, // #580
5589NULL, // #581
5590NULL, // #582
5591NULL, // #583
5592NULL, // #584
5593NULL, // #585
5594NULL, // #586
5595NULL, // #587
5596NULL, // #588
5597NULL, // #589
5598NULL, // #590
5599NULL, // #591
5600NULL, // #592
5601NULL, // #593
5602NULL, // #594
5603NULL, // #595
5604NULL, // #596
5605NULL, // #597
5606NULL, // #598
5607NULL, // #599
5608NULL, // #600
5609NULL, // #601
5610NULL, // #602
5611NULL, // #603
5612NULL, // #604
5613VM_callfunction, // #605
5614VM_writetofile, // #606
5615VM_isfunction, // #607
5616NULL, // #608
5617NULL, // #609
5618VM_findkeysforcommand, // #610 string findkeysforcommand(string command[, float bindmap])
5619NULL, // #611
5620NULL, // #612
5621VM_parseentitydata, // #613
5622NULL, // #614
5623NULL, // #615
5624NULL, // #616
5625NULL, // #617
5626NULL, // #618
5627NULL, // #619
5628NULL, // #620
5629NULL, // #621
5630NULL, // #622
5631NULL, // #623
5632VM_CL_getextresponse, // #624 string getextresponse(void)
5633NULL, // #625
5634NULL, // #626
5635VM_sprintf, // #627 string sprintf(string format, ...)
5636VM_getsurfacenumtriangles, // #628 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACETRIANGLE)
5637VM_getsurfacetriangle, // #629 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACETRIANGLE)
5638VM_setkeybind, // #630 float(float key, string bind[, float bindmap]) setkeybind
5639VM_getbindmaps, // #631 vector(void) getbindmap
5640VM_setbindmaps, // #632 float(vector bm) setbindmap
5641NULL, // #633
5642NULL, // #634
5643NULL, // #635
5644NULL, // #636
5645NULL, // #637
5646VM_CL_RotateMoves, // #638
5647VM_digest_hex, // #639
5648VM_CL_V_CalcRefdef, // #640 void(entity e) V_CalcRefdef (DP_CSQC_V_CALCREFDEF)
5649NULL, // #641
5650VM_coverage, // #642
5651NULL
5652};
static void VM_CL_ReadChar(prvm_prog_t *prog)
Definition clvm_cmds.c:2480
static void VM_CL_getmousepos(prvm_prog_t *prog)
Definition clvm_cmds.c:2272
void VM_stringwidth(prvm_prog_t *prog)
Definition clvm_cmds.c:1546
static void VM_CL_ambientsound(prvm_prog_t *prog)
Definition clvm_cmds.c:722
void VM_precache_pic(prvm_prog_t *prog)
Definition clvm_cmds.c:1306
static void VM_CL_spawn(prvm_prog_t *prog)
Definition clvm_cmds.c:264
static void VM_CL_setpause(prvm_prog_t *prog)
Definition clvm_cmds.c:2251
static void VM_CL_checkbottom(prvm_prog_t *prog)
Definition clvm_cmds.c:627
void VM_drawsetcliparea(prvm_prog_t *prog)
Definition clvm_cmds.c:1961
void VM_drawrotpic(prvm_prog_t *prog)
Definition clvm_cmds.c:1819
static void VM_CL_ResetParticle(prvm_prog_t *prog)
Definition clvm_cmds.c:3651
static void VM_CL_getplayerkey(prvm_prog_t *prog)
Definition clvm_cmds.c:2396
static void VM_CL_ReadShort(prvm_prog_t *prog)
Definition clvm_cmds.c:2487
static void VM_CL_boxparticles(prvm_prog_t *prog)
Definition clvm_cmds.c:2195
static void VM_CL_walkmove(prvm_prog_t *prog)
Definition clvm_cmds.c:4465
static void VM_CL_sound(prvm_prog_t *prog)
Definition clvm_cmds.c:168
static void VM_CL_skel_get_bonename(prvm_prog_t *prog)
Definition clvm_cmds.c:4677
static void VM_CL_ReadByte(prvm_prog_t *prog)
Definition clvm_cmds.c:2473
static void VM_CL_makestatic(prvm_prog_t *prog)
Definition clvm_cmds.c:2582
static void VM_CL_lightstyle(prvm_prog_t *prog)
Definition clvm_cmds.c:607
static void VM_CL_frameduration(prvm_prog_t *prog)
Definition clvm_cmds.c:4893
static void VM_CL_te_bloodshower(prvm_prog_t *prog)
Definition clvm_cmds.c:2742
static void VM_CL_ReadFloat(prvm_prog_t *prog)
Definition clvm_cmds.c:2525
static void VM_CL_skel_mul_bones(prvm_prog_t *prog)
Definition clvm_cmds.c:4814
void VM_drawcolorcodedstring(prvm_prog_t *prog)
Definition clvm_cmds.c:1481
static void VM_CL_te_explosion2(prvm_prog_t *prog)
Definition clvm_cmds.c:3050
static void VM_CL_skel_find_bone(prvm_prog_t *prog)
Definition clvm_cmds.c:4705
static void VM_CL_te_lavasplash(prvm_prog_t *prog)
Definition clvm_cmds.c:3032
static void VM_CL_findradius(prvm_prog_t *prog)
Definition clvm_cmds.c:456
static void VM_CL_skel_get_boneparent(prvm_prog_t *prog)
Definition clvm_cmds.c:4691
static void VM_CL_tracebox(prvm_prog_t *prog)
Definition clvm_cmds.c:320
void VM_drawline(prvm_prog_t *prog)
Definition clvm_cmds.c:1260
static void VM_CL_setsensitivityscale(prvm_prog_t *prog)
Definition clvm_cmds.c:2318
void VM_drawfill(prvm_prog_t *prog)
Definition clvm_cmds.c:1925
static void VM_CL_te_lightning2(prvm_prog_t *prog)
Definition clvm_cmds.c:3084
static void VM_CL_makevectors(prvm_prog_t *prog)
Definition clvm_cmds.c:29
static void VM_CL_skel_get_boneabs(prvm_prog_t *prog)
Definition clvm_cmds.c:4741
static void VM_CL_findbox(prvm_prog_t *prog)
Definition clvm_cmds.c:524
static void VM_CL_te_particlesnow(prvm_prog_t *prog)
Definition clvm_cmds.c:2798
static void VM_CL_runplayerphysics(prvm_prog_t *prog)
Definition clvm_cmds.c:2329
static void VM_CL_project(prvm_prog_t *prog)
Definition clvm_cmds.c:1229
static void VM_CL_pointsound(prvm_prog_t *prog)
Definition clvm_cmds.c:233
static void VM_CL_te_explosionquad(prvm_prog_t *prog)
Definition clvm_cmds.c:2885
static void VM_CL_skel_copybones(prvm_prog_t *prog)
Definition clvm_cmds.c:4841
void VM_freepic(prvm_prog_t *prog)
Definition clvm_cmds.c:1339
static void VM_CL_te_beam(prvm_prog_t *prog)
Definition clvm_cmds.c:3104
static void VM_CL_te_superspike(prvm_prog_t *prog)
Definition clvm_cmds.c:2964
static void VM_CL_skel_get_bonerel(prvm_prog_t *prog)
Definition clvm_cmds.c:4717
static void VM_CL_getlight(prvm_prog_t *prog)
Definition clvm_cmds.c:733
static void VM_CL_frameforname(prvm_prog_t *prog)
Definition clvm_cmds.c:4873
static void VM_CL_te_superspikequad(prvm_prog_t *prog)
Definition clvm_cmds.c:2865
static void VM_CL_te_plasmaburn(prvm_prog_t *prog)
Definition clvm_cmds.c:3114
static void VM_CL_ReadCoord(prvm_prog_t *prog)
Definition clvm_cmds.c:2501
static void VM_CL_te_teleport(prvm_prog_t *prog)
Definition clvm_cmds.c:3041
static void VM_CL_registercmd(prvm_prog_t *prog)
Definition clvm_cmds.c:2466
static void VM_CL_skel_delete(prvm_prog_t *prog)
Definition clvm_cmds.c:4862
static void VM_CL_te_spark(prvm_prog_t *prog)
Definition clvm_cmds.c:2809
static void VM_CL_te_flamejet(prvm_prog_t *prog)
Definition clvm_cmds.c:3125
static void VM_CL_droptofloor(prvm_prog_t *prog)
Definition clvm_cmds.c:559
static void VM_CL_ReadPicture(prvm_prog_t *prog)
Definition clvm_cmds.c:2533
static void VM_CL_tracetoss(prvm_prog_t *prog)
Definition clvm_cmds.c:393
static void VM_CL_te_blood(prvm_prog_t *prog)
Definition clvm_cmds.c:2729
void VM_drawpic(prvm_prog_t *prog)
Definition clvm_cmds.c:1771
static void VM_CL_skel_get_numbones(prvm_prog_t *prog)
Definition clvm_cmds.c:4666
static void VM_CL_traceline(prvm_prog_t *prog)
Definition clvm_cmds.c:281
static void VM_CL_te_lightning3(prvm_prog_t *prog)
Definition clvm_cmds.c:3094
static void VM_CL_checkpvs(prvm_prog_t *prog)
Definition clvm_cmds.c:4540
void VM_iscachedpic(prvm_prog_t *prog)
Definition clvm_cmds.c:1287
static void VM_CL_te_knightspike(prvm_prog_t *prog)
Definition clvm_cmds.c:3020
static void VM_CL_ReadLong(prvm_prog_t *prog)
Definition clvm_cmds.c:2494
static void VM_CL_particle(prvm_prog_t *prog)
Definition clvm_cmds.c:707
static void VM_CL_setcursormode(prvm_prog_t *prog)
Definition clvm_cmds.c:2264
static void VM_CL_ParticleThemeFree(prvm_prog_t *prog)
Definition clvm_cmds.c:3734
static void VM_CL_skel_mul_bone(prvm_prog_t *prog)
Definition clvm_cmds.c:4792
static void VM_CL_GetEntity(prvm_prog_t *prog)
Definition clvm_cmds.c:4000
static void VM_CL_loadcubemap(prvm_prog_t *prog)
Definition clvm_cmds.c:4945
static void VM_CL_ReadString(prvm_prog_t *prog)
Definition clvm_cmds.c:2515
static void VM_CL_RotateMoves(prvm_prog_t *prog)
Definition clvm_cmds.c:4905
static void VM_CL_setlistener(prvm_prog_t *prog)
Definition clvm_cmds.c:2453
static void VM_CL_skel_build(prvm_prog_t *prog)
Definition clvm_cmds.c:4624
void VM_drawcharacter(prvm_prog_t *prog)
Definition clvm_cmds.c:1378
static void VM_CL_te_spike(prvm_prog_t *prog)
Definition clvm_cmds.c:2944
static void VM_CL_ParticleThemeSave(prvm_prog_t *prog)
Definition clvm_cmds.c:3692
void VM_getimagesize(prvm_prog_t *prog)
Definition clvm_cmds.c:2001
static void VM_CL_te_customflash(prvm_prog_t *prog)
Definition clvm_cmds.c:2908
static void VM_CL_pointcontents(prvm_prog_t *prog)
Definition clvm_cmds.c:698
static void VM_CL_skel_create(prvm_prog_t *prog)
Definition clvm_cmds.c:4600
void VM_drawresetcliparea(prvm_prog_t *prog)
Definition clvm_cmds.c:1984
static void VM_CL_setmodelindex(prvm_prog_t *prog)
Definition clvm_cmds.c:2100
static void VM_CL_getstati(prvm_prog_t *prog)
Definition clvm_cmds.c:2047
static void VM_CL_modelnameforindex(prvm_prog_t *prog)
Definition clvm_cmds.c:2137
static void VM_CL_te_particlerain(prvm_prog_t *prog)
Definition clvm_cmds.c:2787
static void VM_CL_te_explosionrgb(prvm_prog_t *prog)
Definition clvm_cmds.c:2762
static void VM_CL_getstats(prvm_prog_t *prog)
Definition clvm_cmds.c:2082
static void VM_CL_te_lightning1(prvm_prog_t *prog)
Definition clvm_cmds.c:3074
static void VM_CL_InitParticleSpawner(prvm_prog_t *prog)
Definition clvm_cmds.c:3641
static void VM_CL_getinputstate(prvm_prog_t *prog)
Definition clvm_cmds.c:2285
static void VM_CL_particleeffectnum(prvm_prog_t *prog)
Definition clvm_cmds.c:2149
void VM_loadfont(prvm_prog_t *prog)
Definition clvm_cmds.c:1630
static void VM_CL_pointparticles(prvm_prog_t *prog)
Definition clvm_cmds.c:2179
static void VM_CL_te_wizspike(prvm_prog_t *prog)
Definition clvm_cmds.c:3008
static void VM_CL_SpawnParticleDelayed(prvm_prog_t *prog)
Definition clvm_cmds.c:3886
static void VM_CL_te_gunshotquad(prvm_prog_t *prog)
Definition clvm_cmds.c:2822
static void VM_CL_V_CalcRefdef(prvm_prog_t *prog)
Definition clvm_cmds.c:4958
static void VM_CL_ParticleTheme(prvm_prog_t *prog)
Definition clvm_cmds.c:3663
static void VM_CL_copyentity(prvm_prog_t *prog)
Definition clvm_cmds.c:2680
void VM_findfont(prvm_prog_t *prog)
Definition clvm_cmds.c:1616
static void VM_CL_te_smallflash(prvm_prog_t *prog)
Definition clvm_cmds.c:2897
static void VM_CL_te_spikequad(prvm_prog_t *prog)
Definition clvm_cmds.c:2845
void VM_drawstring(prvm_prog_t *prog)
Definition clvm_cmds.c:1431
void VM_drawsubpic(prvm_prog_t *prog)
Definition clvm_cmds.c:1868
static void VM_CL_unproject(prvm_prog_t *prog)
Definition clvm_cmds.c:1210
static void VM_CL_te_explosion(prvm_prog_t *prog)
Definition clvm_cmds.c:2984
static void VM_CL_te_gunshot(prvm_prog_t *prog)
Definition clvm_cmds.c:2921
static void VM_CL_SpawnParticle(prvm_prog_t *prog)
Definition clvm_cmds.c:3764
static void VM_CL_trailparticles(prvm_prog_t *prog)
Definition clvm_cmds.c:2160
static void VM_CL_getstatf(prvm_prog_t *prog)
Definition clvm_cmds.c:2026
static void VM_CL_effect(prvm_prog_t *prog)
Definition clvm_cmds.c:2714
static void VM_CL_ReadAngle(prvm_prog_t *prog)
Definition clvm_cmds.c:2508
static void VM_CL_te_particlecube(prvm_prog_t *prog)
Definition clvm_cmds.c:2776
static void VM_CL_te_tarexplosion(prvm_prog_t *prog)
Definition clvm_cmds.c:2996
static void VM_CL_serverkey(prvm_prog_t *prog)
Definition clvm_cmds.c:4522
static void VM_CL_skel_set_bone(prvm_prog_t *prog)
Definition clvm_cmds.c:4772
static void VM_CL_setsize(prvm_prog_t *prog)
Definition clvm_cmds.c:142
void VM_CL_precache_model(void)
void VM_CL_setorigin(void)
void VM_CL_R_SetView(void)
void VM_CL_R_PolygonBegin(void)
void VM_CL_R_AddEntity(void)
void VM_CL_R_ClearScene(void)
void VM_CL_R_RenderScene(void)
void VM_CL_R_PolygonEnd(void)
void VM_CL_gettagindex(void)
void VM_CL_R_PolygonVertex(void)
void VM_CL_gettaginfo(void)
void VM_CL_setattachment(void)
void VM_CL_setmodel(void)
void VM_CL_R_AddDynamicLight(void)
void VM_CL_R_AddEntities(void)
void VM_strunzone(prvm_prog_t *prog)
Definition prvm_cmds.c:2642
void VM_vectorvectors(prvm_prog_t *prog)
Definition prvm_cmds.c:3582
void VM_substring(prvm_prog_t *prog)
Definition prvm_cmds.c:2397
void VM_entityfieldname(prvm_prog_t *prog)
Definition prvm_cmds.c:2129
void VM_buf_writefile(prvm_prog_t *prog)
Definition prvm_cmds.c:4401
void VM_getsoundtime(prvm_prog_t *prog)
Definition prvm_cmds.c:2994
void VM_objerror(prvm_prog_t *prog)
Definition prvm_cmds.c:403
void VM_fabs(prvm_prog_t *prog)
Definition prvm_cmds.c:899
void VM_isserver(prvm_prog_t *prog)
Definition prvm_cmds.c:2864
void VM_nudgeoutofsolid(prvm_prog_t *prog)
Definition prvm_cmds.c:5644
void VM_dprint(prvm_prog_t *prog)
Definition prvm_cmds.c:854
void VM_uri_get(prvm_prog_t *prog)
Definition prvm_cmds.c:5427
void VM_chr2str(prvm_prog_t *prog)
Definition prvm_cmds.c:4918
void VM_digest_hex(prvm_prog_t *prog)
Definition prvm_cmds.c:5175
void VM_soundlength(prvm_prog_t *prog)
Definition prvm_cmds.c:3023
void VM_strncmp(prvm_prog_t *prog)
Definition prvm_cmds.c:5127
void VM_strtolower(prvm_prog_t *prog)
Definition prvm_cmds.c:2329
void VM_fgets(prvm_prog_t *prog)
Definition prvm_cmds.c:1996
void VM_physics_addtorque(prvm_prog_t *prog)
Definition prvm_cmds.c:6613
void VM_search_getsize(prvm_prog_t *prog)
Definition prvm_cmds.c:3238
void VM_findkeysforcommand(prvm_prog_t *prog)
Definition prvm_cmds.c:3352
void VM_tan(prvm_prog_t *prog)
Definition prvm_cmds.c:1704
void VM_modulo(prvm_prog_t *prog)
Definition prvm_cmds.c:3116
void VM_sqrt(prvm_prog_t *prog)
Definition prvm_cmds.c:1643
void VM_stov(prvm_prog_t *prog)
Definition prvm_cmds.c:2603
void VM_random(prvm_prog_t *prog)
Definition prvm_cmds.c:611
void VM_gecko_navigate(prvm_prog_t *prog)
Definition prvm_cmds.c:3500
void VM_eprint(prvm_prog_t *prog)
Definition prvm_cmds.c:1494
void VM_bitshift(prvm_prog_t *prog)
Definition prvm_cmds.c:3594
void VM_precache_sound(prvm_prog_t *prog)
Definition prvm_cmds.c:1381
void VM_CL_getextresponse(prvm_prog_t *prog)
Definition prvm_cmds.c:5612
void VM_buf_getsize(prvm_prog_t *prog)
Definition prvm_cmds.c:4016
void VM_getsurfacetexture(prvm_prog_t *prog)
Definition prvm_cmds.c:6416
void VM_search_end(prvm_prog_t *prog)
Definition prvm_cmds.c:3207
void VM_getentityfieldstring(prvm_prog_t *prog)
Definition prvm_cmds.c:2177
void VM_bufstr_get(prvm_prog_t *prog)
Definition prvm_cmds.c:4172
void VM_gecko_movemouse(prvm_prog_t *prog)
Definition prvm_cmds.c:3523
void VM_cvar_type(prvm_prog_t *prog)
Definition prvm_cmds.c:722
void VM_vlen(prvm_prog_t *prog)
Definition prvm_cmds.c:544
void VM_gecko_destroy(prvm_prog_t *prog)
Definition prvm_cmds.c:3489
void VM_physics_addforce(prvm_prog_t *prog)
Definition prvm_cmds.c:6584
void VM_gecko_get_texture_extent(prvm_prog_t *prog)
Definition prvm_cmds.c:3547
void VM_search_getfilename(prvm_prog_t *prog)
Definition prvm_cmds.c:3266
void VM_centerprint(prvm_prog_t *prog)
Definition prvm_cmds.c:499
void VM_coverage(prvm_prog_t *prog)
Definition prvm_cmds.c:6641
void VM_break(prvm_prog_t *prog)
Definition prvm_cmds.c:661
void VM_strlennocol(prvm_prog_t *prog)
Definition prvm_cmds.c:2305
void VM_tokenize(prvm_prog_t *prog)
Definition prvm_cmds.c:2663
void VM_numentityfields(prvm_prog_t *prog)
Definition prvm_cmds.c:2115
void VM_vtos(prvm_prog_t *prog)
Definition prvm_cmds.c:917
void VM_getsurfacenumpoints(prvm_prog_t *prog)
Definition prvm_cmds.c:6282
void VM_argv_start_index(prvm_prog_t *prog)
Definition prvm_cmds.c:2822
void VM_getsurfacepointattribute(prvm_prog_t *prog)
Definition prvm_cmds.c:6326
void VM_setbindmaps(prvm_prog_t *prog)
Definition prvm_cmds.c:3461
void VM_CL_videoplaying(prvm_prog_t *prog)
Definition prvm_cmds.c:5691
void VM_registercvar(prvm_prog_t *prog)
Definition prvm_cmds.c:1736
void VM_uri_unescape(prvm_prog_t *prog)
Definition prvm_cmds.c:5317
void VM_infoget(prvm_prog_t *prog)
Definition prvm_cmds.c:5110
void VM_randomvec(prvm_prog_t *prog)
Definition prvm_cmds.c:1719
void VM_matchpattern(prvm_prog_t *prog)
Definition prvm_cmds.c:4619
void VM_setkeybind(prvm_prog_t *prog)
Definition prvm_cmds.c:3423
void VM_atan2(prvm_prog_t *prog)
Definition prvm_cmds.c:1692
void VM_etos(prvm_prog_t *prog)
Definition prvm_cmds.c:936
void VM_cvar_defstring(prvm_prog_t *prog)
Definition prvm_cmds.c:786
void VM_asin(prvm_prog_t *prog)
Definition prvm_cmds.c:1656
void VM_vectoyaw(prvm_prog_t *prog)
Definition prvm_cmds.c:557
void VM_strlen(prvm_prog_t *prog)
Definition prvm_cmds.c:2265
void VM_strconv(prvm_prog_t *prog)
Definition prvm_cmds.c:5022
void VM_rint(prvm_prog_t *prog)
Definition prvm_cmds.c:1508
void VM_bound(prvm_prog_t *prog)
Definition prvm_cmds.c:1829
void VM_argv_end_index(prvm_prog_t *prog)
Definition prvm_cmds.c:2840
void VM_buf_implode(prvm_prog_t *prog)
Definition prvm_cmds.c:4128
void VM_precache_file(prvm_prog_t *prog)
Definition prvm_cmds.c:1407
void VM_tokenize_console(prvm_prog_t *prog)
Definition prvm_cmds.c:2694
void VM_sprintf(prvm_prog_t *prog)
Definition prvm_cmds.c:5772
void VM_localsound(prvm_prog_t *prog)
Definition prvm_cmds.c:625
void VM_buf_cvarlist(prvm_prog_t *prog)
Definition prvm_cmds.c:4659
void VM_find(prvm_prog_t *prog)
Definition prvm_cmds.c:1110
void VM_stof(prvm_prog_t *prog)
Definition prvm_cmds.c:954
void VM_getsurfacetriangle(prvm_prog_t *prog)
Definition prvm_cmds.c:6512
void VM_fputs(prvm_prog_t *prog)
Definition prvm_cmds.c:2049
void VM_bufstr_add(prvm_prog_t *prog)
Definition prvm_cmds.c:4235
void VM_strdecolorize(prvm_prog_t *prog)
Definition prvm_cmds.c:2282
void VM_uri_escape(prvm_prog_t *prog)
Definition prvm_cmds.c:5284
void VM_findchainflags(prvm_prog_t *prog)
Definition prvm_cmds.c:1334
void VM_writetofile(prvm_prog_t *prog)
Definition prvm_cmds.c:2082
void VM_physics_enable(prvm_prog_t *prog)
Definition prvm_cmds.c:6557
void VM_putentityfieldstring(prvm_prog_t *prog)
Definition prvm_cmds.c:2229
void VM_etof(prvm_prog_t *prog)
Definition prvm_cmds.c:1001
void VM_nextent(prvm_prog_t *prog)
Definition prvm_cmds.c:1556
void VM_parseentitydata(prvm_prog_t *prog)
Definition prvm_cmds.c:3054
void VM_gecko_resize(prvm_prog_t *prog)
Definition prvm_cmds.c:3535
void VM_fclose(prvm_prog_t *prog)
Definition prvm_cmds.c:1963
void VM_ftoe(prvm_prog_t *prog)
Definition prvm_cmds.c:982
void VM_findfloat(prvm_prog_t *prog)
Definition prvm_cmds.c:1155
void VM_strcat(prvm_prog_t *prog)
Definition prvm_cmds.c:2377
void VM_atan(prvm_prog_t *prog)
Definition prvm_cmds.c:1680
void VM_ceil(prvm_prog_t *prog)
Definition prvm_cmds.c:1541
void VM_buf_del(prvm_prog_t *prog)
Definition prvm_cmds.c:3995
void VM_strpad(prvm_prog_t *prog)
Definition prvm_cmds.c:5070
void VM_strtoupper(prvm_prog_t *prog)
Definition prvm_cmds.c:2352
void VM_normalize(prvm_prog_t *prog)
Definition prvm_cmds.c:515
void VM_changeyaw(prvm_prog_t *prog)
Definition prvm_cmds.c:4747
void VM_tokenizebyseparator(prvm_prog_t *prog)
Definition prvm_cmds.c:2738
void VM_getkeybind(prvm_prog_t *prog)
Definition prvm_cmds.c:3402
void VM_getbindmaps(prvm_prog_t *prog)
Definition prvm_cmds.c:3444
void VM_strftime(prvm_prog_t *prog)
Definition prvm_cmds.c:1014
void VM_floor(prvm_prog_t *prog)
Definition prvm_cmds.c:1527
void VM_cos(prvm_prog_t *prog)
Definition prvm_cmds.c:1630
void VM_whichpack(prvm_prog_t *prog)
Definition prvm_cmds.c:5364
void VM_CL_isdemo(prvm_prog_t *prog)
Definition prvm_cmds.c:5684
void VM_buf_sort(prvm_prog_t *prog)
Definition prvm_cmds.c:4093
void VM_bufstr_find(prvm_prog_t *prog)
Definition prvm_cmds.c:4564
void VM_strzone(prvm_prog_t *prog)
Definition prvm_cmds.c:2621
void VM_cvar_set(prvm_prog_t *prog)
Definition prvm_cmds.c:823
void VM_isfunction(prvm_prog_t *prog)
Definition prvm_cmds.c:5745
void VM_argv(prvm_prog_t *prog)
Definition prvm_cmds.c:2804
void VM_strreplace(prvm_prog_t *prog)
Definition prvm_cmds.c:2469
void VM_min(prvm_prog_t *prog)
Definition prvm_cmds.c:1777
void VM_changepitch(prvm_prog_t *prog)
Definition prvm_cmds.c:4805
void VM_checkextension(prvm_prog_t *prog)
Definition prvm_cmds.c:363
void VM_ftos(prvm_prog_t *prog)
Definition prvm_cmds.c:874
void VM_bufstr_set(prvm_prog_t *prog)
Definition prvm_cmds.c:4202
void VM_findflags(prvm_prog_t *prog)
Definition prvm_cmds.c:1294
void VM_getsurfacenumtriangles(prvm_prog_t *prog)
Definition prvm_cmds.c:6497
void VM_acos(prvm_prog_t *prog)
Definition prvm_cmds.c:1668
void VM_loadfromfile(prvm_prog_t *prog)
Definition prvm_cmds.c:3082
void VM_gecko_create(prvm_prog_t *prog)
Definition prvm_cmds.c:3477
void VM_gettime(prvm_prog_t *prog)
Definition prvm_cmds.c:2948
void VM_findchainfloat(prvm_prog_t *prog)
Definition prvm_cmds.c:1248
void VM_findchain(prvm_prog_t *prog)
Definition prvm_cmds.c:1193
void VM_getsurfaceclippedpoint(prvm_prog_t *prog)
Definition prvm_cmds.c:6478
void VM_traceon(prvm_prog_t *prog)
Definition prvm_cmds.c:1466
void VM_strstrofs(prvm_prog_t *prog)
Definition prvm_cmds.c:4872
void VM_fopen(prvm_prog_t *prog)
Definition prvm_cmds.c:1899
void VM_max(prvm_prog_t *prog)
Definition prvm_cmds.c:1803
void VM_bufstr_free(prvm_prog_t *prog)
Definition prvm_cmds.c:4282
void VM_getsurfacepoint(prvm_prog_t *prog)
Definition prvm_cmds.c:6298
void VM_getsurfacenearpoint(prvm_prog_t *prog)
Definition prvm_cmds.c:6428
void VM_buf_copy(prvm_prog_t *prog)
Definition prvm_cmds.c:4039
void VM_cvar_description(prvm_prog_t *prog)
Definition prvm_cmds.c:805
void VM_search_begin(prvm_prog_t *prog)
Definition prvm_cmds.c:3161
void VM_crc16(prvm_prog_t *prog)
Definition prvm_cmds.c:5162
void VM_stringtokeynum(prvm_prog_t *prog)
Definition prvm_cmds.c:3388
void VM_remove(prvm_prog_t *prog)
Definition prvm_cmds.c:1080
void VM_error(prvm_prog_t *prog)
Definition prvm_cmds.c:380
void VM_buf_create(prvm_prog_t *prog)
Definition prvm_cmds.c:3964
void VM_str2chr(prvm_prog_t *prog)
Definition prvm_cmds.c:4896
void VM_print(prvm_prog_t *prog)
Definition prvm_cmds.c:425
void VM_cvar(prvm_prog_t *prog)
Definition prvm_cmds.c:700
void VM_cvar_string(prvm_prog_t *prog)
Definition prvm_cmds.c:762
void VM_gecko_keyevent(prvm_prog_t *prog)
Definition prvm_cmds.c:3511
void VM_traceoff(prvm_prog_t *prog)
Definition prvm_cmds.c:1480
void VM_callfunction(prvm_prog_t *prog)
Definition prvm_cmds.c:5705
void VM_infoadd(prvm_prog_t *prog)
Definition prvm_cmds.c:5090
void VM_wasfreed(prvm_prog_t *prog)
Definition prvm_cmds.c:5222
void VM_buf_loadfile(prvm_prog_t *prog)
Definition prvm_cmds.c:4318
void VM_localcmd(prvm_prog_t *prog)
Definition prvm_cmds.c:678
void VM_sin(prvm_prog_t *prog)
Definition prvm_cmds.c:1618
void VM_getsurfacenormal(prvm_prog_t *prog)
Definition prvm_cmds.c:6397
void VM_pow(prvm_prog_t *prog)
Definition prvm_cmds.c:1844
void VM_log(prvm_prog_t *prog)
Definition prvm_cmds.c:1850
void VM_coredump(prvm_prog_t *prog)
Definition prvm_cmds.c:1421
void VM_strireplace(prvm_prog_t *prog)
Definition prvm_cmds.c:2536
void VM_keynumtostring(prvm_prog_t *prog)
Definition prvm_cmds.c:3331
void VM_strncasecmp(prvm_prog_t *prog)
Definition prvm_cmds.c:5145
void VM_loadfromdata(prvm_prog_t *prog)
Definition prvm_cmds.c:3040
void VM_vectoangles(prvm_prog_t *prog)
Definition prvm_cmds.c:586
void VM_entityfieldtype(prvm_prog_t *prog)
Definition prvm_cmds.c:2153

Referenced by CL_VM_Init().

◆ vm_cl_numbuiltins

const int vm_cl_numbuiltins
extern

Definition at line 5654 of file clvm_cmds.c.

Referenced by CL_VM_Init().

◆ vm_m_builtins

prvm_builtin_t vm_m_builtins[]
extern

Definition at line 1070 of file mvm_cmds.c.

1070 {
1071NULL, // #0 NULL function (not callable)
1072VM_checkextension, // #1
1073VM_error, // #2
1074VM_objerror, // #3
1075VM_print, // #4
1076VM_bprint, // #5
1077VM_sprint, // #6
1078VM_centerprint, // #7
1079VM_normalize, // #8
1080VM_vlen, // #9
1081VM_vectoyaw, // #10
1082VM_vectoangles, // #11
1083VM_random, // #12
1084VM_localcmd, // #13
1085VM_cvar, // #14
1086VM_cvar_set, // #15
1087VM_dprint, // #16
1088VM_ftos, // #17
1089VM_fabs, // #18
1090VM_vtos, // #19
1091VM_etos, // #20
1092VM_stof, // #21
1093VM_spawn, // #22
1094VM_remove, // #23
1095VM_find, // #24
1096VM_findfloat, // #25
1097VM_findchain, // #26
1098VM_findchainfloat, // #27
1099VM_precache_file, // #28
1100VM_precache_sound, // #29
1101VM_coredump, // #30
1102VM_traceon, // #31
1103VM_traceoff, // #32
1104VM_eprint, // #33
1105VM_rint, // #34
1106VM_floor, // #35
1107VM_ceil, // #36
1108VM_nextent, // #37
1109VM_sin, // #38
1110VM_cos, // #39
1111VM_sqrt, // #40
1112VM_randomvec, // #41
1113VM_registercvar, // #42
1114VM_min, // #43
1115VM_max, // #44
1116VM_bound, // #45
1117VM_pow, // #46
1118VM_M_copyentity, // #47
1119VM_fopen, // #48
1120VM_fclose, // #49
1121VM_fgets, // #50
1122VM_fputs, // #51
1123VM_strlen, // #52
1124VM_strcat, // #53
1125VM_substring, // #54
1126VM_stov, // #55
1127VM_strzone, // #56
1128VM_strunzone, // #57
1129VM_tokenize, // #58
1130VM_argv, // #59
1131VM_isserver, // #60
1132VM_clientcount, // #61
1133VM_clientstate, // #62
1134NULL, // #63 FIXME
1135VM_changelevel, // #64
1136VM_localsound, // #65
1137VM_M_getmousepos, // #66
1138VM_gettime, // #67
1139VM_loadfromdata, // #68
1140VM_loadfromfile, // #69
1141VM_modulo, // #70
1142VM_cvar_string, // #71
1143VM_crash, // #72
1144VM_stackdump, // #73
1145VM_search_begin, // #74
1146VM_search_end, // #75
1147VM_search_getsize, // #76
1149VM_chr, // #78
1150VM_itof, // #79
1151VM_ftoe, // #80
1152VM_itof, // #81 isString
1153VM_altstr_count, // #82
1154VM_altstr_prepare, // #83
1155VM_altstr_get, // #84
1156VM_altstr_set, // #85
1157VM_altstr_ins, // #86
1158VM_findflags, // #87
1159VM_findchainflags, // #88
1160VM_cvar_defstring, // #89
1161// deactivate support for model rendering in the menu until someone has time to do it right [3/2/2008 Andreas]
1162#if 0
1163VM_CL_setmodel, // #90 void(entity e, string m) setmodel (QUAKE)
1164VM_CL_precache_model, // #91 void(string s) precache_model (QUAKE)
1165VM_CL_setorigin, // #92 void(entity e, vector o) setorigin (QUAKE)
1166#else
1167NULL,
1168NULL,
1169NULL,
1170#endif
1171NULL, // #93
1172NULL, // #94
1173NULL, // #95
1174NULL, // #96
1175NULL, // #97
1176NULL, // #98
1177NULL, // #99
1178NULL, // #100
1179NULL, // #101
1180NULL, // #102
1181NULL, // #103
1182NULL, // #104
1183NULL, // #105
1184NULL, // #106
1185NULL, // #107
1186NULL, // #108
1187NULL, // #109
1188NULL, // #110
1189NULL, // #111
1190NULL, // #112
1191NULL, // #113
1192NULL, // #114
1193NULL, // #115
1194NULL, // #116
1195NULL, // #117
1196NULL, // #118
1197NULL, // #119
1198NULL, // #120
1199NULL, // #121
1200NULL, // #122
1201NULL, // #123
1202NULL, // #124
1203NULL, // #125
1204NULL, // #126
1205NULL, // #127
1206NULL, // #128
1207NULL, // #129
1208NULL, // #130
1209NULL, // #131
1210NULL, // #132
1211NULL, // #133
1212NULL, // #134
1213NULL, // #135
1214NULL, // #136
1215NULL, // #137
1216NULL, // #138
1217NULL, // #139
1218NULL, // #140
1219NULL, // #141
1220NULL, // #142
1221NULL, // #143
1222NULL, // #144
1223NULL, // #145
1224NULL, // #146
1225NULL, // #147
1226NULL, // #148
1227NULL, // #149
1228NULL, // #150
1229NULL, // #151
1230NULL, // #152
1231NULL, // #153
1232NULL, // #154
1233NULL, // #155
1234NULL, // #156
1235NULL, // #157
1236NULL, // #158
1237NULL, // #159
1238NULL, // #160
1239NULL, // #161
1240NULL, // #162
1241NULL, // #163
1242NULL, // #164
1243NULL, // #165
1244NULL, // #166
1245NULL, // #167
1246NULL, // #168
1247NULL, // #169
1248NULL, // #170
1249NULL, // #171
1250NULL, // #172
1251NULL, // #173
1252NULL, // #174
1253NULL, // #175
1254NULL, // #176
1255NULL, // #177
1256NULL, // #178
1257NULL, // #179
1258NULL, // #180
1259NULL, // #181
1260NULL, // #182
1261NULL, // #183
1262NULL, // #184
1263NULL, // #185
1264NULL, // #186
1265NULL, // #187
1266NULL, // #188
1267NULL, // #189
1268NULL, // #190
1269NULL, // #191
1270NULL, // #192
1271NULL, // #193
1272NULL, // #194
1273NULL, // #195
1274NULL, // #196
1275NULL, // #197
1276NULL, // #198
1277NULL, // #199
1278NULL, // #200
1279NULL, // #201
1280NULL, // #202
1281NULL, // #203
1282NULL, // #204
1283NULL, // #205
1284NULL, // #206
1285NULL, // #207
1286NULL, // #208
1287NULL, // #209
1288NULL, // #210
1289NULL, // #211
1290NULL, // #212
1291NULL, // #213
1292NULL, // #214
1293NULL, // #215
1294NULL, // #216
1295NULL, // #217
1296NULL, // #218
1297NULL, // #219
1298NULL, // #220
1299VM_strstrofs, // #221 float(string str, string sub[, float startpos]) strstrofs (FTE_STRINGS)
1300VM_str2chr, // #222 float(string str, float ofs) str2chr (FTE_STRINGS)
1301VM_chr2str, // #223 string(float c, ...) chr2str (FTE_STRINGS)
1302VM_strconv, // #224 string(float ccase, float calpha, float cnum, string s, ...) strconv (FTE_STRINGS)
1303VM_strpad, // #225 string(float chars, string s, ...) strpad (FTE_STRINGS)
1304VM_infoadd, // #226 string(string info, string key, string value, ...) infoadd (FTE_STRINGS)
1305VM_infoget, // #227 string(string info, string key) infoget (FTE_STRINGS)
1306VM_strncmp, // #228 float(string s1, string s2, float len) strncmp (FTE_STRINGS)
1307VM_strncasecmp, // #229 float(string s1, string s2) strcasecmp (FTE_STRINGS)
1308VM_strncasecmp, // #230 float(string s1, string s2, float len) strncasecmp (FTE_STRINGS)
1309NULL, // #231
1310NULL, // #232
1311NULL, // #233
1312NULL, // #234
1313NULL, // #235
1314NULL, // #236
1315NULL, // #237
1316NULL, // #238
1317NULL, // #239
1318NULL, // #240
1319NULL, // #241
1320NULL, // #242
1321NULL, // #243
1322NULL, // #244
1323NULL, // #245
1324NULL, // #246
1325NULL, // #247
1326NULL, // #248
1327NULL, // #249
1328NULL, // #250
1329NULL, // #251
1330NULL, // #252
1331NULL, // #253
1332NULL, // #254
1333NULL, // #255
1334NULL, // #256
1335NULL, // #257
1336NULL, // #258
1337NULL, // #259
1338NULL, // #260
1339NULL, // #261
1340NULL, // #262
1341NULL, // #263
1342NULL, // #264
1343NULL, // #265
1344NULL, // #266
1345NULL, // #267
1346NULL, // #268
1347NULL, // #269
1348NULL, // #270
1349NULL, // #271
1350NULL, // #272
1351NULL, // #273
1352NULL, // #274
1353NULL, // #275
1354NULL, // #276
1355NULL, // #277
1356NULL, // #278
1357NULL, // #279
1358NULL, // #280
1359NULL, // #281
1360NULL, // #282
1361NULL, // #283
1362NULL, // #284
1363NULL, // #285
1364NULL, // #286
1365NULL, // #287
1366NULL, // #288
1367NULL, // #289
1368NULL, // #290
1369NULL, // #291
1370NULL, // #292
1371NULL, // #293
1372NULL, // #294
1373NULL, // #295
1374NULL, // #296
1375NULL, // #297
1376NULL, // #298
1377NULL, // #299
1378// deactivate support for model rendering in the menu until someone has time to do it right [3/2/2008 Andreas]
1379#if 0
1380// CSQC range #300-#399
1381VM_CL_R_ClearScene, // #300 void() clearscene (DP_QC_RENDER_SCENE)
1382VM_CL_R_AddEntities, // #301 void(float mask) addentities (DP_QC_RENDER_SCENE)
1383VM_CL_R_AddEntity, // #302 void(entity ent) addentity (DP_QC_RENDER_SCENE)
1384VM_CL_R_SetView, // #303 float(float property, ...) setproperty (DP_QC_RENDER_SCENE)
1385VM_CL_R_RenderScene, // #304 void() renderscene (DP_QC_RENDER_SCENE)
1386VM_CL_R_AddDynamicLight, // #305 void(vector org, float radius, vector lightcolours) adddynamiclight (DP_QC_RENDER_SCENE)
1387VM_CL_R_PolygonBegin, // #306 void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon (DP_QC_RENDER_SCENE)
1388VM_CL_R_PolygonVertex, // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex (DP_QC_RENDER_SCENE)
1389VM_CL_R_PolygonEnd, // #308 void() R_EndPolygon
1390NULL/*VM_CL_R_LoadWorldModel*/, // #309 void(string modelname) R_LoadWorldModel
1391// TODO: rearrange and merge all builtin lists and share as many extensions as possible between all VM instances [1/27/2008 Andreas]
1392VM_CL_setattachment, // #310 void(entity e, entity tagentity, string tagname) setattachment (DP_GFX_QUAKE3MODELTAGS) (DP_QC_RENDER_SCENE)
1393VM_CL_gettagindex, // #311 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
1394VM_CL_gettaginfo, // #312 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
1395#else
1396// CSQC range #300-#399
1397NULL,
1398NULL,
1399NULL,
1400NULL,
1401NULL,
1402NULL,
1403NULL,
1404NULL,
1405NULL,
1406NULL,
1407NULL,
1408NULL,
1409NULL,
1410#endif
1411NULL, // #313
1412NULL, // #314
1413NULL, // #315
1414NULL, // #316
1415NULL, // #317
1416NULL, // #318
1417NULL, // #319
1418NULL, // #320
1419NULL, // #321
1420NULL, // #322
1421NULL, // #323
1422NULL, // #324
1423NULL, // #325
1424NULL, // #326
1425NULL, // #327
1426NULL, // #328
1427NULL, // #329
1428NULL, // #330
1429NULL, // #331
1430NULL, // #332
1431NULL, // #333
1432NULL, // #334
1433NULL, // #335
1434NULL, // #336
1435NULL, // #337
1436NULL, // #338
1437NULL, // #339
1438VM_keynumtostring, // #340 string keynumtostring(float keynum)
1439VM_stringtokeynum, // #341 float stringtokeynum(string key)
1440VM_getkeybind, // #342 string(float keynum[, float bindmap]) getkeybind (EXT_CSQC)
1441NULL, // #343
1442NULL, // #344
1443NULL, // #345
1444NULL, // #346
1445NULL, // #347
1446NULL, // #348
1447VM_CL_isdemo, // #349
1448NULL, // #350
1449NULL, // #351
1450VM_M_registercommand, // #352 void(string cmdname)
1451VM_wasfreed, // #353 float(entity ent) wasfreed
1452NULL, // #354
1453VM_CL_videoplaying, // #355
1454VM_findfont, // #356 float(string fontname) loadfont (DP_GFX_FONTS)
1455VM_loadfont, // #357 float(string fontname, string fontmaps, string sizes, float slot) loadfont (DP_GFX_FONTS)
1456NULL, // #358
1457NULL, // #359
1458NULL, // #360
1459NULL, // #361
1460NULL, // #362
1461NULL, // #363
1462NULL, // #364
1463NULL, // #365
1464NULL, // #366
1465NULL, // #367
1466NULL, // #368
1467NULL, // #369
1468NULL, // #370
1469NULL, // #371
1470NULL, // #372
1471NULL, // #373
1472NULL, // #374
1473NULL, // #375
1474NULL, // #376
1475NULL, // #377
1476NULL, // #378
1477NULL, // #379
1478NULL, // #380
1479NULL, // #381
1480NULL, // #382
1481NULL, // #383
1482NULL, // #384
1483NULL, // #385
1484NULL, // #386
1485NULL, // #387
1486NULL, // #388
1487NULL, // #389
1488NULL, // #390
1489NULL, // #391
1490NULL, // #392
1491NULL, // #393
1492NULL, // #394
1493NULL, // #395
1494NULL, // #396
1495NULL, // #397
1496NULL, // #398
1497NULL, // #399
1498NULL, // #400
1499VM_M_WriteByte, // #401
1500VM_M_WriteChar, // #402
1501VM_M_WriteShort, // #403
1502VM_M_WriteLong, // #404
1503VM_M_WriteAngle, // #405
1504VM_M_WriteCoord, // #406
1505VM_M_WriteString, // #407
1506VM_M_WriteEntity, // #408
1507NULL, // #409
1508NULL, // #410
1509NULL, // #411
1510NULL, // #412
1511NULL, // #413
1512NULL, // #414
1513NULL, // #415
1514NULL, // #416
1515NULL, // #417
1516NULL, // #418
1517NULL, // #419
1518NULL, // #420
1519NULL, // #421
1520NULL, // #422
1521NULL, // #423
1522NULL, // #424
1523NULL, // #425
1524NULL, // #426
1525NULL, // #427
1526NULL, // #428
1527NULL, // #429
1528NULL, // #430
1529NULL, // #431
1530NULL, // #432
1531NULL, // #433
1532NULL, // #434
1533NULL, // #435
1534NULL, // #436
1535NULL, // #437
1536NULL, // #438
1537NULL, // #439
1538VM_buf_create, // #440 float() buf_create (DP_QC_STRINGBUFFERS)
1539VM_buf_del, // #441 void(float bufhandle) buf_del (DP_QC_STRINGBUFFERS)
1540VM_buf_getsize, // #442 float(float bufhandle) buf_getsize (DP_QC_STRINGBUFFERS)
1541VM_buf_copy, // #443 void(float bufhandle_from, float bufhandle_to) buf_copy (DP_QC_STRINGBUFFERS)
1542VM_buf_sort, // #444 void(float bufhandle, float sortpower, float backward) buf_sort (DP_QC_STRINGBUFFERS)
1543VM_buf_implode, // #445 string(float bufhandle, string glue) buf_implode (DP_QC_STRINGBUFFERS)
1544VM_bufstr_get, // #446 string(float bufhandle, float string_index) bufstr_get (DP_QC_STRINGBUFFERS)
1545VM_bufstr_set, // #447 void(float bufhandle, float string_index, string str) bufstr_set (DP_QC_STRINGBUFFERS)
1546VM_bufstr_add, // #448 float(float bufhandle, string str, float order) bufstr_add (DP_QC_STRINGBUFFERS)
1547VM_bufstr_free, // #449 void(float bufhandle, float string_index) bufstr_free (DP_QC_STRINGBUFFERS)
1548NULL, // #450
1549VM_iscachedpic, // #451 draw functions...
1550VM_precache_pic, // #452
1551VM_freepic, // #453
1552VM_drawcharacter, // #454
1553VM_drawstring, // #455
1554VM_drawpic, // #456
1555VM_drawfill, // #457
1556VM_drawsetcliparea, // #458
1557VM_drawresetcliparea, // #459
1558VM_getimagesize, // #460
1559VM_cin_open, // #461
1560VM_cin_close, // #462
1561VM_cin_setstate, // #463
1562VM_cin_getstate, // #464
1563VM_cin_restart, // #465
1564VM_drawline, // #466
1566VM_stringwidth, // #468
1567VM_drawsubpic, // #469
1568VM_drawrotpic, // #470
1569VM_asin, // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
1570VM_acos, // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
1571VM_atan, // #473 float(float t) VM_atan (DP_QC_ASINACOSATANATAN2TAN)
1572VM_atan2, // #474 float(float c, float s) VM_atan2 (DP_QC_ASINACOSATANATAN2TAN)
1573VM_tan, // #475 float(float a) VM_tan (DP_QC_ASINACOSATANATAN2TAN)
1574VM_strlennocol, // #476 float(string s) : DRESK - String Length (not counting color codes) (DP_QC_STRINGCOLORFUNCTIONS)
1575VM_strdecolorize, // #477 string(string s) : DRESK - Decolorized String (DP_QC_STRINGCOLORFUNCTIONS)
1576VM_strftime, // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME)
1577VM_tokenizebyseparator, // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR)
1578VM_strtolower, // #480 string(string s) VM_strtolower : DRESK - Return string as lowercase
1579VM_strtoupper, // #481 string(string s) VM_strtoupper : DRESK - Return string as uppercase
1580NULL, // #482
1581NULL, // #483
1582VM_strreplace, // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
1583VM_strireplace, // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
1584NULL, // #486
1585VM_gecko_create, // #487 float gecko_create( string name )
1586VM_gecko_destroy, // #488 void gecko_destroy( string name )
1587VM_gecko_navigate, // #489 void gecko_navigate( string name, string URI )
1588VM_gecko_keyevent, // #490 float gecko_keyevent( string name, float key, float eventtype )
1589VM_gecko_movemouse, // #491 void gecko_mousemove( string name, float x, float y )
1590VM_gecko_resize, // #492 void gecko_resize( string name, float w, float h )
1591VM_gecko_get_texture_extent, // #493 vector gecko_get_texture_extent( string name )
1592VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
1593VM_cvar_type, // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
1594VM_numentityfields, // #496 float() numentityfields = #496; (QP_QC_ENTITYDATA)
1595VM_entityfieldname, // #497 string(float fieldnum) entityfieldname = #497; (DP_QC_ENTITYDATA)
1596VM_entityfieldtype, // #498 float(float fieldnum) entityfieldtype = #498; (DP_QC_ENTITYDATA)
1597VM_getentityfieldstring, // #499 string(float fieldnum, entity ent) getentityfieldstring = #499; (DP_QC_ENTITYDATA)
1598VM_putentityfieldstring, // #500 float(float fieldnum, entity ent, string s) putentityfieldstring = #500; (DP_QC_ENTITYDATA)
1599NULL, // #501
1600NULL, // #502
1601VM_whichpack, // #503 string(string) whichpack = #503;
1602NULL, // #504
1603NULL, // #505
1604NULL, // #506
1605NULL, // #507
1606NULL, // #508
1607NULL, // #509
1608VM_uri_escape, // #510 string(string in) uri_escape = #510;
1609VM_uri_unescape, // #511 string(string in) uri_unescape = #511;
1610VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT)
1611VM_uri_get, // #513 float(string uri, float id, [string post_contenttype, string post_delim, [float buf]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
1612VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
1613VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
1614VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
1615VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
1616VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
1617NULL, // #519
1618NULL, // #520
1619NULL, // #521
1620NULL, // #522
1621NULL, // #523
1622NULL, // #524
1623NULL, // #525
1624NULL, // #526
1625NULL, // #527
1626NULL, // #528
1627NULL, // #529
1628NULL, // #530
1629NULL, // #531
1630VM_log, // #532
1631VM_getsoundtime, // #533 float(entity e, float channel) getsoundtime = #533; (DP_SND_GETSOUNDTIME)
1632VM_soundlength, // #534 float(string sample) soundlength = #534; (DP_SND_GETSOUNDTIME)
1633VM_buf_loadfile, // #535 float(string filename, float bufhandle) buf_loadfile (DP_QC_STRINGBUFFERS_EXT_WIP)
1634VM_buf_writefile, // #536 float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
1635VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule, float startpos) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
1636VM_matchpattern, // #538 float(string s, string pattern, float matchrule) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
1637NULL, // #539
1638NULL, // #540
1639NULL, // #541
1640NULL, // #542
1641NULL, // #543
1642NULL, // #544
1643NULL, // #545
1644NULL, // #546
1645NULL, // #547
1646NULL, // #548
1647NULL, // #549
1648NULL, // #550
1649NULL, // #551
1650NULL, // #552
1651NULL, // #553
1652NULL, // #554
1653NULL, // #555
1654NULL, // #556
1655NULL, // #557
1656NULL, // #558
1657NULL, // #559
1658NULL, // #560
1659NULL, // #561
1660NULL, // #562
1661NULL, // #563
1662NULL, // #564
1663NULL, // #565
1664NULL, // #566
1665NULL, // #567
1666NULL, // #568
1667NULL, // #569
1668NULL, // #570
1669NULL, // #571
1670NULL, // #572
1671NULL, // #573
1672NULL, // #574
1673NULL, // #575
1674NULL, // #576
1675NULL, // #577
1676NULL, // #578
1677NULL, // #579
1678NULL, // #580
1679NULL, // #581
1680NULL, // #582
1681NULL, // #583
1682NULL, // #584
1683NULL, // #585
1684NULL, // #586
1685NULL, // #587
1686NULL, // #588
1687NULL, // #589
1688NULL, // #590
1689NULL, // #591
1690NULL, // #592
1691NULL, // #593
1692NULL, // #594
1693NULL, // #595
1694NULL, // #596
1695NULL, // #597
1696NULL, // #598
1697NULL, // #599
1698NULL, // #600
1699VM_M_setkeydest, // #601 void setkeydest(float dest)
1700VM_M_getkeydest, // #602 float getkeydest(void)
1701VM_M_setmousetarget, // #603 void setmousetarget(float trg)
1702VM_M_getmousetarget, // #604 float getmousetarget(void)
1703VM_callfunction, // #605 void callfunction(...)
1704VM_writetofile, // #606 void writetofile(float fhandle, entity ent)
1705VM_isfunction, // #607 float isfunction(string function_name)
1706VM_M_getresolution, // #608 vector getresolution(float number, [float forfullscreen])
1707VM_keynumtostring, // #609 string keynumtostring(float keynum)
1708VM_findkeysforcommand, // #610 string findkeysforcommand(string command[, float bindmap])
1709VM_M_getserverliststat, // #611 float gethostcachevalue(float type)
1710VM_M_getserverliststring, // #612 string gethostcachestring(float type, float hostnr)
1711VM_parseentitydata, // #613 void parseentitydata(entity ent, string data)
1712VM_stringtokeynum, // #614 float stringtokeynum(string key)
1713VM_M_resetserverlistmasks, // #615 void resethostcachemasks(void)
1714VM_M_setserverlistmaskstring, // #616 void sethostcachemaskstring(float mask, float fld, string str, float op)
1715VM_M_setserverlistmasknumber, // #617 void sethostcachemasknumber(float mask, float fld, float num, float op)
1716VM_M_resortserverlist, // #618 void resorthostcache(void)
1717VM_M_setserverlistsort, // #619 void sethostcachesort(float fld, float descending)
1718VM_M_refreshserverlist, // #620 void refreshhostcache(void)
1719VM_M_getserverlistnumber, // #621 float gethostcachenumber(float fld, float hostnr)
1720VM_M_getserverlistindexforkey,// #622 float gethostcacheindexforkey(string key)
1721VM_M_addwantedserverlistkey, // #623 void addwantedhostcachekey(string key)
1722VM_CL_getextresponse, // #624 string getextresponse(void)
1723VM_netaddress_resolve, // #625 string netaddress_resolve(string, float)
1724VM_M_getgamedirinfo, // #626 string getgamedirinfo(float n, float prop)
1725VM_sprintf, // #627 string sprintf(string format, ...)
1726NULL, // #628
1727NULL, // #629
1728VM_setkeybind, // #630 float(float key, string bind[, float bindmap]) setkeybind
1729VM_getbindmaps, // #631 vector(void) getbindmap
1730VM_setbindmaps, // #632 float(vector bm) setbindmap
1731VM_M_crypto_getkeyfp, // #633 string(string addr) crypto_getkeyfp
1732VM_M_crypto_getidfp, // #634 string(string addr) crypto_getidfp
1733VM_M_crypto_getencryptlevel, // #635 string(string addr) crypto_getencryptlevel
1734VM_M_crypto_getmykeyfp, // #636 string(float addr) crypto_getmykeyfp
1735VM_M_crypto_getmyidfp, // #637 string(float addr) crypto_getmyidfp
1736NULL, // #638
1737VM_digest_hex, // #639
1738NULL, // #640
1739VM_M_crypto_getmyidstatus, // #641 float(float i) crypto_getmyidstatus
1740VM_coverage, // #642
1741VM_M_crypto_getidstatus, // #643 float(string addr) crypto_getidstatus
1742NULL
1743};
static void VM_M_addwantedserverlistkey(prvm_prog_t *prog)
Definition mvm_cmds.c:671
static void VM_M_WriteCoord(prvm_prog_t *prog)
Definition mvm_cmds.c:758
static void VM_M_crypto_getidfp(prvm_prog_t *prog)
Definition mvm_cmds.c:823
static void VM_M_getserverliststring(prvm_prog_t *prog)
Definition mvm_cmds.c:457
static void VM_M_WriteEntity(prvm_prog_t *prog)
Definition mvm_cmds.c:770
static void VM_M_getgamedirinfo(prvm_prog_t *prog)
Definition mvm_cmds.c:212
static void VM_M_crypto_getencryptlevel(prvm_prog_t *prog)
Definition mvm_cmds.c:855
static void VM_M_WriteByte(prvm_prog_t *prog)
Definition mvm_cmds.c:728
static void VM_M_WriteChar(prvm_prog_t *prog)
Definition mvm_cmds.c:734
static void VM_M_getmousetarget(prvm_prog_t *prog)
Definition mvm_cmds.c:95
static void VM_M_setmousetarget(prvm_prog_t *prog)
Definition mvm_cmds.c:71
static void VM_M_getserverlistindexforkey(prvm_prog_t *prog)
Definition mvm_cmds.c:620
void VM_cin_getstate(prvm_prog_t *prog)
Definition mvm_cmds.c:1025
static void VM_M_WriteString(prvm_prog_t *prog)
Definition mvm_cmds.c:764
static void VM_M_WriteAngle(prvm_prog_t *prog)
Definition mvm_cmds.c:752
static void VM_M_crypto_getmyidfp(prvm_prog_t *prog)
Definition mvm_cmds.c:902
static void VM_M_getmousepos(prvm_prog_t *prog)
Definition mvm_cmds.c:795
static void VM_M_refreshserverlist(prvm_prog_t *prog)
Definition mvm_cmds.c:604
static void VM_M_resetserverlistmasks(prvm_prog_t *prog)
Definition mvm_cmds.c:295
static void VM_M_getresolution(prvm_prog_t *prog)
Definition mvm_cmds.c:181
static void VM_M_setserverlistmasknumber(prvm_prog_t *prog)
Definition mvm_cmds.c:376
static void VM_M_setkeydest(prvm_prog_t *prog)
Definition mvm_cmds.c:114
void VM_cin_open(prvm_prog_t *prog)
Definition mvm_cmds.c:956
static void VM_M_resortserverlist(prvm_prog_t *prog)
Definition mvm_cmds.c:444
static void VM_M_crypto_getkeyfp(prvm_prog_t *prog)
Definition mvm_cmds.c:807
static void VM_M_setserverlistmaskstring(prvm_prog_t *prog)
Definition mvm_cmds.c:311
static void VM_M_getserverlistnumber(prvm_prog_t *prog)
Definition mvm_cmds.c:523
static void VM_M_WriteShort(prvm_prog_t *prog)
Definition mvm_cmds.c:740
static void VM_M_WriteLong(prvm_prog_t *prog)
Definition mvm_cmds.c:746
void VM_cin_restart(prvm_prog_t *prog)
Definition mvm_cmds.c:1049
static void VM_M_getkeydest(prvm_prog_t *prog)
Definition mvm_cmds.c:148
static void VM_M_crypto_getmykeyfp(prvm_prog_t *prog)
Definition mvm_cmds.c:880
void VM_cin_close(prvm_prog_t *prog)
Definition mvm_cmds.c:982
static void VM_M_crypto_getidstatus(prvm_prog_t *prog)
Definition mvm_cmds.c:839
static void VM_M_crypto_getmyidstatus(prvm_prog_t *prog)
Definition mvm_cmds.c:924
static void VM_M_getserverliststat(prvm_prog_t *prog)
Definition mvm_cmds.c:249
static void VM_M_copyentity(prvm_prog_t *prog)
Definition mvm_cmds.c:785
static void VM_M_registercommand(prvm_prog_t *prog)
Definition mvm_cmds.c:1064
static void VM_M_setserverlistsort(prvm_prog_t *prog)
Definition mvm_cmds.c:589
void VM_cin_setstate(prvm_prog_t *prog)
Definition mvm_cmds.c:1000
void VM_altstr_prepare(prvm_prog_t *prog)
Definition prvm_cmds.c:3651
void VM_clientcount(prvm_prog_t *prog)
Definition prvm_cmds.c:2878
void VM_altstr_get(prvm_prog_t *prog)
Definition prvm_cmds.c:3683
void VM_itof(prvm_prog_t *prog)
Definition prvm_cmds.c:969
void VM_stackdump(prvm_prog_t *prog)
Definition prvm_cmds.c:1437
void VM_altstr_count(prvm_prog_t *prog)
Definition prvm_cmds.c:3621
void VM_spawn(prvm_prog_t *prog)
Definition prvm_cmds.c:1063
void VM_netaddress_resolve(prvm_prog_t *prog)
Definition prvm_cmds.c:5590
void VM_altstr_ins(prvm_prog_t *prog)
Definition prvm_cmds.c:3775
void VM_bprint(prvm_prog_t *prog)
Definition prvm_cmds.c:442
void VM_clientstate(prvm_prog_t *prog)
Definition prvm_cmds.c:2892
void VM_altstr_set(prvm_prog_t *prog)
Definition prvm_cmds.c:3731
void VM_changelevel(prvm_prog_t *prog)
Definition prvm_cmds.c:1592
void VM_crash(prvm_prog_t *prog)
Definition prvm_cmds.c:1452
void VM_chr(prvm_prog_t *prog)
Definition prvm_cmds.c:3303
void VM_sprint(prvm_prog_t *prog)
Definition prvm_cmds.c:465

Referenced by MP_Init().

◆ vm_m_extensions

const char* vm_m_extensions[]
extern

Definition at line 13 of file mvm_cmds.c.

13 {
14"BX_WAL_SUPPORT",
15"DP_CINEMATIC_DPV",
16"DP_COVERAGE",
17"DP_CRYPTO",
18"DP_CSQC_BINDMAPS",
19"DP_GFX_FONTS",
20"DP_GFX_FONTS_FREETYPE",
21"DP_UTF8",
22"DP_FONT_VARIABLEWIDTH",
23"DP_MENU_EXTRESPONSEPACKET",
24"DP_QC_ASINACOSATANATAN2TAN",
25"DP_QC_AUTOCVARS",
26"DP_QC_CMD",
27"DP_QC_CRC16",
28"DP_QC_CVAR_TYPE",
29"DP_QC_CVAR_DESCRIPTION",
30"DP_QC_DIGEST",
31"DP_QC_DIGEST_SHA256",
32"DP_QC_FINDCHAIN_TOFIELD",
33"DP_QC_I18N",
34"DP_QC_LOG",
35"DP_QC_RENDER_SCENE",
36"DP_QC_SPRINTF",
37"DP_QC_STRFTIME",
38"DP_QC_STRINGBUFFERS",
39"DP_QC_STRINGBUFFERS_CVARLIST",
40"DP_QC_STRINGBUFFERS_EXT_WIP",
41"DP_QC_STRINGCOLORFUNCTIONS",
42"DP_QC_STRING_CASE_FUNCTIONS",
43"DP_QC_STRREPLACE",
44"DP_QC_TOKENIZEBYSEPARATOR",
45"DP_QC_TOKENIZE_CONSOLE",
46"DP_QC_UNLIMITEDTEMPSTRINGS",
47"DP_QC_URI_ESCAPE",
48"DP_QC_URI_GET",
49"DP_QC_URI_POST",
50"DP_QC_WHICHPACK",
51"FTE_STRINGS",
52"DP_QC_FS_SEARCH_PACKFILE",
53NULL
54};

Referenced by MP_Init(), and PRVM_Init().

◆ vm_m_numbuiltins

const int vm_m_numbuiltins
extern

Definition at line 1745 of file mvm_cmds.c.

Referenced by MP_Init().

◆ vm_sv_builtins

prvm_builtin_t vm_sv_builtins[]
extern

Definition at line 3265 of file svvm_cmds.c.

3265 {
3266NULL, // #0 NULL function (not callable) (QUAKE)
3267VM_makevectors, // #1 void(vector ang) makevectors (QUAKE)
3268VM_SV_setorigin, // #2 void(entity e, vector o) setorigin (QUAKE)
3269VM_SV_setmodel, // #3 void(entity e, string m) setmodel (QUAKE)
3270VM_SV_setsize, // #4 void(entity e, vector min, vector max) setsize (QUAKE)
3271NULL, // #5 void(entity e, vector min, vector max) setabssize (QUAKE)
3272VM_break, // #6 void() break (QUAKE)
3273VM_random, // #7 float() random (QUAKE)
3274VM_SV_sound, // #8 void(entity e, float chan, string samp, float volume[, float atten[, float pitchchange[, float flags]]]) sound (QUAKE)
3275VM_normalize, // #9 vector(vector v) normalize (QUAKE)
3276VM_error, // #10 void(string e) error (QUAKE)
3277VM_objerror, // #11 void(string e) objerror (QUAKE)
3278VM_vlen, // #12 float(vector v) vlen (QUAKE)
3279VM_vectoyaw, // #13 float(vector v) vectoyaw (QUAKE)
3280VM_spawn, // #14 entity() spawn (QUAKE)
3281VM_remove, // #15 void(entity e) remove (QUAKE)
3282VM_SV_traceline, // #16 void(vector v1, vector v2, float tryents) traceline (QUAKE)
3283VM_SV_checkclient, // #17 entity() checkclient (QUAKE)
3284VM_find, // #18 entity(entity start, .string fld, string match) find (QUAKE)
3285VM_SV_precache_sound, // #19 void(string s) precache_sound (QUAKE)
3286VM_SV_precache_model, // #20 void(string s) precache_model (QUAKE)
3287VM_SV_stuffcmd, // #21 void(entity client, string s, ...) stuffcmd (QUAKE)
3288VM_SV_findradius, // #22 entity(vector org, float rad) findradius (QUAKE)
3289VM_bprint, // #23 void(string s, ...) bprint (QUAKE)
3290VM_SV_sprint, // #24 void(entity client, string s, ...) sprint (QUAKE)
3291VM_dprint, // #25 void(string s, ...) dprint (QUAKE)
3292VM_ftos, // #26 string(float f) ftos (QUAKE)
3293VM_vtos, // #27 string(vector v) vtos (QUAKE)
3294VM_coredump, // #28 void() coredump (QUAKE)
3295VM_traceon, // #29 void() traceon (QUAKE)
3296VM_traceoff, // #30 void() traceoff (QUAKE)
3297VM_eprint, // #31 void(entity e) eprint (QUAKE)
3298VM_SV_walkmove, // #32 float(float yaw, float dist) walkmove (QUAKE)
3299NULL, // #33 (QUAKE)
3300VM_SV_droptofloor, // #34 float() droptofloor (QUAKE)
3301VM_SV_lightstyle, // #35 void(float style, string value) lightstyle (QUAKE)
3302VM_rint, // #36 float(float v) rint (QUAKE)
3303VM_floor, // #37 float(float v) floor (QUAKE)
3304VM_ceil, // #38 float(float v) ceil (QUAKE)
3305NULL, // #39 (QUAKE)
3306VM_SV_checkbottom, // #40 float(entity e) checkbottom (QUAKE)
3307VM_SV_pointcontents, // #41 float(vector v) pointcontents (QUAKE)
3308NULL, // #42 (QUAKE)
3309VM_fabs, // #43 float(float f) fabs (QUAKE)
3310VM_SV_aim, // #44 vector(entity e, float speed) aim (QUAKE)
3311VM_cvar, // #45 float(string s) cvar (QUAKE)
3312VM_localcmd, // #46 void(string s) localcmd (QUAKE)
3313VM_nextent, // #47 entity(entity e) nextent (QUAKE)
3314VM_SV_particle, // #48 void(vector o, vector d, float color, float count) particle (QUAKE)
3315VM_changeyaw, // #49 void() ChangeYaw (QUAKE)
3316NULL, // #50 (QUAKE)
3317VM_vectoangles, // #51 vector(vector v) vectoangles (QUAKE)
3318VM_SV_WriteByte, // #52 void(float to, float f) WriteByte (QUAKE)
3319VM_SV_WriteChar, // #53 void(float to, float f) WriteChar (QUAKE)
3320VM_SV_WriteShort, // #54 void(float to, float f) WriteShort (QUAKE)
3321VM_SV_WriteLong, // #55 void(float to, float f) WriteLong (QUAKE)
3322VM_SV_WriteCoord, // #56 void(float to, float f) WriteCoord (QUAKE)
3323VM_SV_WriteAngle, // #57 void(float to, float f) WriteAngle (QUAKE)
3324VM_SV_WriteString, // #58 void(float to, string s) WriteString (QUAKE)
3325VM_SV_WriteEntity, // #59 void(float to, entity e) WriteEntity (QUAKE)
3326VM_sin, // #60 float(float f) sin (DP_QC_SINCOSSQRTPOW) (QUAKE)
3327VM_cos, // #61 float(float f) cos (DP_QC_SINCOSSQRTPOW) (QUAKE)
3328VM_sqrt, // #62 float(float f) sqrt (DP_QC_SINCOSSQRTPOW) (QUAKE)
3329VM_changepitch, // #63 void(entity ent) changepitch (DP_QC_CHANGEPITCH) (QUAKE)
3330VM_SV_tracetoss, // #64 void(entity e, entity ignore) tracetoss (DP_QC_TRACETOSS) (QUAKE)
3331VM_etos, // #65 string(entity ent) etos (DP_QC_ETOS) (QUAKE)
3332NULL, // #66 (QUAKE)
3333VM_SV_MoveToGoal, // #67 void(float step) movetogoal (QUAKE)
3334VM_precache_file, // #68 string(string s) precache_file (QUAKE)
3335VM_SV_makestatic, // #69 void(entity e) makestatic (QUAKE)
3336VM_changelevel, // #70 void(string s) changelevel (QUAKE)
3337NULL, // #71 (QUAKE)
3338VM_cvar_set, // #72 void(string var, string val) cvar_set (QUAKE)
3339VM_SV_centerprint, // #73 void(entity client, strings) centerprint (QUAKE)
3340VM_SV_ambientsound, // #74 void(vector pos, string samp, float vol, float atten) ambientsound (QUAKE)
3341VM_SV_precache_model, // #75 string(string s) precache_model2 (QUAKE)
3342VM_SV_precache_sound, // #76 string(string s) precache_sound2 (QUAKE)
3343VM_precache_file, // #77 string(string s) precache_file2 (QUAKE)
3344VM_SV_setspawnparms, // #78 void(entity e) setspawnparms (QUAKE)
3345NULL, // #79 void(entity killer, entity killee) logfrag (QUAKEWORLD)
3346NULL, // #80 string(entity e, string keyname) infokey (QUAKEWORLD)
3347VM_stof, // #81 float(string s) stof (FRIK_FILE)
3348NULL, // #82 void(vector where, float set) multicast (QUAKEWORLD)
3349NULL, // #83 (QUAKE)
3350NULL, // #84 (QUAKE)
3351NULL, // #85 (QUAKE)
3352NULL, // #86 (QUAKE)
3353NULL, // #87 (QUAKE)
3354NULL, // #88 (QUAKE)
3355NULL, // #89 (QUAKE)
3356VM_SV_tracebox, // #90 void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox (DP_QC_TRACEBOX)
3357VM_randomvec, // #91 vector() randomvec (DP_QC_RANDOMVEC)
3358VM_SV_getlight, // #92 vector(vector org) getlight (DP_QC_GETLIGHT)
3359VM_registercvar, // #93 float(string name, string value) registercvar (DP_REGISTERCVAR)
3360VM_min, // #94 float(float a, floats) min (DP_QC_MINMAXBOUND)
3361VM_max, // #95 float(float a, floats) max (DP_QC_MINMAXBOUND)
3362VM_bound, // #96 float(float minimum, float val, float maximum) bound (DP_QC_MINMAXBOUND)
3363VM_pow, // #97 float(float f, float f) pow (DP_QC_SINCOSSQRTPOW)
3364VM_findfloat, // #98 entity(entity start, .float fld, float match) findfloat (DP_QC_FINDFLOAT)
3365VM_checkextension, // #99 float(string s) checkextension (the basis of the extension system)
3366// FrikaC and Telejano range #100-#199
3367NULL, // #100
3368NULL, // #101
3369NULL, // #102
3370NULL, // #103
3371NULL, // #104
3372NULL, // #105
3373NULL, // #106
3374NULL, // #107
3375NULL, // #108
3376NULL, // #109
3377VM_fopen, // #110 float(string filename, float mode) fopen (FRIK_FILE)
3378VM_fclose, // #111 void(float fhandle) fclose (FRIK_FILE)
3379VM_fgets, // #112 string(float fhandle) fgets (FRIK_FILE)
3380VM_fputs, // #113 void(float fhandle, string s) fputs (FRIK_FILE)
3381VM_strlen, // #114 float(string s) strlen (FRIK_FILE)
3382VM_strcat, // #115 string(string s, string...) strcat (FRIK_FILE)
3383VM_substring, // #116 string(string s, float start, float length) substring (FRIK_FILE)
3384VM_stov, // #117 vector(string) stov (FRIK_FILE)
3385VM_strzone, // #118 string(string s) strzone (FRIK_FILE)
3386VM_strunzone, // #119 void(string s) strunzone (FRIK_FILE)
3387NULL, // #120
3388NULL, // #121
3389NULL, // #122
3390NULL, // #123
3391NULL, // #124
3392NULL, // #125
3393NULL, // #126
3394NULL, // #127
3395NULL, // #128
3396NULL, // #129
3397NULL, // #130
3398NULL, // #131
3399NULL, // #132
3400NULL, // #133
3401NULL, // #134
3402NULL, // #135
3403NULL, // #136
3404NULL, // #137
3405NULL, // #138
3406NULL, // #139
3407NULL, // #140
3408NULL, // #141
3409NULL, // #142
3410NULL, // #143
3411NULL, // #144
3412NULL, // #145
3413NULL, // #146
3414NULL, // #147
3415NULL, // #148
3416NULL, // #149
3417NULL, // #150
3418NULL, // #151
3419NULL, // #152
3420NULL, // #153
3421NULL, // #154
3422NULL, // #155
3423NULL, // #156
3424NULL, // #157
3425NULL, // #158
3426NULL, // #159
3427NULL, // #160
3428NULL, // #161
3429NULL, // #162
3430NULL, // #163
3431NULL, // #164
3432NULL, // #165
3433NULL, // #166
3434NULL, // #167
3435NULL, // #168
3436NULL, // #169
3437NULL, // #170
3438NULL, // #171
3439NULL, // #172
3440NULL, // #173
3441NULL, // #174
3442NULL, // #175
3443NULL, // #176
3444NULL, // #177
3445NULL, // #178
3446NULL, // #179
3447NULL, // #180
3448NULL, // #181
3449NULL, // #182
3450NULL, // #183
3451NULL, // #184
3452NULL, // #185
3453NULL, // #186
3454NULL, // #187
3455NULL, // #188
3456NULL, // #189
3457NULL, // #190
3458NULL, // #191
3459NULL, // #192
3460NULL, // #193
3461NULL, // #194
3462NULL, // #195
3463NULL, // #196
3464NULL, // #197
3465NULL, // #198
3466NULL, // #199
3467// FTEQW range #200-#299
3468NULL, // #200
3469NULL, // #201
3470NULL, // #202
3471NULL, // #203
3472NULL, // #204
3473NULL, // #205
3474NULL, // #206
3475NULL, // #207
3476NULL, // #208
3477NULL, // #209
3478NULL, // #210
3479NULL, // #211
3480NULL, // #212
3481NULL, // #213
3482NULL, // #214
3483NULL, // #215
3484NULL, // #216
3485NULL, // #217
3486VM_bitshift, // #218 float(float number, float quantity) bitshift (EXT_BITSHIFT)
3487NULL, // #219
3488NULL, // #220
3489VM_strstrofs, // #221 float(string str, string sub[, float startpos]) strstrofs (FTE_STRINGS)
3490VM_str2chr, // #222 float(string str, float ofs) str2chr (FTE_STRINGS)
3491VM_chr2str, // #223 string(float c, ...) chr2str (FTE_STRINGS)
3492VM_strconv, // #224 string(float ccase, float calpha, float cnum, string s, ...) strconv (FTE_STRINGS)
3493VM_strpad, // #225 string(float chars, string s, ...) strpad (FTE_STRINGS)
3494VM_infoadd, // #226 string(string info, string key, string value, ...) infoadd (FTE_STRINGS)
3495VM_infoget, // #227 string(string info, string key) infoget (FTE_STRINGS)
3496VM_strncmp, // #228 float(string s1, string s2, float len) strncmp (FTE_STRINGS)
3497VM_strncasecmp, // #229 float(string s1, string s2) strcasecmp (FTE_STRINGS)
3498VM_strncasecmp, // #230 float(string s1, string s2, float len) strncasecmp (FTE_STRINGS)
3499NULL, // #231
3500VM_SV_AddStat, // #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
3501NULL, // #233
3502NULL, // #234
3503NULL, // #235
3504NULL, // #236
3505NULL, // #237
3506NULL, // #238
3507NULL, // #239
3508VM_SV_checkpvs, // #240 float(vector viewpos, entity viewee) checkpvs;
3509NULL, // #241
3510NULL, // #242
3511NULL, // #243
3512NULL, // #244
3513VM_modulo, // #245
3514NULL, // #246
3515NULL, // #247
3516NULL, // #248
3517NULL, // #249
3518NULL, // #250
3519NULL, // #251
3520NULL, // #252
3521NULL, // #253
3522NULL, // #254
3523NULL, // #255
3524NULL, // #256
3525NULL, // #257
3526NULL, // #258
3527NULL, // #259
3528NULL, // #260
3529NULL, // #261
3530NULL, // #262
3531VM_SV_skel_create, // #263 float(float modlindex) skel_create = #263; // (DP_SKELETONOBJECTS) create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex.
3532VM_SV_skel_build, // #264 float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // (DP_SKELETONOBJECTS) blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
3533VM_SV_skel_get_numbones, // #265 float(float skel) skel_get_numbones = #265; // (DP_SKELETONOBJECTS) returns how many bones exist in the created skeleton
3534VM_SV_skel_get_bonename, // #266 string(float skel, float bonenum) skel_get_bonename = #266; // (DP_SKELETONOBJECTS) returns name of bone (as a tempstring)
3535VM_SV_skel_get_boneparent, // #267 float(float skel, float bonenum) skel_get_boneparent = #267; // (DP_SKELETONOBJECTS) returns parent num for supplied bonenum, -1 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
3536VM_SV_skel_find_bone, // #268 float(float skel, string tagname) skel_find_bone = #268; // (DP_SKELETONOBJECTS) get number of bone with specified name, 0 on failure, tagindex (bonenum+1) on success, same as using gettagindex on the modelindex
3537VM_SV_skel_get_bonerel, // #269 vector(float skel, float bonenum) skel_get_bonerel = #269; // (DP_SKELETONOBJECTS) get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
3538VM_SV_skel_get_boneabs, // #270 vector(float skel, float bonenum) skel_get_boneabs = #270; // (DP_SKELETONOBJECTS) get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
3539VM_SV_skel_set_bone, // #271 void(float skel, float bonenum, vector org) skel_set_bone = #271; // (DP_SKELETONOBJECTS) set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
3540VM_SV_skel_mul_bone, // #272 void(float skel, float bonenum, vector org) skel_mul_bone = #272; // (DP_SKELETONOBJECTS) transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
3541VM_SV_skel_mul_bones, // #273 void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // (DP_SKELETONOBJECTS) transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
3542VM_SV_skel_copybones, // #274 void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // (DP_SKELETONOBJECTS) copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
3543VM_SV_skel_delete, // #275 void(float skel) skel_delete = #275; // (DP_SKELETONOBJECTS) deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
3544VM_SV_frameforname, // #276 float(float modlindex, string framename) frameforname = #276; // (DP_SKELETONOBJECTS) finds number of a specified frame in the animation, returns -1 if no match found
3545VM_SV_frameduration, // #277 float(float modlindex, float framenum) frameduration = #277; // (DP_SKELETONOBJECTS) returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
3546NULL, // #278
3547NULL, // #279
3548NULL, // #280
3549NULL, // #281
3550NULL, // #282
3551NULL, // #283
3552NULL, // #284
3553NULL, // #285
3554NULL, // #286
3555NULL, // #287
3556NULL, // #288
3557NULL, // #289
3558NULL, // #290
3559NULL, // #291
3560NULL, // #292
3561NULL, // #293
3562NULL, // #294
3563NULL, // #295
3564NULL, // #296
3565NULL, // #297
3566NULL, // #298
3567NULL, // #299
3568// CSQC range #300-#399
3569NULL, // #300 void() clearscene (EXT_CSQC)
3570NULL, // #301 void(float mask) addentities (EXT_CSQC)
3571NULL, // #302 void(entity ent) addentity (EXT_CSQC)
3572NULL, // #303 float(float property, ...) setproperty (EXT_CSQC)
3573NULL, // #304 void() renderscene (EXT_CSQC)
3574NULL, // #305 void(vector org, float radius, vector lightcolours) adddynamiclight (EXT_CSQC)
3575NULL, // #306 void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon
3576NULL, // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex
3577NULL, // #308 void() R_EndPolygon
3578NULL, // #309
3579NULL, // #310 vector (vector v) cs_unproject (EXT_CSQC)
3580NULL, // #311 vector (vector v) cs_project (EXT_CSQC)
3581NULL, // #312
3582NULL, // #313
3583NULL, // #314
3584NULL, // #315 void(float width, vector pos1, vector pos2, float flag) drawline (EXT_CSQC)
3585NULL, // #316 float(string name) iscachedpic (EXT_CSQC)
3586NULL, // #317 string(string name, float trywad) precache_pic (EXT_CSQC)
3587NULL, // #318 vector(string picname) draw_getimagesize (EXT_CSQC)
3588NULL, // #319 void(string name) freepic (EXT_CSQC)
3589NULL, // #320 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter (EXT_CSQC)
3590NULL, // #321 float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring (EXT_CSQC)
3591NULL, // #322 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic (EXT_CSQC)
3592NULL, // #323 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill (EXT_CSQC)
3593NULL, // #324 void(float x, float y, float width, float height) drawsetcliparea
3594NULL, // #325 void(void) drawresetcliparea
3595NULL, // #326
3596NULL, // #327
3597NULL, // #328
3598NULL, // #329
3599NULL, // #330 float(float stnum) getstatf (EXT_CSQC)
3600NULL, // #331 float(float stnum) getstati (EXT_CSQC)
3601NULL, // #332 string(float firststnum) getstats (EXT_CSQC)
3602VM_SV_setmodelindex, // #333 void(entity e, float mdlindex) setmodelindex (EXT_CSQC)
3603VM_SV_modelnameforindex, // #334 string(float mdlindex) modelnameforindex (EXT_CSQC)
3604VM_SV_particleeffectnum, // #335 float(string effectname) particleeffectnum (EXT_CSQC)
3605VM_SV_trailparticles, // #336 void(entity ent, float effectnum, vector start, vector end) trailparticles (EXT_CSQC)
3606VM_SV_pointparticles, // #337 void(float effectnum, vector origin [, vector dir, float count]) pointparticles (EXT_CSQC)
3607NULL, // #338 void(string s, ...) centerprint (EXT_CSQC)
3608VM_print, // #339 void(string s, ...) print (EXT_CSQC, DP_SV_PRINT)
3609NULL, // #340 string(float keynum) keynumtostring (EXT_CSQC)
3610NULL, // #341 float(string keyname) stringtokeynum (EXT_CSQC)
3611NULL, // #342 string(float keynum) getkeybind (EXT_CSQC)
3612NULL, // #343 void(float usecursor) setcursormode (EXT_CSQC)
3613NULL, // #344 vector() getmousepos (EXT_CSQC)
3614NULL, // #345 float(float framenum) getinputstate (EXT_CSQC)
3615NULL, // #346 void(float sens) setsensitivityscaler (EXT_CSQC)
3616NULL, // #347 void() runstandardplayerphysics (EXT_CSQC)
3617NULL, // #348 string(float playernum, string keyname) getplayerkeyvalue (EXT_CSQC)
3618NULL, // #349 float() isdemo (EXT_CSQC)
3619VM_isserver, // #350 float() isserver (EXT_CSQC)
3620NULL, // #351 void(vector origin, vector forward, vector right, vector up) SetListener (EXT_CSQC)
3621VM_SV_registercommand, // #352 void(string cmdname) registercommand (EXT_CSQC)
3622VM_wasfreed, // #353 float(entity ent) wasfreed (EXT_CSQC) (should be availabe on server too)
3623VM_SV_serverkey, // #354 string(string key) serverkey (EXT_CSQC)
3624NULL, // #355
3625NULL, // #356
3626NULL, // #357
3627NULL, // #358
3628NULL, // #359
3629NULL, // #360 float() readbyte (EXT_CSQC)
3630NULL, // #361 float() readchar (EXT_CSQC)
3631NULL, // #362 float() readshort (EXT_CSQC)
3632NULL, // #363 float() readlong (EXT_CSQC)
3633NULL, // #364 float() readcoord (EXT_CSQC)
3634NULL, // #365 float() readangle (EXT_CSQC)
3635NULL, // #366 string() readstring (EXT_CSQC)
3636NULL, // #367 float() readfloat (EXT_CSQC)
3637NULL, // #368
3638NULL, // #369
3639NULL, // #370
3640NULL, // #371
3641NULL, // #372
3642NULL, // #373
3643NULL, // #374
3644NULL, // #375
3645NULL, // #376
3646NULL, // #377
3647NULL, // #378
3648NULL, // #379
3649NULL, // #380
3650NULL, // #381
3651NULL, // #382
3652NULL, // #383
3653NULL, // #384
3654NULL, // #385
3655NULL, // #386
3656NULL, // #387
3657NULL, // #388
3658NULL, // #389
3659NULL, // #390
3660NULL, // #391
3661NULL, // #392
3662NULL, // #393
3663NULL, // #394
3664NULL, // #395
3665NULL, // #396
3666NULL, // #397
3667NULL, // #398
3668NULL, // #399
3669// LadyHavoc's range #400-#499
3670VM_SV_copyentity, // #400 void(entity from, entity to) copyentity (DP_QC_COPYENTITY)
3671VM_SV_setcolor, // #401 void(entity ent, float colors) setcolor (DP_QC_SETCOLOR)
3672VM_findchain, // #402 entity(.string fld, string match) findchain (DP_QC_FINDCHAIN)
3673VM_findchainfloat, // #403 entity(.float fld, float match) findchainfloat (DP_QC_FINDCHAINFLOAT)
3674VM_SV_effect, // #404 void(vector org, string modelname, float startframe, float endframe, float framerate) effect (DP_SV_EFFECT)
3675VM_SV_te_blood, // #405 void(vector org, vector velocity, float howmany) te_blood (DP_TE_BLOOD)
3676VM_SV_te_bloodshower, // #406 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower (DP_TE_BLOODSHOWER)
3677VM_SV_te_explosionrgb, // #407 void(vector org, vector color) te_explosionrgb (DP_TE_EXPLOSIONRGB)
3678VM_SV_te_particlecube, // #408 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube (DP_TE_PARTICLECUBE)
3679VM_SV_te_particlerain, // #409 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain (DP_TE_PARTICLERAIN)
3680VM_SV_te_particlesnow, // #410 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow (DP_TE_PARTICLESNOW)
3681VM_SV_te_spark, // #411 void(vector org, vector vel, float howmany) te_spark (DP_TE_SPARK)
3682VM_SV_te_gunshotquad, // #412 void(vector org) te_gunshotquad (DP_QUADEFFECTS1)
3683VM_SV_te_spikequad, // #413 void(vector org) te_spikequad (DP_QUADEFFECTS1)
3684VM_SV_te_superspikequad, // #414 void(vector org) te_superspikequad (DP_QUADEFFECTS1)
3685VM_SV_te_explosionquad, // #415 void(vector org) te_explosionquad (DP_QUADEFFECTS1)
3686VM_SV_te_smallflash, // #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH)
3687VM_SV_te_customflash, // #417 void(vector org, float radius, float lifetime, vector color) te_customflash (DP_TE_CUSTOMFLASH)
3688VM_SV_te_gunshot, // #418 void(vector org) te_gunshot (DP_TE_STANDARDEFFECTBUILTINS)
3689VM_SV_te_spike, // #419 void(vector org) te_spike (DP_TE_STANDARDEFFECTBUILTINS)
3690VM_SV_te_superspike, // #420 void(vector org) te_superspike (DP_TE_STANDARDEFFECTBUILTINS)
3691VM_SV_te_explosion, // #421 void(vector org) te_explosion (DP_TE_STANDARDEFFECTBUILTINS)
3692VM_SV_te_tarexplosion, // #422 void(vector org) te_tarexplosion (DP_TE_STANDARDEFFECTBUILTINS)
3693VM_SV_te_wizspike, // #423 void(vector org) te_wizspike (DP_TE_STANDARDEFFECTBUILTINS)
3694VM_SV_te_knightspike, // #424 void(vector org) te_knightspike (DP_TE_STANDARDEFFECTBUILTINS)
3695VM_SV_te_lavasplash, // #425 void(vector org) te_lavasplash (DP_TE_STANDARDEFFECTBUILTINS)
3696VM_SV_te_teleport, // #426 void(vector org) te_teleport (DP_TE_STANDARDEFFECTBUILTINS)
3697VM_SV_te_explosion2, // #427 void(vector org, float colorstart, float colorlength) te_explosion2 (DP_TE_STANDARDEFFECTBUILTINS)
3698VM_SV_te_lightning1, // #428 void(entity own, vector start, vector end) te_lightning1 (DP_TE_STANDARDEFFECTBUILTINS)
3699VM_SV_te_lightning2, // #429 void(entity own, vector start, vector end) te_lightning2 (DP_TE_STANDARDEFFECTBUILTINS)
3700VM_SV_te_lightning3, // #430 void(entity own, vector start, vector end) te_lightning3 (DP_TE_STANDARDEFFECTBUILTINS)
3701VM_SV_te_beam, // #431 void(entity own, vector start, vector end) te_beam (DP_TE_STANDARDEFFECTBUILTINS)
3702VM_vectorvectors, // #432 void(vector dir) vectorvectors (DP_QC_VECTORVECTORS)
3703VM_SV_te_plasmaburn, // #433 void(vector org) te_plasmaburn (DP_TE_PLASMABURN)
3704VM_getsurfacenumpoints, // #434 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACE)
3705VM_getsurfacepoint, // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE)
3706VM_getsurfacenormal, // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE)
3707VM_getsurfacetexture, // #437 string(entity e, float s) getsurfacetexture (DP_QC_GETSURFACE)
3708VM_getsurfacenearpoint, // #438 float(entity e, vector p) getsurfacenearpoint (DP_QC_GETSURFACE)
3709VM_getsurfaceclippedpoint, // #439 vector(entity e, float s, vector p) getsurfaceclippedpoint (DP_QC_GETSURFACE)
3710VM_SV_clientcommand, // #440 void(entity e, string s) clientcommand (KRIMZON_SV_PARSECLIENTCOMMAND)
3711VM_tokenize, // #441 float(string s) tokenize (KRIMZON_SV_PARSECLIENTCOMMAND)
3712VM_argv, // #442 string(float n) argv (KRIMZON_SV_PARSECLIENTCOMMAND)
3713VM_SV_setattachment, // #443 void(entity e, entity tagentity, string tagname) setattachment (DP_GFX_QUAKE3MODELTAGS)
3714VM_search_begin, // #444 float(string pattern, float caseinsensitive, float quiet) search_begin (DP_QC_FS_SEARCH)
3715VM_search_end, // #445 void(float handle) search_end (DP_QC_FS_SEARCH)
3716VM_search_getsize, // #446 float(float handle) search_getsize (DP_QC_FS_SEARCH)
3717VM_search_getfilename, // #447 string(float handle, float num) search_getfilename (DP_QC_FS_SEARCH)
3718VM_cvar_string, // #448 string(string s) cvar_string (DP_QC_CVAR_STRING)
3719VM_findflags, // #449 entity(entity start, .float fld, float match) findflags (DP_QC_FINDFLAGS)
3720VM_findchainflags, // #450 entity(.float fld, float match) findchainflags (DP_QC_FINDCHAINFLAGS)
3721VM_SV_gettagindex, // #451 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO)
3722VM_SV_gettaginfo, // #452 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO)
3723VM_SV_dropclient, // #453 void(entity clent) dropclient (DP_SV_DROPCLIENT)
3724VM_SV_spawnclient, // #454 entity() spawnclient (DP_SV_BOTCLIENT)
3725VM_SV_clienttype, // #455 float(entity clent) clienttype (DP_SV_BOTCLIENT)
3726VM_SV_WriteUnterminatedString, // #456 void(float to, string s) WriteUnterminatedString (DP_SV_WRITEUNTERMINATEDSTRING)
3727VM_SV_te_flamejet, // #457 void(vector org, vector vel, float howmany) te_flamejet = #457 (DP_TE_FLAMEJET)
3728NULL, // #458
3729VM_ftoe, // #459 entity(float num) entitybyindex (DP_QC_EDICT_NUM)
3730VM_buf_create, // #460 float() buf_create (DP_QC_STRINGBUFFERS)
3731VM_buf_del, // #461 void(float bufhandle) buf_del (DP_QC_STRINGBUFFERS)
3732VM_buf_getsize, // #462 float(float bufhandle) buf_getsize (DP_QC_STRINGBUFFERS)
3733VM_buf_copy, // #463 void(float bufhandle_from, float bufhandle_to) buf_copy (DP_QC_STRINGBUFFERS)
3734VM_buf_sort, // #464 void(float bufhandle, float sortpower, float backward) buf_sort (DP_QC_STRINGBUFFERS)
3735VM_buf_implode, // #465 string(float bufhandle, string glue) buf_implode (DP_QC_STRINGBUFFERS)
3736VM_bufstr_get, // #466 string(float bufhandle, float string_index) bufstr_get (DP_QC_STRINGBUFFERS)
3737VM_bufstr_set, // #467 void(float bufhandle, float string_index, string str) bufstr_set (DP_QC_STRINGBUFFERS)
3738VM_bufstr_add, // #468 float(float bufhandle, string str, float order) bufstr_add (DP_QC_STRINGBUFFERS)
3739VM_bufstr_free, // #469 void(float bufhandle, float string_index) bufstr_free (DP_QC_STRINGBUFFERS)
3740NULL, // #470
3741VM_asin, // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
3742VM_acos, // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
3743VM_atan, // #473 float(float t) VM_atan (DP_QC_ASINACOSATANATAN2TAN)
3744VM_atan2, // #474 float(float c, float s) VM_atan2 (DP_QC_ASINACOSATANATAN2TAN)
3745VM_tan, // #475 float(float a) VM_tan (DP_QC_ASINACOSATANATAN2TAN)
3746VM_strlennocol, // #476 float(string s) : DRESK - String Length (not counting color codes) (DP_QC_STRINGCOLORFUNCTIONS)
3747VM_strdecolorize, // #477 string(string s) : DRESK - Decolorized String (DP_SV_STRINGCOLORFUNCTIONS)
3748VM_strftime, // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME)
3749VM_tokenizebyseparator, // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR)
3750VM_strtolower, // #480 string(string s) VM_strtolower (DP_QC_STRING_CASE_FUNCTIONS)
3751VM_strtoupper, // #481 string(string s) VM_strtoupper (DP_QC_STRING_CASE_FUNCTIONS)
3752VM_cvar_defstring, // #482 string(string s) cvar_defstring (DP_QC_CVAR_DEFSTRING)
3753VM_SV_pointsound, // #483 void(vector origin, string sample, float volume, float attenuation) (DP_SV_POINTSOUND)
3754VM_strreplace, // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
3755VM_strireplace, // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
3756VM_getsurfacepointattribute,// #486 vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
3757NULL, // #487
3758NULL, // #488
3759NULL, // #489
3760NULL, // #490
3761NULL, // #491
3762NULL, // #492
3763NULL, // #493
3764VM_crc16, // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
3765VM_cvar_type, // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
3766VM_numentityfields, // #496 float() numentityfields = #496; (DP_QC_ENTITYDATA)
3767VM_entityfieldname, // #497 string(float fieldnum) entityfieldname = #497; (DP_QC_ENTITYDATA)
3768VM_entityfieldtype, // #498 float(float fieldnum) entityfieldtype = #498; (DP_QC_ENTITYDATA)
3769VM_getentityfieldstring, // #499 string(float fieldnum, entity ent) getentityfieldstring = #499; (DP_QC_ENTITYDATA)
3770VM_putentityfieldstring, // #500 float(float fieldnum, entity ent, string s) putentityfieldstring = #500; (DP_QC_ENTITYDATA)
3771VM_SV_WritePicture, // #501
3772NULL, // #502
3773VM_whichpack, // #503 string(string) whichpack = #503;
3774NULL, // #504
3775NULL, // #505
3776NULL, // #506
3777NULL, // #507
3778NULL, // #508
3779NULL, // #509
3780VM_uri_escape, // #510 string(string in) uri_escape = #510;
3781VM_uri_unescape, // #511 string(string in) uri_unescape = #511;
3782VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT)
3783VM_uri_get, // #513 float(string uri, float id, [string post_contenttype, string post_delim, [float buf]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
3784VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
3785VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
3786VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
3787VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
3788VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
3789VM_gettime, // #519 float(float timer) gettime = #519; (DP_QC_GETTIME)
3790NULL, // #520
3791NULL, // #521
3792NULL, // #522
3793NULL, // #523
3794NULL, // #524
3795NULL, // #525
3796NULL, // #526
3797NULL, // #527
3798NULL, // #528
3799VM_loadfromdata, // #529
3800VM_loadfromfile, // #530
3801VM_SV_setpause, // #531 void(float pause) setpause = #531;
3802VM_log, // #532
3803VM_getsoundtime, // #533 float(entity e, float channel) getsoundtime = #533; (DP_SND_GETSOUNDTIME)
3804VM_soundlength, // #534 float(string sample) soundlength = #534; (DP_SND_GETSOUNDTIME)
3805VM_buf_loadfile, // #535 float(string filename, float bufhandle) buf_loadfile (DP_QC_STRINGBUFFERS_EXT_WIP)
3806VM_buf_writefile, // #536 float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
3807VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule, float startpos) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
3808VM_matchpattern, // #538 float(string s, string pattern, float matchrule) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
3809NULL, // #539
3810VM_physics_enable, // #540 void(entity e, float physics_enabled) physics_enable = #540; (DP_PHYSICS_ODE)
3811VM_physics_addforce, // #541 void(entity e, vector force, vector relative_ofs) physics_addforce = #541; (DP_PHYSICS_ODE)
3812VM_physics_addtorque, // #542 void(entity e, vector torque) physics_addtorque = #542; (DP_PHYSICS_ODE)
3813NULL, // #543
3814NULL, // #544
3815NULL, // #545
3816NULL, // #546
3817NULL, // #547
3818NULL, // #548
3819NULL, // #549
3820NULL, // #550
3821NULL, // #551
3822NULL, // #552
3823NULL, // #553
3824NULL, // #554
3825NULL, // #555
3826NULL, // #556
3827NULL, // #557
3828NULL, // #558
3829NULL, // #559
3830NULL, // #560
3831NULL, // #561
3832NULL, // #562
3833NULL, // #563
3834NULL, // #564
3835NULL, // #565
3836VM_SV_findbox, // #566 entity(vector mins, vector maxs) findbox = #566; (DP_QC_FINDBOX)
3837VM_nudgeoutofsolid, // #567 float(entity ent) nudgeoutofsolid = #567; (DP_QC_NUDGEOUTOFSOLID)
3838NULL, // #568
3839NULL, // #569
3840NULL, // #570
3841NULL, // #571
3842NULL, // #572
3843NULL, // #573
3844NULL, // #574
3845NULL, // #575
3846NULL, // #576
3847NULL, // #577
3848NULL, // #578
3849NULL, // #579
3850NULL, // #580
3851NULL, // #581
3852NULL, // #582
3853NULL, // #583
3854NULL, // #584
3855NULL, // #585
3856NULL, // #586
3857NULL, // #587
3858NULL, // #588
3859NULL, // #589
3860NULL, // #590
3861NULL, // #591
3862NULL, // #592
3863NULL, // #593
3864NULL, // #594
3865NULL, // #595
3866NULL, // #596
3867NULL, // #597
3868NULL, // #598
3869NULL, // #599
3870NULL, // #600
3871NULL, // #601
3872NULL, // #602
3873NULL, // #603
3874NULL, // #604
3875VM_callfunction, // #605
3876VM_writetofile, // #606
3877VM_isfunction, // #607
3878NULL, // #608
3879NULL, // #609
3880NULL, // #610
3881NULL, // #611
3882NULL, // #612
3883VM_parseentitydata, // #613
3884NULL, // #614
3885NULL, // #615
3886NULL, // #616
3887NULL, // #617
3888NULL, // #618
3889NULL, // #619
3890NULL, // #620
3891NULL, // #621
3892NULL, // #622
3893NULL, // #623
3894VM_SV_getextresponse, // #624 string getextresponse(void)
3895NULL, // #625
3896NULL, // #626
3897VM_sprintf, // #627 string sprintf(string format, ...)
3898VM_getsurfacenumtriangles, // #628 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACETRIANGLE)
3899VM_getsurfacetriangle, // #629 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACETRIANGLE)
3900NULL, // #630
3901NULL, // #631
3902NULL, // #632
3903NULL, // #633
3904NULL, // #634
3905NULL, // #635
3906NULL, // #636
3907NULL, // #637
3908NULL, // #638
3909VM_digest_hex, // #639
3910NULL, // #640
3911NULL, // #641
3912VM_coverage, // #642
3913NULL, // #643
3914};
void VM_makevectors(prvm_prog_t *prog)
Definition prvm_cmds.c:3563
void VM_SV_getextresponse(prvm_prog_t *prog)
Definition prvm_cmds.c:5627
void VM_SV_MoveToGoal(prvm_prog_t *prog)
Definition sv_move.c:420
static void VM_SV_te_lightning1(prvm_prog_t *prog)
Definition svvm_cmds.c:2316
static void VM_SV_te_spike(prvm_prog_t *prog)
Definition svvm_cmds.c:2205
static void VM_SV_te_customflash(prvm_prog_t *prog)
Definition svvm_cmds.c:2171
static void VM_SV_WriteUnterminatedString(prvm_prog_t *prog)
Definition svvm_cmds.c:1546
static void VM_SV_centerprint(prvm_prog_t *prog)
Definition svvm_cmds.c:416
static void VM_SV_WriteByte(prvm_prog_t *prog)
Definition svvm_cmds.c:1504
static void VM_SV_WriteEntity(prvm_prog_t *prog)
Definition svvm_cmds.c:1553
static void VM_SV_WriteCoord(prvm_prog_t *prog)
Definition svvm_cmds.c:1534
static void VM_SV_setmodel(prvm_prog_t *prog)
Definition svvm_cmds.c:329
static void VM_SV_te_lavasplash(prvm_prog_t *prog)
Definition svvm_cmds.c:2277
static void VM_SV_te_spark(prvm_prog_t *prog)
Definition svvm_cmds.c:2091
static void VM_SV_copyentity(prvm_prog_t *prog)
Definition svvm_cmds.c:1835
static void VM_SV_WritePicture(prvm_prog_t *prog)
Definition svvm_cmds.c:1565
static void VM_SV_te_spikequad(prvm_prog_t *prog)
Definition svvm_cmds.c:2123
static void VM_SV_setcolor(prvm_prog_t *prog)
Definition svvm_cmds.c:1876
static void VM_SV_te_tarexplosion(prvm_prog_t *prog)
Definition svvm_cmds.c:2241
static void VM_SV_skel_get_boneabs(prvm_prog_t *prog)
Definition svvm_cmds.c:3100
static void VM_SV_skel_find_bone(prvm_prog_t *prog)
Definition svvm_cmds.c:3064
static void VM_SV_setsize(prvm_prog_t *prog)
Definition svvm_cmds.c:297
static void VM_SV_ambientsound(prvm_prog_t *prog)
Definition svvm_cmds.c:470
static void VM_SV_sprint(prvm_prog_t *prog)
Definition svvm_cmds.c:374
static void VM_SV_te_flamejet(prvm_prog_t *prog)
Definition svvm_cmds.c:2399
static void VM_SV_findradius(prvm_prog_t *prog)
Definition svvm_cmds.c:992
static void VM_SV_setpause(prvm_prog_t *prog)
Definition svvm_cmds.c:2941
static void VM_SV_te_smallflash(prvm_prog_t *prog)
Definition svvm_cmds.c:2159
static void VM_SV_AddStat(prvm_prog_t *prog)
Definition svvm_cmds.c:1773
static void VM_SV_particle(prvm_prog_t *prog)
Definition svvm_cmds.c:448
static void VM_SV_pointsound(prvm_prog_t *prog)
Definition svvm_cmds.c:607
static void VM_SV_lightstyle(prvm_prog_t *prog)
Definition svvm_cmds.c:1285
static void VM_SV_particleeffectnum(prvm_prog_t *prog)
Definition svvm_cmds.c:2864
static void VM_SV_gettaginfo(prvm_prog_t *prog)
Definition svvm_cmds.c:2657
static void VM_SV_te_explosionrgb(prvm_prog_t *prog)
Definition svvm_cmds.c:1993
static void VM_SV_findbox(prvm_prog_t *prog)
Definition svvm_cmds.c:1069
static void VM_SV_skel_set_bone(prvm_prog_t *prog)
Definition svvm_cmds.c:3131
static void VM_SV_te_particlerain(prvm_prog_t *prog)
Definition svvm_cmds.c:2039
static void VM_SV_checkpvs(prvm_prog_t *prog)
Definition svvm_cmds.c:891
static void VM_SV_WriteAngle(prvm_prog_t *prog)
Definition svvm_cmds.c:1528
static void VM_SV_makestatic(prvm_prog_t *prog)
Definition svvm_cmds.c:1594
static void VM_SV_te_superspikequad(prvm_prog_t *prog)
Definition svvm_cmds.c:2135
static void VM_SV_frameduration(prvm_prog_t *prog)
Definition svvm_cmds.c:3252
static void VM_SV_skel_mul_bones(prvm_prog_t *prog)
Definition svvm_cmds.c:3173
static void VM_SV_skel_get_numbones(prvm_prog_t *prog)
Definition svvm_cmds.c:3025
static void VM_SV_clienttype(prvm_prog_t *prog)
Definition svvm_cmds.c:2762
static void VM_SV_setspawnparms(prvm_prog_t *prog)
Definition svvm_cmds.c:1660
static void VM_SV_WriteString(prvm_prog_t *prog)
Definition svvm_cmds.c:1540
static void VM_SV_te_explosionquad(prvm_prog_t *prog)
Definition svvm_cmds.c:2147
static void VM_SV_getlight(prvm_prog_t *prog)
Definition svvm_cmds.c:1694
static void VM_SV_frameforname(prvm_prog_t *prog)
Definition svvm_cmds.c:3232
static void VM_SV_pointcontents(prvm_prog_t *prog)
Definition svvm_cmds.c:1335
static void VM_SV_aim(prvm_prog_t *prog)
Definition svvm_cmds.c:1351
static void VM_SV_te_gunshotquad(prvm_prog_t *prog)
Definition svvm_cmds.c:2111
static void VM_SV_effect(prvm_prog_t *prog)
Definition svvm_cmds.c:1915
static void VM_SV_skel_copybones(prvm_prog_t *prog)
Definition svvm_cmds.c:3200
static void VM_SV_skel_mul_bone(prvm_prog_t *prog)
Definition svvm_cmds.c:3151
static void VM_SV_gettagindex(prvm_prog_t *prog)
Definition svvm_cmds.c:2621
static void VM_SV_skel_get_boneparent(prvm_prog_t *prog)
Definition svvm_cmds.c:3050
static void VM_SV_tracetoss(prvm_prog_t *prog)
Definition svvm_cmds.c:759
static void VM_SV_skel_get_bonerel(prvm_prog_t *prog)
Definition svvm_cmds.c:3076
static void VM_SV_skel_get_bonename(prvm_prog_t *prog)
Definition svvm_cmds.c:3036
static void VM_SV_setattachment(prvm_prog_t *prog)
Definition svvm_cmds.c:2440
static void VM_SV_traceline(prvm_prog_t *prog)
Definition svvm_cmds.c:649
static void VM_SV_clientcommand(prvm_prog_t *prog)
Definition svvm_cmds.c:2419
static void VM_SV_te_gunshot(prvm_prog_t *prog)
Definition svvm_cmds.c:2193
static void VM_SV_checkclient(prvm_prog_t *prog)
Definition svvm_cmds.c:842
static void VM_SV_WriteChar(prvm_prog_t *prog)
Definition svvm_cmds.c:1510
static void VM_SV_serverkey(prvm_prog_t *prog)
Definition svvm_cmds.c:2784
static void VM_SV_WriteShort(prvm_prog_t *prog)
Definition svvm_cmds.c:1516
static void VM_SV_pointparticles(prvm_prog_t *prog)
Definition svvm_cmds.c:2894
static void VM_SV_te_lightning2(prvm_prog_t *prog)
Definition svvm_cmds.c:2334
static void VM_SV_skel_create(prvm_prog_t *prog)
Definition svvm_cmds.c:2959
static void VM_SV_te_blood(prvm_prog_t *prog)
Definition svvm_cmds.c:1951
static void VM_SV_setmodelindex(prvm_prog_t *prog)
Definition svvm_cmds.c:2794
static void VM_SV_te_wizspike(prvm_prog_t *prog)
Definition svvm_cmds.c:2253
static void VM_SV_walkmove(prvm_prog_t *prog)
Definition svvm_cmds.c:1124
static void VM_SV_dropclient(prvm_prog_t *prog)
Definition svvm_cmds.c:2715
static void VM_SV_setorigin(prvm_prog_t *prog)
Definition svvm_cmds.c:247
static void VM_SV_te_particlecube(prvm_prog_t *prog)
Definition svvm_cmds.c:2009
static void VM_SV_droptofloor(prvm_prog_t *prog)
Definition svvm_cmds.c:1188
static void VM_SV_precache_model(prvm_prog_t *prog)
Definition svvm_cmds.c:1110
static void VM_SV_te_superspike(prvm_prog_t *prog)
Definition svvm_cmds.c:2217
static void VM_SV_te_particlesnow(prvm_prog_t *prog)
Definition svvm_cmds.c:2065
static void VM_SV_trailparticles(prvm_prog_t *prog)
Definition svvm_cmds.c:2875
static void VM_SV_te_beam(prvm_prog_t *prog)
Definition svvm_cmds.c:2370
static void VM_SV_WriteLong(prvm_prog_t *prog)
Definition svvm_cmds.c:1522
static void VM_SV_te_lightning3(prvm_prog_t *prog)
Definition svvm_cmds.c:2352
static void VM_SV_te_knightspike(prvm_prog_t *prog)
Definition svvm_cmds.c:2265
static void VM_SV_stuffcmd(prvm_prog_t *prog)
Definition svvm_cmds.c:960
static void VM_SV_te_explosion2(prvm_prog_t *prog)
Definition svvm_cmds.c:2301
static void VM_SV_tracebox(prvm_prog_t *prog)
Definition svvm_cmds.c:686
static void VM_SV_sound(prvm_prog_t *prog)
Definition svvm_cmds.c:531
static void VM_SV_te_plasmaburn(prvm_prog_t *prog)
Definition svvm_cmds.c:2388
static void VM_SV_skel_build(prvm_prog_t *prog)
Definition svvm_cmds.c:2983
static void VM_SV_skel_delete(prvm_prog_t *prog)
Definition svvm_cmds.c:3221
static void VM_SV_modelnameforindex(prvm_prog_t *prog)
Definition svvm_cmds.c:2841
static void VM_SV_registercommand(prvm_prog_t *prog)
Definition svvm_cmds.c:2934
static void VM_SV_precache_sound(prvm_prog_t *prog)
Definition svvm_cmds.c:1104
static void VM_SV_spawnclient(prvm_prog_t *prog)
Definition svvm_cmds.c:2738
static void VM_SV_te_explosion(prvm_prog_t *prog)
Definition svvm_cmds.c:2229
static void VM_SV_te_teleport(prvm_prog_t *prog)
Definition svvm_cmds.c:2289
static void VM_SV_checkbottom(prvm_prog_t *prog)
Definition svvm_cmds.c:1324
static void VM_SV_te_bloodshower(prvm_prog_t *prog)
Definition svvm_cmds.c:1971

Referenced by SV_VM_Setup().

◆ vm_sv_extensions

const char* vm_sv_extensions[]
extern

client also uses this

Definition at line 11 of file svvm_cmds.c.

11 {
12"BX_WAL_SUPPORT",
13"DP_BUTTONCHAT",
14"DP_BUTTONUSE",
15"DP_CL_LOADSKY",
16"DP_CON_ALIASPARAMETERS",
17"DP_CON_BESTWEAPON",
18"DP_CON_EXPANDCVAR",
19"DP_CON_SET",
20"DP_CON_SETA",
21"DP_CON_STARTMAP",
22"DP_COVERAGE",
23"DP_CRYPTO",
24"DP_CSQC_BINDMAPS",
25"DP_CSQC_ENTITYWORLDOBJECT",
26"DP_CSQC_ENTITYMODELLIGHT",
27"DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET",
28"DP_CSQC_MAINVIEW",
29"DP_CSQC_MINFPS_QUALITY",
30"DP_CSQC_MULTIFRAME_INTERPOLATION",
31"DP_CSQC_BOXPARTICLES",
32"DP_CSQC_SPAWNPARTICLE",
33"DP_CSQC_QUERYRENDERENTITY",
34"DP_CSQC_ROTATEMOVES",
35"DP_CSQC_SETPAUSE",
36"DP_CSQC_V_CALCREFDEF_WIP1",
37"DP_CSQC_V_CALCREFDEF_WIP2",
38"DP_EF_ADDITIVE",
39"DP_EF_BLUE",
40"DP_EF_DOUBLESIDED",
41"DP_EF_DYNAMICMODELLIGHT",
42"DP_EF_FLAME",
43"DP_EF_FULLBRIGHT",
44"DP_EF_NODEPTHTEST",
45"DP_EF_NODRAW",
46"DP_EF_NOGUNBOB",
47"DP_EF_NOSELFSHADOW",
48"DP_EF_NOSHADOW",
49"DP_EF_RED",
50"DP_EF_RESTARTANIM_BIT",
51"DP_EF_STARDUST",
52"DP_EF_TELEPORT_BIT",
53"DP_ENT_ALPHA",
54"DP_ENT_COLORMOD",
55"DP_ENT_CUSTOMCOLORMAP",
56"DP_ENT_EXTERIORMODELTOCLIENT",
57"DP_ENT_GLOW",
58"DP_ENT_GLOWMOD",
59"DP_ENT_LOWPRECISION",
60"DP_ENT_SCALE",
61"DP_ENT_TRAILEFFECTNUM",
62"DP_ENT_VIEWMODEL",
63"DP_GFX_EXTERNALTEXTURES",
64"DP_GFX_EXTERNALTEXTURES_PERMAP",
65"DP_GFX_FOG",
66"DP_GFX_MODEL_INTERPOLATION",
67"DP_GFX_QUAKE3MODELTAGS",
68"DP_GFX_SKINFILES",
69"DP_GFX_SKYBOX",
70"DP_GFX_FONTS",
71"DP_GFX_FONTS_FREETYPE",
72"DP_UTF8",
73"DP_FONT_VARIABLEWIDTH",
74"DP_HALFLIFE_MAP",
75"DP_HALFLIFE_MAP_CVAR",
76"DP_HALFLIFE_SPRITE",
77"DP_INPUTBUTTONS",
78"DP_LIGHTSTYLE_STATICVALUE",
79"DP_LITSPRITES",
80"DP_LITSUPPORT",
81"DP_MONSTERWALK",
82"DP_MOVETYPEBOUNCEMISSILE",
83"DP_MOVETYPEFLYWORLDONLY",
84"DP_MOVETYPEFOLLOW",
85"DP_NULL_MODEL",
86"DP_QC_ASINACOSATANATAN2TAN",
87"DP_QC_AUTOCVARS",
88"DP_QC_CHANGEPITCH",
89"DP_QC_CMD",
90"DP_QC_COPYENTITY",
91"DP_QC_CRC16",
92"DP_QC_CVAR_DEFSTRING",
93"DP_QC_CVAR_DESCRIPTION",
94"DP_QC_CVAR_STRING",
95"DP_QC_CVAR_TYPE",
96"DP_QC_DIGEST",
97"DP_QC_DIGEST_SHA256",
98"DP_QC_EDICT_NUM",
99"DP_QC_ENTITYDATA",
100"DP_QC_ENTITYSTRING",
101"DP_QC_ETOS",
102"DP_QC_EXTRESPONSEPACKET",
103"DP_QC_FINDBOX",
104"DP_QC_FINDCHAIN",
105"DP_QC_FINDCHAINFLAGS",
106"DP_QC_FINDCHAINFLOAT",
107"DP_QC_FINDCHAIN_TOFIELD",
108"DP_QC_FINDFLAGS",
109"DP_QC_FINDFLOAT",
110"DP_QC_FS_SEARCH",
111"DP_QC_FS_SEARCH_PACKFILE",
112"DP_QC_GETLIGHT",
113"DP_QC_GETSURFACE",
114"DP_QC_GETSURFACETRIANGLE",
115"DP_QC_GETSURFACEPOINTATTRIBUTE",
116"DP_QC_GETTAGINFO",
117"DP_QC_GETTAGINFO_BONEPROPERTIES",
118"DP_QC_GETTIME",
119"DP_QC_GETTIME_CDTRACK",
120"DP_QC_I18N",
121"DP_QC_LOG",
122"DP_QC_MINMAXBOUND",
123"DP_QC_MULTIPLETEMPSTRINGS",
124"DP_QC_NUDGEOUTOFSOLID",
125"DP_QC_NUM_FOR_EDICT",
126"DP_QC_RANDOMVEC",
127"DP_QC_SINCOSSQRTPOW",
128"DP_QC_SPRINTF",
129"DP_QC_STRFTIME",
130"DP_QC_STRINGBUFFERS",
131"DP_QC_STRINGBUFFERS_CVARLIST",
132"DP_QC_STRINGBUFFERS_EXT_WIP",
133"DP_QC_STRINGCOLORFUNCTIONS",
134"DP_QC_STRING_CASE_FUNCTIONS",
135"DP_QC_STRREPLACE",
136"DP_QC_TOKENIZEBYSEPARATOR",
137"DP_QC_TOKENIZE_CONSOLE",
138"DP_QC_TRACEBOX",
139"DP_QC_TRACETOSS",
140"DP_QC_TRACE_MOVETYPE_HITMODEL",
141"DP_QC_TRACE_MOVETYPE_WORLDONLY",
142"DP_QC_UNLIMITEDTEMPSTRINGS",
143"DP_QC_URI_ESCAPE",
144"DP_QC_URI_GET",
145"DP_QC_URI_POST",
146"DP_QC_VECTOANGLES_WITH_ROLL",
147"DP_QC_VECTORVECTORS",
148"DP_QC_WHICHPACK",
149"DP_QUAKE2_MODEL",
150"DP_QUAKE2_SPRITE",
151"DP_QUAKE3_MAP",
152"DP_QUAKE3_MODEL",
153"DP_REGISTERCVAR",
154"DP_SKELETONOBJECTS",
155"DP_SND_DIRECTIONLESSATTNNONE",
156"DP_SND_FAKETRACKS",
157"DP_SND_SOUND7_WIP1",
158"DP_SND_SOUND7_WIP2",
159"DP_SND_OGGVORBIS",
160"DP_SND_SETPARAMS",
161"DP_SND_STEREOWAV",
162"DP_SND_GETSOUNDTIME",
163"DP_VIDEO_DPV",
164"DP_VIDEO_SUBTITLES",
165"DP_SOLIDCORPSE",
166"DP_SPRITE32",
167"DP_SV_BOTCLIENT",
168"DP_SV_BOUNCEFACTOR",
169"DP_SV_CLIENTCAMERA",
170"DP_SV_CLIENTCOLORS",
171"DP_SV_CLIENTNAME",
172"DP_SV_CMD",
173"DP_SV_CUSTOMIZEENTITYFORCLIENT",
174"DP_SV_DISABLECLIENTPREDICTION",
175"DP_SV_DISCARDABLEDEMO",
176"DP_SV_DRAWONLYTOCLIENT",
177"DP_SV_DROPCLIENT",
178"DP_SV_EFFECT",
179"DP_SV_ENTITYCONTENTSTRANSITION",
180"DP_SV_MODELFLAGS_AS_EFFECTS",
181"DP_SV_MOVETYPESTEP_LANDEVENT",
182"DP_SV_NETADDRESS",
183"DP_SV_NODRAWTOCLIENT",
184"DP_SV_ONENTITYNOSPAWNFUNCTION",
185"DP_SV_ONENTITYPREPOSTSPAWNFUNCTION",
186"DP_SV_PING",
187"DP_SV_PING_PACKETLOSS",
188"DP_SV_PLAYERPHYSICS",
189"DP_PHYSICS_ODE",
190"DP_SV_POINTPARTICLES",
191"DP_SV_POINTSOUND",
192"DP_SV_PRECACHEANYTIME",
193"DP_SV_PRINT",
194"DP_SV_PUNCHVECTOR",
195"DP_SV_QCSTATUS",
196"DP_SV_ROTATINGBMODEL",
197"DP_SV_SETCOLOR",
198"DP_SV_SHUTDOWN",
199"DP_SV_SLOWMO",
200"DP_SV_SPAWNFUNC_PREFIX",
201"DP_SV_WRITEPICTURE",
202"DP_SV_WRITEUNTERMINATEDSTRING",
203"DP_TE_BLOOD",
204"DP_TE_BLOODSHOWER",
205"DP_TE_CUSTOMFLASH",
206"DP_TE_EXPLOSIONRGB",
207"DP_TE_FLAMEJET",
208"DP_TE_PARTICLECUBE",
209"DP_TE_PARTICLERAIN",
210"DP_TE_PARTICLESNOW",
211"DP_TE_PLASMABURN",
212"DP_TE_QUADEFFECTS1",
213"DP_TE_SMALLFLASH",
214"DP_TE_SPARK",
215"DP_TE_STANDARDEFFECTBUILTINS",
216"DP_TRACE_HITCONTENTSMASK_SURFACEINFO"
217"DP_USERMOVETYPES",
218"DP_VIEWZOOM",
219"EXT_BITSHIFT",
220"FRIK_FILE",
221"FTE_CSQC_SKELETONOBJECTS",
222"FTE_QC_CHECKPVS",
223"FTE_STRINGS",
224"KRIMZON_SV_PARSECLIENTCOMMAND",
225"NEH_CMD_PLAY2",
226"NEH_RESTOREGAME",
227"NEXUIZ_PLAYERMODEL",
228"NXQ_GFX_LETTERBOX",
229"PRYDON_CLIENTCURSOR",
230"TENEBRAE_GFX_DLIGHTS",
231"TW_SV_STEPCONTROL",
232"ZQ_PAUSE",
233"DP_RM_CLIPGROUP",
234NULL
235//"EXT_CSQC" // not ready yet
236};

Referenced by CL_VM_Init(), PRVM_Init(), and SV_VM_Setup().

◆ vm_sv_numbuiltins

const int vm_sv_numbuiltins
extern

Definition at line 3916 of file svvm_cmds.c.

Referenced by SV_VM_Setup().