Beispiel #1
0
// --------- begin of function SERes::far_sound ----------//
//
// as same as far_sound, but no cut_off volume
// usually used in acknowlege voice
//
void SERes::far_sound(short xLoc, short yLoc, short frame,
	char subjectType,short subjectId, char *action, char objectType,short objectId)
{
	//### begin trevor 20/8 ###//
	if( !config.sound_effect_flag )
		return;
	//### end trevor 20/8 ###//

	short relXLoc = xLoc - (world.zoom_matrix->top_x_loc + world.zoom_matrix->disp_x_loc/2);
	short relYLoc = yLoc - (world.zoom_matrix->top_y_loc + world.zoom_matrix->disp_y_loc/2);
	PosVolume posv(relXLoc, relYLoc);
	RelVolume relVolume( posv, 200, MAX_MAP_WIDTH );
	if( !config.pan_control )
		relVolume.ds_pan = 0;
	SEInfo *seInfo;

	if( relVolume.rel_vol < 80)
		relVolume.rel_vol = 80;

	if( (seInfo=scan(subjectType, subjectId, action, objectType, objectId))
		!= NULL && frame == seInfo->out_frame)
	{
		se_output->request(seInfo->effect_id, relVolume );
	}
}
Beispiel #2
0
//------- Begin of function World::process_ambient_sound -------//
//
void World::process_ambient_sound()
{
	int temp = weather.temp_c();
	if( weather.rain_scale() == 0 && temp >= 15 && misc.random(temp) >= 12)
	{
		int bird = misc.random(MAX_BIRD) + 1;
		char sndFile[] = "BIRDS00";
		err_when( bird > 99 );
		sndFile[5] = (bird / 10) + '0';
		sndFile[6] = (bird % 10) + '0';

		int xLoc = misc.random(max_x_loc) - (zoom_matrix->top_x_loc + zoom_matrix->center_x);
		int yLoc = misc.random(max_y_loc) - (zoom_matrix->top_y_loc + zoom_matrix->center_y);
		PosVolume p(PosVolume(xLoc, yLoc));
                RelVolume relVolume(p, 200, MAX_MAP_WIDTH);
		if( relVolume.rel_vol < 80)
			relVolume.rel_vol = 80;

		se_ctrl.request(sndFile, relVolume);
	}
}