Module Name: src Committed By: christos Date: Fri Nov 6 19:53:37 UTC 2015
Modified Files: src/games/tetris: screen.c tetris.c Log Message: PR/50411: Rin Okuyama: fix two bugs: - clear blocks in the 0 row, otherwise the pile up forever. - black (white) blocks are not shown as "next shape": To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/games/tetris/screen.c \ src/games/tetris/tetris.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/games/tetris/screen.c diff -u src/games/tetris/screen.c:1.30 src/games/tetris/screen.c:1.31 --- src/games/tetris/screen.c:1.30 Tue Jul 7 18:53:25 2015 +++ src/games/tetris/screen.c Fri Nov 6 14:53:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: screen.c,v 1.30 2015/07/07 22:53:25 nat Exp $ */ +/* $NetBSD: screen.c,v 1.31 2015/11/06 19:53:37 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -330,8 +330,8 @@ scr_update(void) putstr("Next shape:"); /* draw */ - putpad(enter_standout_mode); setcolor(nextshape->color); + putpad(enter_standout_mode); moveto(r, 2*c); putstr(" "); for(i=0; i<3; i++) { Index: src/games/tetris/tetris.c diff -u src/games/tetris/tetris.c:1.30 src/games/tetris/tetris.c:1.31 --- src/games/tetris/tetris.c:1.30 Sat Jun 13 00:53:13 2015 +++ src/games/tetris/tetris.c Fri Nov 6 14:53:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tetris.c,v 1.30 2015/06/13 04:53:13 dholland Exp $ */ +/* $NetBSD: tetris.c,v 1.31 2015/11/06 19:53:37 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -116,6 +116,8 @@ elide(void) tsleep(); while (--base != 0) board[base + B_COLS] = board[base]; + /* don't forget to clear 0th row */ + memset(&board[1], 0, B_COLS - 2); scr_update(); tsleep(); break;