diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index 1678672f3..cfa785bf0 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -116,7 +116,7 @@ struct GameInterface virtual void SwitchCoopView() { Printf("Unsupported command\n"); } virtual void ToggleShowWeapon() { Printf("Unsupported command\n"); } virtual DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(0,0,0); } - virtual void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) = 0; + virtual void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) = 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 006a796e0..bbd284c6e 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -391,7 +391,7 @@ void HWDrawInfo::CreateScene(bool portal) SetupSprite.Clock(); // vp is in render space, so we must convert back. - gi->processSprites(tsprites, vp.Pos.X * 16, vp.Pos.Y * -16, vp.Pos.Z * -256, DAngle::fromBam(vp.RotAngle), vp.TicFrac); + gi->processSprites(tsprites, DVector3(vp.Pos.X, -vp.Pos.Y, -vp.Pos.Z), DAngle::fromBam(vp.RotAngle), vp.TicFrac); DispatchSprites(); SetupSprite.Unclock(); diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 5f65ce31f..fef95f963 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -996,9 +996,9 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t // //--------------------------------------------------------------------------- -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) +void GameInterface::processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) { - viewProcessSprites(tsprites, viewx, viewy, viewz, viewang, interpfrac); + viewProcessSprites(tsprites, view.X * worldtoint, view.Y * worldtoint, view.Z * zworldtoint, viewang, interpfrac); } int display_mirror; diff --git a/source/games/blood/src/blood.h b/source/games/blood/src/blood.h index fe4c427e4..beca3047f 100644 --- a/source/games/blood/src/blood.h +++ b/source/games/blood/src/blood.h @@ -140,7 +140,7 @@ struct GameInterface : public ::GameInterface void SwitchCoopView() override; void ToggleShowWeapon() override; DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 80., horiz.asbuildf() * 0.625 - 16); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) override; + void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) 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 a43f09643..f816f4f00 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -56,7 +56,7 @@ struct GameInterface : public ::GameInterface void SwitchCoopView() override; void ToggleShowWeapon() override; DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 64., horiz.asbuildf() * 0.5); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) override; + void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) 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 1fc6c3f09..febe91b2e 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -387,9 +387,9 @@ bool GameInterface::GenerateSavePic() return true; } -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) +void GameInterface::processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) { - fi.animatesprites(tsprites, DVector2(viewx * inttoworld, viewy * inttoworld), viewang, interpfrac); + fi.animatesprites(tsprites, view.XY(), viewang, interpfrac); } diff --git a/source/games/exhumed/src/exhumed.h b/source/games/exhumed/src/exhumed.h index 174326da1..1d0e92726 100644 --- a/source/games/exhumed/src/exhumed.h +++ b/source/games/exhumed/src/exhumed.h @@ -236,7 +236,7 @@ struct GameInterface : public ::GameInterface void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override; void ToggleThirdPerson() override; DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 96., horiz.asbuildf() * 0.75); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) override; + void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) override; int GetCurrentSkill() override; std::pair GetCoordinates() override; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 0771b5c93..dd472ac89 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -418,9 +418,9 @@ bool GameInterface::GenerateSavePic() return true; } -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) +void GameInterface::processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) { - analyzesprites(tsprites, DVector3(viewx * inttoworld, viewy * inttoworld, viewz * zinttoworld), interpfrac); + analyzesprites(tsprites, view, interpfrac); } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index f301634c3..d8076924e 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1495,9 +1495,9 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, // //--------------------------------------------------------------------------- -void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac) +void GameInterface::processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) { - analyzesprites(tsprites, DVector3(viewx * inttoworld, viewy * inttoworld, viewz * zinttoworld), interpfrac); + analyzesprites(tsprites, view, interpfrac); post_analyzesprites(tsprites); } diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 337b4e504..c930bbdd5 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1894,7 +1894,7 @@ struct GameInterface : public ::GameInterface void ToggleThirdPerson() override; void SwitchCoopView() override; DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 128., horiz.asbuildf()); } - void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override; + void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double smoothRatio) override; void UpdateCameras(double smoothratio) override; void EnterPortal(DCoreActor* viewer, int type) override; void LeavePortal(DCoreActor* viewer, int type) override;