- refactor animatesprites API

This commit is contained in:
Christoph Oelckers 2022-09-15 19:06:41 +02:00
parent 9a4c699f53
commit 5f44dcc262
5 changed files with 6 additions and 10 deletions

View file

@ -44,11 +44,9 @@ EXTERN_CVAR(Bool, wt_commentary)
BEGIN_DUKE_NS
void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, double interpfrac)
void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac)
{
DAngle viewang = DAngle::fromBuild(a);
DAngle kang;
DVector2 viewVec(x * inttoworld, y * inttoworld);
int k, p;
int l, t1, t3, t4;
tspritetype* t;

View file

@ -37,11 +37,9 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
BEGIN_DUKE_NS
void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, double interpfrac)
void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac)
{
DAngle kang;
DAngle viewang = DAngle::fromBuild(a);
DVector2 viewVec(x * inttoworld, y * inttoworld);
int k, p;
int l, t1, t3, t4;
tspritetype* t;

View file

@ -98,8 +98,8 @@ void displaymasks_d(int snum, int p, double interpfrac);
void displaymasks_r(int snum, int p, double interpfrac);
void think_d();
void think_r();
void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, double interpfrac);
void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, double interpfrac);
void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac);
void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac);
Dispatcher fi;

View file

@ -107,7 +107,7 @@ struct Dispatcher
void (*displayweapon)(int snum, double interpfrac);
void (*displaymasks)(int snum, int p, double interpfrac);
void (*animatesprites)(tspriteArray& tsprites, int x, int y, int a, double interpfrac);
void (*animatesprites)(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac);
};

View file

@ -389,7 +389,7 @@ bool GameInterface::GenerateSavePic()
void GameInterface::processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double interpfrac)
{
fi.animatesprites(tsprites, viewx, viewy, viewang.Buildang(), interpfrac);
fi.animatesprites(tsprites, DVector2(viewx * inttoworld, viewy * inttoworld), viewang, interpfrac);
}