diff --git a/src/core/core.h b/src/core/core.h index b52cd25..db0559c 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -27,7 +27,7 @@ typedef double f64; #define fn #define gb -#define locl +#define locl static #if PLATFORM_WASM #define gb_wasm_export __attribute__((visibility("default"))) diff --git a/src/core/core_lexer.h b/src/core/core_lexer.h index 53b4464..cdcf26b 100644 --- a/src/core/core_lexer.h +++ b/src/core/core_lexer.h @@ -57,7 +57,7 @@ enum lex_kind_t { X(lex_kind_arrow , "'->' arrow" , "->" )\ X(lex_kind_question , "'?' question mark" , "?" )\ X(lex_kind_tag , "'@' tag sign" , "@" )\ - X(lex_kind_escape , "'\' escape" , "\\" )\ + X(lex_kind_escape , "'\\' escape" , "\\" )\ X(lex_kind_preproc_null , "preproc_null" , "---" )\ X(lex_kind_preproc_define , "preproc_define" , "---" )\ X(lex_kind_preproc_ifdef , "preproc_ifdef" , "---" )\ diff --git a/src/ui/ui.c b/src/ui/ui.c index b824c9c..edf2cb7 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -295,8 +295,8 @@ fn r2f32_t window_rect_from_frame(app_frame_t *frame) { } fn void ui__draw_box(app_frame_t *frame, ui_box_t *box) { - box->final_rect = box->full_rect; - r2f32_t rect = box->final_rect; + r2f32_t rect = box->full_rect; + box->final_rect = r2f32_intersect(box->full_rect, ui->clip_rect); v4f32_t rect_color = primary_color_global; if (!v4f32_is_null(box->background_color)) rect_color = box->background_color; @@ -587,12 +587,13 @@ fn void ui_demo_update(app_frame_t *frame) { ui_box_t *item_box = ui_box0((ui_box_flags_t){.draw_rect = true, .clip_rect = true}); ui_set_rect(item_box, r2f32_cut_left(&ui->top->rect, ui_max)); - static f32 scroller_value; ui_set_text_align(ui_text_align_left) ui_set_top(item_box) { for (i32 i = 0; i < lengthof(tweak_table); i += 1) { mt_tweak_t *tweak = tweak_table + i; - if (s8_starts_with(tweak->name, s8_lit("_"), false)) continue; + if (s8_starts_with(tweak->name, s8_lit("_"), false)) { + continue; + } if (tweak->type->kind == type_kind_b32) { b32 *n = (b32 *)tweak->ptr; @@ -613,6 +614,7 @@ fn void ui_demo_update(app_frame_t *frame) { ui_serial_type(&ui_test_event, type(app_event_t)); } + locl f32 scroller_value; // @todo: fix scroller to match mouse defer_block(ui_push_top(scroller_box), ui_pop_top()) { f32 item_count = (f32)item_box->node_count; diff --git a/todo.txt b/todo.txt index c8752a8..f496294 100644 --- a/todo.txt +++ b/todo.txt @@ -13,25 +13,34 @@ [?] wasm (explore) [ ] win32 [ ] linux -[ ] gfx - [ ] simple 2d - [ ] revisit api - [x] change name, hard to type + +[ ] render + [ ] fix opengl warnings on win32 + [ ] wasm (maybe try first without opengl and then opengl) <<<<<<<<<<< [ ] ui [ ] text input + [ ] everything lister (with edits etc.) + [ ] demo style, with different buttons and controls, headings + [ ] palette idea, also push pop palette + [ ] push pop flag [ ] color picker [ ] slider - [ ] custom image as part of design - [ ] demo with different buttons and controls, headings + [ ] draw image in box ui [ ] core + [ ] ast + [ ] move to core layer at some point as the abstract format for different types of serialization + [ ] use bit fields instead of ast_flag + [ ] mt_tag syntax // f32 value; mt_tag(min = 0, min = 10) // mt_tag(something) + [ ] remove most flags + [ ] explore metadata flags for common formats aka (key_value, list etc.. will + [ ] json format + [ ] ini format [x] remove dates and time from core [ ] meta [x] prototype something like templates, readable string generation - [ ] mt_tag syntax // f32 value; mt_tag(min = 0, min = 10) // mt_tag(something) - [ ] remove flags [x] search for python snippets and execute meta.py script on that file [x] simplify logging!!!! [x] somehow index properly the meta files and ignore generated files