smol cleanup
This commit is contained in:
1 parent
8cd79199e8
commit
589c16e1fc
3 files changed
+12
-79
No files matched your search
+1
-69
@@ -584,7 +584,6 @@ static void P_LoadRawSegs(UINT8 *data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Loads the SSECTORS resource from a level.
|
||||
FUNCINLINE static ATTRINLINE void P_LoadRawSubsectors(void *data)
|
||||
{
|
||||
@@ -849,73 +848,6 @@ static void P_LoadRawNodes(UINT8 *data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// P_ReloadRings
|
||||
// Used by NiGHTS, clears all ring/wing/etc items and respawns them
|
||||
//
|
||||
void P_ReloadRings(void)
|
||||
{
|
||||
mobj_t *mo;
|
||||
thinker_t *th;
|
||||
size_t i, numHoops = 0;
|
||||
// Okay, if you have more than 4000 hoops in your map,
|
||||
// you're insane.
|
||||
mapthing_t *hoopsToRespawn[4096];
|
||||
mapthing_t *mt = mapthings;
|
||||
|
||||
// scan the thinkers to find rings/wings/hoops to unset
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)th;
|
||||
|
||||
if (mo->type == MT_HOOPCENTER)
|
||||
{
|
||||
// Hoops give me a headache
|
||||
if (mo->threshold == 4242) // Dead hoop
|
||||
{
|
||||
hoopsToRespawn[numHoops++] = mo->spawnpoint;
|
||||
P_RemoveMobj(mo);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!(mo->type == MT_RING || mo->type == MT_NIGHTSWING || mo->type == MT_COIN
|
||||
|| mo->type == MT_BLUEBALL))
|
||||
continue;
|
||||
|
||||
// Don't auto-disintegrate things being pulled to us
|
||||
if (mo->flags2 & MF2_NIGHTSPULL)
|
||||
continue;
|
||||
|
||||
P_RemoveMobj(mo);
|
||||
}
|
||||
|
||||
// Reiterate through mapthings
|
||||
for (i = 0; i < nummapthings; i++, mt++)
|
||||
{
|
||||
// Notice an omission? We handle hoops differently.
|
||||
if (mt->type == 300 || mt->type == 308 || mt->type == 309
|
||||
|| mt->type == 1706 || (mt->type >= 600 && mt->type <= 609)
|
||||
|| mt->type == 1800)
|
||||
{
|
||||
mt->mobj = NULL;
|
||||
|
||||
// Z for objects Tails 05-26-2002
|
||||
mt->z = (INT16)(R_PointInSubsector(mt->x << FRACBITS, mt->y << FRACBITS)
|
||||
->sector->floorheight>>FRACBITS);
|
||||
|
||||
P_SpawnHoopsAndRings (mt);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < numHoops; i++)
|
||||
{
|
||||
P_SpawnHoopsAndRings(hoopsToRespawn[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_LoadThings
|
||||
//
|
||||
@@ -1642,8 +1574,8 @@ static void P_CreateBlockMap(void)
|
||||
{
|
||||
register size_t i;
|
||||
fixed_t minx = INT32_MAX, miny = INT32_MAX, maxx = INT32_MIN, maxy = INT32_MIN;
|
||||
// First find limits of map
|
||||
|
||||
// First find limits of map
|
||||
for (i = 0; i < numvertexes; i++)
|
||||
{
|
||||
if (vertexes[i].x>>FRACBITS < minx)
|
||||
|
||||
@@ -93,7 +93,6 @@ size_t P_PrecacheLevelFlats(void);
|
||||
void P_AllocMapHeader(INT16 i);
|
||||
|
||||
// Needed for NiGHTS
|
||||
void P_ReloadRings(void);
|
||||
void P_DeleteGrades(INT16 i);
|
||||
void P_AddGradesForMare(INT16 i, UINT8 mare, char *gtext);
|
||||
UINT8 P_GetGrade(UINT32 pscore, INT16 map, UINT8 mare);
|
||||
|
||||
+11
-9
@@ -40,7 +40,6 @@ static void P_UpdateSlopeLightOffset(pslope_t *slope)
|
||||
|
||||
if (slope->normal.z == 0)
|
||||
{
|
||||
|
||||
slope->lightOffset = 0;
|
||||
#ifdef HWRENDER
|
||||
slope->hwLightOffset = 0;
|
||||
@@ -66,7 +65,8 @@ static void P_UpdateSlopeLightOffset(pslope_t *slope)
|
||||
}
|
||||
|
||||
// Calculate line normal
|
||||
void P_CalculateSlopeNormal(pslope_t *slope) {
|
||||
void P_CalculateSlopeNormal(pslope_t *slope)
|
||||
{
|
||||
slope->normal.z = FINECOSINE(slope->zangle>>ANGLETOFINESHIFT);
|
||||
slope->normal.x = -FixedMul(FINESINE(slope->zangle>>ANGLETOFINESHIFT), -slope->d.x);
|
||||
slope->normal.y = -FixedMul(FINESINE(slope->zangle>>ANGLETOFINESHIFT), -slope->d.y);
|
||||
@@ -145,7 +145,8 @@ static void P_ReconfigureVertexSlope(pslope_t *slope)
|
||||
}
|
||||
|
||||
// Recalculate dynamic slopes
|
||||
void P_RunDynamicSlopes(void) {
|
||||
void P_RunDynamicSlopes(void)
|
||||
{
|
||||
pslope_t *slope;
|
||||
|
||||
for (slope = slopelist; slope; slope = slope->next) {
|
||||
@@ -329,7 +330,7 @@ void P_SpawnSlope_Line(int linenum)
|
||||
origin.y = line->v1->y + (line->v2->y - line->v1->y)/2;
|
||||
|
||||
// For FOF slopes, make a special function to copy to the xy origin & direction relative to the position of the FOF on the map!
|
||||
if(frontfloor || frontceil)
|
||||
if (frontfloor || frontceil)
|
||||
{
|
||||
line->frontsector->hasslope = true; // Tell the software renderer that we're sloped
|
||||
|
||||
@@ -353,7 +354,7 @@ void P_SpawnSlope_Line(int linenum)
|
||||
|
||||
// TODO: We take origin and point 's xy values and translate them to the center of an FOF!
|
||||
|
||||
if(frontfloor)
|
||||
if (frontfloor)
|
||||
{
|
||||
fixed_t highest, lowest;
|
||||
size_t l;
|
||||
@@ -462,7 +463,7 @@ void P_SpawnSlope_Line(int linenum)
|
||||
P_CalculateSlopeNormal(cslope);
|
||||
}
|
||||
}
|
||||
if(backfloor || backceil)
|
||||
if (backfloor || backceil)
|
||||
{
|
||||
line->backsector->hasslope = true; // Tell the software renderer that we're sloped
|
||||
|
||||
@@ -485,7 +486,7 @@ void P_SpawnSlope_Line(int linenum)
|
||||
direction.x = -direction.x;
|
||||
direction.y = -direction.y;
|
||||
|
||||
if(backfloor)
|
||||
if (backfloor)
|
||||
{
|
||||
fixed_t highest, lowest;
|
||||
size_t l;
|
||||
@@ -530,7 +531,7 @@ void P_SpawnSlope_Line(int linenum)
|
||||
|
||||
P_CalculateSlopeNormal(fslope);
|
||||
}
|
||||
if(backceil)
|
||||
if (backceil)
|
||||
{
|
||||
fixed_t highest, lowest;
|
||||
size_t l;
|
||||
@@ -680,7 +681,8 @@ pslope_t *P_SlopeById(UINT16 id)
|
||||
}
|
||||
|
||||
// Reset the dynamic slopes pointer, and read all of the fancy schmancy slopes
|
||||
void P_ResetDynamicSlopes(void) {
|
||||
void P_ResetDynamicSlopes(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
slopelist = NULL;
|
||||
|
||||
Reference in new issue
Block a user