mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- Exhumed: Leverage new spritetype
methods within Exhumed.
This commit is contained in:
parent
18fbc8996b
commit
6721a6aa05
3 changed files with 6 additions and 27 deletions
|
@ -175,8 +175,6 @@ int nTimeLimit;
|
|||
|
||||
int bVanilla = 0;
|
||||
|
||||
Loc oldLocs[MAXSPRITES];
|
||||
|
||||
void DebugOut(const char *fmt, ...)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
@ -263,24 +261,14 @@ double calc_smoothratio()
|
|||
return I_GetTimeFrac() * MaxSmoothRatio;
|
||||
}
|
||||
|
||||
static void recordoldspritepos()
|
||||
{
|
||||
for (int i = 0; i < MAXSPRITES; i++)
|
||||
{
|
||||
auto* spr = &sprite[i];
|
||||
Loc* oldLoc = &oldLocs[i];
|
||||
oldLoc->x = spr->x;
|
||||
oldLoc->y = spr->y;
|
||||
oldLoc->z = spr->z;
|
||||
oldLoc->ang = spr->ang;
|
||||
}
|
||||
}
|
||||
|
||||
void GameMove(void)
|
||||
{
|
||||
FixPalette();
|
||||
|
||||
recordoldspritepos();
|
||||
for (int i = 0; i < MAXSPRITES; i++)
|
||||
{
|
||||
sprite[i].backuploc();
|
||||
}
|
||||
|
||||
if (currentLevel->levelNumber == kMap20)
|
||||
{
|
||||
|
|
|
@ -72,11 +72,8 @@ static void analyzesprites(double const smoothratio)
|
|||
if (pTSprite->owner != -1)
|
||||
{
|
||||
// interpolate sprite position
|
||||
Loc* oldLoc = &oldLocs[pTSprite->owner];
|
||||
pTSprite->x = oldLoc->x + MulScale(pTSprite->x - oldLoc->x, smoothratio, 16);
|
||||
pTSprite->y = oldLoc->y + MulScale(pTSprite->y - oldLoc->y, smoothratio, 16);
|
||||
pTSprite->z = oldLoc->z + MulScale(pTSprite->z - oldLoc->z, smoothratio, 16);
|
||||
pTSprite->ang = oldLoc->ang + MulScale(((pTSprite->ang - oldLoc->ang + 1024) & 0x7FF) - 1024, smoothratio, 16);
|
||||
pTSprite->pos = pTSprite->interpolatedvec3(smoothratio);
|
||||
pTSprite->ang = pTSprite->interpolatedang(smoothratio);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,12 +40,6 @@ extern short bTouchFloor;
|
|||
extern short nChunkTotal;
|
||||
extern int gFov;
|
||||
|
||||
struct Loc
|
||||
{
|
||||
int x, y, z, ang;
|
||||
};
|
||||
extern Loc oldLocs[MAXSPRITES];
|
||||
|
||||
static inline int angle_interpolate16(int a, int b, int smooth)
|
||||
{
|
||||
return a + MulScale(((b+1024-a)&2047)-1024, smooth, 16);
|
||||
|
|
Loading…
Reference in a new issue