mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-17 17:11:32 +00:00
- cleaned up the merge and consolidated redundant code.
This commit is contained in:
parent
f83b21ff26
commit
0e017f1e2d
1 changed files with 13 additions and 48 deletions
|
@ -66,7 +66,6 @@
|
||||||
|
|
||||||
// State.
|
// State.
|
||||||
#include "r_state.h"
|
#include "r_state.h"
|
||||||
#include "r_sky.h"
|
|
||||||
|
|
||||||
#include "c_console.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);
|
CopyPortal(sectortag, plane, reference, alpha, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1090,68 +1089,28 @@ void P_SpawnSkybox(ASkyViewpoint *origin)
|
||||||
{
|
{
|
||||||
sector_t *Sector = origin->Sector;
|
sector_t *Sector = origin->Sector;
|
||||||
if (Sector == NULL)
|
if (Sector == NULL)
|
||||||
{
|
{
|
||||||
Printf("Sector not initialized for SkyCamCompat\n");
|
Printf("Sector not initialized for SkyCamCompat\n");
|
||||||
origin->Sector = Sector = P_PointInSector(origin->x, origin->y);
|
origin->Sector = Sector = P_PointInSector(origin->x, origin->y);
|
||||||
}
|
}
|
||||||
if (Sector)
|
if (Sector)
|
||||||
{
|
{
|
||||||
line_t * refline = NULL;
|
line_t * refline = NULL;
|
||||||
for (short i = 0; i < Sector->linecount; i++)
|
for (short i = 0; i < Sector->linecount; i++)
|
||||||
{
|
{
|
||||||
refline = Sector->lines[i];
|
refline = Sector->lines[i];
|
||||||
if (refline->special == Sector_SetPortal && refline->args[1] == 2)
|
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.
|
// 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);
|
CopyPortal(refline->args[0], refline->args[2], origin, 0, true);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void P_SpawnHorizon(line_t *line)
|
|
||||||
{
|
|
||||||
ASkyViewpoint *origin = Spawn<ASkyViewpoint>(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;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[j].special == Sector_SetPortal &&
|
|
||||||
lines[j].args[1] == 1 &&
|
|
||||||
(lines[j].args[2] == line->args[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
|
// P_SetSectorDamage
|
||||||
//
|
//
|
||||||
|
@ -1503,7 +1462,13 @@ void P_SpawnSpecials (void)
|
||||||
}
|
}
|
||||||
else if (lines[i].args[1] == 3 || lines[i].args[1] == 4)
|
else if (lines[i].args[1] == 3 || lines[i].args[1] == 4)
|
||||||
{
|
{
|
||||||
P_SpawnHorizon(&lines[i]);
|
line_t *line = &lines[i];
|
||||||
|
ASkyViewpoint *origin = Spawn<ASkyViewpoint>(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;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue