Merge branch 'master' into renderstate_abstraction

This commit is contained in:
Christoph Oelckers 2018-10-29 14:00:43 +01:00
commit f7446160bb
10 changed files with 62 additions and 24 deletions

View file

@ -93,16 +93,15 @@ matrix:
- os: linux
compiler: clang
env:
- CLANG_VERSION=6.0
- CLANG_VERSION=7
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=MinSizeRel -DDYN_OPENAL=NO -DDYN_SNDFILE=NO -DDYN_MPG123=NO -DDYN_FLUIDSYNTH=NO"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- llvm-toolchain-trusty-7
packages:
- clang-6.0
- libstdc++-5-dev
- clang-7
- libsdl2-dev
- libgme-dev
- libopenal-dev

View file

@ -16,7 +16,7 @@ class GLViewpointBuffer
unsigned int mByteSize;
TArray<bool> mClipPlaneInfo;
unsigned int m2DWidth = ~0u, m2DHeight = ~0u;
int m2DWidth = -1, m2DHeight = -1;
unsigned int mBlockSize;

View file

@ -428,7 +428,7 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t
switch (change & 3)
{
case 1: // type is zeroed
ceiling->m_NewSpecial.Clear();
ceiling->m_NewSpecial = {};
ceiling->m_Type = DCeiling::genCeilingChg0;
break;
case 2: // type is copied
@ -447,7 +447,7 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t
switch (change & 3)
{
case 1: // type is zeroed
ceiling->m_NewSpecial.Clear();
ceiling->m_NewSpecial = {};
ceiling->m_Type = DCeiling::genCeilingChg0;
break;
case 2: // type is copied

View file

@ -229,7 +229,7 @@ void DFloor::SetFloorChangeType (sector_t *sec, int change)
switch (change & 3)
{
case 1:
m_NewSpecial.Clear();
m_NewSpecial = {};
m_Type = DFloor::genFloorChg0;
break;
case 2:
@ -828,7 +828,7 @@ bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed)
floor->m_Speed = slimespeed;
floor->m_Instant = false;
floor->m_Texture = s3->GetTexture(sector_t::floor);
floor->m_NewSpecial.Clear();
floor->m_NewSpecial = {};
height = s3->FindHighestFloorPoint (&spot);
floor->m_FloorDestDist = s2->floorplane.PointToDist (spot, height);
floor->StartFloorSound ();

View file

@ -439,7 +439,7 @@ protected:
// [RH] Need these for BOOM-ish transferring ceilings
FTextureID m_Texture;
secspecial_t m_NewSpecial;
secspecial_t m_NewSpecial{};
// ID
int m_Tag;
@ -536,7 +536,7 @@ public:
bool m_Hexencrush;
bool m_Instant;
int m_Direction;
secspecial_t m_NewSpecial;
secspecial_t m_NewSpecial{};
FTextureID m_Texture;
double m_FloorDestDist;
double m_Speed;

View file

@ -164,7 +164,7 @@ void PolyCull::CullSubsector(subsector_t *sub)
angle_t angle2 = PointToPseudoAngle(line->v1->fX(), line->v1->fY());
angle_t angle1 = PointToPseudoAngle(line->v2->fX(), line->v2->fY());
bool lineVisible = !IsSegmentCulled(angle1, angle2);
if (lineVisible && line->backsector == nullptr)
if (lineVisible && IsSolidLine(line))
{
MarkSegmentCulled(angle1, angle2);
}
@ -182,6 +182,52 @@ void PolyCull::CullSubsector(subsector_t *sub)
SubsectorDepths[sub->Index()] = subsectorDepth;
}
bool PolyCull::IsSolidLine(seg_t *line)
{
// One-sided
if (!line->backsector) return true;
// Portal
if (line->linedef && line->linedef->isVisualPortal() && line->sidedef == line->linedef->sidedef[0]) return true;
double frontCeilingZ1 = line->frontsector->ceilingplane.ZatPoint(line->v1);
double frontFloorZ1 = line->frontsector->floorplane.ZatPoint(line->v1);
double frontCeilingZ2 = line->frontsector->ceilingplane.ZatPoint(line->v2);
double frontFloorZ2 = line->frontsector->floorplane.ZatPoint(line->v2);
double backCeilingZ1 = line->backsector->ceilingplane.ZatPoint(line->v1);
double backFloorZ1 = line->backsector->floorplane.ZatPoint(line->v1);
double backCeilingZ2 = line->backsector->ceilingplane.ZatPoint(line->v2);
double backFloorZ2 = line->backsector->floorplane.ZatPoint(line->v2);
// Closed door.
if (backCeilingZ1 <= frontFloorZ1 && backCeilingZ2 <= frontFloorZ2) return true;
if (backFloorZ1 >= frontCeilingZ1 && backFloorZ2 >= frontCeilingZ2) return true;
// properly render skies (consider door "open" if both ceilings are sky)
if (line->backsector->GetTexture(sector_t::ceiling) == skyflatnum && line->frontsector->GetTexture(sector_t::ceiling) == skyflatnum) return false;
// if door is closed because back is shut:
if (!(backCeilingZ1 <= backFloorZ1 && backCeilingZ2 <= backFloorZ2)) return false;
// preserve a kind of transparent door/lift special effect:
if (((backCeilingZ1 >= frontCeilingZ1 && backCeilingZ2 >= frontCeilingZ2) || line->sidedef->GetTexture(side_t::top).isValid())
&& ((backFloorZ1 <= frontFloorZ1 && backFloorZ2 <= frontFloorZ2) || line->sidedef->GetTexture(side_t::bottom).isValid()))
{
// killough 1/18/98 -- This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff.
//
// It assumes that Doom has already ruled out a door being closed because
// of front-back closure (e.g. front floor is taller than back ceiling).
// This fixes the automap floor height bug -- killough 1/18/98:
// killough 4/7/98: optimize: save result in doorclosed for use in r_segs.c
return true;
}
return false;
}
bool PolyCull::IsSegmentCulled(angle_t startAngle, angle_t endAngle) const
{
if (startAngle > endAngle)

View file

@ -56,6 +56,8 @@ private:
void MarkViewFrustum();
void InvertSegments();
static bool IsSolidLine(seg_t *line);
bool IsSegmentCulled(angle_t angle1, angle_t angle2) const;
void CullNode(void *node);

View file

@ -39,6 +39,7 @@ void PolyRenderModel(PolyRenderThread *thread, const Mat4f &worldToClip, uint32_
renderer.AddLights(actor);
renderer.RenderModel(x, y, z, smf, actor, r_viewpoint.TicFrac);
PolyTriangleDrawer::SetModelVertexShader(thread->DrawQueue, -1, -1, 0.0f);
PolyTriangleDrawer::SetTransform(thread->DrawQueue, thread->FrameMemory->NewObject<Mat4f>(worldToClip), nullptr);
}
void PolyRenderHUDModel(PolyRenderThread *thread, const Mat4f &worldToClip, uint32_t stencilValue, DPSprite *psp, float ofsx, float ofsy)

View file

@ -588,16 +588,6 @@ struct secspecial_t
short damageinterval; // Interval for damage application
short leakydamage; // chance of leaking through radiation suit
int Flags;
secspecial_t()
{
Clear();
}
void Clear()
{
memset(this, 0, sizeof(*this));
}
};
FSerializer &Serialize(FSerializer &arc, const char *key, secspecial_t &spec, secspecial_t *def);

View file

@ -2737,8 +2737,8 @@ DEFINE_ACTION_FUNCTION(DObject, S_ChangeMusic)
PARAM_PROLOGUE;
PARAM_STRING(music);
PARAM_INT_DEF(order);
PARAM_BOOL(looping);
PARAM_BOOL(force);
PARAM_BOOL_DEF(looping);
PARAM_BOOL_DEF(force);
ACTION_RETURN_BOOL(S_ChangeMusic(music, order, looping, force));
}