Add yax_getzsofslope(), based on getzsofslope_player()

git-svn-id: https://svn.eduke32.com/eduke32@8109 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-09-17 03:20:38 +00:00 committed by Christoph Oelckers
parent 062207b2e9
commit 3e4f2de79a
2 changed files with 40 additions and 0 deletions

View file

@ -1226,6 +1226,7 @@ int32_t getceilzofslopeptr(usectorptr_t sec, int32_t dax, int32_t day) ATTRIBU
int32_t getflorzofslopeptr(usectorptr_t sec, int32_t dax, int32_t day) ATTRIBUTE((nonnull(1)));
void getzsofslopeptr(usectorptr_t sec, int32_t dax, int32_t day,
int32_t *ceilz, int32_t *florz) ATTRIBUTE((nonnull(1,4,5)));
void yax_getzsofslope(int sectNum, int playerX, int playerY, int32_t* pCeilZ, int32_t* pFloorZ);
static FORCE_INLINE int32_t getceilzofslope(int16_t sectnum, int32_t dax, int32_t day)
{

View file

@ -12300,6 +12300,45 @@ void getzsofslopeptr(usectorptr_t sec, int32_t dax, int32_t day, int32_t *ceilz,
*florz += scale(sec->floorheinum,j>>1,i)<<1;
}
#ifdef YAX_ENABLE
void yax_getzsofslope(int sectNum, int playerX, int playerY, int32_t *pCeilZ, int32_t *pFloorZ)
{
int didCeiling = 0;
int didFloor = 0;
int testSector = 0;
if ((sector[sectNum].ceilingstat & 512) == 0)
{
testSector = yax_getneighborsect(playerX, playerY, sectNum, YAX_CEILING);
if (testSector >= 0)
{
ceiling:
*pCeilZ = getcorrectceilzofslope(testSector, playerX, playerY);
didCeiling = 1;
}
}
if ((sector[sectNum].floorstat & 512) == 0)
{
testSector = yax_getneighborsect(playerX, playerY, sectNum, YAX_FLOOR);
if (testSector >= 0)
{
floor:
*pFloorZ = getcorrectflorzofslope(testSector, playerX, playerY);
didFloor = 1;
}
}
testSector = sectNum;
if (!didCeiling)
goto ceiling;
else if (!didFloor)
goto floor;
}
#endif
//
// alignceilslope