Changeset 52
- Timestamp:
- Dec 23, 2002, 11:06:27 AM (20 years ago)
- Location:
- ttyvaders/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/configure.ac
r40 r52 14 14 AC_PROG_CPP 15 15 16 AC_ARG_ENABLE(slang, 17 [ --enable-slang slang graphics support (default enabled)]) 16 18 AC_ARG_ENABLE(ncurses, 17 [ --enable-ncurses ncurses interface support (default is slang)])19 [ --enable-ncurses ncurses graphics support (default disabled)]) 18 20 19 21 if test "${enable_ncurses}" = "yes" … … 22 24 AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library])) 23 25 else 24 AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers])) 25 AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library])) 26 if test "${enable_slang}" != "no" 27 then 28 AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers])) 29 AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library])) 30 else 31 : 32 fi 26 33 fi 27 34 35 AM_CONDITIONAL(USE_SLANG, test "${enable_slang}" != "no") 28 36 AM_CONDITIONAL(USE_NCURSES, test "${enable_ncurses}" = "yes") 29 37 -
ttyvaders/trunk/src/Makefile.am
r44 r52 8 8 AM_CFLAGS += -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs 9 9 10 if USE_SLANG 11 CPPFLAGS_slang = -DUSE_SLANG 12 LDFLAGS_slang = -lslang 13 endif 10 14 if USE_NCURSES 11 CPPFLAGS_gfx = -DUSE_NCURSES 12 LDFLAGS_gfx = -lncurses 13 else 14 CPPFLAGS_gfx = -DUSE_SLANG 15 LDFLAGS_gfx = -lslang 15 CPPFLAGS_ncurses = -DUSE_NCURSES 16 LDFLAGS_ncurses = -lncurses 16 17 endif 17 18 … … 34 35 $(NULL) 35 36 36 ttyvaders_CPPFLAGS = $(CPPFLAGS_ gfx)37 ttyvaders_LDADD = $(LDFLAGS_ gfx)37 ttyvaders_CPPFLAGS = $(CPPFLAGS_slang) $(CPPFLAGS_ncurses) 38 ttyvaders_LDADD = $(LDFLAGS_slang) $(LDFLAGS_ncurses) 38 39 -
ttyvaders/trunk/src/ceo.c
r42 r52 4 4 * All Rights Reserved 5 5 * 6 * $Id: ceo.c,v 1. 4 2002/12/22 22:17:41sam Exp $6 * $Id: ceo.c,v 1.5 2002/12/23 10:06:27 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 23 23 #include "config.h" 24 24 25 #include <stdio.h> 25 26 #include <unistd.h> 26 27 -
ttyvaders/trunk/src/common.h
r50 r52 4 4 * All Rights Reserved 5 5 * 6 * $Id: common.h,v 1.1 0 2002/12/23 09:28:37 sam Exp $6 * $Id: common.h,v 1.11 2002/12/23 10:06:27 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 33 33 # define gfx_putchar(x) SLsmg_write_char(x) 34 34 # define gfx_putstr(x) SLsmg_write_string(x) 35 #el se35 #elif USE_NCURSES 36 36 # include <curses.h> 37 37 # define gfx_color(x) attrset(COLOR_PAIR(x)) … … 39 39 # define gfx_putchar(x) addch(x) 40 40 # define gfx_putstr(x) addstr(x) 41 #else 42 # define gfx_color(x) do{}while(0) 43 # define gfx_goto(x,y) do{}while(0) 44 # define gfx_putchar(x) do{}while(0) 45 # define gfx_putstr(x) do{}while(0) 41 46 #endif 42 47 -
ttyvaders/trunk/src/graphics.c
r38 r52 4 4 * All Rights Reserved 5 5 * 6 * $Id: graphics.c,v 1. 4 2002/12/22 18:44:12sam Exp $6 * $Id: graphics.c,v 1.5 2002/12/23 10:06:27 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 50 50 SLsmg_cls(); 51 51 SLsmg_refresh(); 52 #el se52 #elif USE_NCURSES 53 53 /* Initialize ncurses library */ 54 54 initscr(); … … 58 58 noecho(); 59 59 nodelay(stdscr, TRUE); 60 #else 61 /* Dummy driver */ 60 62 #endif 61 63 … … 81 83 g->w = SLtt_Screen_Cols; 82 84 g->h = SLtt_Screen_Rows; 83 #el se85 #elif USE_NCURSES 84 86 start_color(); 85 87 … … 97 99 g->w = COLS; 98 100 g->h = LINES; 101 #else 102 /* Use dummy driver */ 103 g->w = 80; 104 g->h = 25; 99 105 #endif 100 106 } … … 107 113 return SLang_getkey(); 108 114 } 109 #el se115 #elif USE_NCURSES 110 116 char key; 111 117 … … 114 120 return key; 115 121 } 122 #else 123 /* Use dummy driver */ 116 124 #endif 117 125 … … 123 131 #ifdef USE_SLANG 124 132 SLsmg_cls(); 133 #elif USE_NCURSES 134 clear(); 125 135 #else 126 clear();136 /* Use dummy driver */ 127 137 #endif 128 138 } … … 133 143 #ifdef USE_SLANG 134 144 SLsmg_refresh(); 145 #elif USE_NCURSES 146 refresh(); 135 147 #else 136 refresh();148 /* Use dummy driver */ 137 149 #endif 138 150 } … … 143 155 SLang_reset_tty(); 144 156 SLsmg_reset_smg(); 157 #elif USE_NCURSES 158 endwin(); 145 159 #else 146 endwin();160 /* Use dummy driver */ 147 161 #endif 148 162 } 149 163 150 -
ttyvaders/trunk/src/main.c
r50 r52 4 4 * All Rights Reserved 5 5 * 6 * $Id: main.c,v 1. 9 2002/12/23 09:28:37 sam Exp $6 * $Id: main.c,v 1.10 2002/12/23 10:06:27 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 70 70 g->al = malloc(sizeof(aliens)); 71 71 72 init_bonus( g, g->bo ); 72 73 init_weapons( g, g->wp ); 73 74 init_explosions( g, g->ex ); … … 129 130 } 130 131 break; 131 case ' d':132 case 'f': 132 133 if( g->p->nuke == 0 ) 133 134 { … … 223 224 224 225 free_starfield( g, g->sf ); 225 226 #if 0227 free_player( p );228 226 free_tunnel( g->t ); 229 #endif 227 // free_player( g->p ); 230 228 } 231 229 -
ttyvaders/trunk/src/tunnel.c
r50 r52 4 4 * All Rights Reserved 5 5 * 6 * $Id: tunnel.c,v 1. 5 2002/12/23 09:28:37 sam Exp $6 * $Id: tunnel.c,v 1.6 2002/12/23 10:06:27 sam Exp $ 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify … … 40 40 if( t->w >= g->w ) 41 41 { 42 t->left[0] = -10;43 t->right[0] = g->w + 10;44 42 for( i = 0; i < g->h; i++ ) 45 43 { … … 82 80 83 81 /* Slide tunnel one block vertically */ 84 for( i = t->h ; i--; )82 for( i = t->h - 1; i--; ) 85 83 { 86 84 t->left[i+1] = t->left[i];
Note: See TracChangeset
for help on using the changeset viewer.