- pass a vector to the processSprites interface.

This commit is contained in:
Christoph Oelckers 2022-09-16 19:20:35 +02:00
parent bbf77c908b
commit 375d346ae8
10 changed files with 14 additions and 14 deletions

View file

@ -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) {}

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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<DVector3, DAngle> GetCoordinates() override;

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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;