diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-03-06 01:29:13 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-03-06 01:29:13 +0100 |
commit | b2133daa1bc8d86e9b00ce0339c22bb49b14179c (patch) | |
tree | da4be595cc790572c435b79c675b822649034f26 /source | |
parent | 9fc7653a331a6d03d1e937f1d7dd7a2619f712e2 (diff) | |
download | saw-b2133daa1bc8d86e9b00ce0339c22bb49b14179c.zip |
Cleanup
Diffstat (limited to 'source')
-rw-r--r-- | source/saw/main.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/source/saw/main.c b/source/saw/main.c index 47c6a31..fe09a8e 100644 --- a/source/saw/main.c +++ b/source/saw/main.c @@ -133,12 +133,6 @@ enum { // typedef struct { - i64 value; - i64 num; // numerator - i64 den; // denominator -} saw_rate_t; - -typedef struct { b8 enabled; i64 time; f64 duration; @@ -3487,29 +3481,35 @@ static void saw_frame(void) { case UI_DEV: { // FIXME - i64 time_rate = 256; - saw_ui_grid_item_t items[100] = { 0 }; + static const i64 time_rate = 256; + static saw_ui_grid_item_t items[100] = { 0 }; - saw_ui_grid_t grid = { - .x0 = 20., - .y0 = 20., - .width = frame_width - 40., - .height = frame_height - 40., + static saw_ui_grid_t grid = { + .x0 = 0., + .y0 = 0., + .width = 0., + .height = 0., .offset_x = 0., .offset_y = 0., .scale_x = 1., .scale_y = 1., .time_begin = 0, .time_end = time_rate * 10, - .time_cursor = (saw_playback_frame * time_rate) / - SAMPLE_RATE, - .time_rate = time_rate, - .time_num = 4, - .time_den = 4, - .items_size = sizeof items / sizeof *items, - .items = items, + .time_cursor = 0, + .time_rate = time_rate, + .time_num = 4, + .time_den = 4, + .items_size = sizeof items / sizeof *items, + .items = items, }; + grid.x0 = 20.; + grid.y0 = 20.; + grid.width = frame_width - 40.; + grid.height = frame_height - 40.; + grid.time_cursor = (saw_playback_frame * time_rate) / + SAMPLE_RATE; + saw_ui_grid(&grid); } break; |