From 0e017f1e2d60736dbbb5bfc4fd15e0a6b2ac2e24 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 11 Jan 2016 15:40:25 +0100 Subject: [PATCH] - cleaned up the merge and consolidated redundant code. --- src/p_spec.cpp | 61 +++++++++++--------------------------------------- 1 file changed, 13 insertions(+), 48 deletions(-) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index e4f98f07f..4a3df3994 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -66,7 +66,6 @@ // State. #include "r_state.h" -#include "r_sky.h" #include "c_console.h" @@ -1080,7 +1079,7 @@ void P_SpawnPortal(line_t *line, int sectortag, int plane, int alpha) CopyPortal(sectortag, plane, reference, alpha, false); return; - } + } } } @@ -1090,68 +1089,28 @@ void P_SpawnSkybox(ASkyViewpoint *origin) { sector_t *Sector = origin->Sector; if (Sector == NULL) - { + { Printf("Sector not initialized for SkyCamCompat\n"); origin->Sector = Sector = P_PointInSector(origin->x, origin->y); } if (Sector) - { + { line_t * refline = NULL; for (short i = 0; i < Sector->linecount; i++) - { + { refline = Sector->lines[i]; if (refline->special == Sector_SetPortal && refline->args[1] == 2) - { + { // We found the setup linedef for this skybox, so let's use it for our init. CopyPortal(refline->args[0], refline->args[2], origin, 0, true); return; - } - } - } -} - - -void P_SpawnHorizon(line_t *line) -{ - ASkyViewpoint *origin = Spawn(0, 0, 0, NO_REPLACE); - origin->Sector = line->frontsector; - origin->flags7 |= MF7_HANDLENODELAY; // mark as 'special' - if (line->args[1] == 3) origin->flags |= MF_FLOAT; // well, it actually does 'float'... :P - - - int s; - FSectorTagIterator itr(line->args[0]); - while ((s = itr.Next()) >= 0) - { - SetPortal(§ors[s], line->args[2], origin, 0); - } - - for (int j=0;jargs[2] || lines[j].args[2] == 3) && - lines[j].args[3] == line->args[0]) - { - if (lines[j].args[0] == 0) - { - SetPortal(lines[j].frontsector, line->args[2], origin, 0); - } - else - { - FSectorTagIterator itr(lines[j].args[0]); - while ((s = itr.Next()) >= 0) - { - SetPortal(§ors[s], line->args[2], origin, 0); - } } } } } + // // P_SetSectorDamage // @@ -1503,7 +1462,13 @@ void P_SpawnSpecials (void) } else if (lines[i].args[1] == 3 || lines[i].args[1] == 4) { - P_SpawnHorizon(&lines[i]); + line_t *line = &lines[i]; + ASkyViewpoint *origin = Spawn(0, 0, 0, NO_REPLACE); + origin->Sector = line->frontsector; + origin->flags7 |= MF7_HANDLENODELAY; // mark as 'special' + if (line->args[1] == 3) origin->flags |= MF_FLOAT; // well, it actually does 'float'... :P + + CopyPortal(line->args[0], line->args[2], origin, 0, true); } break;