mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- SOP::mid_sector
This commit is contained in:
parent
b936345e11
commit
4149a335a3
6 changed files with 24 additions and 16 deletions
|
@ -1649,6 +1649,10 @@ struct SECTOR_OBJECTstruct
|
|||
DSWActor* so_actors[MAX_SO_SPRITE]; // hold the actors of the object
|
||||
DSWActor* match_event_actor; // spritenum of the match event sprite
|
||||
|
||||
sectortype*
|
||||
mid_sector; // middle sector
|
||||
|
||||
|
||||
int vel, // velocity
|
||||
vel_tgt, // target velocity
|
||||
player_xoff, // player x offset from the xmid
|
||||
|
@ -1676,8 +1680,7 @@ struct SECTOR_OBJECTstruct
|
|||
crush_z,
|
||||
op_main_sector, // main sector operational SO moves in - for speed purposes
|
||||
flags,
|
||||
sector[MAX_SO_SECTOR], // hold the sector numbers of the sector object
|
||||
mid_sector; // middle sector
|
||||
sector[MAX_SO_SECTOR]; // hold the sector numbers of the sector object
|
||||
|
||||
int16_t xorig[MAX_SO_POINTS], // save the original x & y location of each wall so it can be
|
||||
yorig[MAX_SO_POINTS], // refreshed
|
||||
|
@ -1866,6 +1869,10 @@ void DoAnim(int numtics);
|
|||
void AnimDelete(int animtype, int animindex, DSWActor*);
|
||||
short AnimGetGoal(int animtype, int animindex, DSWActor*);
|
||||
int AnimSet(int animtype, int animindex, DSWActor* animactor, int thegoal, int thevel);
|
||||
int AnimSet(int animtype, sectortype* animindex, int thegoal, int thevel)
|
||||
{
|
||||
return AnimSet(animtype, sectnum(animindex), nullptr, thegoal, thevel);
|
||||
}
|
||||
short AnimSetCallback(short anim_ndx, ANIM_CALLBACKp call, SECTOR_OBJECTp data);
|
||||
short AnimSetVelAdj(short anim_ndx, short vel_adj);
|
||||
|
||||
|
|
|
@ -2249,7 +2249,7 @@ void DoPlayerSectorUpdatePostMove(PLAYERp pp)
|
|||
|
||||
}
|
||||
|
||||
void PlaySOsound(short sectnum, short sound_num)
|
||||
void PlaySOsound(sectortype* sectnum, short sound_num)
|
||||
{
|
||||
// play idle sound - sound 1
|
||||
SWSectIterator it(sectnum);
|
||||
|
@ -2264,7 +2264,7 @@ void PlaySOsound(short sectnum, short sound_num)
|
|||
}
|
||||
}
|
||||
|
||||
void StopSOsound(short sectnum)
|
||||
void StopSOsound(sectortype* sectnum)
|
||||
{
|
||||
// play idle sound - sound 1
|
||||
SWSectIterator it(sectnum);
|
||||
|
|
|
@ -136,7 +136,7 @@ void DoPlayerSpriteThrow(PLAYERp pp);
|
|||
int DoPlayerWadeSuperJump(PLAYERp pp);
|
||||
void DoPlayerWarpTeleporter(PLAYERp pp);
|
||||
void UpdatePlayerSprite(PLAYERp pp);
|
||||
void PlaySOsound(short sectnum,short sound_num);
|
||||
void PlaySOsound(sectortype* sectnum,short sound_num);
|
||||
void DoSpawnTeleporterEffectPlace(SPRITEp sp);
|
||||
void FindMainSector(SECTOR_OBJECTp sop);
|
||||
|
||||
|
|
|
@ -383,6 +383,7 @@ void SectorSetup(void)
|
|||
SectorObject[ndx].Animator = nullptr;
|
||||
SectorObject[ndx].controller = nullptr;
|
||||
SectorObject[ndx].sp_child = nullptr;
|
||||
SectorObject[ndx].mid_sector = nullptr;
|
||||
SectorObject[ndx].xmid = INT32_MAX;
|
||||
}
|
||||
|
||||
|
|
|
@ -931,7 +931,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
|
|||
|
||||
u->sx = sop->xmid - sp->x;
|
||||
u->sy = sop->ymid - sp->y;
|
||||
u->sz = sector[sop->mid_sector].floorz - sp->z;
|
||||
u->sz = sop->mid_sector->floorz - sp->z;
|
||||
|
||||
SET(u->Flags, SPR_SO_ATTACHED);
|
||||
|
||||
|
@ -1090,7 +1090,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
|||
{
|
||||
case TAG_OBJECT_CENTER - 500:
|
||||
|
||||
sop->mid_sector = sectnum(sectp);
|
||||
sop->mid_sector = sectp;
|
||||
SectorMidPoint(sectp, &sop->xmid, &sop->ymid, &sop->zmid);
|
||||
//sop->zmid = sector[sectnum].floorz;
|
||||
//sop->zmid = DIV2(sector[sectnum].floorz + sector[sectnum].ceilingz);
|
||||
|
@ -1681,7 +1681,7 @@ void MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)
|
|||
// setting floorz if need be
|
||||
//if (!TEST(sop->flags, SOBJ_SPRITE_OBJ))
|
||||
if (TEST(sop->flags, SOBJ_ZMID_FLOOR))
|
||||
sop->zmid = sector[sop->mid_sector].floorz;
|
||||
sop->zmid = sop->mid_sector->floorz;
|
||||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
|
@ -1797,7 +1797,7 @@ PlayerPart:
|
|||
else
|
||||
{
|
||||
// move with the mid sector
|
||||
sp->z = sector[sop->mid_sector].floorz - u->sz;
|
||||
sp->z = sop->mid_sector->floorz - u->sz;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2145,7 +2145,7 @@ void MoveZ(SECTOR_OBJECTp sop)
|
|||
{
|
||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||
{
|
||||
AnimSet(ANIM_Floorz, sectnum(*sectp), nullptr, sop->zorig_floor[i] + sop->z_tgt, sop->z_rate);
|
||||
AnimSet(ANIM_Floorz, *sectp, sop->zorig_floor[i] + sop->z_tgt, sop->z_rate);
|
||||
}
|
||||
|
||||
RESET(sop->flags, SOBJ_ZDOWN);
|
||||
|
@ -2154,7 +2154,7 @@ void MoveZ(SECTOR_OBJECTp sop)
|
|||
{
|
||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||
{
|
||||
AnimSet(ANIM_Floorz, sectnum(*sectp), nullptr, sop->zorig_floor[i] + sop->z_tgt, sop->z_rate);
|
||||
AnimSet(ANIM_Floorz, *sectp, sop->zorig_floor[i] + sop->z_tgt, sop->z_rate);
|
||||
}
|
||||
|
||||
RESET(sop->flags, SOBJ_ZUP);
|
||||
|
@ -2483,7 +2483,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
|
|||
if (sop->sectp[i]->hasU() && TEST(sop->sectp[i]->flags, SECTFU_SO_DONT_SINK))
|
||||
continue;
|
||||
|
||||
ndx = AnimSet(ANIM_Floorz, sectnum(*sectp), nullptr, sector[dest_sector].floorz, tpoint->tag_high);
|
||||
ndx = AnimSet(ANIM_Floorz, *sectp, sector[dest_sector].floorz, tpoint->tag_high);
|
||||
AnimSetCallback(ndx, CallbackSOsink, sop);
|
||||
AnimSetVelAdj(ndx, 6);
|
||||
}
|
||||
|
@ -2503,7 +2503,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
|
|||
{
|
||||
if ((*sectp) && (*sectp)->stag == SECT_SO_FORM_WHIRLPOOL)
|
||||
{
|
||||
AnimSet(ANIM_Floorz, sectnum(*sectp), nullptr, (*sectp)->floorz + Z((*sectp)->height), 128);
|
||||
AnimSet(ANIM_Floorz, *sectp, (*sectp)->floorz + Z((*sectp)->height), 128);
|
||||
(*sectp)->floorshade += (*sectp)->height / 6;
|
||||
|
||||
RESET((*sectp)->extra, SECTFX_NO_RIDE);
|
||||
|
@ -2632,7 +2632,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
|
|||
// churn through sectors setting their new z values
|
||||
for (i = 0; sop->sector[i] != -1; i++)
|
||||
{
|
||||
AnimSet(ANIM_Floorz, sop->sector[i], nullptr, dz - (sector[sop->mid_sector].floorz - sector[sop->sector[i]].floorz), sop->z_rate);
|
||||
AnimSet(ANIM_Floorz, sop->sector[i], nullptr, dz - (sop->mid_sector->floorz - sector[sop->sector[i]].floorz), sop->z_rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10685,7 +10685,7 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECTp sop)
|
|||
|
||||
u->sx = sop->xmid - sp->x;
|
||||
u->sy = sop->ymid - sp->y;
|
||||
u->sz = sector[sop->mid_sector].floorz - sp->z;
|
||||
u->sz = sop->mid_sector->floorz - sp->z;
|
||||
|
||||
u->sang = sp->ang;
|
||||
}
|
||||
|
@ -10750,7 +10750,7 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECTp sop,
|
|||
else
|
||||
{
|
||||
// move with the mid sector
|
||||
exp->z = sector[sop->mid_sector].floorz - u->sz;
|
||||
exp->z = sop->mid_sector->floorz - u->sz;
|
||||
exp->backupz();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue