diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -21,8 +21,6 @@ WITH REGARD TO THIS SOFTWARE. | |||
21 | 21 | ||
22 | void | 22 | void |
23 | render(void) { | 23 | render(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 | } |