mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
added airjump sound. added the option to choose sound device
This commit is contained in:
parent
e02afe76dd
commit
c4915c5bd9
|
@ -86,6 +86,12 @@ sounds {
|
|||
"data/audio/foley_land-04.wv"
|
||||
}
|
||||
|
||||
player_airjump {
|
||||
"data/audio/foley_dbljump-01.wv"
|
||||
"data/audio/foley_dbljump-02.wv"
|
||||
"data/audio/foley_dbljump-03.wv"
|
||||
}
|
||||
|
||||
player_jump {
|
||||
"data/audio/foley_foot_left-01.wv"
|
||||
"data/audio/foley_foot_left-02.wv"
|
||||
|
|
|
@ -208,7 +208,6 @@ static void mix(short *final_out, unsigned frames)
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
/* release the lock */
|
||||
lock_release(sound_lock);
|
||||
|
||||
|
@ -249,9 +248,24 @@ int snd_init()
|
|||
|
||||
mixing_rate = config.snd_rate;
|
||||
|
||||
params.device = Pa_GetDefaultOutputDevice();
|
||||
{
|
||||
int num = Pa_GetDeviceCount();
|
||||
int i;
|
||||
const PaDeviceInfo *info;
|
||||
|
||||
for(i = 0; i < num; i++)
|
||||
{
|
||||
info = Pa_GetDeviceInfo(i);
|
||||
dbg_msg("snd", "device #%d name='%s'", i, info->name);
|
||||
}
|
||||
}
|
||||
|
||||
params.device = config.snd_device;
|
||||
if(params.device == -1)
|
||||
params.device = Pa_GetDefaultOutputDevice();
|
||||
if(params.device < 0)
|
||||
return 1;
|
||||
dbg_msg("snd", "device = %d", params.device);
|
||||
params.channelCount = 2;
|
||||
params.sampleFormat = paInt16;
|
||||
params.suggestedLatency = Pa_GetDeviceInfo(params.device)->defaultLowOutputLatency;
|
||||
|
|
|
@ -22,6 +22,7 @@ MACRO_CONFIG_INT(b_max_requests, 10, 0, 1000)
|
|||
MACRO_CONFIG_INT(snd_rate, 48000, 0, 0)
|
||||
MACRO_CONFIG_INT(snd_enable, 1, 0, 1)
|
||||
MACRO_CONFIG_INT(snd_volume, 100, 0, 100)
|
||||
MACRO_CONFIG_INT(snd_device, -1, 0, 0)
|
||||
|
||||
MACRO_CONFIG_INT(gfx_screen_width, 800, 0, 0)
|
||||
MACRO_CONFIG_INT(gfx_screen_height, 600, 0, 0)
|
||||
|
|
|
@ -802,7 +802,7 @@ extern "C" void modc_predict()
|
|||
if(events&COREEVENT_AIR_JUMP)
|
||||
{
|
||||
create_air_jump_effect(pos);
|
||||
snd_play_random(CHN_WORLD, SOUND_PLAYER_JUMP, 1.0f, pos);
|
||||
snd_play_random(CHN_WORLD, SOUND_PLAYER_AIRJUMP, 1.0f, pos);
|
||||
}
|
||||
//if(events&COREEVENT_HOOK_LAUNCH) snd_play_random(CHN_WORLD, SOUND_HOOK_LOOP, 1.0f, pos);
|
||||
if(events&COREEVENT_HOOK_ATTACH_PLAYER) snd_play_random(CHN_WORLD, SOUND_HOOK_ATTACH_PLAYER, 1.0f, pos);
|
||||
|
|
|
@ -1093,7 +1093,7 @@ void player::tick_defered()
|
|||
if(events&COREEVENT_GROUND_JUMP) create_sound(pos, SOUND_PLAYER_JUMP, mask);
|
||||
if(events&COREEVENT_AIR_JUMP)
|
||||
{
|
||||
create_sound(pos, SOUND_PLAYER_JUMP, mask);
|
||||
create_sound(pos, SOUND_PLAYER_AIRJUMP, mask);
|
||||
ev_common *c = (ev_common *)::events.create(EVENT_AIR_JUMP, sizeof(ev_common), mask);
|
||||
if(c)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue