Skip to content

Commit

Permalink
Mark fallthrough in piano example
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Mar 28, 2022
1 parent 086b66b commit d12e85e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions examples/piano/piano.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ void init() {

// set global volume
// volume = 2048;

screen.pen = Pen(0, 0, 0, 255);
screen.clear();
screen.clear();
}

void render(uint32_t time_ms) {
Expand All @@ -79,23 +79,30 @@ void render(uint32_t time_ms) {
switch(note % 12) {
case 11:
y += 10;
[[fallthrough]];
case 9:
y += 10;
[[fallthrough]];
case 7:
y += 10;
[[fallthrough]];
case 5:
y += 10;
[[fallthrough]];
case 4:
y += 10;
[[fallthrough]];
case 2:
y += 10;
[[fallthrough]];
case 0:
y_offset = 3;
if (pass == 1) continue;
screen.pen = Pen(255, 255, 255);
break;
case 3:
y += 10;
[[fallthrough]];
case 1:
y += 4;
w = 15;
Expand All @@ -106,8 +113,10 @@ void render(uint32_t time_ms) {
break;
case 10:
y += 10;
[[fallthrough]];
case 8:
y += 10;
[[fallthrough]];
case 6:
y += 34;
w = 15;
Expand Down Expand Up @@ -159,7 +168,7 @@ void render(uint32_t time_ms) {
10, 5
));

screen.watermark();
screen.watermark();
}

void play_selected_note() {
Expand Down Expand Up @@ -233,4 +242,4 @@ void update(uint32_t time_ms) {
beat = 0;
}
}

0 comments on commit d12e85e

Please sign in to comment.