X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=clvm_cmds.c;h=5547057df3f3a5e42246291ae02c928728cfdb87;hb=eb529936e63194bad80c9a4896a85a7a2e3610c6;hp=9e8cbb430877ddbf74783cd1429a0a79d1a6854d;hpb=a4e10bde7cdd08e59fa07f76a9c01c71804f7b3a;p=xonotic%2Fdarkplaces.git diff --git a/clvm_cmds.c b/clvm_cmds.c index 9e8cbb43..5547057d 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -162,6 +162,37 @@ static void VM_CL_sound (void) S_StartSound(32768 + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), entity->fields.client->origin, volume, attenuation); } +// #483 void(vector origin, string sample, float volume, float attenuation) pointsound +static void VM_CL_pointsound(void) +{ + const char *sample; + float volume; + float attenuation; + vec3_t org; + + VM_SAFEPARMCOUNT(4, VM_CL_pointsound); + + VectorCopy( PRVM_G_VECTOR(OFS_PARM0), org); + sample = PRVM_G_STRING(OFS_PARM1); + volume = PRVM_G_FLOAT(OFS_PARM2); + attenuation = PRVM_G_FLOAT(OFS_PARM3); + + if (volume < 0 || volume > 1) + { + VM_Warning("VM_CL_pointsound: volume must be in range 0-1\n"); + return; + } + + if (attenuation < 0 || attenuation > 4) + { + VM_Warning("VM_CL_pointsound: attenuation must be in range 0-4\n"); + return; + } + + // Send World Entity as Entity to Play Sound (for CSQC, that is 32768) + S_StartSound(32768, 0, S_FindName(sample), org, volume, attenuation); +} + // #14 entity() spawn static void VM_CL_spawn (void) { @@ -3044,9 +3075,9 @@ VM_drawpic, // #322 float(vector position, string pic, vector size, vector VM_drawfill, // #323 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill (EXT_CSQC) VM_drawsetcliparea, // #324 void(float x, float y, float width, float height) drawsetcliparea VM_drawresetcliparea, // #325 void(void) drawresetcliparea -NULL, // #326 -NULL, // #327 -NULL, // #328 +VM_drawcolorcodedstring, // #326 float drawcolorcodedstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) (EXT_CSQC) +NULL, // #327 // FIXME add stringwidth() here? +NULL, // #328 // FIXME add drawsubpic() here? NULL, // #329 VM_CL_getstatf, // #330 float(float stnum) getstatf (EXT_CSQC) VM_CL_getstati, // #331 float(float stnum) getstati (EXT_CSQC) @@ -3202,9 +3233,9 @@ VM_tokenizebyseparator, // #479 float(string s) tokenizebyseparator (DP_QC_TOK VM_strtolower, // #480 string(string s) VM_strtolower (DP_QC_STRING_CASE_FUNCTIONS) VM_strtoupper, // #481 string(string s) VM_strtoupper (DP_QC_STRING_CASE_FUNCTIONS) VM_cvar_defstring, // #482 string(string s) cvar_defstring (DP_QC_CVAR_DEFSTRING) -NULL, // #483 -NULL, // #484 -NULL, // #485 +VM_CL_pointsound, // #483 void(vector origin, string sample, float volume, float attenuation) (DP_SV_POINTSOUND) +VM_strreplace, // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE) +VM_strireplace, // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE) NULL, // #486 NULL, // #487 NULL, // #488