2 // Basically every vm builtin cmd should be in here.
3 // All 3 builtin and extension lists can be found here
4 // cause large (I think they will) parts are from pr_cmds the same copyright like in pr_cmds
9 ============================================================================
13 checkextension(string)
18 sprint(float clientnum,...[string])
19 centerprint(...[string])
20 vector normalize(vector)
22 float vectoyaw(vector)
23 vector vectoangles(vector)
27 cvar_set (string,string)
33 float stof(...[string])
36 entity find(entity start, .string field, string match)
38 entity findfloat(entity start, .float field, float match)
39 entity findentity(entity start, .entity field, entity match)
41 entity findchain(.string field, string match)
43 entity findchainfloat(.string field, float match)
44 entity findchainentity(.string field, entity match)
46 string precache_file(string)
47 string precache_sound (string sample)
55 entity nextent(entity)
60 float registercvar (string name, string value, float flags)
61 float min(float a, float b, ...[float])
62 float max(float a, float b, ...[float])
63 float bound(float min, float value, float max)
64 float pow(float a, float b)
65 copyentity(entity src, entity dst)
66 float fopen(string filename, float mode)
68 string fgets(float fhandle)
69 fputs(float fhandle, string s)
70 float strlen(string s)
71 string strcat(string,string,...[string])
72 string substring(string s, float start, float length)
74 string strzone(string s)
76 float tokenize(string s)
81 clientcommand(float client, string s) (for client and menu)
82 changelevel(string map)
83 localsound(string sample)
86 loadfromdata(string data)
87 loadfromfile(string file)
88 parseentitydata(entity ent, string data)
89 float mod(float val, float m)
90 const string cvar_string (string)
94 float search_begin(string pattern, float caseinsensitive, float quiet)
95 void search_end(float handle)
96 float search_getsize(float handle)
97 string search_getfilename(float handle, float num)
99 string chr(float ascii)
102 entity ftoe(float num)
104 -------will be removed soon----------
105 float altstr_count(string)
106 string altstr_prepare(string)
107 string altstr_get(string,float)
108 string altstr_set(string altstr, float num, string set)
109 string altstr_ins(string altstr, float num, string set)
110 --------------------------------------
112 entity findflags(entity start, .float field, float match)
113 entity findchainflags(.float field, float match)
115 const string VM_cvar_defstring (string)
117 perhaps only : Menu : WriteMsg
118 ===============================
120 WriteByte(float data, float dest, float desto)
121 WriteChar(float data, float dest, float desto)
122 WriteShort(float data, float dest, float desto)
123 WriteLong(float data, float dest, float desto)
124 WriteAngle(float data, float dest, float desto)
125 WriteCoord(float data, float dest, float desto)
126 WriteString(string data, float dest, float desto)
127 WriteEntity(entity data, float dest, float desto)
129 Client & Menu : draw functions & video functions (& gecko functions)
130 ===================================================
132 float iscachedpic(string pic)
133 string precache_pic(string pic)
135 float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag)
136 float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag)
137 float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag)
138 float stringwidth(string text, float handleColors)
139 float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag)
140 float drawsubpic(vector position, vector size, string pic, vector srcPos, vector srcSize, vector rgb, float alpha, float flag)
141 float drawfill(vector position, vector size, vector rgb, float alpha, float flag)
142 drawsetcliparea(float x, float y, float width, float height)
144 vector getimagesize(string pic)
146 float cin_open(string file, string name)
147 void cin_close(string name)
148 void cin_setstate(string name, float type)
149 float cin_getstate(string name)
150 void cin_restart(string name)
152 float[bool] gecko_create( string name )
153 void gecko_destroy( string name )
154 void gecko_navigate( string name, string URI )
155 float[bool] gecko_keyevent( string name, float key, float eventtype )
156 void gecko_mousemove( string name, float x, float y )
158 ==============================================================================
162 setkeydest(float dest)
164 setmousetarget(float target)
165 float getmousetarget()
167 callfunction(...,string function_name)
168 writetofile(float fhandle, entity ent)
169 float isfunction(string function_name)
170 vector getresolution(float number)
171 string keynumtostring(float keynum)
172 string findkeysforcommand(string command)
173 float getserverliststat(float type)
174 string getserverliststring(float fld, float hostnr)
176 float stringtokeynum(string key)
178 resetserverlistmasks()
179 setserverlistmaskstring(float mask, float fld, string str)
180 setserverlistmasknumber(float mask, float fld, float num, float op)
182 setserverlistsort(float field, float descending)
184 float getserverlistnumber(float fld, float hostnr)
185 float getserverlistindexforkey(string key)
186 addwantedserverlistkey(string key)
189 #include "quakedef.h"
190 #include "progdefs.h"
192 #include "clprogdefs.h"
193 #include "mprogdefs.h"
195 #include "cl_video.h"
196 #include "cl_gecko.h"
198 //============================================================================
199 // nice helper macros
201 #ifndef VM_NOPARMCHECK
202 #define VM_SAFEPARMCOUNTRANGE(p1,p2,f) if(prog->argc < p1 || prog->argc > p2) PRVM_ERROR(#f " wrong parameter count %i (" #p1 " to " #p2 " expected ) !", prog->argc)
203 #define VM_SAFEPARMCOUNT(p,f) if(prog->argc != p) PRVM_ERROR(#f " wrong parameter count %i (" #p " expected ) !", prog->argc)
205 #define VM_SAFEPARMCOUNTRANGE(p1,p2,f)
206 #define VM_SAFEPARMCOUNT(p,f)
209 #define VM_RETURN_EDICT(e) (((int *)prog->globals.generic)[OFS_RETURN] = PRVM_EDICT_TO_PROG(e))
211 #define VM_STRINGTEMP_LENGTH MAX_INPUTLINE
213 // builtins and other general functions
215 void VM_CheckEmptyString (const char *s);
216 void VM_VarString(int first, char *out, int outlength);
218 void VM_checkextension (void);
219 void VM_error (void);
220 void VM_objerror (void);
221 void VM_print (void);
222 void VM_bprint (void);
223 void VM_sprint (void);
224 void VM_centerprint (void);
225 void VM_normalize (void);
227 void VM_vectoyaw (void);
228 void VM_vectoangles (void);
229 void VM_random (void);
230 void VM_localsound(void);
231 void VM_break (void);
232 void VM_localcmd (void);
234 void VM_cvar_string(void);
235 void VM_cvar_defstring (void);
236 void VM_cvar_set (void);
237 void VM_dprint (void);
245 void VM_strftime(void);
246 void VM_spawn (void);
247 void VM_remove (void);
249 void VM_findfloat (void);
250 void VM_findchain (void);
251 void VM_findchainfloat (void);
252 void VM_findflags (void);
253 void VM_findchainflags (void);
254 void VM_precache_file (void);
255 void VM_precache_sound (void);
256 void VM_coredump (void);
258 void VM_stackdump (void);
259 void VM_crash(void); // REMOVE IT
260 void VM_traceon (void);
261 void VM_traceoff (void);
262 void VM_eprint (void);
264 void VM_floor (void);
266 void VM_nextent (void);
268 void VM_changelevel (void);
272 void VM_randomvec (void);
273 void VM_registercvar (void);
276 void VM_bound (void);
281 void VM_atan2 (void);
284 void VM_Files_Init(void);
285 void VM_Files_CloseAll(void);
288 void VM_fclose(void);
291 void VM_writetofile(void); // only used by menu
293 void VM_strlen(void);
294 void VM_strcat(void);
295 void VM_substring(void);
297 void VM_strzone(void);
298 void VM_strunzone(void);
300 // DRESK - String Length (not counting color codes)
301 void VM_strlennocol(void);
302 // DRESK - Decolorized String
303 void VM_strdecolorize(void);
304 // DRESK - String Uppercase and Lowercase Support
305 void VM_strtolower(void);
306 void VM_strtoupper(void);
308 void VM_clcommand (void);
310 void VM_tokenize (void);
311 void VM_tokenizebyseparator (void);
314 void VM_isserver(void);
315 void VM_clientcount(void);
316 void VM_clientstate(void);
317 // not used at the moment -> not included in the common list
318 void VM_getostype(void);
319 void VM_getmousepos(void);
320 void VM_gettime(void);
321 void VM_loadfromdata(void);
322 void VM_parseentitydata(void);
323 void VM_loadfromfile(void);
324 void VM_modulo(void);
326 void VM_search_begin(void);
327 void VM_search_end(void);
328 void VM_search_getsize(void);
329 void VM_search_getfilename(void);
331 void VM_iscachedpic(void);
332 void VM_precache_pic(void);
333 void VM_freepic(void);
334 void VM_drawcharacter(void);
335 void VM_drawstring(void);
336 void VM_drawcolorcodedstring(void);
337 void VM_stringwidth(void);
338 void VM_drawpic(void);
339 void VM_drawsubpic(void);
340 void VM_drawfill(void);
341 void VM_drawsetcliparea(void);
342 void VM_drawresetcliparea(void);
343 void VM_getimagesize(void);
345 void VM_makevectors (void);
346 void VM_vectorvectors (void);
348 void VM_keynumtostring (void);
349 void VM_stringtokeynum (void);
351 void VM_cin_open( void );
352 void VM_cin_close( void );
353 void VM_cin_setstate( void );
354 void VM_cin_getstate( void );
355 void VM_cin_restart( void );
357 void VM_gecko_create( void );
358 void VM_gecko_destroy( void );
359 void VM_gecko_navigate( void );
360 void VM_gecko_keyevent( void );
361 void VM_gecko_movemouse( void );
362 void VM_gecko_resize( void );
363 void VM_gecko_get_texture_extent( void );
365 void VM_drawline (void);
367 void VM_bitshift (void);
369 void VM_altstr_count( void );
370 void VM_altstr_prepare( void );
371 void VM_altstr_get( void );
372 void VM_altstr_set( void );
373 void VM_altstr_ins(void);
375 void VM_buf_create(void);
376 void VM_buf_del (void);
377 void VM_buf_getsize (void);
378 void VM_buf_copy (void);
379 void VM_buf_sort (void);
380 void VM_buf_implode (void);
381 void VM_bufstr_get (void);
382 void VM_bufstr_set (void);
383 void VM_bufstr_add (void);
384 void VM_bufstr_free (void);
386 void VM_changeyaw (void);
387 void VM_changepitch (void);
389 void VM_uncolorstring (void);
391 void VM_strstrofs (void);
392 void VM_str2chr (void);
393 void VM_chr2str (void);
394 void VM_strconv (void);
395 void VM_strpad (void);
396 void VM_infoadd (void);
397 void VM_infoget (void);
398 void VM_strncmp (void);
399 void VM_strncmp (void);
400 void VM_strncasecmp (void);
401 void VM_registercvar (void);
402 void VM_wasfreed (void);
404 void VM_strreplace (void);
405 void VM_strireplace (void);
409 void VM_SetTraceGlobals(const trace_t *trace);
411 void VM_Cmd_Init(void);
412 void VM_Cmd_Reset(void);