From 915879628438829dd4d8e0f9a61a936274518428 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Dec 2021 11:48:10 +0100 Subject: [PATCH] - partial replacement of tspriteptr_t. --- source/games/exhumed/src/sequence.cpp | 6 +++--- source/games/sw/src/draw.cpp | 28 +++++++++++++-------------- source/games/sw/src/jsector.cpp | 4 ++-- source/games/sw/src/jsector.h | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index 70b0d62bc..7262d289d 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -471,7 +471,7 @@ int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx) int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal) { - tspriteptr_t pTSprite = &mytsprite[nSprite]; + tspritetype* pTSprite = &mytsprite[nSprite]; int nAngle = GetMyAngle(nCamerax - pTSprite->pos.X, nCameray - pTSprite->pos.Y); int nSeqOffset = ((((pTSprite->ang + 512) - nAngle) + 128) & kAngleMask) >> 8; @@ -519,7 +519,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal) int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) { - tspriteptr_t pTSprite = &mytsprite[nSprite]; + tspritetype* pTSprite = &mytsprite[nSprite]; int nAngle = GetMyAngle(nCamerax - pTSprite->pos.X, nCameray - pTSprite->pos.Y); int val; @@ -572,7 +572,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) break; } - tspriteptr_t tsp = &mytsprite[(*myspritesortcnt)++]; + tspritetype* tsp = &mytsprite[(*myspritesortcnt)++]; tsp->pos.X = pTSprite->pos.X; tsp->pos.Y = pTSprite->pos.Y; tsp->pos.Z = pTSprite->pos.Z; diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index c83f3f461..4daa51282 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -83,7 +83,7 @@ void SW_InitMultiPsky(void) #if 1 -void ShadeSprite(tspriteptr_t tsp) +void ShadeSprite(tspritetype* tsp) { // set shade of sprite tsp->shade = tsp->sector()->floorshade - 25; @@ -104,7 +104,7 @@ int GetRotation(tspritetype* tsprite, int& spritesortcnt, int tSpriteNum, int vi static const uint8_t RotTable5[] = {0, 1, 2, 3, 4, 3, 2, 1}; int rotation; - tspriteptr_t tsp = &tsprite[tSpriteNum]; + tspritetype* tsp = &tsprite[tSpriteNum]; auto ownerActor = static_cast(tsp->ownerActor); int angle2; @@ -171,7 +171,7 @@ directions was not standardized. int SetActorRotation(tspritetype* tsprite, int& spritesortcnt, int tSpriteNum, int viewx, int viewy) { - tspriteptr_t tsp = &tsprite[tSpriteNum]; + tspritetype* tsp = &tsprite[tSpriteNum]; auto ownerActor = static_cast(tsp->ownerActor); int StateOffset, Rotation; @@ -204,7 +204,7 @@ int SetActorRotation(tspritetype* tsprite, int& spritesortcnt, int tSpriteNum, i return 0; } -int DoShadowFindGroundPoint(tspriteptr_t tspr) +int DoShadowFindGroundPoint(tspritetype* tspr) { // USES TSPRITE !!!!! auto ownerActor = static_cast(tspr->ownerActor); @@ -258,9 +258,9 @@ int DoShadowFindGroundPoint(tspriteptr_t tspr) return loz; } -void DoShadows(tspritetype* tsprite, int& spritesortcnt, tspriteptr_t tsp, int viewz, int camang) +void DoShadows(tspritetype* tsprite, int& spritesortcnt, tspritetype* tsp, int viewz, int camang) { - tspriteptr_t tSpr = &tsprite[spritesortcnt]; + tspritetype* tSpr = &tsprite[spritesortcnt]; auto ownerActor = static_cast(tsp->ownerActor); int ground_dist = 0; int view_dist = 0; @@ -415,7 +415,7 @@ void DoMotionBlur(tspritetype* tsprite, int& spritesortcnt, tspritetype const * for (i = 0; i < ownerActor->user.motion_blur_num; i++) { - tspriteptr_t tSpr = &tsprite[spritesortcnt]; + tspritetype* tSpr = &tsprite[spritesortcnt]; *tSpr = *tsp; tSpr->cstat |= CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_TRANS_FLIP; @@ -468,7 +468,7 @@ void WarpCopySprite(tspritetype* tsprite, int& spritesortcnt) if (itActor2->spr.picnum == ST1) continue; - tspriteptr_t newTSpr = renderAddTsprite(tsprite, spritesortcnt, itActor2); + tspritetype* newTSpr = renderAddTsprite(tsprite, spritesortcnt, itActor2); newTSpr->statnum = 0; xoff = itActor->spr.pos.X - newTSpr->pos.X; @@ -490,7 +490,7 @@ void WarpCopySprite(tspritetype* tsprite, int& spritesortcnt) if (itActor2->spr.picnum == ST1) continue; - tspriteptr_t newTSpr = renderAddTsprite(tsprite, spritesortcnt, itActor2); + tspritetype* newTSpr = renderAddTsprite(tsprite, spritesortcnt, itActor2); newTSpr->statnum = 0; auto off = itActor1->spr.pos - newTSpr->pos; @@ -502,7 +502,7 @@ void WarpCopySprite(tspritetype* tsprite, int& spritesortcnt) } } -void DoStarView(tspriteptr_t tsp, DSWActor* tActor, int viewz) +void DoStarView(tspritetype* tsp, DSWActor* tActor, int viewz) { extern STATE s_Star[], s_StarDown[]; extern STATE s_StarStuck[], s_StarDownStuck[]; @@ -605,7 +605,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie for (tSpriteNum = spritesortcnt - 1; tSpriteNum >= 0; tSpriteNum--) { - tspriteptr_t tsp = &tsprite[tSpriteNum]; + tspritetype* tsp = &tsprite[tSpriteNum]; auto tActor = static_cast(tsp->ownerActor); auto tsectp = tsp->sector(); @@ -886,7 +886,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie #if 1 -tspriteptr_t get_tsprite(tspritetype* tsprite, int& spritesortcnt, DSWActor* actor) +tspritetype* get_tsprite(tspritetype* tsprite, int& spritesortcnt, DSWActor* actor) { int tSpriteNum; @@ -907,13 +907,13 @@ void post_analyzesprites(tspritetype* tsprite, int& spritesortcnt) { auto actor = static_cast(tsprite[tSpriteNum].ownerActor); if (!actor) continue; // JBF: verify this is safe - tspriteptr_t tsp = &tsprite[tSpriteNum]; + tspritetype* tsp = &tsprite[tSpriteNum]; if (actor->hasU()) { if (actor->user.ID == FIREBALL_FLAMES && actor->user.attachActor != nullptr) { - tspriteptr_t const atsp = get_tsprite(tsprite, spritesortcnt, actor->user.attachActor); + tspritetype* const atsp = get_tsprite(tsprite, spritesortcnt, actor->user.attachActor); if (!atsp) { diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 25fffe7cc..583bbeac4 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -682,7 +682,7 @@ void GameInterface::LeavePortal(DCoreActor* viewer, int type) } -void DoAutoSize(tspriteptr_t tspr) +void DoAutoSize(tspritetype* tspr) { if (!bAutoSize) return; @@ -831,7 +831,7 @@ void DoAutoSize(tspriteptr_t tspr) // Rotation angles for sprites short rotang = 0; -void JAnalyzeSprites(tspriteptr_t tspr) +void JAnalyzeSprites(tspritetype* tspr) { rotang += 4; if (rotang > 2047) diff --git a/source/games/sw/src/jsector.h b/source/games/sw/src/jsector.h index ff2ea80d9..04aad6125 100644 --- a/source/games/sw/src/jsector.h +++ b/source/games/sw/src/jsector.h @@ -60,7 +60,7 @@ extern short floormirrorsector[MAXMIRRORS]; extern bool mirrorinview; extern short NormalVisibility; -void JAnalyzeSprites(tspriteptr_t tspr); +void JAnalyzeSprites(tspritetype* tspr); void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio); void JS_CameraParms(PLAYERp pp, int tx, int ty, int tz); void JS_DrawMirrors(PLAYERp pp,int tx,int ty,int tz,fixed_t tpq16ang,fixed_t tpq16horiz);