Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 229 lines (200 sloc) 3.987 kB
b126e26 @tbradshaw The source of the setup program included with DOOM, Final DOOM, Strif…
tbradshaw authored
1 //
2 // Warp to level
3 //
4 #include <dos.h>
5
6 #include "main.h"
7 #include "keys.h"
8
9 int respawn;
10 int nomonsters;
11 int deathmatch2;
12
13 enum
14 {
15 W_NOMON,
16 #ifndef HERETIC
17 W_DM2,
18 #endif
19 W_RESPAWN,
20
21 E1M1,
22 E1M2,
23 E1M3,
24 E1M4,
25 E1M5,
26 E1M6,
27 E1M7,
28 E1M8,
29 E1M9,
30 #ifdef DOOM2
31 E1M10,
32 #endif
33
34 E2M1,
35 E2M2,
36 E2M3,
37 E2M4,
38 E2M5,
39 E2M6,
40 E2M7,
41 E2M8,
42 E2M9,
43 #ifdef DOOM2
44 E2M10,
45 #endif
46
47 E3M1,
48 E3M2,
49 E3M3,
50 E3M4,
51 E3M5,
52 E3M6,
53 E3M7,
54 E3M8,
55 E3M9,
56 #ifdef DOOM2
57 E3M10,
58 #endif
59
60 W_MAX
61 };
62
63 item_t cwarpitems[]=
64 {
65 #ifdef HERETIC
66 {W_NOMON, 35,6,15, -1,-1},
67 {W_RESPAWN, 35,7,15, -1,-1},
68 #else
69 {W_NOMON, 35,5,15, -1,-1},
70 {W_DM2, 35,6,15, -1,-1},
71 {W_RESPAWN, 35,7,15, -1,-1},
72 #endif
73
74 {E1M1, 31,9,6, -1,E2M1},
75 {E1M2, 31,10,6, -1,E2M2},
76 {E1M3, 31,11,6, -1,E2M3},
77 {E1M4, 31,12,6, -1,E2M4},
78 {E1M5, 31,13,6, -1,E2M5},
79 {E1M6, 31,14,6, -1,E2M6},
80 {E1M7, 31,15,6, -1,E2M7},
81 {E1M8, 31,16,6, -1,E2M8},
82 {E1M9, 31,17,6, -1,E2M9},
83 #ifdef DOOM2
84 {E1M10, 31,18,6, -1,E2M10},
85 #endif
86
87 {E2M1, 38,9,6, E1M1,E3M1,W_RESPAWN},
88 {E2M2, 38,10,6,E1M2,E3M2},
89 {E2M3, 38,11,6,E1M3,E3M3},
90 {E2M4, 38,12,6,E1M4,E3M4},
91 {E2M5, 38,13,6,E1M5,E3M5},
92 {E2M6, 38,14,6,E1M6,E3M6},
93 {E2M7, 38,15,6,E1M7,E3M7},
94 {E2M8, 38,16,6, E1M8,E3M8},
95 {E2M9, 38,17,6, E1M9,E3M9},
96 #ifdef DOOM2
97 {E2M10, 38,18,6, E1M10,E3M10},
98 #endif
99
100 {E3M1, 45,9,6, E2M1,-1,W_RESPAWN},
101 {E3M2, 45,10,6, E2M2,-1},
102 {E3M3, 45,11,6, E2M3,-1},
103 {E3M4, 45,12,6, E2M4,-1},
104 {E3M5, 45,13,6, E2M5,-1},
105 {E3M6, 45,14,6, E2M6,-1},
106 {E3M7, 45,15,6, E2M7,-1},
107 {E3M8, 45,16,6, E2M8,-1},
108 {E3M9, 45,17,6, E2M9,-1},
109 #ifdef DOOM2
110 {E3M10, 45,18,6, E2M10,-1}
111 #endif
112 };
113
114 menu_t cwarpmenu=
115 {
116 &cwarpitems[0],
117 W_NOMON,
118 W_MAX,
119 0x7f
120 };
121
122 unsigned WarpTime(void)
123 {
124 int e;
125 int l;
126 short key;
127 short field;
128 int exit;
129
130
131 SaveScreen();
132 DrawPup(&cwarp);
133
134 SetMark(&cwarpitems[W_RESPAWN],respawn);
135 SetMark(&cwarpitems[W_NOMON],nomonsters);
136 #ifndef HERETIC
137 SetMark(&cwarpitems[W_DM2],deathmatch2);
138 #endif
139
140 exit = 0;
141
142 while(1)
143 {
144 SetupMenu(&cwarpmenu);
145 field = GetMenuInput();
146 key = menukey;
147
148 switch(key)
149 {
150 case KEY_ESC:
151 RestoreScreen();
152 return 0;
153
154 case KEY_F10:
155 case KEY_ENTER:
156
157 switch(field)
158 {
159 case E1M1: e=1;l=1; exit=1; break;
160 case E1M2: e=1;l=2; exit=1; break;
161 case E1M3: e=1;l=3; exit=1; break;
162 case E1M4: e=1;l=4; exit=1; break;
163 case E1M5: e=1;l=5; exit=1; break;
164 case E1M6: e=1;l=6; exit=1; break;
165 case E1M7: e=1;l=7; exit=1; break;
166 case E1M8: e=1;l=8; exit=1; break;
167 case E1M9: e=1;l=9; exit=1; break;
168 #ifdef DOOM2
169 case E1M10: e=1;l=10; exit=1; break;
170 #endif
171
172 case E2M1: e=2;l=1; exit=1; break;
173 case E2M2: e=2;l=2; exit=1; break;
174 case E2M3: e=2;l=3; exit=1; break;
175 case E2M4: e=2;l=4; exit=1; break;
176 case E2M5: e=2;l=5; exit=1; break;
177 case E2M6: e=2;l=6; exit=1; break;
178 case E2M7: e=2;l=7; exit=1; break;
179 case E2M8: e=2;l=8; exit=1; break;
180 case E2M9: e=2;l=9; exit=1; break;
181 #ifdef DOOM2
182 case E2M10: e=2;l=10; exit=1; break;
183 #endif
184
185 case E3M1: e=3;l=1; exit=1; break;
186 case E3M2: e=3;l=2; exit=1; break;
187 case E3M3: e=3;l=3; exit=1; break;
188 case E3M4: e=3;l=4; exit=1; break;
189 case E3M5: e=3;l=5; exit=1; break;
190 case E3M6: e=3;l=6; exit=1; break;
191 case E3M7: e=3;l=7; exit=1; break;
192 case E3M8: e=3;l=8; exit=1; break;
193 case E3M9: e=3;l=9; exit=1; break;
194 #ifdef DOOM2
195 case E3M10: e=3;l=10; exit=1; break;
196 #endif
197
198 case W_RESPAWN:
199 respawn ^= 1;
200 SetMark(&cwarpitems[W_RESPAWN],respawn);
201 break;
202
203 case W_NOMON:
204 nomonsters ^= 1;
205 SetMark(&cwarpitems[W_NOMON],nomonsters);
206 break;
207 #ifndef HERETIC
208 case W_DM2:
209 deathmatch2 ^= 1;
210 SetMark(&cwarpitems[W_DM2],deathmatch2);
211 break;
212 #endif
213 }
214
215 if (exit)
216 {
217 RestoreScreen();
218 #ifdef DOOM2
219 return ((e-1)*10+l);
220 #else
221 return (e<<8)+l;
222 #endif
223 }
224 }
225 }
226 }
227
228
Something went wrong with that request. Please try again.