@@ -47,6 +47,7 @@ void add_smoke(int y, int x);
4747void add_man (int y , int x );
4848int add_C51 (int x );
4949int add_D51 (int x );
50+ int add_TGV (int x );
5051int add_sl (int x );
5152void option (char * str );
5253int my_mvaddstr (int y , int x , char * str );
@@ -55,6 +56,7 @@ int ACCIDENT = 0;
5556int LOGO = 0 ;
5657int FLY = 0 ;
5758int C51 = 0 ;
59+ int TGV = 0 ;
5860
5961int my_mvaddstr (int y , int x , char * str )
6062{
@@ -75,6 +77,7 @@ void option(char *str)
7577 case 'F' : FLY = 1 ; break ;
7678 case 'l' : LOGO = 1 ; break ;
7779 case 'c' : C51 = 1 ; break ;
80+ case 'G' : TGV = 1 ; break ;
7881 default : break ;
7982 }
8083 }
@@ -96,6 +99,19 @@ int main(int argc, char *argv[])
9699 nodelay (stdscr , TRUE);
97100 leaveok (stdscr , TRUE);
98101 scrollok (stdscr , FALSE);
102+ /*
103+ * first Non prototype TGV was orange, first 1 was red, but slighty diferent
104+ * but red anyway, so in both case this color "Work"
105+ */
106+ if (TGV == 1 ) {
107+ if (has_colors ()) {
108+ start_color ();
109+ init_pair (1 , COLOR_WHITE , COLOR_BLACK );
110+ init_pair (2 , COLOR_YELLOW , COLOR_BLACK );
111+ } else {
112+ TGV = 0 ;
113+ }
114+ }
99115
100116 for (x = COLS - 1 ; ; -- x ) {
101117 if (LOGO == 1 ) {
@@ -104,12 +120,18 @@ int main(int argc, char *argv[])
104120 else if (C51 == 1 ) {
105121 if (add_C51 (x ) == ERR ) break ;
106122 }
123+ else if (TGV == 1 ) {
124+ if (add_TGV (x ) == ERR ) break ;
125+ }
107126 else {
108127 if (add_D51 (x ) == ERR ) break ;
109128 }
110- getch ();
111- refresh ();
112- usleep (40000 );
129+ /* if (TGV) { */
130+ /* --x; */
131+ /* } */
132+ getch ();
133+ refresh ();
134+ usleep (40000 );
113135 }
114136 mvcur (0 , COLS - 1 , LINES - 1 , 0 );
115137 endwin ();
@@ -199,6 +221,43 @@ int add_D51(int x)
199221 return OK ;
200222}
201223
224+ int add_TGV (int x )
225+ {
226+ static char * tgv [TGVPATTERNS ][TGVHEIGHT + 1 ]
227+ = {{TGVSTR0 , TGVSTR1 , TGVSTR2 , TGVSTR3 , TGVSTR4 , TGVSTR5 , TGVSTR6 ,
228+ TGVWHL1 , TGVDEL },
229+ {TGVSTR0 , TGVSTR1 , TGVSTR2 , TGVSTR3 , TGVSTR4 , TGVSTR5 , TGVSTR6 ,
230+ TGVWHL2 , TGVDEL }};
231+ static char * vagoon [TGVHEIGHT + 1 ]
232+ = {TGVVAG0 , TGVVAG1 , TGVVAG2 , TGVVAG3 , TGVVAG4 , TGVVAG5 , TGVVAG6 , TGVVAG7 , TGVDEL };
233+
234+ int y , i , dy = 0 ;
235+
236+ if (x < - TGVLENGTH ) return ERR ;
237+ y = LINES / 2 - 5 ;
238+
239+ if (FLY == 1 ) {
240+ y = (x / 7 ) + LINES - (COLS / 7 ) - TGVHEIGHT ;
241+ dy = 1 ;
242+ }
243+ attron (COLOR_PAIR (2 ));
244+ for (i = 0 ; i <= TGVHEIGHT ; ++ i ) {
245+ my_mvaddstr (y + i , x , tgv [((TGVLENGTH + x ) / 2 ) % TGVPATTERNS ][i ]);
246+ my_mvaddstr (y + i + dy , x + 55 , vagoon [i ]);
247+ }
248+ attroff (COLOR_PAIR (2 ));
249+
250+ if (ACCIDENT == 1 ) {
251+ add_man (y + 2 , x + 14 );
252+
253+ add_man (y + dy + 3 , x + 85 );
254+ add_man (y + dy + 3 , x + 90 );
255+ add_man (y + dy + 3 , x + 95 );
256+ add_man (y + dy + 3 , x + 100 );
257+ }
258+ return OK ;
259+ }
260+
202261int add_C51 (int x )
203262{
204263 static char * c51 [C51PATTERNS ][C51HEIGHT + 1 ]
0 commit comments