Merge remote-tracking branch 'origin/master' into archive_split

This commit is contained in:
Rachael Alexanderson 2017-09-12 06:34:02 -04:00
commit 6d2c55f57d
5 changed files with 65 additions and 55 deletions

View File

@ -56,15 +56,15 @@ matrix:
- os: linux
compiler: clang
env:
- CLANG_VERSION=4.0
- CLANG_VERSION=5.0
- 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-4.0
- llvm-toolchain-trusty-5.0
packages:
- clang-4.0
- clang-5.0
- libstdc++-5-dev
- libsdl2-dev
- libgme-dev

View File

@ -10041,7 +10041,7 @@ scriptwait:
}
else
{
FCanvasTextureInfo::Add (camera, picnum, ACSToDouble(STACK(1)));
FCanvasTextureInfo::Add (camera, picnum, STACK(1));
}
}
sp -= 3;

View File

@ -186,11 +186,13 @@ void RenderPolyPlane::Render(PolyRenderThread *thread, const TriMatrix &worldToC
TriVertex *vertices = thread->FrameMemory->AllocMemory<TriVertex>(sub->numlines);
if (ceiling)
{
if (!isSky)
{
for (uint32_t i = 0; i < sub->numlines; i++)
{
seg_t *line = &sub->firstline[i];
vertices[sub->numlines - 1 - i] = transform.GetVertex(line->v1, isSky ? skyHeight : frontsector->ceilingplane.ZatPoint(line->v1));
vertices[sub->numlines - 1 - i] = transform.GetVertex(line->v1, frontsector->ceilingplane.ZatPoint(line->v1));
}
}
else
@ -198,7 +200,27 @@ void RenderPolyPlane::Render(PolyRenderThread *thread, const TriMatrix &worldToC
for (uint32_t i = 0; i < sub->numlines; i++)
{
seg_t *line = &sub->firstline[i];
vertices[i] = transform.GetVertex(line->v1, isSky ? skyHeight : frontsector->floorplane.ZatPoint(line->v1));
vertices[sub->numlines - 1 - i] = transform.GetVertex(line->v1, skyHeight);
}
}
}
else
{
if (!isSky)
{
for (uint32_t i = 0; i < sub->numlines; i++)
{
seg_t *line = &sub->firstline[i];
vertices[i] = transform.GetVertex(line->v1, frontsector->floorplane.ZatPoint(line->v1));
}
}
else
{
for (uint32_t i = 0; i < sub->numlines; i++)
{
seg_t *line = &sub->firstline[i];
vertices[i] = transform.GetVertex(line->v1, skyHeight);
}
}
}
@ -259,26 +281,29 @@ void RenderPolyPlane::RenderSkyWalls(PolyRenderThread *thread, PolyDrawArgs &arg
{
for (uint32_t i = 0; i < sub->numlines; i++)
{
TriVertex *wallvert = thread->FrameMemory->AllocMemory<TriVertex>(4);
seg_t *line = &sub->firstline[i];
double skyBottomz1 = frontsector->ceilingplane.ZatPoint(line->v1);
double skyBottomz2 = frontsector->ceilingplane.ZatPoint(line->v2);
if (line->backsector)
{
sector_t *backsector = (line->backsector != line->frontsector) ? line->backsector : line->frontsector;
double frontceilz1 = frontsector->ceilingplane.ZatPoint(line->v1);
double frontfloorz1 = frontsector->floorplane.ZatPoint(line->v1);
double frontceilz2 = frontsector->ceilingplane.ZatPoint(line->v2);
double frontfloorz2 = frontsector->floorplane.ZatPoint(line->v2);
sector_t *backsector = line->backsector;
double backceilz1 = backsector->ceilingplane.ZatPoint(line->v1);
double backfloorz1 = backsector->floorplane.ZatPoint(line->v1);
double backceilz2 = backsector->ceilingplane.ZatPoint(line->v2);
double backfloorz2 = backsector->floorplane.ZatPoint(line->v2);
bool bothSkyCeiling = frontsector->GetTexture(sector_t::ceiling) == skyflatnum && backsector->GetTexture(sector_t::ceiling) == skyflatnum;
bool closedSector = backceilz1 == backfloorz1 && backceilz2 == backfloorz2;
if (ceiling && bothSkyCeiling && closedSector)
{
double frontceilz1 = frontsector->ceilingplane.ZatPoint(line->v1);
double frontfloorz1 = frontsector->floorplane.ZatPoint(line->v1);
double frontceilz2 = frontsector->ceilingplane.ZatPoint(line->v2);
double frontfloorz2 = frontsector->floorplane.ZatPoint(line->v2);
double topceilz1 = frontceilz1;
double topceilz2 = frontceilz2;
double topfloorz1 = MIN(backceilz1, frontceilz1);
@ -290,11 +315,6 @@ void RenderPolyPlane::RenderSkyWalls(PolyRenderThread *thread, PolyDrawArgs &arg
double middlefloorz1 = MIN(bottomceilz1, middleceilz1);
double middlefloorz2 = MIN(bottomceilz2, middleceilz2);
bool bothSkyCeiling = frontsector->GetTexture(sector_t::ceiling) == skyflatnum && backsector->GetTexture(sector_t::ceiling) == skyflatnum;
bool closedSector = backceilz1 == backfloorz1 && backceilz2 == backfloorz2;
if (ceiling && bothSkyCeiling && closedSector)
{
skyBottomz1 = middlefloorz1;
skyBottomz2 = middlefloorz2;
}
@ -310,6 +330,8 @@ void RenderPolyPlane::RenderSkyWalls(PolyRenderThread *thread, PolyDrawArgs &arg
skyBottomz2 = frontsector->floorplane.ZatPoint(line->v2);
}
TriVertex *wallvert = thread->FrameMemory->AllocMemory<TriVertex>(4);
if (ceiling)
{
wallvert[0] = transform.GetVertex(line->v1, skyHeight);
@ -361,28 +383,6 @@ PolyPlaneUVTransform::PolyPlaneUVTransform(const FTransform &transform, FTexture
}
}
TriVertex PolyPlaneUVTransform::GetVertex(vertex_t *v1, double height) const
{
TriVertex v;
v.x = (float)v1->fPos().X;
v.y = (float)v1->fPos().Y;
v.z = (float)height;
v.w = 1.0f;
v.u = GetU(v.x, v.y);
v.v = GetV(v.x, v.y);
return v;
}
float PolyPlaneUVTransform::GetU(float x, float y) const
{
return (xOffs + x * cosine - y * sine) * xscale;
}
float PolyPlaneUVTransform::GetV(float x, float y) const
{
return (yOffs - x * sine - y * cosine) * yscale;
}
/////////////////////////////////////////////////////////////////////////////
void Render3DFloorPlane::RenderPlanes(PolyRenderThread *thread, const TriMatrix &worldToClip, const PolyClipPlane &clipPlane, subsector_t *sub, uint32_t stencilValue, uint32_t subsectorDepth, std::vector<PolyTranslucentObject *> &translucentObjects)

View File

@ -31,11 +31,21 @@ class PolyPlaneUVTransform
public:
PolyPlaneUVTransform(const FTransform &transform, FTexture *tex);
TriVertex GetVertex(vertex_t *v1, double height) const;
TriVertex GetVertex(vertex_t *v1, double height) const
{
TriVertex v;
v.x = (float)v1->fX();
v.y = (float)v1->fY();
v.z = (float)height;
v.w = 1.0f;
v.u = GetU(v.x, v.y);
v.v = GetV(v.x, v.y);
return v;
}
private:
float GetU(float x, float y) const;
float GetV(float x, float y) const;
float GetU(float x, float y) const { return (xOffs + x * cosine - y * sine) * xscale; }
float GetV(float x, float y) const { return (yOffs - x * sine - y * cosine) * yscale; }
float xscale;
float yscale;

View File

@ -112,7 +112,7 @@ bool RenderPolyWall::RenderLine(PolyRenderThread *thread, const TriMatrix &world
}
else
{
sector_t *backsector = (line->backsector != line->frontsector) ? line->backsector : line->frontsector;
sector_t *backsector = line->backsector;
double backceilz1 = backsector->ceilingplane.ZatPoint(line->v1);
double backfloorz1 = backsector->floorplane.ZatPoint(line->v1);