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;
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)
browser->mode = k_filebrowser_mode_pick_file;
browser->filter = 0x1 << k_media_type_image;
}
+
+void _board_maker_close(void)
+{
+ for( u32 i=0; i<k_workshop_shader_part_max; i ++ )
+ {
+ struct board_maker_decal *decal = &_board_maker.decals[i];
+ clear_decal( decal );
+ }
+ vg_framebuffer_free( &_board_maker.compositor_fb );
+
+ free( _board_maker.browser );
+ _board_maker.browser = NULL;
+
+ vg_allocator_free( _board_maker.static_heap );
+ vg_allocator_free( _board_maker.template_heap );
+
+ _board_maker.static_heap = NULL;
+ _board_maker.template_heap = NULL;
+ _board_maker.state = k_board_maker_state_not_ready;
+ mdl_sync_std_unload( &_board_maker.template_mdl );
+ _board_maker.model_loaded = 0;
+}