Exemplo n.º 1
0
/*
* S_HandleSetListernerCmd
*/
static unsigned S_HandleSetListernerCmd( const sndCmdSetListener_t *cmd )
{
	//Com_Printf("S_HandleSetListernerCmd\n");
	S_SetListener( cmd->origin, cmd->velocity, cmd->axis );
	S_UpdateSources();
	return sizeof( *cmd );
}
Exemplo n.º 2
0
/*
* S_Update
*/
void S_Update( const vec3_t origin, const vec3_t velocity, const vec3_t forward, const vec3_t right, const vec3_t up, qboolean avidump )
{
	float orientation[6];

	orientation[0] = forward[0];
	orientation[1] = forward[1];
	orientation[2] = forward[2];
	orientation[3] = up[0];
	orientation[4] = up[1];
	orientation[5] = up[2];

	qalListenerfv( AL_POSITION, origin );
	qalListenerfv( AL_VELOCITY, velocity );
	qalListenerfv( AL_ORIENTATION, orientation );

	S_UpdateSources();
	S_UpdateStream();
	S_UpdateMusic();

	s_volume->modified = qfalse; // Checked by src and stream
	s_musicvolume->modified = qfalse; // Checked by stream and music

	if( s_doppler->modified )
	{
		if( s_doppler->value > 0.0f )
			qalDopplerFactor( s_doppler->value );
		else
			qalDopplerFactor( 0.0f );
		s_doppler->modified = qfalse;
	}

	if( s_sound_velocity->modified )
	{
		qalDopplerVelocity( s_sound_velocity->value > 0.0f ? s_sound_velocity->value : 0.0f );
		if( qalSpeedOfSound )
			qalSpeedOfSound( s_sound_velocity->value > 0.0f ? s_sound_velocity->value : 0.0f );
		s_sound_velocity->modified = qfalse;
	}
}