mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-31 01:24:43 +02:00
allow dynamic switching of graphics stripping
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@216 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
6a0ceb9af0
commit
38503b374a
28
ttyplay.c
28
ttyplay.c
@ -188,11 +188,23 @@ ttypread (FILE * fp, Header * h, char **buf, int pread)
|
|||||||
{ /* a user hits a character? */
|
{ /* a user hits a character? */
|
||||||
char c;
|
char c;
|
||||||
read (STDIN_FILENO, &c, 1); /* drain the character */
|
read (STDIN_FILENO, &c, 1); /* drain the character */
|
||||||
|
static int stripped = NO_GRAPHICS;
|
||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'q':
|
case 'q':
|
||||||
return READ_EOF;
|
return READ_EOF;
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
switch (stripped)
|
||||||
|
{
|
||||||
|
case NO_GRAPHICS: populate_gfx_array ((stripped = DEC_GRAPHICS)); break;
|
||||||
|
case DEC_GRAPHICS: populate_gfx_array ((stripped = IBM_GRAPHICS)); break;
|
||||||
|
case IBM_GRAPHICS: populate_gfx_array ((stripped = NO_GRAPHICS)); break;
|
||||||
|
}
|
||||||
|
return READ_RESTART;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'm':
|
case 'm':
|
||||||
if (!loggedin)
|
if (!loggedin)
|
||||||
{
|
{
|
||||||
@ -219,13 +231,10 @@ ttywrite (char *buf, int len)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (bstripgfx)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
for (i = 0; i < len; i++)
|
buf[i] = strip_gfx (buf[i]);
|
||||||
{
|
}
|
||||||
buf[i] = strip_gfx (buf[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fwrite (buf, 1, len, stdout);
|
fwrite (buf, 1, len, stdout);
|
||||||
}
|
}
|
||||||
@ -389,10 +398,7 @@ ttyplay_main (char *ttyfile, int mode, int rstripgfx)
|
|||||||
FILE *input = stdin;
|
FILE *input = stdin;
|
||||||
struct termios old, new;
|
struct termios old, new;
|
||||||
|
|
||||||
/* strip graphics mode flag */
|
populate_gfx_array (NO_GRAPHICS);
|
||||||
bstripgfx = rstripgfx;
|
|
||||||
if (bstripgfx)
|
|
||||||
populate_gfx_array (DEC_GRAPHICS);
|
|
||||||
|
|
||||||
seek_offset_clrscr = 0;
|
seek_offset_clrscr = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user