Mercurial > hg > forks > yadex
diff 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 |
line wrap: on
line diff
--- a/src/s_lift.cc Mon Oct 06 12:30:57 2014 +0300 +++ b/src/s_lift.cc Mon Oct 06 12:42:55 2014 +0300 @@ -40,7 +40,7 @@ turn a Sector into a lift: change the linedefs and sidedefs */ -void MakeLiftFromSector(int sector) /* SWAP! */ +void MakeLiftFromSector(int sector) // SWAP! { int sd1, sd2; int n, s, tag; @@ -52,7 +52,7 @@ ldflip = NULL; ld1s = NULL; sect = NULL; -/* build lists of linedefs that border the Sector */ +// build lists of linedefs that border the Sector for (n = 0; n < NumLineDefs; n++) { sd1 = LineDefs[n].sidedef1; @@ -61,14 +61,14 @@ { if (SideDefs[sd2].sector == sector) { - SelectObject(&ldok, n); /* already ok */ + SelectObject(&ldok, n); // already ok s = SideDefs[sd1].sector; if (s != sector && !IsSelected(sect, s)) SelectObject(§, s); } if (SideDefs[sd1].sector == sector) { - SelectObject(&ldflip, n); /* will be flipped */ + SelectObject(&ldflip, n); // will be flipped s = SideDefs[sd2].sector; if (s != sector && !IsSelected(sect, s)) SelectObject(§, s); @@ -77,10 +77,10 @@ else if (sd1 >= 0 && sd2 < 0) { if (SideDefs[sd1].sector == sector) - SelectObject(&ld1s, n); /* wall (one-sided) */ + SelectObject(&ld1s, n); // wall (one-sided) } } -/* there must be a way to go on the lift... */ +// there must be a way to go on the lift... if (sect == NULL) { Beep(); @@ -92,10 +92,10 @@ ForgetSelection(&ld1s); return; } -/* flip the linedefs that have the wrong orientation */ +// flip the linedefs that have the wrong orientation if (ldflip != NULL) FlipLineDefs(ldflip, 1); -/* merge the two selection lists */ +// merge the two selection lists while (ldflip != NULL) { if (!IsSelected(ldok, ldflip->objnum)) @@ -103,10 +103,10 @@ UnSelectObject(&ldflip, ldflip->objnum); } -/* find a free tag number */ +// find a free tag number tag = FindFreeTag(); -/* find the minimum and maximum altitudes */ +// find the minimum and maximum altitudes minh = 32767; maxh = -32767; for (curs = sect; curs; curs = curs->next) @@ -118,28 +118,28 @@ } ForgetSelection(§); -/* change the lift's floor height if necessary */ +// change the lift's floor height if necessary if (Sectors[sector].floorh < maxh) Sectors[sector].floorh = maxh; -/* change the lift's ceiling height if necessary */ +// change the lift's ceiling height if necessary if (Sectors[sector].ceilh < maxh + DOOM_PLAYER_HEIGHT) Sectors[sector].ceilh = maxh + DOOM_PLAYER_HEIGHT; -/* assign the new tag number to the lift */ +// assign the new tag number to the lift Sectors[sector].tag = tag; -/* change the linedefs and sidedefs */ +// change the linedefs and sidedefs while (ldok != NULL) { - /* give the "lower lift" type and flags to the linedef */ + // give the "lower lift" type and flags to the linedef n = ldok->objnum; - LineDefs[n].type = 62; /* lower lift (switch) */ + LineDefs[n].type = 62; // lower lift (switch) LineDefs[n].flags = 0x04; LineDefs[n].tag = tag; - sd1 = LineDefs[n].sidedef1; /* outside */ - sd2 = LineDefs[n].sidedef2; /* inside */ - /* adjust the textures for the sidedef visible from the outside */ + sd1 = LineDefs[n].sidedef1; // outside + sd2 = LineDefs[n].sidedef2; // inside + // adjust the textures for the sidedef visible from the outside if (strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) { if (!strncmp(SideDefs[sd1].tex2, "-", WAD_TEX_NAME)) @@ -148,7 +148,7 @@ } if (!strncmp(SideDefs[sd1].tex2, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd1].tex2, "SHAWN2", WAD_TEX_NAME); - /* adjust the textures for the sidedef visible from the lift */ + // adjust the textures for the sidedef visible from the lift strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); s = SideDefs[sd1].sector; if (Sectors[s].floorh > minh) @@ -168,34 +168,34 @@ strncpy(SideDefs[sd2].tex2, "-", WAD_TEX_NAME); } strncpy(SideDefs[sd2].tex3, "-", WAD_TEX_NAME); - /* if the ceiling of the sector is lower than that of the lift */ + // if the ceiling of the sector is lower than that of the lift if (Sectors[s].ceilh < Sectors[sector].ceilh) { if (strncmp(SideDefs[sd2].tex1, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd2].tex1, cfg.def.upper_texture, WAD_TEX_NAME); } - /* if the floor of the sector is above the lift */ + // if the floor of the sector is above the lift if (Sectors[s].floorh >= Sectors[sector].floorh) { - LineDefs[n].type = 88; /* lower lift (walk through) */ - /* flip it, just for fun */ + LineDefs[n].type = 88; // lower lift (walk through) + // flip it, just for fun curs = NULL; SelectObject(&curs, n); FlipLineDefs(curs, 1); ForgetSelection(&curs); } - /* done with this linedef */ + // done with this linedef UnSelectObject(&ldok, n); } while (ld1s != NULL) { - /* these are the lift walls (one-sided) */ + // these are the lift walls (one-sided) n = ld1s->objnum; LineDefs[n].flags = 0x01; sd1 = LineDefs[n].sidedef1; - /* adjust the textures for the sidedef */ + // adjust the textures for the sidedef if (!strncmp(SideDefs[sd1].tex3, "-", WAD_TEX_NAME)) strncpy(SideDefs[sd1].tex3, cfg.def.middle_texture, WAD_TEX_NAME); strncpy(SideDefs[sd1].tex1, "-", WAD_TEX_NAME);