From 10c3f324b1d39ec1099a23461fd8f371ae0479c9 Mon Sep 17 00:00:00 2001 From: nat Date: Thu, 3 Mar 2016 21:38:55 +0000 Subject: Center game board on screen. OK from christos@. --- tetris/screen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tetris/screen.c') diff --git a/tetris/screen.c b/tetris/screen.c index 62d50a2d..193b2c6a 100644 --- a/tetris/screen.c +++ b/tetris/screen.c @@ -1,4 +1,4 @@ -/* $NetBSD: screen.c,v 1.31 2015/11/06 19:53:37 christos Exp $ */ +/* $NetBSD: screen.c,v 1.32 2016/03/03 21:38:55 nat Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -197,6 +197,7 @@ scr_set(void) MINCOLS, MINROWS); stop(""); /* stop() supplies \n */ } + Offset = (Rows - D_LAST + D_FIRST - 2) / 2; if (tcgetattr(0, &oldtt) < 0) stop("tcgetattr() fails"); newtt = oldtt; @@ -360,7 +361,7 @@ scr_update(void) putpad(exit_standout_mode); cur_so = 0; } - moveto(RTOD(j), CTOD(i)); + moveto(RTOD(j + Offset), CTOD(i)); } if (enter_standout_mode) { if (so != cur_so) { -- cgit v1.2.3-56-ge451