more comprehensive audio visualizer
[fishladder.git] / fishladder.c
index dec99e2c266da40d93d327e18c01164bcdf7421c..e024fca71987265a050db88d2a0be6b4f99317de 100644 (file)
@@ -597,6 +597,7 @@ void vg_update(void)
                else
                        world.selected = -1;
        }
+       else world.selected = -1;
        
        // Simulation stop/start
        if( vg_get_button_down("go") )
@@ -611,11 +612,15 @@ void vg_update(void)
                                world.io[i].recv_count = 0;
                        
                        vg_info( "Stopping simulation!\n" );
+                       
+                       sfx_system_fadeout( &audio_system_balls_rolling, 44100 );
                }
                else
                {
                        vg_success( "Starting simulation!\n" );
                        
+                       sfx_set_playrnd( &audio_rolls, &audio_system_balls_rolling, 0, 1 );
+                       
                        world.simulating = 1;
                        world.num_fishes = 0;
                        world.sim_frame = 0;
@@ -636,7 +641,8 @@ void vg_update(void)
        {
                while( world.sim_frame < (int)((vg_time-world.sim_start)*2.0f) )
                {
-                       vg_info( "frame: %u\n", world.sim_frame );
+                       //vg_info( "frame: %u\n", world.sim_frame );
+                       sfx_set_playrnd( &audio_random, &audio_system_balls_switching, 0, 9 );
                        
                        for( int i = 0; i < arrlen( world.io ); i ++ )
                        {
@@ -755,7 +761,10 @@ void vg_update(void)
                                        fish->alive = 0;
                                else
                                        if( cell_entry->config == k_cell_type_split )
+                                       {
+                                               sfx_set_playrnd( &audio_splitter, &audio_system_balls_important, 0, 1 );
                                                cell_entry->state |= FLAG_FLIP_ROTATING;
+                                       }
                        }
                        
                        world.sim_frame ++;
@@ -1093,4 +1102,5 @@ void vg_render(void)
 void vg_ui(void)
 {
        //ui_test();
+       sfx_internal_debug_overlay();
 }