sfx_set_t audio_tile_mod =
{
.sources = "\
-sound/mod00.ogg\0\
-sound/mod01.ogg\0\
-sound/mod02.ogg\0\
-sound/mod03.ogg\0",
+sound/mod_01.ogg\0\
+sound/mod_02.ogg\0\
+sound/mod_03.ogg\0\
+sound/mod_04.ogg\0\
+sound/mod_05.ogg\0\
+sound/mod_06.ogg\0",
.flags = 0
};
if( vg_get_button_down("primary") )
{
world.data[ world.selected ].state ^= FLAG_CANAL;
- sfx_set_playrnd( &audio_tile_mod, &audio_system_sfx );
+
+ if( world.data[ world.selected ].state & FLAG_CANAL )
+ sfx_set_playrnd( &audio_tile_mod, &audio_system_sfx, 3, 6 );
+ else
+ sfx_set_playrnd( &audio_tile_mod, &audio_system_sfx, 0, 3 );
}
}
else
}
// Pick a random sound from the buffer and play it into system
-void sfx_set_playrnd( sfx_set_t *source, sfx_system_t *sys )
+void sfx_set_playrnd( sfx_set_t *source, sfx_system_t *sys, int min_id, int max_id )
{
if( !source->numsegments )
{
return;
}
- int pick = rand() % source->numsegments;
-
+ int pick = (rand() % (max_id-min_id)) + min_id;
+
sys->source = source->main;
sys->cur = source->segments[ pick*2 + 0 ];
sys->end = source->segments[ pick*2 + 1 ];