Skip to content

Commit

Permalink
Blood: Use original logic for applying sprite sector pal
Browse files Browse the repository at this point in the history
  • Loading branch information
tmyqlfpir authored and Hendricks266 committed Dec 30, 2024
1 parent e9bcfe3 commit a46eecc
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions source/blood/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2636,16 +2636,6 @@ tspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect)
LOCATION gPrevSpriteLoc[kMaxSprites];
static LOCATION gViewSpritePredictLoc;

static void viewApplyDefaultPal(tspritetype *pTSprite, sectortype const *pSector)
{
int const nXSector = pSector->extra;
XSECTOR const *pXSector = nXSector >= 0 ? &xsector[nXSector] : NULL;
if (pXSector && pXSector->color && (VanillaMode() || pSector->floorpal != 0))
{
pTSprite->pal = pSector->floorpal;
}
}

void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth)
{
UNREFERENCED_PARAMETER(smooth);
Expand Down Expand Up @@ -2908,7 +2898,8 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
}
break;
default:
viewApplyDefaultPal(pTSprite, pSector);
if (pXSector && pXSector->color)
pTSprite->pal = pSector->floorpal;
break;
}
}
Expand Down Expand Up @@ -2938,8 +2929,8 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
default:
if (pTSprite->type >= kItemKeySkull && pTSprite->type < kItemKeyMax)
pTSprite->shade = -128;

viewApplyDefaultPal(pTSprite, pSector);
if (pXSector && pXSector->color)
pTSprite->pal = pSector->floorpal;
break;
}
}
Expand Down Expand Up @@ -2996,15 +2987,10 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
}
}




if (pXSector && pXSector->color) pTSprite->pal = pSector->floorpal;
if (powerupCheck(gView, kPwUpBeastVision) > 0) pTSprite->shade = -128;

if (IsPlayerSprite(pTSprite)) {
viewApplyDefaultPal(pTSprite, pSector);

PLAYER *pPlayer = &gPlayer[pTSprite->type-kDudePlayer1];
if (powerupCheck(pPlayer, kPwUpShadowCloak) && !powerupCheck(gView, kPwUpBeastVision)) {
pTSprite->cstat |= 2;
Expand Down Expand Up @@ -3086,7 +3072,8 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
break;
}
case kStatThing: {
viewApplyDefaultPal(pTSprite, pSector);
if (pXSector && pXSector->color)
pTSprite->pal = pSector->floorpal;

if (pTSprite->type < kThingBase || pTSprite->type >= kThingMax || !gSpriteHit[nXSprite].florhit) {
if ((pTSprite->flags & kPhysMove) && getflorzofslope(pTSprite->sectnum, pTSprite->x, pTSprite->y) >= cZ)
Expand Down

0 comments on commit a46eecc

Please sign in to comment.