From 4a8518e4f190e4b77c76057505400788c35a5473 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 28 Dec 2009 00:01:07 +0000 Subject: [PATCH] - added a 'copy portal' option so that linedef-based portals can be transferred to sectors that already have a tag. SVN r2053 (trunk) --- src/p_setup.cpp | 12 ++++++------ src/p_spec.cpp | 42 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index f844b01ea..ab467a77e 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1601,9 +1601,6 @@ void P_SpawnThings (int position) { int numthings = MapThingsConverted.Size(); - // [RH] Spawn slope creating things first. - P_SpawnSlopeMakers (&MapThingsConverted[0], &MapThingsConverted[numthings]); - for (int i=0; i < numthings; i++) { SpawnMapThing (i, &MapThingsConverted[i], position); @@ -3623,11 +3620,14 @@ void P_SetupLevel (char *lumpname, int position) deathmatchstarts.Clear (); - // Spawn 3d floors - must be done before spawning things so it can't be done in P_SpawnSpecials - P_Spawn3DFloors(); - if (!buildmap) { + // [RH] Spawn slope creating things first. + P_SpawnSlopeMakers (&MapThingsConverted[0], &MapThingsConverted[MapThingsConverted.Size()]); + + // Spawn 3d floors - must be done before spawning things so it can't be done in P_SpawnSpecials + P_Spawn3DFloors(); + times[14].Clock(); P_SpawnThings(position); diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 1571ef31b..525a601fa 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -828,6 +828,19 @@ void DWallLightTransfer::DoTransfer (BYTE lightlevel, int target, BYTE flags) } } + +inline void SetPortal(sector_t *sector, INTBOOL ceiling, AStackPoint *portal) +{ + if (ceiling) + { + if (sector->CeilingSkyBox == NULL) sector->CeilingSkyBox = portal; + } + else + { + if (sector->FloorSkyBox == NULL) sector->FloorSkyBox = portal; + } +} + void P_SpawnPortal(line_t *line, int sectortag, INTBOOL ceiling, int alpha) { for (int i=0;i= 0;) { - if (ceiling) + SetPortal(§ors[s], ceiling, reference); + } + + for (int j=0;j= 0;) + { + SetPortal(§ors[s], ceiling, reference); + } + } } } + return; } }