diff --git a/README.md b/README.md index 35a2c1be4..60720381e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Please see license files for individual contributor licenses Special thanks to Coraline of the 3DGE team for allowing us to use her README.md as a template for this one. -### Licensed under the GPL v3 (or greater) +### Licensed under the GPL v3 ##### https://www.gnu.org/licenses/quick-guide-gplv3.en.html --- diff --git a/src/gl/data/gl_vertexbuffer.cpp b/src/gl/data/gl_vertexbuffer.cpp index bf867f13e..cd7549aa8 100644 --- a/src/gl/data/gl_vertexbuffer.cpp +++ b/src/gl/data/gl_vertexbuffer.cpp @@ -249,10 +249,7 @@ void FFlatVertexBuffer::Unmap() void FFlatVertexBuffer::CreateVBO() { vbo_shadowdata.Resize(mNumReserved); - if (!gl.legacyMode) - { - FFlatVertexGenerator::CreateVertices(); - } + FFlatVertexGenerator::CreateVertices(); mCurIndex = mIndex = vbo_shadowdata.Size(); Map(); memcpy(map, &vbo_shadowdata[0], vbo_shadowdata.Size() * sizeof(FFlatVertex)); diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index 70ca080f2..63c4f9a01 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -207,11 +207,15 @@ void FDrawInfo::ProcessLights(GLFlat *flat, bool istrans) void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool istrans) { int dli = flat->dynlightindex; + auto vcount = flat->sector->ibocount; gl_RenderState.Apply(); - if (gl.legacyMode) processlights = false; + if (gl.legacyMode) + { + processlights = false; + goto legacy; + } - auto vcount = flat->sector->ibocount; if (vcount > 0 && !gl_RenderState.GetClipLineShouldBeActive()) { if (processlights) SetupSectorLights(flat, GLPASS_ALL, &dli); @@ -243,6 +247,7 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool } else { + legacy: // Draw the subsectors belonging to this sector for (int i=0; isector->subsectorcount; i++) { diff --git a/src/hwrenderer/scene/hw_bsp.cpp b/src/hwrenderer/scene/hw_bsp.cpp index 4393424c1..1c7041d46 100644 --- a/src/hwrenderer/scene/hw_bsp.cpp +++ b/src/hwrenderer/scene/hw_bsp.cpp @@ -75,6 +75,21 @@ void HWDrawInfo::UnclipSubsector(subsector_t *sub) // //========================================================================== +CVAR(Float, gl_line_distance_cull, 0.0, 0 /*CVAR_ARCHIVE|CVAR_GLOBALCONFIG*/) // this is deactivated, for now + +inline bool IsDistanceCulled(seg_t *line) +{ + double dist3 = gl_line_distance_cull * gl_line_distance_cull; + if (dist3 <= 0.0) + return false; + + double dist1 = (line->v1->fPos() - r_viewpoint.Pos).LengthSquared(); + double dist2 = (line->v2->fPos() - r_viewpoint.Pos).LengthSquared(); + if ((dist1 > dist3) && (dist2 > dist3)) + return true; + return false; +} + void HWDrawInfo::AddLine (seg_t *seg, bool portalclip) { #ifdef _DEBUG @@ -123,6 +138,8 @@ void HWDrawInfo::AddLine (seg_t *seg, bool portalclip) uint8_t ispoly = uint8_t(seg->sidedef->Flags & WALLF_POLYOBJ); + if (IsDistanceCulled(seg)) { clipper.SafeAddClipRange(startAngle, endAngle); return; } + if (!seg->backsector) { clipper.SafeAddClipRange(startAngle, endAngle); diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index b70c4ebf8..f8ed6d30d 100644 --- a/src/hwrenderer/scene/hw_walls.cpp +++ b/src/hwrenderer/scene/hw_walls.cpp @@ -1522,7 +1522,7 @@ void GLWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_ } v1 = seg->v1; v2 = seg->v2; - flags |= GLWF_NOSPLITLOWER | GLWF_NOSPLITLOWER; // seg-splitting not needed for single segs. + flags |= GLWF_NOSPLITUPPER | GLWF_NOSPLITLOWER; // seg-splitting not needed for single segs. } diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index 1a898f062..b8b324524 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -94,8 +94,16 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s if (smf->flags & MDL_ROTATING) { - double turns = (I_GetTime() % 200 + I_GetTimeFrac()) / 200.0; - rotateOffset = turns * 360.0; + if (smf->rotationSpeed > 0.0000000001) + { + double turns = (I_GetTime() + I_GetTimeFrac()) / (200.0 / smf->rotationSpeed); + turns -= floor(turns); + rotateOffset = turns * 360.0; + } + else + { + rotateOffset = 0.0; + } } // Added MDL_USEACTORPITCH and MDL_USEACTORROLL flags processing. diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index e7180afd1..8dfe5d8f8 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -1060,6 +1060,7 @@ FxExpression *FxFloatCast::Resolve(FCompileContext &ctx) if (basex->IsFloat()) { FxExpression *x = basex; + x->ValueType = ValueType; basex = nullptr; delete this; return x;