mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
Merge remote-tracking branch 'origin/master' into archive_split
This commit is contained in:
commit
6d2c55f57d
5 changed files with 65 additions and 55 deletions
|
@ -56,15 +56,15 @@ matrix:
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env:
|
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"
|
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=MinSizeRel -DDYN_OPENAL=NO -DDYN_SNDFILE=NO -DDYN_MPG123=NO -DDYN_FLUIDSYNTH=NO"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-trusty-4.0
|
- llvm-toolchain-trusty-5.0
|
||||||
packages:
|
packages:
|
||||||
- clang-4.0
|
- clang-5.0
|
||||||
- libstdc++-5-dev
|
- libstdc++-5-dev
|
||||||
- libsdl2-dev
|
- libsdl2-dev
|
||||||
- libgme-dev
|
- libgme-dev
|
||||||
|
|
|
@ -10041,7 +10041,7 @@ scriptwait:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FCanvasTextureInfo::Add (camera, picnum, ACSToDouble(STACK(1)));
|
FCanvasTextureInfo::Add (camera, picnum, STACK(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sp -= 3;
|
sp -= 3;
|
||||||
|
|
|
@ -186,11 +186,13 @@ void RenderPolyPlane::Render(PolyRenderThread *thread, const TriMatrix &worldToC
|
||||||
TriVertex *vertices = thread->FrameMemory->AllocMemory<TriVertex>(sub->numlines);
|
TriVertex *vertices = thread->FrameMemory->AllocMemory<TriVertex>(sub->numlines);
|
||||||
|
|
||||||
if (ceiling)
|
if (ceiling)
|
||||||
|
{
|
||||||
|
if (!isSky)
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < sub->numlines; i++)
|
for (uint32_t i = 0; i < sub->numlines; i++)
|
||||||
{
|
{
|
||||||
seg_t *line = &sub->firstline[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
|
else
|
||||||
|
@ -198,7 +200,27 @@ void RenderPolyPlane::Render(PolyRenderThread *thread, const TriMatrix &worldToC
|
||||||
for (uint32_t i = 0; i < sub->numlines; i++)
|
for (uint32_t i = 0; i < sub->numlines; i++)
|
||||||
{
|
{
|
||||||
seg_t *line = &sub->firstline[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++)
|
for (uint32_t i = 0; i < sub->numlines; i++)
|
||||||
{
|
{
|
||||||
TriVertex *wallvert = thread->FrameMemory->AllocMemory<TriVertex>(4);
|
|
||||||
|
|
||||||
seg_t *line = &sub->firstline[i];
|
seg_t *line = &sub->firstline[i];
|
||||||
|
|
||||||
double skyBottomz1 = frontsector->ceilingplane.ZatPoint(line->v1);
|
double skyBottomz1 = frontsector->ceilingplane.ZatPoint(line->v1);
|
||||||
double skyBottomz2 = frontsector->ceilingplane.ZatPoint(line->v2);
|
double skyBottomz2 = frontsector->ceilingplane.ZatPoint(line->v2);
|
||||||
if (line->backsector)
|
if (line->backsector)
|
||||||
{
|
{
|
||||||
sector_t *backsector = (line->backsector != line->frontsector) ? line->backsector : line->frontsector;
|
sector_t *backsector = line->backsector;
|
||||||
|
|
||||||
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 backceilz1 = backsector->ceilingplane.ZatPoint(line->v1);
|
double backceilz1 = backsector->ceilingplane.ZatPoint(line->v1);
|
||||||
double backfloorz1 = backsector->floorplane.ZatPoint(line->v1);
|
double backfloorz1 = backsector->floorplane.ZatPoint(line->v1);
|
||||||
double backceilz2 = backsector->ceilingplane.ZatPoint(line->v2);
|
double backceilz2 = backsector->ceilingplane.ZatPoint(line->v2);
|
||||||
double backfloorz2 = backsector->floorplane.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 topceilz1 = frontceilz1;
|
||||||
double topceilz2 = frontceilz2;
|
double topceilz2 = frontceilz2;
|
||||||
double topfloorz1 = MIN(backceilz1, frontceilz1);
|
double topfloorz1 = MIN(backceilz1, frontceilz1);
|
||||||
|
@ -290,11 +315,6 @@ void RenderPolyPlane::RenderSkyWalls(PolyRenderThread *thread, PolyDrawArgs &arg
|
||||||
double middlefloorz1 = MIN(bottomceilz1, middleceilz1);
|
double middlefloorz1 = MIN(bottomceilz1, middleceilz1);
|
||||||
double middlefloorz2 = MIN(bottomceilz2, middleceilz2);
|
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;
|
skyBottomz1 = middlefloorz1;
|
||||||
skyBottomz2 = middlefloorz2;
|
skyBottomz2 = middlefloorz2;
|
||||||
}
|
}
|
||||||
|
@ -310,6 +330,8 @@ void RenderPolyPlane::RenderSkyWalls(PolyRenderThread *thread, PolyDrawArgs &arg
|
||||||
skyBottomz2 = frontsector->floorplane.ZatPoint(line->v2);
|
skyBottomz2 = frontsector->floorplane.ZatPoint(line->v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TriVertex *wallvert = thread->FrameMemory->AllocMemory<TriVertex>(4);
|
||||||
|
|
||||||
if (ceiling)
|
if (ceiling)
|
||||||
{
|
{
|
||||||
wallvert[0] = transform.GetVertex(line->v1, skyHeight);
|
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)
|
void Render3DFloorPlane::RenderPlanes(PolyRenderThread *thread, const TriMatrix &worldToClip, const PolyClipPlane &clipPlane, subsector_t *sub, uint32_t stencilValue, uint32_t subsectorDepth, std::vector<PolyTranslucentObject *> &translucentObjects)
|
||||||
|
|
|
@ -31,11 +31,21 @@ class PolyPlaneUVTransform
|
||||||
public:
|
public:
|
||||||
PolyPlaneUVTransform(const FTransform &transform, FTexture *tex);
|
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:
|
private:
|
||||||
float GetU(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;
|
float GetV(float x, float y) const { return (yOffs - x * sine - y * cosine) * yscale; }
|
||||||
|
|
||||||
float xscale;
|
float xscale;
|
||||||
float yscale;
|
float yscale;
|
||||||
|
|
|
@ -112,7 +112,7 @@ bool RenderPolyWall::RenderLine(PolyRenderThread *thread, const TriMatrix &world
|
||||||
}
|
}
|
||||||
else
|
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 backceilz1 = backsector->ceilingplane.ZatPoint(line->v1);
|
||||||
double backfloorz1 = backsector->floorplane.ZatPoint(line->v1);
|
double backfloorz1 = backsector->floorplane.ZatPoint(line->v1);
|
||||||
|
|
Loading…
Reference in a new issue