X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg%2Fvg_debug.h;h=0f6f28ac0a0399fe0599fbb4f8fc717277251f7d;hb=3b9fa3ad6ac1ff919f31fafaeceac689c7c4736b;hp=333aed82ddc819b694a28315312e183962912903;hpb=ed4d77304bd5515253b4048fabbc9a4da81a6f44;p=fishladder.git diff --git a/vg/vg_debug.h b/vg/vg_debug.h index 333aed8..0f6f28a 100644 --- a/vg/vg_debug.h +++ b/vg/vg_debug.h @@ -1,5 +1,9 @@ +int sfx_debug = 0; + static void sfx_internal_debug_overlay(void) { + if( !sfx_debug ) return; + // Grab values struct sound_info { @@ -44,16 +48,6 @@ static void sfx_internal_debug_overlay(void) // UI part // ======== - - ui_begin( &ui_global_ctx, vg_window_x, vg_window_y ); - - // TODO: Find a more elegent form for this - int mouse_state = 0; - if( vg_get_button( "primary" ) ) mouse_state = 2; - if( vg_get_button_down( "primary" ) ) mouse_state = 1; - if( vg_get_button_up( "primary" ) ) mouse_state = 3; - - ui_set_mouse( &ui_global_ctx, vg_mouse[0], vg_mouse[1], mouse_state ); // Draw audio stack for( int i = 0; i < num_systems; i ++ ) @@ -91,13 +85,4 @@ static void sfx_internal_debug_overlay(void) ui_end_down( &ui_global_ctx ); ui_global_ctx.cursor[1] += 1; } - - ui_resolve( &ui_global_ctx ); - - m3x3f view = M3X3_IDENTITY; - m3x3_translate( view, (v3f){ -1.0f, 1.0f, 0.0f } ); - m3x3_scale( view, (v3f){ 1.0f/((float)vg_window_x*0.5f), -1.0f/((float)vg_window_y*0.5f), 1.0f } ); - vg_lines_drawall( (float*)view ); - - ui_draw( &ui_global_ctx ); }