mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
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:
parent
062207b2e9
commit
3e4f2de79a
2 changed files with 40 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue