From: hgn Date: Thu, 20 Mar 2025 03:31:04 +0000 (+0000) Subject: exit X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=26c2245f957f5b22e38a0c0bf931872e4ffc7f35;p=carveJwlIkooP6JGAAIwe30JlM.git exit --- diff --git a/shaders/workshop_compositor.fs b/shaders/workshop_compositor.fs index fd5ddf8..9a1ed10 100644 --- a/shaders/workshop_compositor.fs +++ b/shaders/workshop_compositor.fs @@ -11,6 +11,11 @@ void main() { vec4 c = texture( uTexMain, aUv.xy ); + if( uDecal == 0 ) + { + c.rgb = c.rgb*uColour.rgb; + } + if( uDecal == 1 ) { vec4 d = texture( uTexDecal, aUv.zw ); diff --git a/src/board_maker.c b/src/board_maker.c index 45a4fe4..1d6cde5 100644 --- a/src/board_maker.c +++ b/src/board_maker.c @@ -456,6 +456,15 @@ void _board_maker_ui( ui_context *ctx ) ui_fill( ctx, bib, colour ); } + ui_rect quit_box; + ui_split( panel, k_ui_axis_h, -24, 0, panel, quit_box ); + + bool quit_me = 0; + if( ui_button_text( ctx, quit_box, "Exit", 1 ) == k_ui_button_click ) + { + quit_me = 1; + } + if( _board_maker.ui_state == k_board_maker_ui_state_pick_colour ) { _board_maker.pop_panel[0] = root[0] + root[2] + 8; @@ -598,6 +607,12 @@ void _board_maker_ui( ui_context *ctx ) ui_rect box = { vg.window_x-(400+8),8, 400,400 }; ui_image( ctx, box, &_board_maker.compositor_fb.attachments[0].id ); ui_outline( ctx, box, 1, ui_colour( ctx, k_ui_fg ), 0 ); + + if( quit_me ) + { + if( world_clear_event( k_world_event_board_maker ) ) + _board_maker_close(); + } } void _board_maker_open(void) @@ -625,3 +640,25 @@ void _board_maker_open(void) browser->mode = k_filebrowser_mode_pick_file; browser->filter = 0x1 << k_media_type_image; } + +void _board_maker_close(void) +{ + for( u32 i=0; i