maths api changes
[carveJwlIkooP6JGAAIwe30JlM.git] / audio.h
diff --git a/audio.h b/audio.h
index 51445b665b6edfc70e49a8d247e326bf90be157a..e6e76bdd22d5940a1ffb3beff528485d06b4854a 100644 (file)
--- a/audio.h
+++ b/audio.h
@@ -186,6 +186,8 @@ VG_STATIC void audio_ambient_sprite_play( v3f co, audio_clip *clip )
    audio_unlock();
 }
 
+VG_STATIC
+enum audio_sprite_type world_audio_sample_sprite_random(v3f origin, v3f output);
 VG_STATIC void audio_ambient_sprites_update( world_instance *world, v3f co )
 {
    static float accum = 0.0f;
@@ -201,11 +203,13 @@ VG_STATIC void audio_ambient_sprites_update( world_instance *world, v3f co )
    
    if( sprite_type != k_audio_sprite_type_none ){
       if( sprite_type == k_audio_sprite_type_grass ){
-         audio_ambient_sprite_play( sprite_pos, &audio_grass[rand()%4] );
+         audio_ambient_sprite_play( sprite_pos, &audio_grass[vg_randu32()%4] );
       }
       else if( sprite_type == k_audio_sprite_type_water ){
-         if( world->water.enabled )
-            audio_ambient_sprite_play( sprite_pos, &audio_water[rand()%6] );
+         if( world->water.enabled ){
+            audio_ambient_sprite_play( sprite_pos, 
+                                       &audio_water[vg_randu32()%6] );
+         }
       }
    }
 }