Apply loop shorthand macros (#17159)

This commit is contained in:
Scott Lahteine
2020-03-13 23:18:16 -05:00
committed by GitHub
parent a96be32fae
commit 118bd2f8b2
93 changed files with 465 additions and 505 deletions

View File

@@ -140,13 +140,13 @@ void BrickoutGame::game_screen() {
// Draw bricks
if (PAGE_CONTAINS(BRICK_TOP, BRICK_BOT)) {
for (uint8_t y = 0; y < BRICK_ROWS; ++y) {
LOOP_L_N(y, BRICK_ROWS) {
const uint8_t yy = y * BRICK_H + BRICK_TOP;
if (PAGE_CONTAINS(yy, yy + BRICK_H - 1)) {
for (uint8_t x = 0; x < BRICK_COLS; ++x) {
LOOP_L_N(x, BRICK_COLS) {
if (TEST(bdat.bricks[y], x)) {
const uint8_t xx = x * BRICK_W;
for (uint8_t v = 0; v < BRICK_H - 1; ++v)
LOOP_L_N(v, BRICK_H - 1)
if (PAGE_CONTAINS(yy + v, yy + v))
u8g.drawHLine(xx, yy + v, BRICK_W - 1);
}