From a46eecc7d8c790967cbedd0e8ec0f88b6131c1c7 Mon Sep 17 00:00:00 2001 From: tmyqlfpir <80724828+tmyqlfpir@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:21:10 +1000 Subject: [PATCH] Blood: Use original logic for applying sprite sector pal --- source/blood/src/view.cpp | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 24ba779ac5..b7deef2601 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -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); @@ -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; } } @@ -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; } } @@ -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; @@ -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)