- call the game specific analyzesprites functions.

This commit is contained in:
Christoph Oelckers 2021-03-26 15:06:14 +01:00
parent 098db655ab
commit fd0e9824b6
6 changed files with 13 additions and 0 deletions

View file

@ -156,6 +156,7 @@ EXTERN sectortype *sector;
EXTERN walltype *wall;
EXTERN spritetype *sprite;
EXTERN tspriteptr_t tsprite;
EXTERN int leveltimer;
extern sectortype sectorbackup[MAXSECTORS];
extern walltype wallbackup[MAXWALLS];

View file

@ -255,6 +255,7 @@ struct spritetype
};
int16_t extra;
int16_t detail;
int time;
#if 0
// make sure we do not accidentally copy this

View file

@ -344,6 +344,7 @@ int32_t insertsprite(int16_t sectnum, int16_t statnum)
Numsprites++;
}
sprite[newspritenum].time = leveltimer++;
return newspritenum;
}
@ -702,6 +703,7 @@ int32_t engineInit(void)
void (*initspritelists_replace)(void) = NULL;
void initspritelists(void)
{
leveltimer = 0;
if (initspritelists_replace)
{
initspritelists_replace();

View file

@ -39,6 +39,7 @@
#include "hw_clipper.h"
#include "v_draw.h"
#include "gamecvars.h"
#include "gamestruct.h"
EXTERN_CVAR(Float, r_visibility)
CVAR(Bool, gl_bandedswlight, false, CVAR_ARCHIVE)
@ -306,6 +307,8 @@ void HWDrawInfo::CreateScene()
screen->mVertexData->Map();
screen->mLights->Map();
spritesortcnt = 0;
vec2_t view = { int(vp.Pos.X * 16), int(vp.Pos.Y * -16) };
mDrawer.Init(this, mClipper, view);
if (vp.SectNums)
@ -313,6 +316,10 @@ void HWDrawInfo::CreateScene()
else
mDrawer.RenderScene(&vp.SectCount, 1);
SetupSprite.Clock();
gi->processSprites(view.x, view.y, vp.Pos.Z * -256, bamang(vp.RotAngle), vp.TicFrac * 65536);
SetupSprite.Unclock();
screen->mLights->Unmap();
screen->mVertexData->Unmap();

View file

@ -496,6 +496,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet
("hitag", c.hitag, def->hitag)
("extra", c.extra, def->extra)
("detail", c.detail, def->detail)
("time", c.time, def->time)
.EndObject();
}
return arc;

View file

@ -201,6 +201,7 @@ int InsertSprite(int nSector, int nStat)
Numsprites++;
sprite[nSprite].time = leveltimer++;
return nSprite;
}