- got rid of the mostly redundant GetWallType function.

This commit is contained in:
Christoph Oelckers 2021-11-21 09:51:51 +01:00
parent 1fc99d4733
commit 378bf40143
6 changed files with 11 additions and 20 deletions

View file

@ -231,7 +231,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int
sector.Data()[mirrorsector].floorz = sector[nSector].floorz;
sector.Data()[mirrorsector].ceilingz = sector[nSector].ceilingz;
int cx, cy, ca;
if (GetWallType(nWall) == kWallStack)
if (pWall->type == kWallStack)
{
cx = x - (wall[pWall->hitag].x - pWall->point2Wall()->x);
cy = y - (wall[pWall->hitag].y - pWall->point2Wall()->y);
@ -244,7 +244,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int
renderDrawRoomsQ16(cx, cy, z, ca, horiz, mirrorsector, true);
viewProcessSprites(pm_tsprite, pm_spritesortcnt, cx, cy, z, FixedToInt(ca), smooth);
renderDrawMasks();
if (GetWallType(nWall) != kWallStack)
if (pWall->type != kWallStack)
renderCompleteMirror();
pWall->nextwall = nNextWall;
pWall->nextsector = nNextSector;

View file

@ -5368,18 +5368,18 @@ int MoveMissile(DBloodActor* actor)
else if (clipmoveresult.type == kHitWall)
{
gHitInfo.hitwall = clipmoveresult.index;
if (wall[clipmoveresult.index].nextsector == -1) cliptype = 0;
if (clipmoveresult.wall()->nextsector == -1) cliptype = 0;
else
{
int32_t fz, cz;
getzsofslope(wall[clipmoveresult.index].nextsector, pos.x, pos.y, &cz, &fz);
getzsofslope(clipmoveresult.wall()->nextsector, pos.x, pos.y, &cz, &fz);
if (pos.z <= cz || pos.z >= fz) cliptype = 0;
else cliptype = 4;
}
}
if (cliptype == 4)
{
walltype* pWall = &wall[gHitInfo.hitwall];
walltype* pWall = clipmoveresult.wall();
if (pWall->hasX())
{
XWALL* pXWall = &pWall->xw();
@ -6814,14 +6814,12 @@ bool actCheckRespawn(DBloodActor* actor)
//
//---------------------------------------------------------------------------
bool actCanSplatWall(int nWall)
bool actCanSplatWall(walltype* pWall)
{
assert(validWallIndex(nWall));
walltype* pWall = &wall[nWall];
if (pWall->cstat & 16384) return 0;
if (pWall->cstat & 32768) return 0;
int nType = GetWallType(nWall);
int nType = pWall->type;
if (nType >= kWallBase && nType < kWallMax) return 0;
if (pWall->nextsector != -1)
@ -6896,7 +6894,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
assert(validWallIndex(nWall));
auto pWall = &wall[nWall];
nSurf = surfType[pWall->picnum];
if (actCanSplatWall(nWall))
if (actCanSplatWall(pWall))
{
int x = gHitInfo.hitx - MulScale(a4, 16, 14);
int y = gHitInfo.hity - MulScale(a5, 16, 14);
@ -6999,7 +6997,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
{
int nWall = gHitInfo.hitwall;
int nSector = gHitInfo.hitsect;
if (actCanSplatWall(nWall))
if (actCanSplatWall(&wall[nWall]))
{
int x = gHitInfo.hitx - MulScale(a4, 16, 14);
int y = gHitInfo.hity - MulScale(a5, 16, 14);

View file

@ -235,7 +235,6 @@ void actBurnSprite(DBloodActor* pSource, DBloodActor* pTarget, int nTime);
int actGetRespawnTime(DBloodActor *pSprite);
bool actCheckRespawn(DBloodActor *pSprite);
bool actCanSplatWall(int nWall);
void actFireVector(DBloodActor *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType);
void actPostSprite(DBloodActor* actor, int status);
void actPostProcess(void);

View file

@ -85,11 +85,6 @@ extern const char *gItemText[];
extern const char *gAmmoText[];
extern const char *gWeaponText[];
static inline int GetWallType(int nWall)
{
return wall[nWall].type;
}
template<typename T> void GetSpriteExtents(T const * const pSprite, int *top, int *bottom)
{
*top = *bottom = pSprite->z;

View file

@ -56,7 +56,7 @@ void InitMirrors(void)
int nTile = 4080+mirrorcnt;
if (pWalli->overpicnum == 504)
{
if (pWalli->extra > 0 && GetWallType(i) == kWallStack)
if (pWalli->extra > 0 && pWalli->type == kWallStack)
{
pWalli->overpicnum = nTile;
@ -70,7 +70,7 @@ void InitMirrors(void)
if (j == i)
continue;
auto pWallj = &wall[j];
if (pWallj->extra > 0 && GetWallType(i) == kWallStack)
if (pWallj->extra > 0 && pWallj->type == kWallStack)
{
if (tmp != pWallj->xw().data)
continue;

View file

@ -666,7 +666,6 @@ void OperateWall(walltype* pWall, EVENT event) {
switch (pWall->type) {
case kWallGib:
if (GetWallType(wallnum(pWall)) != pWall->type) break;
bool bStatus;
switch (event.cmd) {
case kCmdOn: