root/trunk/src/main-gcu.c

Revision 507, 17.0 kB (checked in by takkaria, 9 months ago)

Update file headers to the new GPL template for files which are 100%, known, entirely-GPL.

Line 
1 /*
2  * File: main-gcu.c
3  * Purpose: Support for "curses" systems
4  *
5  * Copyright (c) 1997 Ben Harrison, and others
6  *
7  * This work is free software; you can redistribute it and/or modify it
8  * under the terms of either:
9  *
10  * a) the GNU General Public License as published by the Free Software
11  *    Foundation, version 2, or
12  *
13  * b) the "Angband licence":
14  *    This software may be copied and distributed for educational, research,
15  *    and not for profit purposes provided that this copyright and statement
16  *    are included in all such copies.  Other copyrights may also apply.
17  */
18 #include "angband.h"
19
20
21 /*
22  * This file provides support for Angband using the Curses library.  To use
23  * it, define USE_GCU in your makefile, and if you are using the ncurses
24  * library, also add USE_NCURSES.
25  *
26  *
27  * Note that this file is not *intended* to support non-Unix machines, nor is
28  * it intended to support VMS or other bizarre setups.  It should, however,
29  * work with most versions of "curses" or "ncurses".
30  *
31  * This package assumes that the underlying "curses" handles both the "nonl()"
32  * and "cbreak()" commands correctly, see the "OPTION" below.
33  *
34  *
35  * See also "USE_CAP" and "main-cap.c" for code that bypasses "curses"
36  * and uses the "termcap" information directly, or even bypasses the
37  * "termcap" information and sends direct vt100 escape sequences.
38  *
39  * This file provides up to 4 term windows, or alternatively, bigscreen
40  * support.
41  *
42  * This file will attempt to redefine the screen colors to conform to
43  * standard Angband colors.  It will only do so if the terminal type
44  * indicates that it can do so.
45  *
46  * Consider the use of "savetty()" and "resetty()".  XXX XXX XXX
47  */
48
49
50 #ifdef USE_GCU
51
52 #include "main.h"
53
54 /*
55  * Hack -- play games with "bool" and "term"
56  */
57 #undef bool
58
59 /* Avoid 'struct term' name conflict with <curses.h> (via <term.h>) on AIX */
60 #define term System_term
61
62
63 /*
64  * Include the proper "header" file
65  */
66 #ifdef USE_NCURSES
67 # ifdef HAVE_STDBOOL_H
68 define NCURSES_ENABLE_STDBOOL_H 0
69 # endif
70
71 # include <ncurses.h>
72 #else
73 # include <curses.h>
74 #endif
75
76 #undef term
77
78
79
80 /*
81  * Use POSIX terminal I/O
82  */
83 #define USE_TPOSIX
84
85
86 /*
87  * Hack -- Windows Console mode uses PDCURSES and cannot do any terminal stuff
88  * Hack -- Windows needs Sleep(), and I really don't want to pull in all
89  *         the Win32 headers for this one function
90  */
91 #if defined(WIN32_CONSOLE_MODE)
92 # undef USE_TPOSIX
93 _stdcall void Sleep(int);
94 #define usleep(v) Sleep(v / 1000)
95 #endif
96
97 /*
98  * POSIX stuff
99  */
100 #ifdef USE_TPOSIX
101 # include <termios.h>
102 #endif
103
104
105
106 /*
107  * If you have errors relating to curs_set(), comment out the following line
108  */
109 #define USE_CURS_SET
110
111
112 /*
113  * If you have errors with any of the functions mentioned below, try
114  * uncommenting the line it's mentioned on.
115  */
116 /* #define cbreak() crmode() */
117 /* #define nonl() */
118 /* #define nl() */
119
120
121
122 /*
123  * Save the "normal" and "angband" terminal settings
124  */
125
126 #ifdef USE_TPOSIX
127
128 static struct termios  norm_termios;
129 static struct termios  game_termios;
130
131 #endif
132
133
134 /*
135  * Information about a term
136  */
137 typedef struct term_data
138 {
139         term t;                 /* All term info */
140         WINDOW *win;            /* Pointer to the curses window */
141 } term_data;
142
143 /* Max number of windows on screen */
144 #define MAX_TERM_DATA 4
145
146 /* Information about our windows */
147 static term_data data[MAX_TERM_DATA];
148
149 /* Number of initialized "term" structures */
150 static int active = 0;
151
152
153
154 #ifdef A_COLOR
155
156 /*
157  * Hack -- define "A_BRIGHT" to be "A_BOLD", because on many
158  * machines, "A_BRIGHT" produces ugly "inverse" video.
159  */
160 #ifndef A_BRIGHT
161 # define A_BRIGHT A_BOLD
162 #endif
163
164 /*
165  * Software flag -- we are allowed to use color
166  */
167 static int can_use_color = FALSE;
168
169 /*
170  * Software flag -- we are allowed to change the colors
171  */
172 static int can_fix_color = FALSE;
173
174 /*
175  * Simple Angband to Curses color conversion table
176  */
177 static int colortable[BASIC_COLORS];
178
179 #endif
180
181
182
183 /*
184  * Place the "keymap" into its "normal" state
185  */
186 static void keymap_norm(void)
187 {
188
189 #ifdef USE_TPOSIX
190
191         /* restore the saved values of the special chars */
192         (void)tcsetattr(0, TCSAFLUSH, &norm_termios);
193
194 #endif
195
196
197 }
198
199
200 /*
201  * Place the "keymap" into the "game" state
202  */
203 static void keymap_game(void)
204 {
205
206 #ifdef USE_TPOSIX
207
208         /* restore the saved values of the special chars */
209         (void)tcsetattr(0, TCSAFLUSH, &game_termios);
210
211 #endif
212 }
213
214
215 /*
216  * Save the normal keymap
217  */
218 static void keymap_norm_prepare(void)
219 {
220
221 #ifdef USE_TPOSIX
222
223         /* Get the normal keymap */
224         tcgetattr(0, &norm_termios);
225
226 #endif
227
228 }
229
230
231 /*
232  * Save the keymaps (normal and game)
233  */
234 static void keymap_game_prepare(void)
235 {
236
237 #ifdef USE_TPOSIX
238
239         /* Acquire the current mapping */
240         tcgetattr(0, &game_termios);
241
242         /* Force "Ctrl-C" to interupt */
243         game_termios.c_cc[VINTR] = (char)3;
244
245         /* Force "Ctrl-Z" to suspend */
246         game_termios.c_cc[VSUSP] = (char)26;
247
248         /* Hack -- Leave "VSTART/VSTOP" alone */
249
250         /* Disable the standard control characters */
251         game_termios.c_cc[VQUIT] = (char)-1;
252         game_termios.c_cc[VERASE] = (char)-1;
253         game_termios.c_cc[VKILL] = (char)-1;
254         game_termios.c_cc[VEOF] = (char)-1;
255         game_termios.c_cc[VEOL] = (char)-1;
256
257         /* Normally, block until a character is read */
258         game_termios.c_cc[VMIN] = 1;
259         game_termios.c_cc[VTIME] = 0;
260
261         /* Turn off flow control (enable ^S) */
262         game_termios.c_iflag &= ~IXON;
263
264 #endif
265
266
267 }
268
269
270
271
272 /*
273  * Suspend/Resume
274  */
275 static errr Term_xtra_gcu_alive(int v)
276 {
277         int x, y;
278
279
280         /* Suspend */
281         if (!v)
282         {
283                 /* Go to normal keymap mode */
284                 keymap_norm();
285
286                 /* Restore modes */
287                 nocbreak();
288                 echo();
289                 nl();
290
291                 /* Hack -- make sure the cursor is visible */
292                 Term_xtra(TERM_XTRA_SHAPE, 1);
293
294                 /* Flush the curses buffer */
295                 (void)refresh();
296
297                 /* Get current cursor position */
298                 getyx(curscr, y, x);
299
300                 /* Move the cursor to bottom right corner */
301                 mvcur(y, x, LINES - 1, 0);
302
303                 /* Exit curses */
304                 endwin();
305
306                 /* Flush the output */
307                 (void)fflush(stdout);
308         }
309
310         /* Resume */
311         else
312         {
313                 /* Refresh */
314                 /* (void)touchwin(curscr); */
315                 /* (void)wrefresh(curscr); */
316
317                 /* Restore the settings */
318                 cbreak();
319                 noecho();
320                 nonl();
321
322                 /* Go to angband keymap mode */
323                 keymap_game();
324         }
325
326         /* Success */
327         return (0);
328 }
329
330
331 #ifdef USE_NCURSES
332 const char help_gcu[] = "NCurses, for terminal console, subopts -b(ig screen)";
333 #else /* USE_NCURSES */
334 const char help_gcu[] = "Curses, for terminal console, subopts -b(ig screen)";
335 #endif /* USE_NCURSES */
336
337
338 /*
339  * Init the "curses" system
340  */
341 static void Term_init_gcu(term *t)
342 {
343         term_data *td = (term_data *)(t->data);
344
345         /*
346          * This is necessary to keep the first call to getch()
347          * from clearing the screen
348          */
349         wrefresh(stdscr);
350
351         /* Count init's, handle first */
352         if (active++ != 0) return;
353
354         /* Erase the window */
355         (void)wclear(td->win);
356
357         /* Reset the cursor */
358         (void)wmove(td->win, 0, 0);
359
360         /* Flush changes */
361         (void)wrefresh(td->win);
362
363         /* Game keymap */
364         keymap_game();
365 }
366
367
368 /*
369  * Nuke the "curses" system
370  */
371 static void Term_nuke_gcu(term *t)
372 {
373         int x, y;
374         term_data *td = (term_data *)(t->data);
375
376         /* Delete this window */
377         delwin(td->win);
378
379         /* Count nuke's, handle last */
380         if (--active != 0) return;
381
382         /* Hack -- make sure the cursor is visible */
383         Term_xtra(TERM_XTRA_SHAPE, 1);
384
385 #ifdef A_COLOR
386         /* Reset colors to defaults */
387         start_color();
388 #endif
389
390         /* Get current cursor position */
391         getyx(curscr, y, x);
392
393         /* Move the cursor to bottom right corner */
394         mvcur(y, x, LINES - 1, 0);
395
396         /* Flush the curses buffer */
397         (void)refresh();
398
399         /* Exit curses */
400         endwin();
401
402         /* Flush the output */
403         (void)fflush(stdout);
404
405         /* Normal keymap */
406         keymap_norm();
407 }
408
409
410
411
412 /*
413  * Process events, with optional wait
414  */
415 static errr Term_xtra_gcu_event(int v)
416 {
417         int i, k;
418
419         /* Wait */
420         if (v)
421         {
422                 /* Paranoia -- Wait for it */
423                 nodelay(stdscr, FALSE);
424
425                 /* Get a keypress */
426                 i = getch();
427
428                 /* Mega-Hack -- allow graceful "suspend" */
429                 for (k = 0; (k < 10) && (i == ERR); k++) i = getch();
430
431                 /* Broken input is special */
432                 if (i == ERR) exit_game_panic();
433                 if (i == EOF) exit_game_panic();
434         }
435
436         /* Do not wait */
437         else
438         {
439                 /* Do not wait for it */
440                 nodelay(stdscr, TRUE);
441
442                 /* Check for keypresses */
443                 i = getch();
444
445                 /* Wait for it next time */
446                 nodelay(stdscr, FALSE);
447
448                 /* None ready */
449                 if (i == ERR) return (1);
450                 if (i == EOF) return (1);
451         }
452
453 #ifdef KEY_DOWN
454         /* Handle arrow keys */
455         switch (i)
456         {
457                 case KEY_DOWN:  i = ARROW_DOWN;  break;
458                 case KEY_UP:    i = ARROW_UP;    break;
459                 case KEY_LEFT:  i = ARROW_LEFT;  break;
460                 case KEY_RIGHT: i = ARROW_RIGHT; break;
461         }
462 #endif
463
464         /* Enqueue the keypress */
465         Term_keypress(i);
466
467         /* Success */
468         return (0);
469 }
470
471
472 /*
473  * React to changes
474  */
475 static errr Term_xtra_gcu_react(void)
476 {
477
478 #ifdef A_COLOR
479
480         int i;
481
482         /* Cannot handle color redefinition */
483         if (!can_fix_color) return (0);
484
485         /* Set the colors */
486         for (i = 0; i < BASIC_COLORS; i++)
487         {
488                 /* Set one color (note scaling) */
489                 init_color(i, angband_color_table[i][1] * 1000 / 255,
490                               angband_color_table[i][2] * 1000 / 255,
491                               angband_color_table[i][3] * 1000 / 255);
492         }
493
494 #endif
495
496         /* Success */
497         return (0);
498 }
499
500
501 /*
502  * Handle a "special request"
503  */
504 static errr Term_xtra_gcu(int n, int v)
505 {
506         term_data *td = (term_data *)(Term->data);
507
508         /* Analyze the request */
509         switch (n)
510         {
511                 /* Clear screen */
512                 case TERM_XTRA_CLEAR:
513                 touchwin(td->win);
514                 (void)wclear(td->win);
515                 return (0);
516
517                 /* Make a noise */
518                 case TERM_XTRA_NOISE:
519                 (void)write(1, "\007", 1);
520                 return (0);
521
522                 /* Flush the Curses buffer */
523                 case TERM_XTRA_FRESH:
524                 (void)wrefresh(td->win);
525                 return (0);
526
527 #ifdef USE_CURS_SET
528
529                 /* Change the cursor visibility */
530                 case TERM_XTRA_SHAPE:
531                 curs_set(v);
532                 return (0);
533
534 #endif
535
536                 /* Suspend/Resume curses */
537                 case TERM_XTRA_ALIVE:
538                 return (Term_xtra_gcu_alive(v));
539
540                 /* Process events */
541                 case TERM_XTRA_EVENT:
542                 return (Term_xtra_gcu_event(v));
543
544                 /* Flush events */
545                 case TERM_XTRA_FLUSH:
546                 while (!Term_xtra_gcu_event(FALSE));
547                 return (0);
548
549                 /* Delay */
550                 case TERM_XTRA_DELAY:
551                 if (v > 0)
552                         usleep(1000 * v);
553                 return (0);
554
555                 /* React to events */
556                 case TERM_XTRA_REACT:
557                 Term_xtra_gcu_react();
558                 return (0);
559         }
560
561         /* Unknown */
562         return (1);
563 }
564
565
566 /*
567  * Actually MOVE the hardware cursor
568  */
569 static errr Term_curs_gcu(int x, int y)
570 {
571         term_data *td = (term_data *)(Term->data);
572
573         /* Literally move the cursor */
574         wmove(td->win, y, x);
575
576         /* Success */
577         return (0);
578 }
579
580
581 /*
582  * Erase a grid of space
583  * Hack -- try to be "semi-efficient".
584  */
585 static errr Term_wipe_gcu(int x, int y, int n)
586 {
587         term_data *td = (term_data *)(Term->data);
588         char buf[1024];
589
590         /* Place cursor */
591         wmove(td->win, y, x);
592
593         /* Clear to end of line */
594         if (x + n >= td->t.wid)
595         {
596                 wclrtoeol(td->win);
597         }
598
599         /* Clear some characters */
600         else
601         {
602                 /* Format a buffer */
603                 strnfmt(buf, sizeof(buf), "%*c", n, ' ');
604
605                 /* Output */
606                 waddstr(td->win, buf);
607         }
608
609         /* Success */
610         return (0);
611 }
612
613
614 /*
615  * Place some text on the screen using an attribute
616  */
617 static errr Term_text_gcu(int x, int y, int n, byte a, cptr s)
618 {
619         term_data *td = (term_data *)(Term->data);
620         char buf[1024];
621
622 #ifdef A_COLOR
623         /* Set the color */
624         if (can_use_color) wattrset(td->win, colortable[a & (BASIC_COLORS-1)]);
625 #endif
626
627         /* Move the cursor */
628         wmove(td->win, y, x);
629
630         /* Format to appropriate size */
631         strnfmt(buf, sizeof(buf), "%.*s", n, s);
632
633         /* Write to screen */
634         waddstr(td->win, buf);
635
636 #ifdef A_COLOR
637         /* Unset the color */
638         if (can_use_color) wattrset(td->win, 0);
639 #endif
640
641         /* Success */
642         return (0);
643 }
644
645
646 /*
647  * Create a window for the given "term_data" argument.
648  *
649  * Assumes legal arguments.
650  */
651 static errr term_data_init_gcu(term_data *td, int rows, int cols, int y, int x)
652 {
653         term *t = &td->t;
654
655         /* Create new window */
656         td->win = newwin(rows, cols, y, x);
657
658         /* Check for failure */
659         if (!td->win)
660         {
661                 /* Error */
662                 quit("Failed to setup curses window.");
663         }
664
665         /* Initialize the term */
666         term_init(t, cols, rows, 256);
667
668         /* Avoid bottom right corner */
669         t->icky_corner = TRUE;
670
671         /* Erase with "white space" */
672         t->attr_blank = TERM_WHITE;
673         t->char_blank = ' ';
674
675         /* Set some hooks */
676         t->init_hook = Term_init_gcu;
677         t->nuke_hook = Term_nuke_gcu;
678
679         /* Set some more hooks */
680         t->text_hook = Term_text_gcu;
681         t->wipe_hook = Term_wipe_gcu;
682         t->curs_hook = Term_curs_gcu;
683         t->xtra_hook = Term_xtra_gcu;
684
685         /* Save the data */
686         t->data = td;
687
688         /* Activate it */
689         Term_activate(t);
690
691         /* Success */
692         return (0);
693 }
694
695
696 static void hook_quit(cptr str)
697 {
698         /* Unused */
699         (void)str;
700
701         /* Exit curses */
702         endwin();
703 }
704
705
706 /*
707  * Prepare "curses" for use by the file "z-term.c"
708  *
709  * Installs the "hook" functions defined above, and then activates
710  * the main screen "term", which clears the screen and such things.
711  *
712  * Someone should really check the semantics of "initscr()"
713  */
714 errr init_gcu(int argc, char **argv)
715 {
716         int i;
717
718         int num_term = MAX_TERM_DATA, next_win = 0;
719
720         bool use_big_screen = FALSE;
721
722
723         /* Parse args */
724         for (i = 1; i < argc; i++)
725         {
726                 if (prefix(argv[i], "-b"))
727                 {
728                         use_big_screen = TRUE;
729                         continue;
730                 }
731
732                 plog_fmt("Ignoring option: %s", argv[i]);
733         }
734
735
736         /* Extract the normal keymap */
737         keymap_norm_prepare();
738
739         /* Initialize */
740         if (initscr() == NULL) return (-1);
741
742         /* Activate hooks */
743         quit_aux = hook_quit;
744
745         /* Require standard size screen */
746         if ((LINES < 24) || (COLS < 80))
747         {
748                 quit("Angband needs at least an 80x24 'curses' screen");
749         }
750
751
752 #ifdef A_COLOR
753
754         /*** Init the Color-pairs and set up a translation table ***/
755
756         /* Do we have color, and enough color, available? */
757         can_use_color = ((start_color() != ERR) && has_colors() &&
758                          (COLORS >= 8) && (COLOR_PAIRS >= 8));
759
760 #ifdef HAVE_CAN_CHANGE_COLOR
761
762         /* Can we change colors? */
763         can_fix_color = (can_use_color && can_change_color() &&
764                          (COLORS >= 16) && (COLOR_PAIRS > 8));
765
766 #endif
767
768         /* Attempt to use customized colors */
769         if (can_fix_color)
770         {
771                 /* Prepare the color pairs */
772                 for (i = 0; i < (BASIC_COLORS / 2); i++)
773                 {
774                         /* Reset the color */
775                         if (init_pair(i + 1, i, 0) == ERR)
776                         {
777                                 quit("Color pair init failed");
778                         }
779
780                         /* Set up the colormap */
781                         colortable[i] = (COLOR_PAIR(i + 1) | A_NORMAL);
782                         colortable[i + (BASIC_COLORS / 2)] = (COLOR_PAIR(i + 1) | A_BRIGHT);
783                 }
784
785                 /* Take account of "gamma correction" XXX XXX XXX */
786
787                 /* Prepare the "Angband Colors" */
788                 Term_xtra_gcu_react();
789         }
790
791         /* Attempt to use colors */
792         else if (can_use_color)
793         {
794                 /* Color-pair 0 is *always* WHITE on BLACK */
795
796                 /* Prepare the color pairs */
797                 init_pair(1, COLOR_RED,     COLOR_BLACK);
798                 init_pair(2, COLOR_GREEN,   COLOR_BLACK);
799                 init_pair(3, COLOR_YELLOW,  COLOR_BLACK);
800                 init_pair(4, COLOR_BLUE,    COLOR_BLACK);
801                 init_pair(5, COLOR_MAGENTA, COLOR_BLACK);
802                 init_pair(6, COLOR_CYAN,    COLOR_BLACK);
803                 init_pair(7, COLOR_BLACK,   COLOR_BLACK);
804
805                 /* Prepare the colors */
806                 colortable[0] = (COLOR_PAIR(7) | A_NORMAL);     /* Black */
807                 colortable[1] = (COLOR_PAIR(0) | A_BRIGHT);     /* White */
808                 colortable[2] = (COLOR_PAIR(0) | A_NORMAL);     /* Grey XXX */
809                 colortable[3] = (COLOR_PAIR(1) | A_BRIGHT);     /* Orange XXX */
810                 colortable[4] = (COLOR_PAIR(1) | A_NORMAL);     /* Red */
811                 colortable[5] = (COLOR_PAIR(2) | A_NORMAL);     /* Green */
812                 colortable[6] = (COLOR_PAIR(4) | A_NORMAL);     /* Blue */
813                 colortable[7] = (COLOR_PAIR(3) | A_NORMAL);     /* Umber */
814                 colortable[8] = (COLOR_PAIR(7) | A_BRIGHT);     /* Dark-grey XXX */
815                 colortable[9] = (COLOR_PAIR(0) | A_NORMAL);     /* Light-grey XXX */
816                 colortable[10] = (COLOR_PAIR(5) | A_NORMAL);    /* Purple */
817                 colortable[11] = (COLOR_PAIR(3) | A_BRIGHT);    /* Yellow */
818                 colortable[12] = (COLOR_PAIR(5) | A_BRIGHT);    /* Light Red XXX */
819                 colortable[13] = (COLOR_PAIR(2) | A_BRIGHT);    /* Light Green */
820                 colortable[14] = (COLOR_PAIR(4) | A_BRIGHT);    /* Light Blue */
821                 colortable[15] = (COLOR_PAIR(3) | A_NORMAL);    /* Light Umber XXX */
822         }
823
824 #endif
825
826
827         /*** Low level preparation ***/
828
829         /* Paranoia -- Assume no waiting */
830         nodelay(stdscr, FALSE);
831
832         /* Prepare */
833         cbreak();
834         noecho();
835         nonl();
836
837 #ifdef PDCURSES
838         keypad(stdscr, TRUE);
839 #endif
840
841         /* Extract the game keymap */
842         keymap_game_prepare();
843
844
845         /*** Now prepare the term(s) ***/
846
847         /* Big screen -- one big term */
848         if (use_big_screen)
849         {
850                 /* Create a term */
851                 term_data_init_gcu(&data[0], LINES, COLS, 0, 0);
852
853                 /* Remember the term */
854                 angband_term[0] = &data[0].t;
855         }
856
857         /* No big screen -- create as many term windows as possible */
858         else
859         {
860                 /* Create several terms */
861                 for (i = 0; i < num_term; i++)
862                 {
863                         int rows, cols, y, x;
864
865                         /* Decide on size and position */
866                         switch (i)
867                         {
868                                 /* Upper left */
869                                 case 0:
870                                 {
871                                         rows = 24;
872                                         cols = 80;
873                                         y = x = 0;
874                                         break;
875                                 }
876
877                                 /* Lower left */
878                                 case 1:
879                                 {
880                                         rows = LINES - 25;
881                                         cols = 80;
882                                         y = 25;
883                                         x = 0;
884                                         break;
885                                 }
886
887                                 /* Upper right */
888                                 case 2:
889                                 {
890                                         rows = 24;
891                                         cols = COLS - 81;
892                                         y = 0;
893                                         x = 81;
894                                         break;
895                                 }
896
897                                 /* Lower right */
898                                 case 3:
899                                 {
900                                         rows = LINES - 25;
901                                         cols = COLS - 81;
902                                         y = 25;
903                                         x = 81;
904                                         break;
905                                 }
906
907                                 /* XXX */
908                                 default:
909                                 {
910                                         rows = cols = y = x = 0;
911                                         break;
912                                 }
913                         }
914
915                         /* Skip non-existant windows */
916                         if (rows <= 0 || cols <= 0) continue;
917
918                         /* Create a term */
919                         term_data_init_gcu(&data[next_win], rows, cols, y, x);
920
921                         /* Remember the term */
922                         angband_term[next_win] = &data[next_win].t;
923
924                         /* One more window */
925                         next_win++;
926                 }
927         }
928
929         /* Activate the "Angband" window screen */
930         Term_activate(&data[0].t);
931
932         /* Remember the active screen */
933         term_screen = &data[0].t;
934
935         /* Success */
936         return (0);
937 }
938
939
940 #endif /* USE_GCU */
Note: See TracBrowser for help on using the browser.