X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_replay.c;fp=player_replay.c;h=2bd1ab22c8cf889c5d64720c235f3f69a7682e6d;hb=5a233469f45ee7cbdc89cb87956f9ef2989ad1b5;hp=50ffc5ca564a7a8af2743ddedbe536c2fe044356;hpb=d74362c9d867f465d887ccd0df36c07efb5e125c;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_replay.c b/player_replay.c index 50ffc5c..2bd1ab2 100644 --- a/player_replay.c +++ b/player_replay.c @@ -846,7 +846,7 @@ static void replay_fly_edit_keyframe( replay_keyframe *kf ) } /* move freecam */ - vg_ui.wants_mouse = 0; + ui_capture_mouse(0); freecam_preupdate(); if( vg_getkey(SDLK_q) ) @@ -967,7 +967,7 @@ void skaterift_replay_imgui(void) ui_text( timeline, "0s", 1, k_ui_align_middle_right, 0 ); if( !player_replay.editor_mode ) return; - vg_ui.wants_mouse = 1; + ui_capture_mouse(1); ui_rect panel = { 0, timeline[3] + 20, 200, 400 }; ui_fill( panel, ui_opacity( ui_colour(k_ui_bg), 0.5f ) ); @@ -984,7 +984,7 @@ void skaterift_replay_imgui(void) ui_rect script = { 0, height + 2, vg.window_x, 16 }; ui_fill( script, ui_colour( k_ui_bg ) ); - f64 mouse_t = start + ((f64)vg_ui.mouse[0] / (f64)vg.window_x)*len; + f64 mouse_t = start + ((f64)g_ui_ctx->mouse[0] / (f64)vg.window_x)*len; /* keyframe draw and select */ bool absorb_by_keyframe = 0; @@ -1007,7 +1007,7 @@ void skaterift_replay_imgui(void) /* keyframe selection */ ui_rect tag = { x, script[1], 16, 16 }; - if( ui_inside_rect( tag, vg_ui.mouse ) ) + if( ui_inside_rect( tag, g_ui_ctx->mouse ) ) { absorb_by_keyframe = 1; @@ -1036,7 +1036,7 @@ void skaterift_replay_imgui(void) bool pos_correct = 0; - if( ui_inside_rect( dragbar, vg_ui.mouse_click ) ) + if( ui_inside_rect( dragbar, g_ui_ctx->mouse_click ) ) { if( ui_clicking( UI_MOUSE_LEFT ) ) { @@ -1062,15 +1062,15 @@ void skaterift_replay_imgui(void) if( pos_correct ) { - tag[0] = vg_ui.mouse[0]-8; + tag[0] = g_ui_ctx->mouse[0]-8; tray[0] = tag[0]+8-32; dragbar[0] = tray[0]+16; } } - if( ui_inside_rect( dragbar, vg_ui.mouse ) ) + if( ui_inside_rect( dragbar, g_ui_ctx->mouse ) ) { - vg_ui.cursor = k_ui_cursor_hand; + g_ui_ctx->cursor = k_ui_cursor_hand; } if( !pos_correct ) @@ -1111,11 +1111,11 @@ void skaterift_replay_imgui(void) } /* adding keyframes */ - if( ui_inside_rect( script, vg_ui.mouse ) ) + if( ui_inside_rect( script, g_ui_ctx->mouse ) ) { - vg_ui.cursor = k_ui_cursor_hand; + g_ui_ctx->cursor = k_ui_cursor_hand; - ui_rect cursor = { vg_ui.mouse[0], script[1], 4, 16 }; + ui_rect cursor = { g_ui_ctx->mouse[0], script[1], 4, 16 }; ui_fill( cursor, ui_colour( k_ui_fg ) ); if( !absorb_by_keyframe && ui_click_down( UI_MOUSE_LEFT ) ) @@ -1143,12 +1143,12 @@ void skaterift_replay_imgui(void) /* timeline scrub */ bool start_in_timeline = ui_clicking(UI_MOUSE_LEFT) && - ui_inside_rect(timeline, vg_ui.mouse_click); - if( (ui_inside_rect( timeline, vg_ui.mouse )) || start_in_timeline ) + ui_inside_rect(timeline, g_ui_ctx->mouse_click); + if( (ui_inside_rect( timeline, g_ui_ctx->mouse )) || start_in_timeline ) { - ui_rect cursor = { vg_ui.mouse[0], timeline[1], 4, timeline[3] }; + ui_rect cursor = { g_ui_ctx->mouse[0], timeline[1], 4, timeline[3] }; ui_fill( cursor, ui_colour( k_ui_fg ) ); - vg_ui.cursor = k_ui_cursor_ibeam; + g_ui_ctx->cursor = k_ui_cursor_ibeam; if( ui_clicking( UI_MOUSE_LEFT ) && start_in_timeline ) {