- Blood: Eliminate VIEW structure entirely.

This commit is contained in:
Mitchell Richters 2022-09-10 22:34:44 +10:00 committed by Christoph Oelckers
parent b4af1a4600
commit 3c39174a22
3 changed files with 4 additions and 34 deletions

View file

@ -43,8 +43,6 @@ void fakePlayerProcess(PLAYER* pPlayer, InputPacket* pInput);
void fakeActProcessSprites(void);
bool gPrediction = true;
VIEW predict, predictOld;
static VIEW predictFifo[256];
void viewInitializePrediction(void)
{
@ -89,14 +87,16 @@ void viewInitializePrediction(void)
void viewUpdatePrediction(InputPacket* pInput)
{
#if 0
predictOld = predict;
auto bakCstat = gMe->actor->spr.cstat;
gMe->actor->spr.cstat = 0;
fakePlayerProcess(gMe, pInput);
fakeActProcessSprites();
gMe->actor->spr.cstat = bakCstat;
//predictFifo[gPredictTail&255] = predict;
//gPredictTail++;
predictFifo[gPredictTail&255] = predict;
gPredictTail++;
#endif
}
static void fakeProcessInput(PLAYER* pPlayer, InputPacket* pInput)

View file

@ -47,7 +47,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
VIEW gPrevView[kMaxPlayers];
VIEWPOS gViewPos;
int gViewIndex;
@ -445,7 +444,6 @@ static void DrawMap(DBloodActor* view, const double smoothratio)
setViewport(Hud_Stbar);
tm = 1;
}
VIEW* pView = &gPrevView[gViewIndex];
auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(smoothratio * (1. / MaxSmoothRatio));
DrawOverheadMap(view->interpolatedpos(smoothratio * (1. / MaxSmoothRatio)).XY(), ang, smoothratio * (1. / MaxSmoothRatio));
if (tm)
@ -492,7 +490,6 @@ static void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sec
else
#endif
{
VIEW* pView = &gPrevView[gViewIndex];
cX = interpolatedvalue(gView->actor->opos.X, gView->actor->spr.pos.X, smoothratio * (1. / MaxSmoothRatio)) * worldtoint;
cY = interpolatedvalue(gView->actor->opos.Y, gView->actor->spr.pos.Y, smoothratio * (1. / MaxSmoothRatio)) * worldtoint;
cZ = interpolatedvalue(gView->ozView, gView->zView, smoothratio * (1. / MaxSmoothRatio));

View file

@ -31,33 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
struct VIEW {
int bobPhase;
int Kills;
int shakeBobY; // bob sway y
int shakeBobX; // bob sway x
int zViewVel;
int zWeapon;
int zWeaponVel;
int posture; // posture
double spin; // spin
int xvel; //xvel
int yvel; //yvel
int zvel; //zvel
int sectnum; // sectnum
unsigned int floordist; // floordist
uint8_t lookCenter; // look center
uint8_t cantJump;
uint8_t isRunning; // run
uint8_t jump; // jump
uint8_t isUnderwater; // underwater
int16_t sprflags; // sprite flags
SPRITEHIT hit;
};
extern VIEW gPrevView[kMaxPlayers];
extern VIEW predict, predictOld;
extern bool gPrediction;
enum VIEW_EFFECT {