mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Checkpoint: Move fadingdata to line_t (or ffloor_t?)
This commit is contained in:
parent
d92fca91d1
commit
c56dc6d0c7
2 changed files with 80 additions and 34 deletions
|
|
@ -2578,8 +2578,8 @@ static inline void LoadFadeThinker(actionf_p1 thinker)
|
||||||
ht->doghostfade = READUINT8(save_p);
|
ht->doghostfade = READUINT8(save_p);
|
||||||
|
|
||||||
line_t *ffloorline = LoadLine(ht->affectee);
|
line_t *ffloorline = LoadLine(ht->affectee);
|
||||||
if (ffloorline && ffloorline->frontsector)
|
if (ffloorline)
|
||||||
ffloorline->frontsector->fadingdata = ht;
|
ffloorline->fadingdata = ht;
|
||||||
|
|
||||||
P_AddThinker(&ht->thinker);
|
P_AddThinker(&ht->thinker);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
110
src/p_spec.c
110
src/p_spec.c
|
|
@ -3103,43 +3103,89 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
|
|
||||||
case 452: // Fade FOF
|
case 452: // Fade FOF
|
||||||
{
|
{
|
||||||
INT32 s, j;
|
INT16 destvalue = (INT16)(sides[line->sidenum[1]].textureoffset>>FRACBITS);
|
||||||
for (s = -1; (s = P_FindSectorFromLineTag(line, s)) >= 0 ;)
|
INT16 speed = (INT16)(sides[line->sidenum[1]].rowoffset>>FRACBITS);
|
||||||
for (j = 0; (unsigned)j < sectors[s].linecount; j++)
|
INT16 sectag = (INT16)(sides[line->sidenum[0]].textureoffset>>FRACBITS);
|
||||||
if (sectors[s].lines[j]->special >= 100 && sectors[s].lines[j]->special < 300)
|
INT16 foftag = (INT16)(sides[line->sidenum[0]].rowoffset>>FRACBITS);
|
||||||
{
|
sector_t *sec; // Sector that the FOF is visible in
|
||||||
if (sides[line->sidenum[0]].rowoffset>>FRACBITS > 0)
|
ffloor_t *rover; // FOF that we are going to crumble
|
||||||
P_AddMasterFader(sides[line->sidenum[0]].textureoffset>>FRACBITS,
|
|
||||||
sides[line->sidenum[0]].rowoffset>>FRACBITS,
|
for (secnum = -1; (secnum = P_FindSectorFromTag(sectag, secnum)) >= 0 ;)
|
||||||
(line->flags & ML_BLOCKMONSTERS), // handle FF_EXISTS
|
{
|
||||||
!(line->flags & ML_NOCLIMB), // do not handle FF_TRANSLUCENT
|
sec = sectors + secnum;
|
||||||
(line->flags & ML_BOUNCY), // handle FF_SOLID
|
|
||||||
(line->flags & ML_EFFECT1), // handle spawnflags
|
if (!sec->ffloors)
|
||||||
(line->flags & ML_EFFECT2), // enable flags on fade-in finish only
|
{
|
||||||
(INT32)(sectors[s].lines[j]-lines));
|
CONS_Debug(DBG_GAMELOGIC, "Line type 452 Executor: Target sector #%d has no FOFs.\n", secnum);
|
||||||
else
|
return;
|
||||||
{
|
}
|
||||||
P_RemoveFading(&lines[(INT32)(sectors[s].lines[j]-lines)]);
|
|
||||||
P_FindFakeFloorsDoAlpha(sides[line->sidenum[0]].textureoffset>>FRACBITS,
|
for (rover = sec->ffloors; rover; rover = rover->next)
|
||||||
0, // set alpha immediately
|
{
|
||||||
(line->flags & ML_BLOCKMONSTERS), // handle FF_EXISTS
|
if (rover->master->frontsector->tag == foftag)
|
||||||
!(line->flags & ML_NOCLIMB), // do not handle FF_TRANSLUCENT
|
break;
|
||||||
(line->flags & ML_BOUNCY), // handle FF_SOLID
|
}
|
||||||
(line->flags & ML_EFFECT1), // handle spawnflags
|
|
||||||
(line->flags & ML_EFFECT2), // enable flags on fade-in finish only
|
if (!rover)
|
||||||
(INT32)(sectors[s].lines[j]-lines));
|
{
|
||||||
}
|
CONS_Debug(DBG_GAMELOGIC, "Line type 452 Executor: Can't find a FOF control sector with tag %d\n", foftag);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (speed > 0)
|
||||||
|
P_AddMasterFader(destvalue, speed,
|
||||||
|
(line->flags & ML_BLOCKMONSTERS), // handle FF_EXISTS
|
||||||
|
!(line->flags & ML_NOCLIMB), // do not handle FF_TRANSLUCENT
|
||||||
|
(line->flags & ML_BOUNCY), // handle FF_SOLID
|
||||||
|
(line->flags & ML_EFFECT1), // handle spawnflags
|
||||||
|
(line->flags & ML_EFFECT2), // enable flags on fade-in finish only
|
||||||
|
(INT32)(rover->master-lines));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
P_RemoveFading(&lines[(INT32)(sectors[s].lines[j]-lines)]);
|
||||||
|
P_FindFakeFloorsDoAlpha(destvalue, 0, // set alpha immediately
|
||||||
|
(line->flags & ML_BLOCKMONSTERS), // handle FF_EXISTS
|
||||||
|
!(line->flags & ML_NOCLIMB), // do not handle FF_TRANSLUCENT
|
||||||
|
(line->flags & ML_BOUNCY), // handle FF_SOLID
|
||||||
|
(line->flags & ML_EFFECT1), // handle spawnflags
|
||||||
|
(line->flags & ML_EFFECT2), // enable flags on fade-in finish only
|
||||||
|
(INT32)(sectors[s].lines[j]-lines));
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 453: // Stop fading FOF
|
case 453: // Stop fading FOF
|
||||||
{
|
{
|
||||||
INT32 s, j;
|
INT16 sectag = (INT16)(sides[line->sidenum[0]].textureoffset>>FRACBITS);
|
||||||
for (s = -1; (s = P_FindSectorFromLineTag(line, s)) >= 0 ;)
|
INT16 foftag = (INT16)(sides[line->sidenum[0]].rowoffset>>FRACBITS);
|
||||||
for (j = 0; (unsigned)j < sectors[s].linecount; j++)
|
sector_t *sec; // Sector that the FOF is visible in
|
||||||
if (sectors[s].lines[j]->special >= 100 && sectors[s].lines[j]->special < 300)
|
ffloor_t *rover; // FOF that we are going to crumble
|
||||||
P_RemoveFading(&lines[(INT32)(sectors[s].lines[j]-lines)]);
|
|
||||||
|
for (secnum = -1; (secnum = P_FindSectorFromTag(sectag, secnum)) >= 0 ;)
|
||||||
|
{
|
||||||
|
sec = sectors + secnum;
|
||||||
|
|
||||||
|
if (!sec->ffloors)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Line type 453 Executor: Target sector #%d has no FOFs.\n", secnum);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (rover = sec->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (rover->master->frontsector->tag == foftag)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rover)
|
||||||
|
{
|
||||||
|
CONS_Debug(DBG_GAMELOGIC, "Line type 453 Executor: Can't find a FOF control sector with tag %d\n", foftag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
P_RemoveFading(&lines[(INT32)(sectors[s].lines[j]-lines)]);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue