diff options
author | Bad Diode <bd@badd10de.dev> | 2023-04-23 21:28:41 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-04-23 21:28:41 +0200 |
commit | fba5fc17df5c5e2e6a56ca13844771984cf30dc7 (patch) | |
tree | 061249890247acd14b062c23314289d7187ae65c | |
parent | 4959741a7eaac3b429912a1ccfd7ebe06d41ef0d (diff) | |
download | stepper-fba5fc17df5c5e2e6a56ca13844771984cf30dc7.tar.gz stepper-fba5fc17df5c5e2e6a56ca13844771984cf30dc7.zip |
Add remaining UI elements for next RC
-rw-r--r-- | src/drawing.c | 11 | ||||
-rw-r--r-- | src/globals.c | 1 | ||||
-rw-r--r-- | src/main.c | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/drawing.c b/src/drawing.c index 83ffb50..7a3fff0 100644 --- a/src/drawing.c +++ b/src/drawing.c | |||
@@ -144,9 +144,9 @@ draw_right_col_cursor(int i, u8 clr) { | |||
144 | } | 144 | } |
145 | 145 | ||
146 | void | 146 | void |
147 | draw_current_step(u8 col) { | 147 | draw_current_step(u8 step, u8 col) { |
148 | size_t offset_x = TRIG_OFFSET_X * (step_counter % 8); | 148 | size_t offset_x = TRIG_OFFSET_X * (step % 8); |
149 | size_t offset_y = step_counter < 8 ? 2 : 2 + TRIG_OFFSET_Y; | 149 | size_t offset_y = step < 8 ? 2 : 2 + TRIG_OFFSET_Y; |
150 | size_t x0 = TRIG_START_X + 3 + offset_x; | 150 | size_t x0 = TRIG_START_X + 3 + offset_x; |
151 | size_t x1 = TRIG_START_X - 3 + TRIG_W + offset_x; | 151 | size_t x1 = TRIG_START_X - 3 + TRIG_W + offset_x; |
152 | size_t y = TRIG_START_Y - 4 + TRIG_H + offset_y; | 152 | size_t y = TRIG_START_Y - 4 + TRIG_H + offset_y; |
@@ -1251,11 +1251,15 @@ clear_cursors(void) { | |||
1251 | draw_channel_cursor(last_channel_loc, COL_BG); | 1251 | draw_channel_cursor(last_channel_loc, COL_BG); |
1252 | draw_pattern_cursor(last_pattern_loc, COL_BG); | 1252 | draw_pattern_cursor(last_pattern_loc, COL_BG); |
1253 | draw_right_col_cursor(last_right_col_loc, COL_BG); | 1253 | draw_right_col_cursor(last_right_col_loc, COL_BG); |
1254 | for (size_t i = 0; i < 16; i++) { | ||
1255 | draw_current_step(i, COL_GREY); | ||
1256 | } | ||
1254 | } | 1257 | } |
1255 | 1258 | ||
1256 | void | 1259 | void |
1257 | draw_cursors(void) { | 1260 | draw_cursors(void) { |
1258 | clear_cursors(); | 1261 | clear_cursors(); |
1262 | draw_current_step(step_counter, COL_RED); | ||
1259 | if (input_handler == handle_trigger_selection) { | 1263 | if (input_handler == handle_trigger_selection) { |
1260 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); | 1264 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); |
1261 | } | 1265 | } |
@@ -1277,5 +1281,6 @@ draw_cursors(void) { | |||
1277 | input_handler == handle_param_selection_wave || | 1281 | input_handler == handle_param_selection_wave || |
1278 | input_handler == handle_param_selection_noise) { | 1282 | input_handler == handle_param_selection_noise) { |
1279 | draw_params_cursor(param_selection_loc, COL_CURSOR); | 1283 | draw_params_cursor(param_selection_loc, COL_CURSOR); |
1284 | draw_trig_cursor(trig_selection_loc, COL_GREY); | ||
1280 | } | 1285 | } |
1281 | } | 1286 | } |
diff --git a/src/globals.c b/src/globals.c index e718dd4..34e9bb5 100644 --- a/src/globals.c +++ b/src/globals.c | |||
@@ -16,6 +16,7 @@ u32 last_trig_loc = 0; | |||
16 | u32 last_channel_loc = 0; | 16 | u32 last_channel_loc = 0; |
17 | u32 last_pattern_loc = 0; | 17 | u32 last_pattern_loc = 0; |
18 | u32 last_right_col_loc = 0; | 18 | u32 last_right_col_loc = 0; |
19 | u32 last_step_counter = 0; | ||
19 | 20 | ||
20 | // | 21 | // |
21 | // Color indexes. | 22 | // Color indexes. |
@@ -15,7 +15,7 @@ WITH REGARD TO THIS SOFTWARE. | |||
15 | #include "renderer_m0.c" | 15 | #include "renderer_m0.c" |
16 | #include "sequencer.c" | 16 | #include "sequencer.c" |
17 | 17 | ||
18 | #define PROF_ENABLE 1 | 18 | #define PROF_ENABLE 0 |
19 | #include "profiling.c" | 19 | #include "profiling.c" |
20 | 20 | ||
21 | void | 21 | void |
@@ -66,7 +66,6 @@ render(void) { | |||
66 | redraw_params = false; | 66 | redraw_params = false; |
67 | } | 67 | } |
68 | 68 | ||
69 | // PROF(draw_current_step(COL_RED), draw_cursor_cycles); | ||
70 | PROF(draw_cursors(), draw_cursor_cycles); | 69 | PROF(draw_cursors(), draw_cursor_cycles); |
71 | } | 70 | } |
72 | 71 | ||