This commit is contained in:
Rachael Alexanderson 2016-12-09 03:00:02 -05:00
commit c109ebf7cb
5 changed files with 28 additions and 19 deletions

View file

@ -1654,7 +1654,10 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
/* mid texture */ /* mid texture */
bool drawfogboundary = gl_CheckFog(frontsector, backsector); bool isportal = seg->linedef->isVisualPortal() && seg->sidedef == seg->linedef->sidedef[0];
sector_t *backsec = isportal? seg->linedef->getPortalDestination()->frontsector : backsector;
bool drawfogboundary = gl_CheckFog(frontsector, backsec);
FTexture *tex = TexMan(seg->sidedef->GetTexture(side_t::mid)); FTexture *tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
if (tex != NULL) if (tex != NULL)
{ {
@ -1672,7 +1675,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2); fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2);
} }
if (seg->linedef->isVisualPortal() && seg->sidedef == seg->linedef->sidedef[0]) if (isportal)
{ {
lineportal = linePortalToGL[seg->linedef->portalindex]; lineportal = linePortalToGL[seg->linedef->portalindex];
ztop[0] = bch1; ztop[0] = bch1;

View file

@ -3061,7 +3061,7 @@ void A_Face(AActor *self, AActor *other, DAngle max_turn, DAngle max_pitch, DAng
double dist_z = target_z - source_z; double dist_z = target_z - source_z;
double ddist = g_sqrt(dist.X*dist.X + dist.Y*dist.Y + dist_z*dist_z); double ddist = g_sqrt(dist.X*dist.X + dist.Y*dist.Y + dist_z*dist_z);
DAngle other_pitch = DAngle::ToDegrees(g_asin(dist_z / ddist)).Normalized180(); DAngle other_pitch = -DAngle::ToDegrees(g_asin(dist_z / ddist)).Normalized180();
if (max_pitch != 0) if (max_pitch != 0)
{ {

View file

@ -390,13 +390,14 @@ void DPSprite::SetState(FState *newstate, bool pending)
if (ID != PSP_FLASH) if (ID != PSP_FLASH)
{ // It's still possible to set the flash layer's offsets with the action function. { // It's still possible to set the flash layer's offsets with the action function.
// Anything going through here cannot be reliably interpolated so this has to reset the interpolation coordinates if it changes the values.
if (newstate->GetMisc1()) if (newstate->GetMisc1())
{ // Set coordinates. { // Set coordinates.
x = newstate->GetMisc1(); oldx = x = newstate->GetMisc1();
} }
if (newstate->GetMisc2()) if (newstate->GetMisc2())
{ {
y = newstate->GetMisc2(); oldy = y = newstate->GetMisc2();
} }
} }
@ -1041,6 +1042,7 @@ enum WOFFlags
WOF_KEEPX = 1, WOF_KEEPX = 1,
WOF_KEEPY = 1 << 1, WOF_KEEPY = 1 << 1,
WOF_ADD = 1 << 2, WOF_ADD = 1 << 2,
WOF_INTERPOLATE = 1 << 3,
}; };
void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags) void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
@ -1069,6 +1071,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
else else
{ {
psp->x = wx; psp->x = wx;
if (!(flags & WOF_INTERPOLATE)) psp->oldx = psp->x;
} }
} }
if (!(flags & WOF_KEEPY)) if (!(flags & WOF_KEEPY))
@ -1080,6 +1083,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
else else
{ {
psp->y = wy; psp->y = wy;
if (!(flags & WOF_INTERPOLATE)) psp->oldy = psp->y;
} }
} }
} }

View file

@ -26,10 +26,8 @@ DWORD NumStdSprites; // The first x sprites that don't belong to skins.
struct spriteframewithrotate : public spriteframe_t struct spriteframewithrotate : public spriteframe_t
{ {
int rotate; int rotate;
} };
sprtemp[MAX_SPRITE_FRAMES];
int maxframe;
char* spritename;
// [RH] skin globals // [RH] skin globals
FPlayerSkin *skins; FPlayerSkin *skins;
@ -46,7 +44,7 @@ PalEntry OtherGameSkinPalette[256];
// [RH] Removed checks for coexistance of rotation 0 with other // [RH] Removed checks for coexistance of rotation 0 with other
// rotations and made it look more like BOOM's version. // rotations and made it look more like BOOM's version.
// //
static bool R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool flipped) static bool R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool flipped, spriteframewithrotate *sprtemp, int &maxframe)
{ {
unsigned rotation; unsigned rotation;
@ -119,7 +117,7 @@ static bool R_InstallSpriteLump (FTextureID lump, unsigned frame, char rot, bool
// [RH] Seperated out of R_InitSpriteDefs() // [RH] Seperated out of R_InitSpriteDefs()
static void R_InstallSprite (int num) static void R_InstallSprite (int num, spriteframewithrotate *sprtemp, int &maxframe)
{ {
int frame; int frame;
int framestart; int framestart;
@ -267,6 +265,8 @@ void R_InitSpriteDefs ()
unsigned int i, j, smax, vmax; unsigned int i, j, smax, vmax;
DWORD intname; DWORD intname;
spriteframewithrotate sprtemp[MAX_SPRITE_FRAMES];
// Create a hash table to speed up the process // Create a hash table to speed up the process
smax = TexMan.NumTextures(); smax = TexMan.NumTextures();
hashes = new Hasher[smax]; hashes = new Hasher[smax];
@ -348,7 +348,7 @@ void R_InitSpriteDefs ()
sprtemp[j].Voxel = NULL; sprtemp[j].Voxel = NULL;
} }
maxframe = -1; int maxframe = -1;
intname = sprites[i].dwName; intname = sprites[i].dwName;
// scan the lumps, filling in the frames for whatever is found // scan the lumps, filling in the frames for whatever is found
@ -358,10 +358,10 @@ void R_InitSpriteDefs ()
FTexture *tex = TexMan[hash]; FTexture *tex = TexMan[hash];
if (TEX_DWNAME(tex) == intname) if (TEX_DWNAME(tex) == intname)
{ {
bool res = R_InstallSpriteLump (FTextureID(hash), tex->Name[4] - 'A', tex->Name[5], false); bool res = R_InstallSpriteLump (FTextureID(hash), tex->Name[4] - 'A', tex->Name[5], false, sprtemp, maxframe);
if (tex->Name[6] && res) if (tex->Name[6] && res)
R_InstallSpriteLump (FTextureID(hash), tex->Name[6] - 'A', tex->Name[7], true); R_InstallSpriteLump (FTextureID(hash), tex->Name[6] - 'A', tex->Name[7], true, sprtemp, maxframe);
} }
hash = hashes[hash].Next; hash = hashes[hash].Next;
} }
@ -398,7 +398,7 @@ void R_InitSpriteDefs ()
hash = vh->Next; hash = vh->Next;
} }
R_InstallSprite ((int)i); R_InstallSprite ((int)i, sprtemp, maxframe);
} }
delete[] hashes; delete[] hashes;
@ -762,13 +762,14 @@ void R_InitSkins (void)
for(int spr = 0; spr<2; spr++) for(int spr = 0; spr<2; spr++)
{ {
spriteframewithrotate sprtemp[MAX_SPRITE_FRAMES];
memset (sprtemp, 0xFFFF, sizeof(sprtemp)); memset (sprtemp, 0xFFFF, sizeof(sprtemp));
for (k = 0; k < MAX_SPRITE_FRAMES; ++k) for (k = 0; k < MAX_SPRITE_FRAMES; ++k)
{ {
sprtemp[k].Flip = 0; sprtemp[k].Flip = 0;
sprtemp[k].Voxel = NULL; sprtemp[k].Voxel = NULL;
} }
maxframe = -1; int maxframe = -1;
if (spr == 1) if (spr == 1)
{ {
@ -792,10 +793,10 @@ void R_InitSkins (void)
if (lnameint == intname) if (lnameint == intname)
{ {
FTextureID picnum = TexMan.CreateTexture(k, FTexture::TEX_SkinSprite); FTextureID picnum = TexMan.CreateTexture(k, FTexture::TEX_SkinSprite);
bool res = R_InstallSpriteLump (picnum, lname[4] - 'A', lname[5], false); bool res = R_InstallSpriteLump (picnum, lname[4] - 'A', lname[5], false, sprtemp, maxframe);
if (lname[6] && res) if (lname[6] && res)
R_InstallSpriteLump (picnum, lname[6] - 'A', lname[7], true); R_InstallSpriteLump (picnum, lname[6] - 'A', lname[7], true, sprtemp, maxframe);
} }
} }
@ -811,7 +812,7 @@ void R_InitSkins (void)
int sprno = (int)sprites.Push (temp); int sprno = (int)sprites.Push (temp);
if (spr==0) skins[i].sprite = sprno; if (spr==0) skins[i].sprite = sprno;
else skins[i].crouchsprite = sprno; else skins[i].crouchsprite = sprno;
R_InstallSprite (sprno); R_InstallSprite (sprno, sprtemp, maxframe);
} }
} }

View file

@ -703,6 +703,7 @@ enum EWeaponOffsetFlags
WOF_KEEPX = 1, WOF_KEEPX = 1,
WOF_KEEPY = 1 << 1, WOF_KEEPY = 1 << 1,
WOF_ADD = 1 << 2, WOF_ADD = 1 << 2,
WOF_INTERPOLATE = 1 << 3,
}; };
// Flags for psprite layers // Flags for psprite layers