text3d
[carveJwlIkooP6JGAAIwe30JlM.git] / audio.h
diff --git a/audio.h b/audio.h
index eb58b267412cd67e9bc0b6cf5614f97df51310fe..d52f410defd3cebef94613ba19c348e3612d85b6 100644 (file)
--- a/audio.h
+++ b/audio.h
 VG_STATIC float audio_occlusion_current = 0.0f,
              k_audio_occlusion_rate  = 1.0f;
 
-VG_STATIC int   k_audio_debug_soundscape = 0;
+VG_STATIC int k_audio_debug_soundscape = 0;
 
 audio_clip audio_board[] =
 {
    { .path="sound/skate_hpf.ogg" },
    { .path="sound/wheel.ogg" },
    { .path="sound/slide.ogg" },
-   { .path="sound/reverb.ogg" },
-   { .path="sound/grind_loop.ogg" },
    { .path="sound/grind_enter.ogg" },
-   { .path="sound/grind_exit.ogg" }
+   { .path="sound/grind_exit.ogg" },
+   { .path="sound/grind_loop.ogg" },
+   { .path="sound/woodslide.ogg" },
+   { .path="sound/metalscrape.ogg" },
+   { .path="sound/slidetap.ogg" }
+};
+
+audio_clip audio_taps[] =
+{
+   { .path="sound/tap0.ogg" },
+   { .path="sound/tap1.ogg" },
+   { .path="sound/tap2.ogg" },
+   { .path="sound/tap3.ogg" }
+};
+
+audio_clip audio_hits[] =
+{
+   { .path="sound/hit0.ogg" },
+   { .path="sound/hit1.ogg" },
+   { .path="sound/hit2.ogg" },
+   { .path="sound/hit3.ogg" },
+   { .path="sound/hit4.ogg" }
 };
 
 audio_clip audio_splash =
@@ -126,11 +145,6 @@ audio_clip audio_ui[] = {
    { .path = "sound/ui_ding.ogg" },
 };
 
-audio_clip audio_music[] = {
-   { .path = "sound/song.ogg", .flags = k_audio_format_vorbis },
-   { .path = "sound/skate.ogg", .flags = k_audio_format_vorbis },
-};
-
 #if 0
 audio_player ambient_sprites[4] =
 {
@@ -195,12 +209,13 @@ VG_STATIC void audio_init(void)
 #endif
 
    audio_clip_loadn( audio_board, vg_list_size(audio_board), NULL );
+   audio_clip_loadn( audio_taps, vg_list_size(audio_taps), NULL );
+   audio_clip_loadn( audio_hits, vg_list_size(audio_hits), NULL );
    audio_clip_loadn( audio_ambience, vg_list_size(audio_ambience), NULL );
    audio_clip_loadn( &audio_splash, 1, NULL );
    audio_clip_loadn( &audio_gate_pass, 1, NULL );
    audio_clip_loadn( &audio_gate_lap, 1, NULL );
    audio_clip_loadn( &audio_gate_ambient, 1, NULL );
-   audio_clip_loadn( audio_music, vg_list_size(audio_music), NULL );
 
    audio_clip_loadn( audio_jumps, vg_list_size(audio_jumps), NULL );
    audio_clip_loadn( audio_lands, vg_list_size(audio_lands), NULL );
@@ -384,17 +399,14 @@ VG_STATIC enum audio_sprite_type audio_sample_sprite_random( v3f origin,
 
    world_instance *world = get_active_world();
    
-   if( ray_world( world, pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) )
-   {
-      struct world_material *mat = ray_hit_material( world, &contact );
+   if( ray_world( world, pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) ){
+      struct world_surface *mat = ray_hit_surface( world, &contact );
 
-      if( mat->info.surface_prop == k_surface_prop_grass) 
-      {
+      if( mat->info.surface_prop == k_surface_prop_grass){
          v3_copy( contact.pos, output );
          return k_audio_sprite_type_grass;
       }
-      else
-      {
+      else{
 #if 0
          vg_line( pos, contact.pos, 0xff0000ff );
          vg_line_pt3( contact.pos, 0.3f, 0xff0000ff );