Mercurial > hg > forks > yadex
annotate src/s_lift.cc @ 107:20aa5a515896
Reformat one line /* */ comments to //
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 06 Oct 2014 12:42:55 +0300 |
parents | 2f1ecc1c5f72 |
children |
rev | line source |
---|---|
0 | 1 /* |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
2 * s_lift.cc |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
3 * Make lift from sector |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
4 * AYM 1998-02-03 |
0 | 5 */ |
6 | |
7 | |
8 /* | |
9 This file is part of Yadex. | |
10 | |
11 Yadex incorporates code from DEU 5.21 that was put in the public domain in | |
12 1994 by Raphaël Quinet and Brendon Wyber. | |
13 | |
14 The rest of Yadex is Copyright © 1997-2003 André Majorel and others. | |
15 | |
16 This program is free software; you can redistribute it and/or modify it under | |
17 the terms of the GNU General Public License as published by the Free Software | |
18 Foundation; either version 2 of the License, or (at your option) any later | |
19 version. | |
20 | |
21 This program is distributed in the hope that it will be useful, but WITHOUT | |
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
23 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
24 | |
25 You should have received a copy of the GNU General Public License along with | |
26 this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |
27 Place, Suite 330, Boston, MA 02111-1307, USA. | |
28 */ | |
29 | |
30 | |
31 #include "yadex.h" | |
32 #include "dialog.h" | |
33 #include "levels.h" | |
34 #include "objects.h" | |
35 #include "objid.h" | |
36 #include "selectn.h" | |
37 | |
38 | |
39 /* | |
40 turn a Sector into a lift: change the linedefs and sidedefs | |
41 */ | |
42 | |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
43 void MakeLiftFromSector(int sector) // SWAP! |
0 | 44 { |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
45 int sd1, sd2; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
46 int n, s, tag; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
47 SelPtr ldok, ldflip, ld1s; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
48 SelPtr sect, curs; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
49 int minh, maxh; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
50 |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
51 ldok = NULL; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
52 ldflip = NULL; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
53 ld1s = NULL; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
54 sect = NULL; |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
55 // build lists of linedefs that border the Sector |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
56 for (n = 0; n < NumLineDefs; n++) |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
57 { |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
58 sd1 = LineDefs[n].sidedef1; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
59 sd2 = LineDefs[n].sidedef2; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
60 if (sd1 >= 0 && sd2 >= 0) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
61 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
62 if (SideDefs[sd2].sector == sector) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
63 { |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
64 SelectObject(&ldok, n); // already ok |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
65 s = SideDefs[sd1].sector; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
66 if (s != sector && !IsSelected(sect, s)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
67 SelectObject(§, s); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
68 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
69 if (SideDefs[sd1].sector == sector) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
70 { |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
71 SelectObject(&ldflip, n); // will be flipped |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
72 s = SideDefs[sd2].sector; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
73 if (s != sector && !IsSelected(sect, s)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
74 SelectObject(§, s); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
75 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
76 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
77 else if (sd1 >= 0 && sd2 < 0) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
78 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
79 if (SideDefs[sd1].sector == sector) |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
80 SelectObject(&ld1s, n); // wall (one-sided) |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
81 } |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
82 } |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
83 // there must be a way to go on the lift... |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
84 if (sect == NULL) |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
85 { |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
86 Beep(); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
87 Notify(-1, -1, |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
88 "The lift must be connected to at least one other Sector.", |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
89 NULL); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
90 ForgetSelection(&ldok); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
91 ForgetSelection(&ldflip); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
92 ForgetSelection(&ld1s); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
93 return; |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
94 } |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
95 // flip the linedefs that have the wrong orientation |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
96 if (ldflip != NULL) |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
97 FlipLineDefs(ldflip, 1); |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
98 // merge the two selection lists |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
99 while (ldflip != NULL) |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
100 { |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
101 if (!IsSelected(ldok, ldflip->objnum)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
102 SelectObject(&ldok, ldflip->objnum); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
103 UnSelectObject(&ldflip, ldflip->objnum); |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
104 } |
0 | 105 |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
106 // find a free tag number |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
107 tag = FindFreeTag(); |
0 | 108 |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
109 // find the minimum and maximum altitudes |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
110 minh = 32767; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
111 maxh = -32767; |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
112 for (curs = sect; curs; curs = curs->next) |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
113 { |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
114 if (Sectors[curs->objnum].floorh < minh) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
115 minh = Sectors[curs->objnum].floorh; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
116 if (Sectors[curs->objnum].floorh > maxh) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
117 maxh = Sectors[curs->objnum].floorh; |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
118 } |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
119 ForgetSelection(§); |
0 | 120 |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
121 // change the lift's floor height if necessary |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
122 if (Sectors[sector].floorh < maxh) |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
123 Sectors[sector].floorh = maxh; |
0 | 124 |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
125 // change the lift's ceiling height if necessary |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
126 if (Sectors[sector].ceilh < maxh + DOOM_PLAYER_HEIGHT) |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
127 Sectors[sector].ceilh = maxh + DOOM_PLAYER_HEIGHT; |
0 | 128 |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
129 // assign the new tag number to the lift |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
130 Sectors[sector].tag = tag; |
0 | 131 |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
132 // change the linedefs and sidedefs |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
133 while (ldok != NULL) |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
134 { |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
135 // give the "lower lift" type and flags to the linedef |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
136 n = ldok->objnum; |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
137 LineDefs[n].type = 62; // lower lift (switch) |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
138 LineDefs[n].flags = 0x04; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
139 LineDefs[n].tag = tag; |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
140 sd1 = LineDefs[n].sidedef1; // outside |
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
141 sd2 = LineDefs[n].sidedef2; // inside |
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
142 // adjust the textures for the sidedef visible from the outside |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
143 if (strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
144 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
145 if (!strncmp(SideDefs[sd1].tex2, "-", WAD_TEX_NAME)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
146 strncpy(SideDefs[sd1].tex2, SideDefs[sd1].tex3, WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
147 strncpy(SideDefs[sd1].tex3, "-", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
148 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
149 if (!strncmp(SideDefs[sd1].tex2, "-", WAD_TEX_NAME)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
150 strncpy(SideDefs[sd1].tex2, "SHAWN2", WAD_TEX_NAME); |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
151 // adjust the textures for the sidedef visible from the lift |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
152 strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
153 s = SideDefs[sd1].sector; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
154 if (Sectors[s].floorh > minh) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
155 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
156 if (strncmp(SideDefs[sd2].tex3, "-", WAD_TEX_NAME)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
157 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
158 if (!strncmp(SideDefs[sd2].tex2, "-", WAD_TEX_NAME)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
159 strncpy(SideDefs[sd2].tex2, SideDefs[sd1].tex3, |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
160 WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
161 strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
162 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
163 if (!strncmp(SideDefs[sd2].tex2, "-", WAD_TEX_NAME)) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
164 strncpy(SideDefs[sd2].tex2, "SHAWN2", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
165 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
166 else |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
167 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
168 strncpy(SideDefs[sd2].tex2, "-", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
169 } |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
170 strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
171 // if the ceiling of the sector is lower than that of the lift |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
172 if (Sectors[s].ceilh < Sectors[sector].ceilh) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
173 { |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
174 if (strncmp(SideDefs[sd2].tex1, "-", WAD_TEX_NAME)) |
80
2f1ecc1c5f72
Huge cleanup -- move some global variables into a struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
175 strncpy(SideDefs[sd2].tex1, cfg.def.upper_texture, |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
176 WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
177 } |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
178 // if the floor of the sector is above the lift |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
179 if (Sectors[s].floorh >= Sectors[sector].floorh) |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
180 { |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
181 LineDefs[n].type = 88; // lower lift (walk through) |
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
182 // flip it, just for fun |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
183 curs = NULL; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
184 SelectObject(&curs, n); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
185 FlipLineDefs(curs, 1); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
186 ForgetSelection(&curs); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
187 } |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
188 // done with this linedef |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
189 UnSelectObject(&ldok, n); |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
190 } |
0 | 191 |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
192 while (ld1s != NULL) |
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
193 { |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
194 // these are the lift walls (one-sided) |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
195 n = ld1s->objnum; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
196 LineDefs[n].flags = 0x01; |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
197 sd1 = LineDefs[n].sidedef1; |
107
20aa5a515896
Reformat one line /* */ comments to //
Matti Hamalainen <ccr@tnsp.org>
parents:
80
diff
changeset
|
198 // adjust the textures for the sidedef |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
199 if (!strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) |
80
2f1ecc1c5f72
Huge cleanup -- move some global variables into a struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
200 strncpy(SideDefs[sd1].tex3, cfg.def.middle_texture, WAD_TEX_NAME); |
33
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
201 strncpy(SideDefs[sd1].tex1, "-", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
202 strncpy(SideDefs[sd1].tex2, "-", WAD_TEX_NAME); |
a68786b9c74b
Oops, used indent with tabs enabled. Remove tabs.
Matti Hamalainen <ccr@tnsp.org>
parents:
25
diff
changeset
|
203 UnSelectObject(&ld1s, n); |
25
8eaf72e2041b
Reindent the source using GNU indent and "indent -i4 -bli0 -npcs -nprs -npsl".
Matti Hamalainen <ccr@tnsp.org>
parents:
22
diff
changeset
|
204 } |
0 | 205 } |