Beispiel #1
0
Datei: title.c Projekt: rzel/dim3
void title_open(void)
{
	int			buffer_idx;
	
		// titles
		
	gui_initialize(title_dir,title_name);
	
		// sound

	if (title_sound_name[0]!=0x0) {
		buffer_idx=al_find_buffer(title_sound_name);
		al_play_source(buffer_idx,NULL,1.0f,FALSE,FALSE,TRUE,FALSE);
	}

		// fades
		
	title_fade_tick=-1;
	title_fade_mode=title_fade_mode_in;
	
		// force server state, there are a couple
		// places where this isn't being switch in,
		// like an app intro
		
	server.state=gs_title;
}
Beispiel #2
0
void map_set_ambient(char *name,float pitch)
{
	strcpy(map_ambient_name,name);
	map_ambient_pitch=pitch;
	
	map_ambient_buffer_idx=al_find_buffer(name);
	if (map_ambient_buffer_idx==-1) {
		map_ambient_idx=-1;
		map_ambient_name[0]=0x0;
		return;
	}

	map_ambient_idx=al_play_source(map_ambient_buffer_idx,NULL,pitch,TRUE,FALSE,TRUE,FALSE);
}
Beispiel #3
0
void map_restart_ambient(void)
{
	if (map_ambient_idx!=-1) {
		map_ambient_idx=al_play_source(map_ambient_buffer_idx,NULL,map_ambient_pitch,TRUE,FALSE,TRUE,FALSE);
	}
}
Beispiel #4
0
void model_animation_effect_launch(model_draw *draw,int animate_idx,int pose_idx)
{
	int						t;
	bool					global;
	d3pnt					pnt;
	model_type				*mdl;
	model_draw_setup		*setup;
	model_animate_type		*animate;
	model_pose_move_type	*pose_move;
	
	if (draw->model_idx==-1) return;

	setup=&draw->setup;
	mdl=server.model_list.models[draw->model_idx];
	
	animate=&mdl->animates[animate_idx];
	if ((pose_idx<0) || (pose_idx>=animate->npose_move)) return;
	
	pose_move=&animate->pose_moves[pose_idx];

		// sounds
		
	if (pose_move->sound.name[0]!=0x0) {
		model_animation_effect_launch_bone_position(draw,animate_idx,pose_move->pose_idx,pose_move->sound.bone_idx,&pnt);

		global=pose_move->sound.no_position;		// only use global sounds if launched by player
		if (!draw->player) global=FALSE;

		if ((!app.dedicated_host) && (pose_move->sound.buffer_idx!=-1)) {
			al_play_source(pose_move->sound.buffer_idx,&pnt,pose_move->sound.pitch,FALSE,FALSE,global,draw->player);
			object_watch_sound_alert(&pnt,draw->connect.obj_idx,pose_move->sound.name);	// sound watches
		}
		
		if ((net_setup.mode!=net_mode_none) && (draw->connect.net_sound)) {
			if (draw->connect.obj_idx!=-1) net_client_send_sound(server.obj_list.objs[draw->connect.obj_idx],&pnt,pose_move->sound.pitch,pose_move->sound.name);
		}
	}

		// mesh fades

	if (pose_move->mesh_fade.mesh_idx!=-1) {
		model_mesh_fade_start(draw,pose_move->mesh_fade.mesh_idx,pose_move->mesh_fade.fade_in_msec,pose_move->mesh_fade.fade_life_msec,pose_move->mesh_fade.fade_out_msec);
	}
	
		// flash
		
	if (pose_move->flash.intensity!=0) {
		model_animation_effect_launch_bone_position(draw,animate_idx,pose_move->pose_idx,pose_move->flash.bone_idx,&pnt);
		effect_spawn_flash(&pnt,&pose_move->flash.col,pose_move->flash.intensity,pose_move->flash.exponent,pose_move->flash.flash_msec,pose_move->flash.fade_msec);
	}
	
		// shake
		
	if (pose_move->shake.distance!=0) {
		effect_spawn_shake(&pnt,pose_move->shake.distance,pose_move->shake.size,pose_move->shake.life_msec);
	}
	
		// particles
		
	for (t=0;t!=pose_move->particle.count;t++) {
		if (pose_move->particle.particles[t].particle_idx!=-1) {
			model_animation_effect_launch_bone_position(draw,animate_idx,pose_move->pose_idx,pose_move->particle.particles[t].bone_idx,&pnt);
			model_animation_effect_launch_particle(&pose_move->particle.particles[t],&pnt,&setup->ang,&draw->connect,pose_move->particle.particles[t].bone_idx);
		}
	}

		// rings
		
	for (t=0;t!=pose_move->ring.count;t++) {
		if (pose_move->ring.rings[t].ring_idx!=-1) {
			model_animation_effect_launch_bone_position(draw,animate_idx,pose_move->pose_idx,pose_move->ring.rings[t].bone_idx,&pnt);
			model_animation_effect_launch_ring(&pose_move->ring.rings[t],&pnt,&setup->ang,&draw->connect);
		}
	}
}