Merge branch 'master' into float

# Conflicts:
#	src/g_heretic/a_hereticweaps.cpp
#	src/p_map.cpp
#	src/p_mobj.cpp
#	src/p_things.cpp
#	src/portal.cpp
This commit is contained in:
Christoph Oelckers 2016-03-15 00:16:13 +01:00
commit c64eee5b15
104 changed files with 1206 additions and 1073 deletions

View file

@ -246,12 +246,15 @@ static line_t *FindDestination(line_t *src, int tag)
static void SetRotation(FLinePortal *port)
{
if (port != NULL && port->mDestination != NULL)
{
line_t *dst = port->mDestination;
line_t *line = port->mOrigin;
double angle = g_atan2(dst->dy, dst->dx) - g_atan2(line->dy, line->dx) + M_PI;
port->mSinRot = FLOAT2FIXED(g_sin(angle));
port->mCosRot = FLOAT2FIXED(g_cos(angle));
port->mAngleDiff = RAD2ANGLE(angle);
}
}
//============================================================================
@ -934,7 +937,7 @@ void P_CreateLinkedPortals()
TThinkerIterator<AStackPoint> it;
AStackPoint *mo;
TArray<AStackPoint *> orgs;
int id = 0;
int id = 1;
bool bogus = false;
while ((mo = it.Next()))
@ -953,12 +956,9 @@ void P_CreateLinkedPortals()
}
}
}
if (orgs.Size() == 0)
id = 1;
if (orgs.Size() != 0)
{
// Create the 0->0 translation which is always needed.
Displacements.Create(1);
return;
}
for (int i = 0; i < numsectors; i++)
{
for (int j = 0; j < 2; j++)
@ -971,19 +971,19 @@ void P_CreateLinkedPortals()
{
// The engine cannot deal with portals on a sloped plane.
sectors[i].SkyBoxes[j] = NULL;
Printf("Portal on %s of sector %d is sloped and will be disabled\n", j==0? "floor":"ceiling", i);
Printf("Portal on %s of sector %d is sloped and will be disabled\n", j == 0 ? "floor" : "ceiling", i);
}
}
}
}
// Group all sectors, starting at each portal origin.
id = 1;
for (unsigned i = 0; i < orgs.Size(); i++)
{
if (CollectSectors(id, orgs[i]->Sector)) id++;
if (CollectSectors(id, orgs[i]->Mate->Sector)) id++;
}
}
for (unsigned i = 0; i < linePortals.Size(); i++)
{
if (linePortals[i].mType == PORTT_LINKED)