From f5e1709c3774fb58b2434e5c121d0071bd5c3790 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 6 Oct 2022 00:59:55 +0200 Subject: [PATCH] - renamed yet another bunch of repeat variables. --- source/games/blood/src/aiunicult.cpp | 2 +- source/games/blood/src/fx.cpp | 12 ++++++------ source/games/blood/src/nnexts.cpp | 16 ++++++++-------- source/games/blood/src/nnexts.h | 4 ++-- source/games/blood/src/seq.cpp | 18 +++++++++--------- source/games/blood/src/seq.h | 4 ++-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index c9c36d5e8..d883b3e2a 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -2304,7 +2304,7 @@ bool genDudePrepare(DBloodActor* actor, int propId) // to ensure mass gets updated, let's clear all cache SPRITEMASS* pMass = &actor->spriteMass; pMass->seqId = pMass->picnum = 0; - pMass->xrepeat = pMass->yrepeat = 0; + pMass->scalex = pMass->scaley = 0; pMass->clipDist = 0; pMass->mass = pMass->airVel = pMass->fraction = 0; getSpriteMassBySize(actor); diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index c318ef163..de049c1dd 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -40,8 +40,8 @@ struct FXDATA { int32_t drag; // air drag int32_t defangle; int16_t picnum; - uint8_t xrepeat; - uint8_t yrepeat; + uint8_t _xrepeat; + uint8_t _yrepeat; ESpriteFlags cstat; int8_t shade; uint8_t pal; @@ -171,10 +171,10 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& p actor->spr.shade = pFX->shade; actor->spr.pal = pFX->pal; actor->spr.detail = pFX->detail; - if (pFX->xrepeat > 0) - actor->spr.xrepeat = pFX->xrepeat; - if (pFX->yrepeat > 0) - actor->spr.yrepeat = pFX->yrepeat; + if (pFX->_xrepeat > 0) + actor->spr.xrepeat = pFX->_xrepeat; + if (pFX->_yrepeat > 0) + actor->spr.yrepeat = pFX->_yrepeat; if ((pFX->flags & 1) && Chance(0x8000)) actor->spr.cstat |= CSTAT_SPRITE_XFLIP; if ((pFX->flags & 2) && Chance(0x8000)) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index c5bfd0b3d..733eea988 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1432,8 +1432,8 @@ int getSpriteMassBySize(DBloodActor* actor) } SPRITEMASS* cached = &actor->spriteMass; - if (((seqId >= 0 && seqId == cached->seqId) || actor->spr.picnum == cached->picnum) && actor->spr.xrepeat == cached->xrepeat && - actor->spr.yrepeat == cached->yrepeat && clipDist == cached->clipDist) + if (((seqId >= 0 && seqId == cached->seqId) || actor->spr.picnum == cached->picnum) && actor->spr.xrepeat == cached->scalex && + actor->spr.yrepeat == cached->scaley && clipDist == cached->clipDist) { return cached->mass; } @@ -1513,8 +1513,8 @@ int getSpriteMassBySize(DBloodActor* actor) cached->airVel = ClipRange(400 - cached->mass, 32, 400); cached->fraction = ClipRange(60000 - (cached->mass << 7), 8192, 60000); - cached->xrepeat = actor->spr.xrepeat; - cached->yrepeat = actor->spr.yrepeat; + cached->scalex = actor->spr.xrepeat; + cached->scaley = actor->spr.yrepeat; cached->picnum = actor->spr.picnum; cached->seqId = seqId; cached->clipDist = actor->clipdist; @@ -6520,8 +6520,8 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor) for (int i = 0; i < pSeq->nFrames; i++) { if ((canInherit & 0x4) && pSeq->frames[i].palette != 0) canInherit &= ~0x4; - if ((canInherit & 0x2) && pSeq->frames[i].xrepeat != 0) canInherit &= ~0x2; - if ((canInherit & 0x1) && pSeq->frames[i].yrepeat != 0) canInherit &= ~0x1; + if ((canInherit & 0x2) && pSeq->frames[i].scalex != 0) canInherit &= ~0x2; + if ((canInherit & 0x1) && pSeq->frames[i].scaley != 0) canInherit &= ~0x1; } } @@ -9349,8 +9349,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRITEMASS& w, SPR { arc("seq", w.seqId, &nul.seqId) ("picnum", w.picnum, &nul.picnum) - ("xrepeat", w.xrepeat, &nul.xrepeat) - ("yrepeat", w.yrepeat, &nul.yrepeat) + ("scalex", w.scalex, &nul.scalex) + ("scaley", w.scaley, &nul.scaley) ("clipdist", w.clipDist) ("mass", w.mass) ("airvel", w.airVel) diff --git a/source/games/blood/src/nnexts.h b/source/games/blood/src/nnexts.h index 83ef8f9ca..0121f47b0 100644 --- a/source/games/blood/src/nnexts.h +++ b/source/games/blood/src/nnexts.h @@ -194,8 +194,8 @@ enum { struct SPRITEMASS { // sprite mass info for getSpriteMassBySize(); int seqId; int16_t picnum; // mainly needs for moving debris - int16_t xrepeat; - int16_t yrepeat; + int16_t scalex; + int16_t scaley; int16_t airVel; // mainly needs for moving debris double clipDist; // mass multiplier int mass; diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 0d6cf9323..8a3be404e 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -245,7 +245,7 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame) if (actor->spr.flags & 2) { if (tileHeight(actor->spr.picnum) != tileHeight(seqGetTile(pFrame)) || tileTopOffset(actor->spr.picnum) != tileTopOffset(seqGetTile(pFrame)) - || (pFrame->yrepeat && pFrame->yrepeat != actor->spr.yrepeat)) + || (pFrame->scaley && pFrame->scaley != actor->spr.yrepeat)) actor->spr.flags |= 4; } actor->spr.picnum = seqGetTile(pFrame); @@ -254,14 +254,14 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame) actor->spr.shade = pFrame->shade; int scale = actor->xspr.scale; // SEQ size scaling - if (pFrame->xrepeat) { - if (scale) actor->spr.xrepeat = ClipRange(MulScale(pFrame->xrepeat, scale, 8), 0, 255); - else actor->spr.xrepeat = pFrame->xrepeat; + if (pFrame->scalex) { + if (scale) actor->spr.xrepeat = ClipRange(MulScale(pFrame->scalex, scale, 8), 0, 255); + else actor->spr.xrepeat = pFrame->scalex; } - if (pFrame->yrepeat) { - if (scale) actor->spr.yrepeat = ClipRange(MulScale(pFrame->yrepeat, scale, 8), 0, 255); - else actor->spr.yrepeat = pFrame->yrepeat; + if (pFrame->scaley) { + if (scale) actor->spr.yrepeat = ClipRange(MulScale(pFrame->scaley, scale, 8), 0, 255); + else actor->spr.yrepeat = pFrame->scaley; } if (pFrame->transparent) @@ -528,8 +528,8 @@ static void ByteSwapSEQ(Seq* pSeq) swapFrame.transparent2 = bitReader.readBit(); swapFrame.blockable = bitReader.readBit(); swapFrame.hittable = bitReader.readBit(); - swapFrame.xrepeat = bitReader.readUnsigned(8); - swapFrame.yrepeat = bitReader.readUnsigned(8); + swapFrame.scalex = bitReader.readUnsigned(8); + swapFrame.scaley = bitReader.readUnsigned(8); swapFrame.shade = bitReader.readSigned(8); swapFrame.palette = bitReader.readUnsigned(5); swapFrame.trigger = bitReader.readBit(); diff --git a/source/games/blood/src/seq.h b/source/games/blood/src/seq.h index e2a2f30a8..29771dc54 100644 --- a/source/games/blood/src/seq.h +++ b/source/games/blood/src/seq.h @@ -33,8 +33,8 @@ struct SEQFRAME unsigned int transparent2 : 1; unsigned int blockable : 1; unsigned int hittable : 1; - unsigned int xrepeat : 8; - unsigned int yrepeat : 8; + unsigned int scalex : 8; + unsigned int scaley : 8; signed int shade : 8; unsigned int palette : 5; unsigned int trigger : 1;