diff options
| author | 2019-10-23 18:08:20 -0400 | |
|---|---|---|
| committer | 2019-10-23 18:08:20 -0400 | |
| commit | ce7bc0b52aa8db24eb417786763be843efcd640b (patch) | |
| tree | 4f586a54416c947c0ccb40c8434bf07865756591 /frontends/curses | |
| parent | dc753ff2db5234dcfbac0eea4250e68d4455aef0 (diff) | |
| download | cetris-ce7bc0b52aa8db24eb417786763be843efcd640b.tar.gz cetris-ce7bc0b52aa8db24eb417786763be843efcd640b.tar.bz2 cetris-ce7bc0b52aa8db24eb417786763be843efcd640b.zip | |
optimize memory further (530 bytes) and refactor srs
Diffstat (limited to 'frontends/curses')
| -rw-r--r-- | frontends/curses/curses_ui.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/frontends/curses/curses_ui.c b/frontends/curses/curses_ui.c index 94b6141..f3ebaa8 100644 --- a/frontends/curses/curses_ui.c +++ b/frontends/curses/curses_ui.c @@ -145,19 +145,15 @@ void draw_board() { }
int index = game.current_index;
- attron(COLOR_PAIR(game.piece_queue[index].t));
+ attron(COLOR_PAIR(game.piece_queue[index]));
for (int x = 0; x < 4; x++) {
for (int y = 0; y < 4; y++) {
- if (game.piece_queue[index].m[y][x]) {
- if (game.piece_queue[index].t == MINO_I || game.piece_queue[index].t == MINO_O) {
- mvaddstr(6 + y, (x * 2) + 36, BLOCK);
- } else {
- mvaddstr(6 + y, (x * 2) + 37, BLOCK);
- }
+ if ((default_matrices[game.piece_queue[index]][y]>>(3 - x))&1) {
+ mvaddstr(6 + y, (x * 2) + 36, BLOCK);
}
}
}
- attroff(COLOR_PAIR(game.piece_queue[index].t));
+ attroff(COLOR_PAIR(game.piece_queue[index]));
attron(A_BOLD);
|