- got rid of COVERupdatesector

Not needed as it just forwards to the engine’s updatesector - and it gets in the way of other changes
This commit is contained in:
Christoph Oelckers 2021-11-07 18:55:55 +01:00
parent 3811147f70
commit 16f9d4ec36
9 changed files with 27 additions and 26 deletions

View file

@ -70,6 +70,15 @@ inline int clipmove(int* x, int* y, int* z, int* sect, int xv, int yv, int wal,
int pushmove(vec3_t *const vect, int16_t *const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true) ATTRIBUTE((nonnull(1, 2)));
inline int pushmove(vec3_t *const vect, int *const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true)
{
short sect16 = *sectnum;
auto r = pushmove(vect, &sect16, walldist, ceildist, flordist, cliptype, clear);
*sectnum = sect16;
return r;
}
[[deprecated]]
inline int pushmove(int* x, int* y, int* z, int16_t* const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
uint32_t const cliptype, bool clear = true)

View file

@ -943,7 +943,7 @@ CircleCamera(int *nx, int *ny, int *nz, int *vsect, binangle *nang, fixed_t q16h
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
// Make sure sector passed to hitscan is correct
//COVERupdatesector(*nx, *ny, vsect);
//updatesector(*nx, *ny, vsect);
hitscan(&n, *vsect, vx, vy, vz,
&hitinfo, CLIPMASK_MISSILE);

View file

@ -1964,8 +1964,6 @@ void FAFgetzrangepoint(int32_t x, int32_t y, int32_t z, int16_t sectnum,
int32_t* hiz, int32_t* ceilhit,
int32_t* loz, int32_t* florhit);
void COVERupdatesector(int32_t x, int32_t y, int16_t* newsector);
void short_setinterpolation(short *posptr);
void short_stopinterpolation(short *posptr);

View file

@ -1310,7 +1310,7 @@ DoPlayerTeleportToSprite(PLAYERp pp, SPRITEp sp)
pp->posz = pp->oposz = sp->z - PLAYER_HEIGHT;
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
//pp->lastcursectnum = pp->cursectnum;
SET(pp->Flags2, PF2_TELEPORTED);
}
@ -1321,7 +1321,7 @@ DoPlayerTeleportToOffset(PLAYERp pp)
pp->oposx = pp->oldposx = pp->posx;
pp->oposy = pp->oldposy = pp->posy;
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
//pp->lastcursectnum = pp->cursectnum;
SET(pp->Flags2, PF2_TELEPORTED);
}
@ -2150,7 +2150,7 @@ DoPlayerMove(PLAYERp pp)
}
pp->posx += pp->xvect >> 14;
pp->posy += pp->yvect >> 14;
COVERupdatesector(pp->posx, pp->posy, &sectnum);
updatesector(pp->posx, pp->posy, &sectnum);
if (sectnum != -1)
pp->cursectnum = sectnum;
}
@ -2178,7 +2178,7 @@ DoPlayerMove(PLAYERp pp)
save_cstat = pp->SpriteP->cstat;
RESET(pp->SpriteP->cstat, CSTAT_SPRITE_BLOCK);
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
clipmove(&pp->pos, &pp->cursectnum, pp->xvect, pp->yvect, ((int)pp->SpriteP->clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER);
pp->SpriteP->cstat = save_cstat;
PlayerCheckValidMove(pp);
@ -5181,12 +5181,12 @@ void FindMainSector(SECTOR_OBJECTp sop)
// set it to something valid
sop->op_main_sector = 0;
//COVERupdatesector(sx, sy, &sop->op_main_sector);
//updatesector(sx, sy, &sop->op_main_sector);
//updatesectorz(sx, sy, sop->zmid - Z(8), &sop->op_main_sector);
updatesectorz(sx, sy, sop->zmid, &sop->op_main_sector);
//COVERupdatesector(sx, sy, &sop->op_main_sector);
//updatesector(sx, sy, &sop->op_main_sector);
////DSPRINTF(ds,"main sector %d, zmid %d",sop->op_main_sector, sop->zmid);
//MONO_PRINT(ds);
@ -5270,7 +5270,7 @@ DoPlayerBeginOperate(PLAYERp pp)
pp->angle.oang = pp->angle.ang = buildang(sop->ang);
pp->posx = sop->xmid;
pp->posy = sop->ymid;
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
getzsofslope(pp->cursectnum, pp->posx, pp->posy, &cz, &fz);
pp->posz = fz - PLAYER_HEIGHT;
@ -5357,7 +5357,7 @@ DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
pp->angle.oang = pp->angle.ang = buildang(sop->ang);
pp->posx = sop->xmid;
pp->posy = sop->ymid;
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
getzsofslope(pp->cursectnum, pp->posx, pp->posy, &cz, &fz);
pp->posz = fz - PLAYER_HEIGHT;
@ -6368,7 +6368,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
// try to stay in valid area - death sometimes throws you out of the map
sectnum = pp->cursectnum;
COVERupdatesector(pp->posx, pp->posy, &sectnum);
updatesector(pp->posx, pp->posy, &sectnum);
if (sectnum < 0)
{
pp->cursectnum = pp->lv_sectnum;
@ -6584,7 +6584,7 @@ void DoPlayerDeathExplode(PLAYERp pp)
else
{
// special line for amoeba
//COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
//updatesector(pp->posx, pp->posy, &pp->cursectnum);
DoPlayerDeathCheckKick(pp);
DoPlayerDeathHurl(pp);

View file

@ -54,12 +54,6 @@ SAVE save;
bool FAF_DebugView = false;
void COVERupdatesector(int32_t x, int32_t y, int16_t* newsector)
{
// ASSERT(*newsector>=0 && *newsector<MAXSECTORS);
updatesector(x,y,newsector);
}
int COVERinsertsprite(short sectnum, short stat)
{
short spnum;

View file

@ -572,7 +572,7 @@ int DoSkelTeleport(DSWActor* actor)
sp->y -= 512 + RANDOM_P2(1024);
setspritez(SpriteNum, &sp->pos);
//COVERupdatesector(sp->x, sp->y, &sp->sectnum);
//updatesector(sp->x, sp->y, &sp->sectnum);
if (sp->sectnum != -1)
break;

View file

@ -5030,7 +5030,7 @@ DropAhead(short SpriteNum, short min_height)
day = sp->y + MOVEy(256, sp->ang);
newsector = sp->sectnum;
COVERupdatesector(dax, day, &newsector);
updatesector(dax, day, &newsector);
// look straight down for a drop
if (ActorDrop(SpriteNum, dax, day, sp->z, newsector, min_height))

View file

@ -253,7 +253,7 @@ ActorFindTrack(short SpriteNum, int8_t player_dir, int track_type, short *track_
if (near_dist < 15000)
{
// get the sector number of the point
COVERupdatesector(near_tp->x, near_tp->y, &track_sect);
updatesector(near_tp->x, near_tp->y, &track_sect);
// if can see the point, return the track number
if (FAFcansee(sp->x, sp->y, sp->z - Z(16), sp->sectnum, near_tp->x, near_tp->y, sector[track_sect].floorz - Z(32), track_sect))
@ -1672,7 +1672,7 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// THIS WAS CAUSING PROLEMS!!!!
// Sectors are still being manipulated so you can end up in a void (-1) sector
//COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
//updatesector(pp->posx, pp->posy, &pp->cursectnum);
// New angle is formed by taking last known angle and
// adjusting by the delta angle
@ -1709,7 +1709,7 @@ MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)
sop->sp_child->x = sop->xmid;
sop->sp_child->y = sop->ymid;
//COVERupdatesector(sop->xmid, sop->ymid, &sop->sectnum);
//updatesector(sop->xmid, sop->ymid, &sop->sectnum);
// setting floorz if need be
//if (!TEST(sop->flags, SOBJ_SPRITE_OBJ))
@ -1895,7 +1895,7 @@ PlayerPart:
// prevents you from falling into map HOLEs created by moving
// Sectors and sprites around.
//if (sop->xmid < MAXSO)
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
updatesector(pp->posx, pp->posy, &pp->cursectnum);
// in case you are in a whirlpool
// move perfectly with the ride in the z direction

View file

@ -12831,7 +12831,7 @@ DoSerpRing(DSWActor* actor)
if ((dist < 18000 && (RANDOM_P2(2048<<5)>>5) < 16) || User[sp->owner]->Counter < 4)
{
short sectnum = sp->sectnum;
COVERupdatesector(sp->x,sp->y,&sectnum);
updatesector(sp->x,sp->y,&sectnum);
// if (valid sector and can see target)
if (sectnum != -1 && CanSeePlayer(Weapon))