aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-23 19:43:33 +0200
committerBad Diode <bd@badd10de.dev>2023-04-23 19:43:33 +0200
commiteeeacde00c589cb227746b164a39372356d1eeec (patch)
treebc95e0501f4b1cee72d1e9939ef4c1a0a033e0cd /src/main.c
parentec5c1ad9f16772434f0f49811c87ec58a3569e83 (diff)
downloadstepper-eeeacde00c589cb227746b164a39372356d1eeec.tar.gz
stepper-eeeacde00c589cb227746b164a39372356d1eeec.zip
Fix a couple of rendering corner cases
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index b6be6b9..aa5bd43 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,8 +21,6 @@ WITH REGARD TO THIS SOFTWARE.
21 21
22void 22void
23render(void) { 23render(void) {
24 // TODO: Decouple update from rendering.
25 // PROF(screen_fill(0), clear_cycles);
26 PROF(draw_rect(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 1), clear_cycles); 24 PROF(draw_rect(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 1), clear_cycles);
27 if (redraw_trigs) { 25 if (redraw_trigs) {
28 PROF(draw_triggers(), draw_trigs_cycles); 26 PROF(draw_triggers(), draw_trigs_cycles);
@@ -51,10 +49,17 @@ render(void) {
51 } 49 }
52 if (redraw_piano_note) { 50 if (redraw_piano_note) {
53 PROF(draw_piano(), draw_piano_cycles); 51 PROF(draw_piano(), draw_piano_cycles);
54 // TODO: Draw the notes currently playing with a fade off animation for 52 if (input_handler != handle_trigger_selection &&
55 // the first 3 channels. 53 input_handler != handle_param_selection_sq1 &&
56 TriggerNote *trig = get_current_trig(); 54 input_handler != handle_param_selection_sq2 &&
57 PROF(draw_note(trig->note, COL_NOTE_PRESSED), draw_piano_cycles); 55 input_handler != handle_param_selection_wave &&
56 input_handler != handle_param_selection_noise) {
57 // TODO: Show last/current played notes in all channels.
58 } else {
59 // Show currently selected trigger note.
60 TriggerNote *trig = get_current_trig();
61 PROF(draw_note(trig->note, COL_NOTE_PRESSED), draw_piano_cycles);
62 }
58 redraw_piano_note = false; 63 redraw_piano_note = false;
59 } 64 }
60 if (redraw_params) { 65 if (redraw_params) {
@@ -97,6 +102,7 @@ main(void) {
97 FRAME_START(); 102 FRAME_START();
98 PROF(flip_buffer(), flip_cycles); 103 PROF(flip_buffer(), flip_cycles);
99 PROF(handle_sequencer_input(), input_cycles); 104 PROF(handle_sequencer_input(), input_cycles);
105 // TODO: Update function to performa animations, etc.
100 PROF(render(), render_cycles); 106 PROF(render(), render_cycles);
101 FRAME_END(); 107 FRAME_END();
102 } 108 }