X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg%2Fvg_debug.h;fp=vg%2Fvg_debug.h;h=333aed82ddc819b694a28315312e183962912903;hb=f8e80fde4a84a6b990ec17c067b2a95847ae744c;hp=ba61dd21a120e8685c247a828f58cc3077192c24;hpb=d7980e9e89e1e75ea457ff995fb199586260049c;p=fishladder.git diff --git a/vg/vg_debug.h b/vg/vg_debug.h index ba61dd2..333aed8 100644 --- a/vg/vg_debug.h +++ b/vg/vg_debug.h @@ -5,7 +5,9 @@ static void sfx_internal_debug_overlay(void) { float signal; const char *name; - u32 length, cursor, flags; + u32 cursor, flags; + + u32 buffer_length, clip_start, clip_end; } infos[ SFX_MAX_SYSTEMS ]; int num_systems; @@ -21,9 +23,21 @@ static void sfx_internal_debug_overlay(void) snd->signal = sys->signal_average; snd->name = sys->name; - snd->length = sys->end; snd->cursor = sys->cur; - snd->flags = sys->flags; + snd->flags = sys->flags; + + if( sys->thread_clone ) + { + snd->clip_start = sys->thread_clone->clip_start; + snd->clip_end = sys->thread_clone->clip_end; + snd->buffer_length = sys->thread_clone->buffer_length; + } + else + { + snd->clip_start = 0; + snd->clip_end = sys->end; + snd->buffer_length = sys->end; + } } MUTEX_UNLOCK( sfx_mux_t01 ); @@ -50,13 +64,28 @@ static void sfx_internal_debug_overlay(void) u32 alpha = (infos[i].flags & SFX_FLAG_GHOST)? 0x44000000: 0xff000000; ui_new_node( &ui_global_ctx ); - { + { ui_fill_rect( &ui_global_ctx, ui_global_ctx.cursor, 0x00333333 | alpha ); - ui_rect_pad( ui_global_ctx.cursor, 2 ); - ui_global_ctx.cursor[2] = (int)(((float)infos[i].cursor / (float)infos[i].length) * 150.0f); + ui_px baseline = ui_global_ctx.cursor[0]; + ui_px width_block_1 = (ui_px)(((float)infos[i].clip_start / (float)infos[i].buffer_length) * 150.0f); + ui_px width_block_2 = (ui_px)(((float)(infos[i].buffer_length-infos[i].clip_end) / (float)infos[i].buffer_length) * 150.0f ); + + ui_global_ctx.cursor[2] = width_block_1; + ui_fill_rect( &ui_global_ctx, ui_global_ctx.cursor, 0x77ffffff ); + + ui_global_ctx.cursor[2] = width_block_2; + ui_align_right( &ui_global_ctx ); ui_fill_rect( &ui_global_ctx, ui_global_ctx.cursor, 0x77ffffff ); + // Cursor + + ui_global_ctx.cursor[2] = 2; + ui_global_ctx.cursor[0] = baseline + (ui_px)(((float)infos[i].cursor / (float)infos[i].buffer_length) * 150.0f); + ui_fill_rect( &ui_global_ctx, ui_global_ctx.cursor, 0xffffffff ); + + ui_global_ctx.cursor[0] = baseline + 2; + ui_global_ctx.cursor[1] += 2; ui_text( &ui_global_ctx, infos[i].name, 1, 0 ); } ui_end_down( &ui_global_ctx );