const char *sample;
int channel;
prvm_edict_t *entity;
- float volume;
+ float fvolume;
float attenuation;
float pitchchange;
float startposition;
entity = PRVM_G_EDICT(OFS_PARM0);
channel = (int)PRVM_G_FLOAT(OFS_PARM1);
sample = PRVM_G_STRING(OFS_PARM2);
- volume = PRVM_G_FLOAT(OFS_PARM3);
+ fvolume = PRVM_G_FLOAT(OFS_PARM3);
attenuation = PRVM_G_FLOAT(OFS_PARM4);
- if (volume < 0 || volume > 1)
+ if (fvolume < 0 || fvolume > 1)
{
VM_Warning(prog, "VM_CL_sound: volume must be in range 0-1\n");
return;
}
CL_VM_GetEntitySoundOrigin(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), org);
- S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, startposition, flags, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
+ S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, fvolume, attenuation, startposition, flags, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
}
// #483 void(vector origin, string sample, float volume, float attenuation) pointsound
static void VM_CL_pointsound(prvm_prog_t *prog)
{
const char *sample;
- float volume;
+ float fvolume;
float attenuation;
vec3_t org;
VectorCopy( PRVM_G_VECTOR(OFS_PARM0), org);
sample = PRVM_G_STRING(OFS_PARM1);
- volume = PRVM_G_FLOAT(OFS_PARM2);
+ fvolume = PRVM_G_FLOAT(OFS_PARM2);
attenuation = PRVM_G_FLOAT(OFS_PARM3);
- if (volume < 0 || volume > 1)
+ if (fvolume < 0 || fvolume > 1)
{
VM_Warning(prog, "VM_CL_pointsound: volume must be in range 0-1\n");
return;
}
// Send World Entity as Entity to Play Sound (for CSQC, that is MAX_EDICTS)
- S_StartSound(MAX_EDICTS, 0, S_FindName(sample), org, volume, attenuation);
+ S_StartSound(MAX_EDICTS, 0, S_FindName(sample), org, fvolume, attenuation);
}
// #14 entity() spawn
//============================================================================
//[515]: SCENE MANAGER builtins
+extern cvar_t v_yshearing;
void CSQC_R_RecalcView (void)
{
extern matrix4x4_t viewmodelmatrix_nobob;
extern matrix4x4_t viewmodelmatrix_withbob;
Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, cl.csqc_vieworigin[0], cl.csqc_vieworigin[1], cl.csqc_vieworigin[2], cl.csqc_viewangles[0], cl.csqc_viewangles[1], cl.csqc_viewangles[2], 1);
+ if (v_yshearing.value > 0)
+ Matrix4x4_QuakeToDuke3D(&r_refdef.view.matrix, &r_refdef.view.matrix, v_yshearing.value);
Matrix4x4_Copy(&viewmodelmatrix_nobob, &r_refdef.view.matrix);
Matrix4x4_ConcatScale(&viewmodelmatrix_nobob, cl_viewmodel_scale.value);
Matrix4x4_Concat(&viewmodelmatrix_withbob, &r_refdef.view.matrix, &cl.csqc_viewmodelmatrixfromengine);
VM_SAFEPARMCOUNT(1, VM_CL_project);
VectorCopy(PRVM_G_VECTOR(OFS_PARM0), f);
- Matrix4x4_Invert_Simple(&m, &r_refdef.view.matrix);
+ Matrix4x4_Invert_Full(&m, &r_refdef.view.matrix);
Matrix4x4_Transform(&m, f, v);
if(v_flipped.integer)
v[1] = -v[1];
else
{
// queue the polygon as 3D for sorted transparent rendering later
- int i;
if (polys->max_triangles < polys->num_triangles + polys->begin_vertices-2)
{
while (polys->max_triangles < polys->num_triangles + polys->begin_vertices-2)