6 // Basically every vm builtin cmd should be in here.
7 // All 3 builtin and extension lists can be found here
8 // cause large (I think they will) parts are from pr_cmds the same copyright like in pr_cmds
13 ============================================================================
17 checkextension(string)
22 sprint(float clientnum,...[string])
23 centerprint(...[string])
24 vector normalize(vector)
26 float vectoyaw(vector)
27 vector vectoangles(vector)
31 cvar_set (string,string)
37 float stof(...[string])
40 entity find(entity start, .string field, string match)
42 entity findfloat(entity start, .float field, float match)
43 entity findentity(entity start, .entity field, entity match)
45 entity findchain(.string field, string match)
47 entity findchainfloat(.string field, float match)
48 entity findchainentity(.string field, entity match)
50 string precache_file(string)
51 string precache_sound (string sample)
59 entity nextent(entity)
64 float registercvar (string name, string value, float flags)
65 float min(float a, float b, ...[float])
66 float max(float a, float b, ...[float])
67 float bound(float min, float value, float max)
68 float pow(float a, float b)
69 copyentity(entity src, entity dst)
70 float fopen(string filename, float mode)
72 string fgets(float fhandle)
73 fputs(float fhandle, string s)
74 float strlen(string s)
75 string strcat(string,string,...[string])
76 string substring(string s, float start, float length)
78 string strzone(string s)
80 float tokenize(string s)
85 clientcommand(float client, string s) (for client and menu)
86 changelevel(string map)
87 localsound(string sample)
90 loadfromdata(string data)
91 loadfromfile(string file)
92 parseentitydata(entity ent, string data)
93 float mod(float val, float m)
94 const string cvar_string (string)
95 float cvar_type (string)
99 float search_begin(string pattern, float caseinsensitive, float quiet)
100 void search_end(float handle)
101 float search_getsize(float handle)
102 string search_getfilename(float handle, float num)
104 string chr(float ascii)
107 entity ftoe(float num)
109 -------will be removed soon----------
110 float altstr_count(string)
111 string altstr_prepare(string)
112 string altstr_get(string,float)
113 string altstr_set(string altstr, float num, string set)
114 string altstr_ins(string altstr, float num, string set)
115 --------------------------------------
117 entity findflags(entity start, .float field, float match)
118 entity findchainflags(.float field, float match)
120 const string VM_cvar_defstring (string)
122 perhaps only : Menu : WriteMsg
123 ===============================
125 WriteByte(float data, float dest, float desto)
126 WriteChar(float data, float dest, float desto)
127 WriteShort(float data, float dest, float desto)
128 WriteLong(float data, float dest, float desto)
129 WriteAngle(float data, float dest, float desto)
130 WriteCoord(float data, float dest, float desto)
131 WriteString(string data, float dest, float desto)
132 WriteEntity(entity data, float dest, float desto)
134 Client & Menu : draw functions & video functions (& gecko functions)
135 ===================================================
137 float iscachedpic(string pic)
138 string precache_pic(string pic)
140 float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag)
141 float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag)
142 float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag)
143 float stringwidth(string text, float handleColors)
144 float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag)
145 float drawsubpic(vector position, vector size, string pic, vector srcPos, vector srcSize, vector rgb, float alpha, float flag)
146 float drawfill(vector position, vector size, vector rgb, float alpha, float flag)
147 drawsetcliparea(float x, float y, float width, float height)
149 vector getimagesize(string pic)
151 float cin_open(string file, string name)
152 void cin_close(string name)
153 void cin_setstate(string name, float type)
154 float cin_getstate(string name)
155 void cin_restart(string name)
157 float[bool] gecko_create( string name )
158 void gecko_destroy( string name )
159 void gecko_navigate( string name, string URI )
160 float[bool] gecko_keyevent( string name, float key, float eventtype )
161 void gecko_mousemove( string name, float x, float y )
163 ==============================================================================
167 setkeydest(float dest)
169 setmousetarget(float target)
170 float getmousetarget()
172 callfunction(...,string function_name)
173 writetofile(float fhandle, entity ent)
174 float isfunction(string function_name)
175 vector getresolution(float number)
176 string keynumtostring(float keynum)
177 string findkeysforcommand(string command)
178 float getserverliststat(float type)
179 string getserverliststring(float fld, float hostnr)
181 float stringtokeynum(string key)
183 resetserverlistmasks()
184 setserverlistmaskstring(float mask, float fld, string str)
185 setserverlistmasknumber(float mask, float fld, float num, float op)
187 setserverlistsort(float field, float descending)
189 float getserverlistnumber(float fld, float hostnr)
190 float getserverlistindexforkey(string key)
191 addwantedserverlistkey(string key)
194 #include "quakedef.h"
195 #include "progdefs.h"
197 #include "clprogdefs.h"
198 #include "mprogdefs.h"
200 #include "cl_video.h"
202 //============================================================================
203 // nice helper macros
205 #ifndef VM_NOPARMCHECK
206 #define VM_SAFEPARMCOUNTRANGE(p1,p2,f) if(prog->argc < p1 || prog->argc > p2) prog->error_cmd(#f " wrong parameter count %i (" #p1 " to " #p2 " expected ) !", prog->argc)
207 #define VM_SAFEPARMCOUNT(p,f) if(prog->argc != p) prog->error_cmd(#f " wrong parameter count %i (" #p " expected ) !", prog->argc)
209 #define VM_SAFEPARMCOUNTRANGE(p1,p2,f)
210 #define VM_SAFEPARMCOUNT(p,f)
213 #define VM_RETURN_EDICT(e) (prog->globals.ip[OFS_RETURN] = PRVM_EDICT_TO_PROG(e))
215 #define VM_STRINGTEMP_LENGTH MAX_INPUTLINE
218 void VM_CheckEmptyString (prvm_prog_t *prog, const char *s);
219 void VM_VarString(prvm_prog_t *prog, int first, char *out, int outlength);
220 prvm_stringbuffer_t *BufStr_FindCreateReplace (prvm_prog_t *prog, int bufindex, int flags, const char *format);
221 void BufStr_Set(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer, int strindex, const char *str);
222 void BufStr_Del(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer);
223 void BufStr_Flush(prvm_prog_t *prog);
226 void VM_checkextension (prvm_prog_t *prog);
227 void VM_error (prvm_prog_t *prog);
228 void VM_objerror (prvm_prog_t *prog);
229 void VM_print (prvm_prog_t *prog);
230 void VM_bprint (prvm_prog_t *prog);
231 void VM_sprint (prvm_prog_t *prog);
232 void VM_centerprint (prvm_prog_t *prog);
233 void VM_normalize (prvm_prog_t *prog);
234 void VM_vlen (prvm_prog_t *prog);
235 void VM_vectoyaw (prvm_prog_t *prog);
236 void VM_vectoangles (prvm_prog_t *prog);
237 void VM_random (prvm_prog_t *prog);
238 void VM_localsound(prvm_prog_t *prog);
239 void VM_break (prvm_prog_t *prog);
240 void VM_localcmd_client(prvm_prog_t *prog);
241 void VM_localcmd_server(prvm_prog_t *prog);
242 void VM_cvar (prvm_prog_t *prog);
243 void VM_cvar_string(prvm_prog_t *prog);
244 void VM_cvar_type (prvm_prog_t *prog);
245 void VM_cvar_defstring (prvm_prog_t *prog);
246 void VM_cvar_set (prvm_prog_t *prog);
247 void VM_dprint (prvm_prog_t *prog);
248 void VM_ftos (prvm_prog_t *prog);
249 void VM_fabs (prvm_prog_t *prog);
250 void VM_vtos (prvm_prog_t *prog);
251 void VM_etos (prvm_prog_t *prog);
252 void VM_stof(prvm_prog_t *prog);
253 void VM_itof(prvm_prog_t *prog);
254 void VM_ftoe(prvm_prog_t *prog);
255 void VM_strftime(prvm_prog_t *prog);
256 void VM_spawn (prvm_prog_t *prog);
257 void VM_remove (prvm_prog_t *prog);
258 void VM_find (prvm_prog_t *prog);
259 void VM_findfloat (prvm_prog_t *prog);
260 void VM_findchain (prvm_prog_t *prog);
261 void VM_findchainfloat (prvm_prog_t *prog);
262 void VM_findflags (prvm_prog_t *prog);
263 void VM_findchainflags (prvm_prog_t *prog);
264 void VM_precache_file (prvm_prog_t *prog);
265 void VM_precache_sound (prvm_prog_t *prog);
266 void VM_coredump (prvm_prog_t *prog);
268 void VM_stackdump (prvm_prog_t *prog);
269 void VM_crash(prvm_prog_t *prog); // REMOVE IT
270 void VM_traceon (prvm_prog_t *prog);
271 void VM_traceoff (prvm_prog_t *prog);
272 void VM_eprint (prvm_prog_t *prog);
273 void VM_rint (prvm_prog_t *prog);
274 void VM_floor (prvm_prog_t *prog);
275 void VM_ceil (prvm_prog_t *prog);
276 void VM_nextent (prvm_prog_t *prog);
278 void VM_changelevel (prvm_prog_t *prog);
279 void VM_sin (prvm_prog_t *prog);
280 void VM_cos (prvm_prog_t *prog);
281 void VM_sqrt (prvm_prog_t *prog);
282 void VM_randomvec (prvm_prog_t *prog);
283 void VM_registercvar (prvm_prog_t *prog);
284 void VM_min (prvm_prog_t *prog);
285 void VM_max (prvm_prog_t *prog);
286 void VM_bound (prvm_prog_t *prog);
287 void VM_pow (prvm_prog_t *prog);
288 void VM_log (prvm_prog_t *prog);
289 void VM_asin (prvm_prog_t *prog);
290 void VM_acos (prvm_prog_t *prog);
291 void VM_atan (prvm_prog_t *prog);
292 void VM_atan2 (prvm_prog_t *prog);
293 void VM_tan (prvm_prog_t *prog);
295 void VM_Files_Init(prvm_prog_t *prog);
296 void VM_Files_CloseAll(prvm_prog_t *prog);
298 void VM_fopen(prvm_prog_t *prog);
299 void VM_fclose(prvm_prog_t *prog);
300 void VM_fgets(prvm_prog_t *prog);
301 void VM_fputs(prvm_prog_t *prog);
302 void VM_writetofile(prvm_prog_t *prog); // only used by menu
304 void VM_strlen(prvm_prog_t *prog);
305 void VM_strcat(prvm_prog_t *prog);
306 void VM_substring(prvm_prog_t *prog);
307 void VM_stov(prvm_prog_t *prog);
308 void VM_strzone(prvm_prog_t *prog);
309 void VM_strunzone(prvm_prog_t *prog);
311 // KrimZon - DP_QC_ENTITYDATA
312 void VM_numentityfields(prvm_prog_t *prog);
313 void VM_entityfieldname(prvm_prog_t *prog);
314 void VM_entityfieldtype(prvm_prog_t *prog);
315 void VM_getentityfieldstring(prvm_prog_t *prog);
316 void VM_putentityfieldstring(prvm_prog_t *prog);
318 // DRESK - String Length (not counting color codes)
319 void VM_strlennocol(prvm_prog_t *prog);
320 // DRESK - Decolorized String
321 void VM_strdecolorize(prvm_prog_t *prog);
322 // DRESK - String Uppercase and Lowercase Support
323 void VM_strtolower(prvm_prog_t *prog);
324 void VM_strtoupper(prvm_prog_t *prog);
326 void VM_clcommand (prvm_prog_t *prog);
328 void VM_tokenize (prvm_prog_t *prog);
329 void VM_tokenizebyseparator (prvm_prog_t *prog);
330 void VM_argv (prvm_prog_t *prog);
332 void VM_isserver(prvm_prog_t *prog);
333 void VM_clientcount(prvm_prog_t *prog);
334 void VM_clientstate(prvm_prog_t *prog);
335 // not used at the moment -> not included in the common list
336 void VM_getostype(prvm_prog_t *prog);
337 void VM_getmousepos(prvm_prog_t *prog);
338 void VM_gettime(prvm_prog_t *prog);
339 void VM_getsoundtime(prvm_prog_t *prog);
340 void VM_soundlength(prvm_prog_t *prog);
341 void VM_loadfromdata(prvm_prog_t *prog);
342 void VM_parseentitydata(prvm_prog_t *prog);
343 void VM_loadfromfile(prvm_prog_t *prog);
344 void VM_modulo(prvm_prog_t *prog);
346 void VM_search_begin(prvm_prog_t *prog);
347 void VM_search_end(prvm_prog_t *prog);
348 void VM_search_getsize(prvm_prog_t *prog);
349 void VM_search_getfilename(prvm_prog_t *prog);
350 void VM_chr(prvm_prog_t *prog);
351 void VM_iscachedpic(prvm_prog_t *prog);
352 void VM_precache_pic(prvm_prog_t *prog);
353 void VM_freepic(prvm_prog_t *prog);
354 void VM_drawcharacter(prvm_prog_t *prog);
355 void VM_drawstring(prvm_prog_t *prog);
356 void VM_drawcolorcodedstring(prvm_prog_t *prog);
357 void VM_stringwidth(prvm_prog_t *prog);
358 void VM_drawpic(prvm_prog_t *prog);
359 void VM_drawrotpic(prvm_prog_t *prog);
360 void VM_drawsubpic(prvm_prog_t *prog);
361 void VM_drawfill(prvm_prog_t *prog);
362 void VM_drawsetcliparea(prvm_prog_t *prog);
363 void VM_drawresetcliparea(prvm_prog_t *prog);
364 void VM_getimagesize(prvm_prog_t *prog);
366 void VM_findfont(prvm_prog_t *prog);
367 void VM_loadfont(prvm_prog_t *prog);
369 void VM_makevectors (prvm_prog_t *prog);
370 void VM_vectorvectors (prvm_prog_t *prog);
372 void VM_keynumtostring (prvm_prog_t *prog);
373 void VM_getkeybind (prvm_prog_t *prog);
374 void VM_findkeysforcommand (prvm_prog_t *prog);
375 void VM_stringtokeynum (prvm_prog_t *prog);
376 void VM_setkeybind (prvm_prog_t *prog);
377 void VM_getbindmaps (prvm_prog_t *prog);
378 void VM_setbindmaps (prvm_prog_t *prog);
380 void VM_cin_open(prvm_prog_t *prog);
381 void VM_cin_close(prvm_prog_t *prog);
382 void VM_cin_setstate(prvm_prog_t *prog);
383 void VM_cin_getstate(prvm_prog_t *prog);
384 void VM_cin_restart(prvm_prog_t *prog);
386 void VM_gecko_create(prvm_prog_t *prog);
387 void VM_gecko_destroy(prvm_prog_t *prog);
388 void VM_gecko_navigate(prvm_prog_t *prog);
389 void VM_gecko_keyevent(prvm_prog_t *prog);
390 void VM_gecko_movemouse(prvm_prog_t *prog);
391 void VM_gecko_resize(prvm_prog_t *prog);
392 void VM_gecko_get_texture_extent(prvm_prog_t *prog);
394 void VM_drawline (prvm_prog_t *prog);
396 void VM_bitshift (prvm_prog_t *prog);
398 void VM_altstr_count(prvm_prog_t *prog);
399 void VM_altstr_prepare(prvm_prog_t *prog);
400 void VM_altstr_get(prvm_prog_t *prog);
401 void VM_altstr_set(prvm_prog_t *prog);
402 void VM_altstr_ins(prvm_prog_t *prog);
404 void VM_buf_create(prvm_prog_t *prog);
405 void VM_buf_del (prvm_prog_t *prog);
406 void VM_buf_getsize (prvm_prog_t *prog);
407 void VM_buf_copy (prvm_prog_t *prog);
408 void VM_buf_sort (prvm_prog_t *prog);
409 void VM_buf_implode (prvm_prog_t *prog);
410 void VM_bufstr_get (prvm_prog_t *prog);
411 void VM_bufstr_set (prvm_prog_t *prog);
412 void VM_bufstr_add (prvm_prog_t *prog);
413 void VM_bufstr_free (prvm_prog_t *prog);
415 void VM_buf_loadfile(prvm_prog_t *prog);
416 void VM_buf_writefile(prvm_prog_t *prog);
417 void VM_bufstr_find(prvm_prog_t *prog);
418 void VM_matchpattern(prvm_prog_t *prog);
420 void VM_changeyaw (prvm_prog_t *prog);
421 void VM_changepitch (prvm_prog_t *prog);
423 void VM_uncolorstring (prvm_prog_t *prog);
425 void VM_strstrofs (prvm_prog_t *prog);
426 void VM_str2chr (prvm_prog_t *prog);
427 void VM_chr2str (prvm_prog_t *prog);
428 void VM_strconv (prvm_prog_t *prog);
429 void VM_strpad (prvm_prog_t *prog);
430 void VM_infoadd (prvm_prog_t *prog);
431 void VM_infoget (prvm_prog_t *prog);
432 void VM_strncmp (prvm_prog_t *prog);
433 void VM_strncmp (prvm_prog_t *prog);
434 void VM_strncasecmp (prvm_prog_t *prog);
435 void VM_registercvar (prvm_prog_t *prog);
436 void VM_wasfreed (prvm_prog_t *prog);
438 void VM_strreplace (prvm_prog_t *prog);
439 void VM_strireplace (prvm_prog_t *prog);
441 void VM_crc16(prvm_prog_t *prog);
442 void VM_digest_hex(prvm_prog_t *prog);
444 void VM_SetTraceGlobals(prvm_prog_t *prog, const trace_t *trace);
445 void VM_ClearTraceGlobals(prvm_prog_t *prog);
447 void VM_uri_escape (prvm_prog_t *prog);
448 void VM_uri_unescape (prvm_prog_t *prog);
449 void VM_whichpack (prvm_prog_t *prog);
451 void VM_etof (prvm_prog_t *prog);
452 void VM_uri_get (prvm_prog_t *prog);
453 void VM_netaddress_resolve (prvm_prog_t *prog);
455 void VM_tokenize_console (prvm_prog_t *prog);
456 void VM_argv_start_index (prvm_prog_t *prog);
457 void VM_argv_end_index (prvm_prog_t *prog);
459 void VM_buf_cvarlist(prvm_prog_t *prog);
460 void VM_cvar_description(prvm_prog_t *prog);
462 void VM_CL_getextresponse (prvm_prog_t *prog);
463 void VM_SV_getextresponse (prvm_prog_t *prog);
465 // Common functions between menu.dat and clsprogs
466 void VM_CL_isdemo (prvm_prog_t *prog);
467 void VM_CL_videoplaying (prvm_prog_t *prog);
469 void VM_isfunction(prvm_prog_t *prog);
470 void VM_callfunction(prvm_prog_t *prog);
472 void VM_sprintf(prvm_prog_t *prog);
474 void VM_getsurfacenumpoints(prvm_prog_t *prog);
475 void VM_getsurfacepoint(prvm_prog_t *prog);
476 void VM_getsurfacepointattribute(prvm_prog_t *prog);
477 void VM_getsurfacenormal(prvm_prog_t *prog);
478 void VM_getsurfacetexture(prvm_prog_t *prog);
479 void VM_getsurfacenearpoint(prvm_prog_t *prog);
480 void VM_getsurfaceclippedpoint(prvm_prog_t *prog);
481 void VM_getsurfacenumtriangles(prvm_prog_t *prog);
482 void VM_getsurfacetriangle(prvm_prog_t *prog);
485 void VM_physics_enable(prvm_prog_t *prog);
486 void VM_physics_addforce(prvm_prog_t *prog);
487 void VM_physics_addtorque(prvm_prog_t *prog);
489 void VM_coverage(prvm_prog_t *prog);