- fixed compilation.

This commit is contained in:
Christoph Oelckers 2021-11-12 00:48:53 +01:00
parent 7ba152e588
commit 2a1a175305
8 changed files with 29 additions and 20 deletions

View file

@ -53,6 +53,7 @@ struct PlayerHorizon
fixedhoriz osum() { return ohoriz + ohorizoff; } fixedhoriz osum() { return ohoriz + ohorizoff; }
fixedhoriz sum() { return horiz + horizoff; } fixedhoriz sum() { return horiz + horizoff; }
fixedhoriz interpolatedsum(double const smoothratio) { return interpolatedhorizon(osum(), sum(), smoothratio); } fixedhoriz interpolatedsum(double const smoothratio) { return interpolatedhorizon(osum(), sum(), smoothratio); }
fixedhoriz interpolatedoff(double const smoothratio) { return interpolatedhorizon(ohorizoff, horizoff, smoothratio); }
// Ticrate playsim adjustment helpers. // Ticrate playsim adjustment helpers.
void addadjustment(double value) { __addadjustment(buildfhoriz(value)); } void addadjustment(double value) { __addadjustment(buildfhoriz(value)); }

View file

@ -435,18 +435,18 @@ void processinput(int num) {
if (plr.noclip) { if (plr.noclip) {
plr.x += xvect >> 14; plr.x += xvect >> 14;
plr.y += yvect >> 14; plr.y += yvect >> 14;
short sect = plr.sector; int sect = plr.sector;
updatesector(plr.x, plr.y, &sect); updatesector(plr.x, plr.y, &sect);
if (sect != -1) if (sect != -1)
plr.sector = sect; plr.sector = sect;
} }
else { else {
short sect = plr.sector; int sect = plr.sector;
clipmove(&plr.x, &plr.y, &plr.z, &sect, xvect, yvect, 128, 4 << 8, 4 << 8, CLIPMASK0); clipmove(&plr.pos, &sect, xvect, yvect, 128, 4 << 8, 4 << 8, CLIPMASK0);
if (sect != -1) plr.sector = sect; if (sect != -1) plr.sector = sect;
sect = plr.sector; sect = plr.sector;
pushmove(&plr.x, &plr.y, &plr.z, &sect, 128, 4 << 8, 4 << 8, CLIPMASK0); pushmove(&plr.pos, &sect, 128, 4 << 8, 4 << 8, CLIPMASK0);
if (sect != -1) plr.sector = sect; if (sect != -1) plr.sector = sect;
} }

View file

@ -9,13 +9,19 @@ struct PLAYER {
InputPacket plInput; InputPacket plInput;
int spellnum; int spellnum;
int x,y,z; union {
struct
{
int32_t x, y, z;
};
vec3_t pos;
};
PlayerAngle angle; PlayerAngle angle;
PlayerHorizon horizon; PlayerHorizon horizon;
int height; int height;
int hvel; int hvel;
short sector; int sector;
short oldsector; int oldsector;
short spritenum; short spritenum;
boolean keytoggle; boolean keytoggle;
int flags; int flags;

View file

@ -73,7 +73,7 @@ void drawscreen(int num, double dasmoothratio, bool sceneonly)
// Todo: render this with 30% light only. // Todo: render this with 30% light only.
inpreparemirror = true; inpreparemirror = true;
renderSetRollAngle(1024); renderSetRollAngle(1024);
renderDrawRoomsQ16(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), floormirrorsector[i]); renderDrawRoomsQ16(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), floormirrorsector[i], false);
analyzesprites(plr, (int)dasmoothratio, pm_tsprite, pm_spritesortcnt); analyzesprites(plr, (int)dasmoothratio, pm_tsprite, pm_spritesortcnt);
renderDrawMasks(); renderDrawMasks();
renderSetRollAngle(0); renderSetRollAngle(0);
@ -93,7 +93,7 @@ void drawscreen(int num, double dasmoothratio, bool sceneonly)
if (!testnewrenderer) if (!testnewrenderer)
{ {
renderSetRollAngle((float)crotscrnang.asbuildf()); renderSetRollAngle((float)crotscrnang.asbuildf());
renderDrawRoomsQ16(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), plr.sector); renderDrawRoomsQ16(cposx, cposy, cposz, cang.asq16(), choriz.asq16(), plr.sector, false);
analyzesprites(plr, (int)dasmoothratio, pm_tsprite, pm_spritesortcnt); analyzesprites(plr, (int)dasmoothratio, pm_tsprite, pm_spritesortcnt);
renderDrawMasks(); renderDrawMasks();
} }

View file

@ -353,7 +353,7 @@ extern short revolvesector[4], revolveang[4], revolvecnt;
extern int revolvex[4][32], revolvey[4][32]; extern int revolvex[4][32], revolvey[4][32];
extern int revolvepivotx[4], revolvepivoty[4]; extern int revolvepivotx[4], revolvepivoty[4];
extern int warpx, warpy, warpz, warpang; extern int warpx, warpy, warpz, warpang;
extern short warpsect; extern int warpsect;
extern int scarytime; extern int scarytime;
extern int scarysize; extern int scarysize;
extern int thunderflash; extern int thunderflash;

View file

@ -32,7 +32,7 @@ static short revolvesyncang, revolvesyncrotang;
static int revolvesyncx, revolvesyncy; static int revolvesyncx, revolvesyncy;
int warpx, warpy, warpz, warpang; int warpx, warpy, warpz, warpang;
short warpsect; int warpsect;
int scarytime = -1; int scarytime = -1;
int scarysize = 0; int scarysize = 0;

View file

@ -1712,9 +1712,9 @@ boolean damageactor(PLAYER& plr, int hitobject, short i) {
int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, int cliptype) { int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, int cliptype) {
int daz, zoffs; int zoffs;
int retval; int retval;
short tempshort, dasectnum; int tempshort, dasectnum;
SPRITE& spr = sprite[spritenum]; SPRITE& spr = sprite[spritenum];
if (spr.statnum == MAXSTATUS) if (spr.statnum == MAXSTATUS)
@ -1739,12 +1739,14 @@ int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordi
zoffs = 0; zoffs = 0;
dasectnum = spr.sectnum; // Can't modify sprite sectors directly becuase of linked lists dasectnum = spr.sectnum; // Can't modify sprite sectors directly becuase of linked lists
daz = spr.z + zoffs; // Must do this if not using the new centered centering (of course)
auto pos = spr.pos;
pos.z += zoffs; // Must do this if not using the new centered centering (of course)
retval = clipmove(&pos, &dasectnum, dx, dy, (spr.clipdist) << 2, ceildist, flordist, dcliptype);
retval = clipmove(&spr.x, &spr.y, &daz, &dasectnum, dx, dy, (spr.clipdist) << 2, ceildist, flordist, dcliptype); pushmove(&pos, &dasectnum, spr.clipdist << 2, ceildist, flordist, CLIPMASK0);
spr.x = pos.x;
pushmove(&spr.x, &spr.y, &daz, &dasectnum, spr.clipdist << 2, ceildist, flordist, CLIPMASK0); spr.y = pos.y;
if ((dasectnum != spr.sectnum) && (dasectnum >= 0)) if ((dasectnum != spr.sectnum) && (dasectnum >= 0))
changespritesect(spritenum, dasectnum); changespritesect(spritenum, dasectnum);
@ -1756,7 +1758,7 @@ int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordi
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, dcliptype); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, dcliptype);
spr.cstat = tempshort; spr.cstat = tempshort;
daz = spr.z + zoffs + dz; int daz = spr.z + zoffs + dz;
if ((daz <= zr_ceilz) || (daz > zr_florz)) { if ((daz <= zr_ceilz) || (daz > zr_florz)) {
if (retval != 0) if (retval != 0)
return (retval); return (retval);

View file

@ -230,8 +230,8 @@ struct WhPlayer native {
//PlayerHorizon horizon; //PlayerHorizon horizon;
native int height; native int height;
native int hvel; native int hvel;
native int16 sector; native int sector;
native int16 oldsector; native int oldsector;
native int16 spritenum; native int16 spritenum;
native bool keytoggle; native bool keytoggle;
native int flags; native int flags;