From e13627e9d81f3764ef6490d86e242c5e81e425f9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 5 Jan 2017 11:28:08 +0100 Subject: [PATCH 1/4] - fixed: portal offsets at frame start were not applied to ViewActorPos. --- src/r_utility.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/r_utility.cpp b/src/r_utility.cpp index 0ac3d9cde..5e9ac6b52 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -491,6 +491,7 @@ void R_InterpolateView (player_t *player, double Frac, InterpolationViewer *ivie if (ViewPos.Z > viewsector->GetPortalPlaneZ(sector_t::ceiling)) { ViewPos += viewsector->GetPortalDisplacement(sector_t::ceiling); + ViewActorPos += viewsector->GetPortalDisplacement(sector_t::ceiling); viewsector = R_PointInSubsector(ViewPos)->sector; moved = true; } @@ -503,6 +504,7 @@ void R_InterpolateView (player_t *player, double Frac, InterpolationViewer *ivie if (ViewPos.Z < viewsector->GetPortalPlaneZ(sector_t::floor)) { ViewPos += viewsector->GetPortalDisplacement(sector_t::floor); + ViewActorPos += viewsector->GetPortalDisplacement(sector_t::floor); viewsector = R_PointInSubsector(ViewPos)->sector; moved = true; } From b74c374a668c7ccbf03372c3d1c24e502cc32d76 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 5 Jan 2017 11:39:29 +0100 Subject: [PATCH 2/4] - fixed: The CheckReturn check for FxSwitchStatement was not strict enough. It may only return true if there is no default case because without that any non-matching value will go past the statement. --- src/scripting/codegeneration/codegen.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index dc28f953c..ed0c27270 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -8926,15 +8926,20 @@ ExpEmit FxSwitchStatement::Emit(VMFunctionBuilder *build) bool FxSwitchStatement::CheckReturn() { - //A switch statement returns when it contains no breaks and ends with a return + bool founddefault = false; + //A switch statement returns when it contains a no breaks, a default case, and ends with a return for (auto line : Content) { if (line->ExprType == EFX_JumpStatement) { return false; // Break means that the end of the statement will be reached, Continue cannot happen in the last statement of the last block. } + else if (line->ExprType == EFX_CaseStatement) + { + if (static_cast(line)->Condition == nullptr) founddefault = true; + } } - return Content.Size() > 0 && Content.Last()->CheckReturn(); + return founddefault && Content.Size() > 0 && Content.Last()->CheckReturn(); } //========================================================================== From c87836c3f3d86720945c98fabac40a7ee1d05d7e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 5 Jan 2017 11:50:45 +0100 Subject: [PATCH 3/4] - fixed check for Mesa driver. --- src/gl/system/gl_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index f1babfb7f..086c2c365 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -167,8 +167,8 @@ void gl_LoadExtensions() gl.flags |= RFL_SAMPLER_OBJECTS; } - // The minimum requirement for the modern render path are GL 3.0 + uniform buffers - if (gl_version < 3.0f || (gl_version < 3.1f && !CheckExtension("GL_ARB_uniform_buffer_object") && strstr(gl.vendorstring, "X.Org") == nullptr)) + // The minimum requirement for the modern render path are GL 3.0 + uniform buffers. Also exclude the Linux Mesa driver at GL 3.0 because it errors out on shader compilation. + if (gl_version < 3.0f || (gl_version < 3.1f && (!CheckExtension("GL_ARB_uniform_buffer_object") || strstr(gl.vendorstring, "X.Org") != nullptr))) { gl.legacyMode = true; gl.lightmethod = LM_LEGACY; From fcb1c1edc4bc0dab716fcae355157969bde6a81d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 5 Jan 2017 12:01:00 +0100 Subject: [PATCH 4/4] - only print GL extensions to the log, but not to the console. The list has become so long by now that it's more of a distraction than help. Besides, searching on-screen for specific extensions is futile anyway. --- src/gl/system/gl_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index 086c2c365..7f98c7f3c 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -294,10 +294,10 @@ void gl_PrintStartupLog() Printf ("GL_RENDERER: %s\n", glGetString(GL_RENDERER)); Printf ("GL_VERSION: %s (%s profile)\n", glGetString(GL_VERSION), (v & GL_CONTEXT_CORE_PROFILE_BIT)? "Core" : "Compatibility"); Printf ("GL_SHADING_LANGUAGE_VERSION: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION)); - Printf ("GL_EXTENSIONS:"); + Printf (PRINT_LOG, "GL_EXTENSIONS:"); for (unsigned i = 0; i < m_Extensions.Size(); i++) { - Printf(" %s", m_Extensions[i].GetChars()); + Printf(PRINT_LOG, " %s", m_Extensions[i].GetChars()); } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &v);