Provide an option to restore traditional black-and-white mode.

This commit is contained in:
pgoyette 2014-07-13 16:23:55 +00:00
parent fb7d7d5abf
commit 68006fcab2
4 changed files with 18 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: screen.c,v 1.28 2014/06/11 16:47:39 christos Exp $ */
/* $NetBSD: screen.c,v 1.29 2014/07/13 16:23:55 pgoyette Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -98,6 +98,8 @@ static void
setcolor(int c)
{
char *buf;
if (nocolor == 1)
return;
if (set_a_foreground == NULL)
return;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: tetris.6,v 1.11 2005/09/15 02:09:42 wiz Exp $
.\" $NetBSD: tetris.6,v 1.12 2014/07/13 16:23:55 pgoyette Exp $
.\"
.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
@ -40,7 +40,7 @@
.Nd the game of tetris
.Sh SYNOPSIS
.Nm
.Op Fl ps
.Op Fl cps
.Op Fl k Ar keys
.Op Fl l Ar level
.Sh DESCRIPTION
@ -73,6 +73,11 @@ quit
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl c
By default, shapes are displayed colorfully if the user's CRT supports color.
The
.Fl c
option can be used to restore the traditional black-and-white behavior.
.It Fl k
The default control keys can be changed using the
.Fl k

View File

@ -1,4 +1,4 @@
/* $NetBSD: tetris.c,v 1.25 2014/06/11 16:47:39 christos Exp $ */
/* $NetBSD: tetris.c,v 1.26 2014/07/13 16:23:55 pgoyette Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -73,6 +73,7 @@ gid_t gid, egid;
char key_msg[100];
int showpreview;
int nocolor;
static void elide(void);
static void setup_board(void);
@ -144,8 +145,11 @@ main(int argc, char *argv[])
keys = "jkl pq";
while ((ch = getopt(argc, argv, "k:l:ps")) != -1)
while ((ch = getopt(argc, argv, "ck:l:ps")) != -1)
switch(ch) {
case 'c':
nocolor = 1;
break;
case 'k':
if (strlen(keys = optarg) != 6)
usage();

View File

@ -1,4 +1,4 @@
/* $NetBSD: tetris.h,v 1.13 2014/06/11 16:47:39 christos Exp $ */
/* $NetBSD: tetris.h,v 1.14 2014/07/13 16:23:55 pgoyette Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -168,6 +168,7 @@ extern gid_t gid, egid;
extern char key_msg[100];
extern int showpreview;
extern int nocolor;
int fits_in(const struct shape *, int);
void place(const struct shape *, int, int);