mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- added a 'copy portal' option so that linedef-based portals can be transferred to sectors that already have a tag.
SVN r2053 (trunk)
This commit is contained in:
parent
3f059898fd
commit
4a8518e4f1
2 changed files with 42 additions and 12 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<numlines;i++)
|
||||
|
@ -858,15 +871,32 @@ void P_SpawnPortal(line_t *line, int sectortag, INTBOOL ceiling, int alpha)
|
|||
|
||||
for (int s=-1; (s = P_FindSectorFromTag(sectortag,s)) >= 0;)
|
||||
{
|
||||
if (ceiling)
|
||||
SetPortal(§ors[s], ceiling, reference);
|
||||
}
|
||||
|
||||
for (int j=0;j<numlines;j++)
|
||||
{
|
||||
// Check if this portal needs to be copied to other sectors
|
||||
// This must be done here to ensure that it gets done only after the portal is set up
|
||||
if (lines[i].special == Sector_SetPortal &&
|
||||
lines[i].args[1] == 1 &&
|
||||
lines[i].args[2] == ceiling &&
|
||||
lines[i].args[3] == sectortag)
|
||||
{
|
||||
if (sectors[s].CeilingSkyBox == NULL) sectors[s].CeilingSkyBox = reference;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sectors[s].FloorSkyBox == NULL) sectors[s].FloorSkyBox = reference;
|
||||
if (lines[i].args[0] == 0)
|
||||
{
|
||||
SetPortal(lines[i].frontsector, ceiling, reference);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int s=-1; (s = P_FindSectorFromTag(lines[i].args[0],s)) >= 0;)
|
||||
{
|
||||
SetPortal(§ors[s], ceiling, reference);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue