stuff
[carveJwlIkooP6JGAAIwe30JlM.git] / world_audio.h
index e6ee331a8ee1267e91c6194e750e441008de4b89..2de8bf2b07402f429e9bc4d42ad3a7b23117bc2e 100644 (file)
@@ -2,14 +2,19 @@
 #define WORLD_AUDIO_H
 
 #include "common.h"
+#include "vg/vg_audio.h"
 #include "audio.h"
 
-sfx_set audio_birds =
+#if 0
+audio_pack audio_birds =
 {
    .sources = "sound/bird0.ogg\0"
               "sound/bird1.ogg\0"
-              "sound/bird2.ogg\0"
+              "sound/bird2.ogg\0",
+   .name = "Birds",
+   .source_mode = k_audio_source_compressed
 };
+#endif
 
 static float k_audio_random_freq = 1.0f/10.0f,
              k_audio_random_hz   = 1.0f;
@@ -18,14 +23,15 @@ static double world_audio_last_tick = 0.0;
 
 static struct world_ambient_layer
 {
-   sfx_system sys;
+   audio_player sys;
    v3f pos;
 }
 world_ambient_layers[8];
 
 static void world_audio_init(void)
 {
-   sfx_set_init( &audio_birds, NULL );
+#if 0
+   audio_pack_init( &audio_birds );
 
    vg_convar_push( (struct vg_convar){
       .name = "aud_random_freq",
@@ -38,17 +44,18 @@ static void world_audio_init(void)
    for( int i=0; i<vg_list_size(world_ambient_layers); i++ )
    {
       struct world_ambient_layer *layer = &world_ambient_layers[i];
-      sfx_system *sys = &layer->sys;
-      sys->vol = 1.0f;
+      audio_player *sys = &layer->sys;
+      sys->_vol = 1.0f;
       sys->ch  = 1;
-      sys->vol_src = &audio_vol_all;
       sys->name = "ambient";
       sys->flags = SFX_FLAG_PERSISTENT;
    }
+#endif
 }
 
 static void world_audio_spawn_random( v3f around )
 {
+#if 0
    for( int i=0; i<vg_list_size(world_ambient_layers); i++ )
    {
       struct world_ambient_layer *layer = &world_ambient_layers[i];
@@ -64,10 +71,12 @@ static void world_audio_spawn_random( v3f around )
          return;
       }
    }
+#endif
 }
 
 static void world_audio_update( v3f around, v3f ears )
 {
+#if 0
    if( world_audio_last_tick + (double)k_audio_random_hz < vg_time )
    {
       world_audio_last_tick = vg_time;
@@ -85,12 +94,14 @@ static void world_audio_update( v3f around, v3f ears )
       struct world_ambient_layer *layer = &world_ambient_layers[i];
 
       if( layer->sys.is_playing )
-         audio_spacialize( &layer->sys, layer->pos, around, ears, 30.0f );
+         audio_player_spacialize(&layer->sys, layer->pos, around, ears, 30.0f);
    }
+#endif
 }
 
 static void world_audio_debug(void)
 {
+#if 0
    for( int i=0; i<vg_list_size(world_ambient_layers); i++ )
    {
       struct world_ambient_layer *layer = &world_ambient_layers[i];
@@ -100,6 +111,7 @@ static void world_audio_debug(void)
          vg_line_pt3( layer->pos, 1.0f, 0xffff00ff );
       }
    }
+#endif
 }
 
 #endif /* WORLD_AUDIO_H */