mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +00:00
- moved sectno method to DCoreActor.
This commit is contained in:
parent
f0b7fe4add
commit
88e4bb9f79
10 changed files with 17 additions and 16 deletions
|
@ -58,6 +58,12 @@ public:
|
||||||
spr.sectp = sect;
|
spr.sectp = sect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sectno() const
|
||||||
|
{
|
||||||
|
return spr.sectp ? ::sector.IndexOf(spr.sectp) : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// holds pointers to the game-side actors.
|
// holds pointers to the game-side actors.
|
||||||
|
|
|
@ -629,11 +629,6 @@ inline sectortype* spritetypebase::sector() const
|
||||||
return sectp;
|
return sectp;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int spritetypebase::sectno() const
|
|
||||||
{
|
|
||||||
return sectp? ::sector.IndexOf(sectp) : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline sectortype* walltype::nextSector() const
|
inline sectortype* walltype::nextSector() const
|
||||||
{
|
{
|
||||||
return !validSectorIndex(nextsector)? nullptr : &::sector[nextsector];
|
return !validSectorIndex(nextsector)? nullptr : &::sector[nextsector];
|
||||||
|
|
|
@ -677,7 +677,7 @@ bool HWLineToSpritePortal::Setup(HWDrawInfo* di, FRenderState& rstate, Clipper*
|
||||||
int origy = vp.Pos.Y * -16;
|
int origy = vp.Pos.Y * -16;
|
||||||
|
|
||||||
vp.SectNums = nullptr;
|
vp.SectNums = nullptr;
|
||||||
vp.SectCount = camera->spr.sectno();
|
vp.SectCount = camera->sectno();
|
||||||
vp.Pos.X = npos.X;
|
vp.Pos.X = npos.X;
|
||||||
vp.Pos.Y = npos.Y;
|
vp.Pos.Y = npos.Y;
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ inline void GetActorExtents(DBloodActor* actor, int* top, int* bottom)
|
||||||
|
|
||||||
inline bool CheckSector(const BitArray& bits, DBloodActor* act)
|
inline bool CheckSector(const BitArray& bits, DBloodActor* act)
|
||||||
{
|
{
|
||||||
return bits[act->spr.sectno()];
|
return bits[act->sectno()];
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsTargetTeammate(DBloodActor* pSource, DBloodActor* pTarget)
|
inline bool IsTargetTeammate(DBloodActor* pSource, DBloodActor* pTarget)
|
||||||
|
|
|
@ -722,7 +722,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
BloodStatIterator it(kStatExplosion);
|
BloodStatIterator it(kStatExplosion);
|
||||||
while (auto actor = it.Next())
|
while (auto actor = it.Next())
|
||||||
{
|
{
|
||||||
if (actor->hasX() && gotsector[actor->spr.sectno()])
|
if (actor->hasX() && gotsector[actor->sectno()])
|
||||||
{
|
{
|
||||||
brightness += actor->xspr.data3 * 32;
|
brightness += actor->xspr.data3 * 32;
|
||||||
}
|
}
|
||||||
|
@ -735,7 +735,7 @@ void viewDrawScreen(bool sceneonly)
|
||||||
case kMissileTeslaAlt:
|
case kMissileTeslaAlt:
|
||||||
case kMissileFlareAlt:
|
case kMissileFlareAlt:
|
||||||
case kMissileTeslaRegular:
|
case kMissileTeslaRegular:
|
||||||
if (gotsector[actor->spr.sectno()]) brightness += 256;
|
if (gotsector[actor->sectno()]) brightness += 256;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ void DoSector(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
if (lVar1 == g_iThisActorID)
|
if (lVar1 == g_iThisActorID)
|
||||||
{
|
{
|
||||||
// if they've asked for 'this', then use 'this'...
|
// if they've asked for 'this', then use 'this'...
|
||||||
iSector = sActor->spr.sectno();
|
iSector = sActor->sectno();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1232,7 +1232,7 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
case ACTOR_SECTNUM: // made read only because this is not safe.
|
case ACTOR_SECTNUM: // made read only because this is not safe.
|
||||||
if (!bSet) /*changespritesect(iActor, lValue);
|
if (!bSet) /*changespritesect(iActor, lValue);
|
||||||
else*/ SetGameVarID(lVar2, act->spr.sectno(), sActor, sPlayer);
|
else*/ SetGameVarID(lVar2, act->sectno(), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
case ACTOR_STATNUM:
|
case ACTOR_STATNUM:
|
||||||
if (!bSet) /*changespritestat(iActor, lValue);
|
if (!bSet) /*changespritestat(iActor, lValue);
|
||||||
|
|
|
@ -855,7 +855,7 @@ static void SpawnPortals()
|
||||||
{
|
{
|
||||||
if (p.type == PORTAL_SECTOR_FLOOR && p.dz == act->spr.hitag)
|
if (p.type == PORTAL_SECTOR_FLOOR && p.dz == act->spr.hitag)
|
||||||
{
|
{
|
||||||
p.targets.Push(act2->spr.sectno());
|
p.targets.Push(act2->sectno());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -868,7 +868,7 @@ static void SpawnPortals()
|
||||||
{
|
{
|
||||||
if (p.type == PORTAL_SECTOR_CEILING && p.dz == act->spr.hitag)
|
if (p.type == PORTAL_SECTOR_CEILING && p.dz == act->spr.hitag)
|
||||||
{
|
{
|
||||||
p.targets.Push(act->spr.sectno());
|
p.targets.Push(act->sectno());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -506,7 +506,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
||||||
while(auto act1 = itt.Next())
|
while(auto act1 = itt.Next())
|
||||||
{
|
{
|
||||||
if (act1->spr.picnum == RRTILE66)
|
if (act1->spr.picnum == RRTILE66)
|
||||||
if (act1->spr.lotag == act->spr.sectno()) // bad map format design... Should have used a tag instead...
|
if (act1->spr.lotag == act->sectno()) // bad map format design... Should have used a tag instead...
|
||||||
{
|
{
|
||||||
childsectnum = act1->spr.sector();
|
childsectnum = act1->spr.sector();
|
||||||
deletesprite(act1);
|
deletesprite(act1);
|
||||||
|
|
|
@ -119,7 +119,7 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
|
||||||
act->spr.hitag = 0;
|
act->spr.hitag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show2dsector[act->spr.sectno()]) act->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
|
if (show2dsector[act->sectno()]) act->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
|
||||||
else act->spr.cstat2 &= ~CSTAT2_SPRITE_MAPPED;
|
else act->spr.cstat2 &= ~CSTAT2_SPRITE_MAPPED;
|
||||||
|
|
||||||
act->sprext = {};
|
act->sprext = {};
|
||||||
|
|
|
@ -119,7 +119,7 @@ void FAF_DrawRooms(int x, int y, int z, fixed_t q16ang, fixed_t q16horiz, int se
|
||||||
while (auto actor = it.Next())
|
while (auto actor = it.Next())
|
||||||
{
|
{
|
||||||
// manually set gotpic
|
// manually set gotpic
|
||||||
if (gotsector[actor->spr.sectno()])
|
if (gotsector[actor->sectno()])
|
||||||
{
|
{
|
||||||
gotpic.Set(FAF_MIRROR_PIC);
|
gotpic.Set(FAF_MIRROR_PIC);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue