From d3022947eb008e045f7e5512ff5adab6debca070 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 27 Aug 2022 18:49:41 +1000 Subject: [PATCH] - Replace use of `binangle` in `gi->processSprites()` with `DAngle` object. --- source/core/gamestruct.h | 2 +- source/core/rendering/scene/hw_drawinfo.cpp | 2 +- source/games/blood/src/animatesprite.cpp | 4 ++-- source/games/blood/src/blood.h | 2 +- source/games/duke/src/duke3d.h | 2 +- source/games/duke/src/render.cpp | 4 ++-- source/games/exhumed/src/exhumed.h | 2 +- source/games/exhumed/src/view.cpp | 2 +- source/games/sw/src/draw.cpp | 4 ++-- source/games/sw/src/game.h | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index 21b1883b0..c10b530b5 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -117,7 +117,7 @@ struct GameInterface virtual void SwitchCoopView() { Printf("Unsupported command\n"); } virtual void ToggleShowWeapon() { Printf("Unsupported command\n"); } virtual vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(0,0,0); } - virtual void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) = 0; + virtual void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) = 0; virtual void UpdateCameras(double smoothratio) {} virtual void EnterPortal(DCoreActor* viewer, int type) {} virtual void LeavePortal(DCoreActor* viewer, int type) {} diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 546b7327b..8f23cd0ae 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -394,7 +394,7 @@ void HWDrawInfo::CreateScene(bool portal) mDrawer.RenderScene(&vp.SectCount, 1, portal); SetupSprite.Clock(); - gi->processSprites(tsprites, view.X, view.Y, vp.Pos.Z * -256, bamang(vp.RotAngle), vp.TicFrac * 65536); + gi->processSprites(tsprites, view.X, view.Y, vp.Pos.Z * -256, DAngle::fromBam(vp.RotAngle), vp.TicFrac * 65536); DispatchSprites(); SetupSprite.Unclock(); diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index cf368e222..45b6bdfb2 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -1016,9 +1016,9 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t // //--------------------------------------------------------------------------- -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) +void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) { - viewProcessSprites(tsprites, viewx, viewy, viewz, viewang, int(smoothRatio)); + viewProcessSprites(tsprites, viewx, viewy, viewz, buildang(viewang.Buildang()), int(smoothRatio)); } int display_mirror; diff --git a/source/games/blood/src/blood.h b/source/games/blood/src/blood.h index f9237f40b..f75c9b86c 100644 --- a/source/games/blood/src/blood.h +++ b/source/games/blood/src/blood.h @@ -143,7 +143,7 @@ struct GameInterface : public ::GameInterface void SwitchCoopView() override; void ToggleShowWeapon() override; vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 1280.), int(-ang.Sin() * 1280.), FixedToInt(MulScale(horiz.asq16(), 1280, 3)) - (16 << 8)); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) override; + void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override; void EnterPortal(DCoreActor* viewer, int type) override; void LeavePortal(DCoreActor* viewer, int type) override; void LoadGameTextures() override; diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index e338d6cd5..08964199a 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -57,7 +57,7 @@ struct GameInterface : public ::GameInterface void SwitchCoopView() override; void ToggleShowWeapon() override; vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 1024.), int(-ang.Sin() * 1024.), horiz.asq16() >> 9); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) override; + void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override; void UpdateCameras(double smoothratio) override; void EnterPortal(DCoreActor* viewer, int type) override; void LeavePortal(DCoreActor* viewer, int type) override; diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index edb980960..17fceefb3 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -405,9 +405,9 @@ bool GameInterface::GenerateSavePic() return true; } -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) +void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) { - fi.animatesprites(tsprites, viewx, viewy, viewang.asbuild(), int(smoothRatio)); + fi.animatesprites(tsprites, viewx, viewy, viewang.Buildang(), int(smoothRatio)); } diff --git a/source/games/exhumed/src/exhumed.h b/source/games/exhumed/src/exhumed.h index 5cac2847c..2c5d4a510 100644 --- a/source/games/exhumed/src/exhumed.h +++ b/source/games/exhumed/src/exhumed.h @@ -237,7 +237,7 @@ struct GameInterface : public ::GameInterface void WarpToCoords(int x, int y, int z, int a, int h) override; void ToggleThirdPerson() override; vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 1536.), int(-ang.Sin() * 1536.), (horiz.asq16() * 3) >> 10); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) override; + void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override; int GetCurrentSkill() override; ::GameStats getStats() override; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 10e1e6e6a..1374ac101 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -442,7 +442,7 @@ bool GameInterface::GenerateSavePic() return true; } -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) +void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) { analyzesprites(tsprites, viewx, viewy, viewz, smoothRatio); } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 0ea45dcea..34206a1c7 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1782,9 +1782,9 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int return true; } -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) +void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) { - analyzesprites(tsprites, viewx, viewy, viewz, viewang.asbuild()); + analyzesprites(tsprites, viewx, viewy, viewz, viewang.Buildang()); post_analyzesprites(tsprites); } diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 9854a4e01..c80188d00 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1919,7 +1919,7 @@ struct GameInterface : public ::GameInterface void ToggleThirdPerson() override; void SwitchCoopView() override; vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 2048.), int(-ang.Sin() * 2048.), horiz.asq16() >> 8); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, binangle viewang, double smoothRatio) override; + void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override; void UpdateCameras(double smoothratio) override; void EnterPortal(DCoreActor* viewer, int type) override; void LeavePortal(DCoreActor* viewer, int type) override;