-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsl-car.patch
112 lines (107 loc) · 3.13 KB
/
sl-car.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Binary files sl-3.03/sl and sl-3.04/sl differ
diff -urN sl-3.03/sl.c sl-3.04/sl.c
--- sl-3.03/sl.c 2008-11-08 15:47:01.000000000 +0200
+++ sl-3.04/sl.c 2008-11-08 16:02:32.000000000 +0200
@@ -30,12 +30,16 @@
#include <curses.h>
#include <signal.h>
#include <unistd.h>
+#include <string.h>
+
#include "sl.h"
+#include "sl-car.h"
int ACCIDENT = 0;
int LOGO = 0;
int FLY = 0;
int INTR = 0;
+int SPORTSCAR = 0;
int my_mvaddstr(int y, int x, char *str)
{
@@ -56,6 +60,8 @@
case 'F': FLY = 1; break;
case 'l': LOGO = 1; break;
case 'e': INTR = 1; break;
+ case 'C':
+ case 'c': SPORTSCAR = 1; break;
default: break;
}
}
@@ -64,6 +70,8 @@
int main(int argc, char *argv[])
{
int x, i;
+ /* Symlink application to car. Sometimes we typo cat too.. */
+ if (!strcmp(argv[0], "car") || !strcmp(argv[0], "./car")) { SPORTSCAR = 1; }
for (i = 1; i < argc; ++i) {
if (*argv[i] == '-') {
@@ -79,10 +87,12 @@
scrollok(stdscr, FALSE);
for (x = COLS - 1; ; --x) {
- if (LOGO == 0) {
- if (add_D51(x) == ERR) break;
- } else {
+ if (LOGO) {
if (add_sl(x) == ERR) break;
+ } else if (SPORTSCAR){
+ if (add_sportscar(x) == ERR) break;
+ } else {
+ if (add_D51(x) == ERR) break;
}
refresh();
usleep(20000);
@@ -233,3 +243,28 @@
return 0;
}
+
+int add_sportscar(int x) {
+ static char *sl[SPORTSCARPATTERNS][SPORTSCARHEIGHT + 1]
+ = {{SPORTSCAR1, SPORTSCAR2, SPORTSCAR3, SPORTSCAR4, SPORTSCAR5, SPORTSCAR6, SPORTSCAR7, SPORTSCARDELLN}};
+
+ int i, y, py1 = 0, py2 = 0, py3 = 0;
+
+ if (x < - SPORTSCARLENGTH) return ERR;
+ y = LINES / 2 - 3;
+
+ if (FLY == 1) {
+ y = (x / 6) + LINES - (COLS / 6) - SPORTSCARHEIGHT;
+ py1 = 2; py2 = 4; py3 = 6;
+ }
+ for (i = 0; i <= SPORTSCARHEIGHT; ++i) {
+ my_mvaddstr(y + i, x, sl[(SPORTSCARLENGTH + x) / 3 % SPORTSCARPATTERNS][i]);
+ }
+
+ if (ACCIDENT == 1) {
+ add_man(y + 1, x + 20);
+ }
+
+ add_smoke(y + 4, x + SPORTSCARFUNNEL );
+ return OK;
+}
diff -urN sl-3.03/sl-car.h sl-3.04/sl-car.h
--- sl-3.03/sl-car.h 1970-01-01 02:00:00.000000000 +0200
+++ sl-3.04/sl-car.h 2008-11-08 16:00:22.000000000 +0200
@@ -0,0 +1,24 @@
+/*========================================
+ * sl-car.h: Text data of sportscar of SL version 3.04
+ * Copyright 2008 Onur YALAZI
+ * (yalazi@mobilada.com)
+ * Last Modified: 2008/11/8
+ *========================================
+ */
+
+
+#define SPORTSCARHEIGHT 7
+#define SPORTSCARFUNNEL 44
+#define SPORTSCARLENGTH 22
+#define SPORTSCARPATTERNS 1
+
+#define SPORTSCAR1 " .---------. "
+#define SPORTSCAR2 " ./,---. ,---.\\ "
+#define SPORTSCAR3 " .----------/ /____| |____\\\\______ "
+#define SPORTSCAR4 " / ___ __ __ __ \\__ "
+#define SPORTSCAR5 " d / \\ ' ' / \\ b "
+#define SPORTSCAR6 " |_\\ ( o ) ( o ) |ı "
+#define SPORTSCAR7 " --\\___/-------------------\\___/----'' "
+#define SPORTSCARDELLN " "
+
+extern int add_sportscar();