diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index e24ac553b2..dcde3f006a 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -324,7 +324,10 @@ void gl_LoadExtensions() FUDGE_FUNC(glBindRenderbuffer, EXT); FUDGE_FUNC(glCheckFramebufferStatus, EXT); } - gl_legacy_mode = gl.legacyMode; + + UCVarValue value; + value.Bool = gl.legacyMode; + gl_legacy_mode.ForceSet (value, CVAR_Bool); } //========================================================================== diff --git a/src/gl/system/gl_swframebuffer.cpp b/src/gl/system/gl_swframebuffer.cpp index 665b23d385..c0ed432117 100644 --- a/src/gl/system/gl_swframebuffer.cpp +++ b/src/gl/system/gl_swframebuffer.cpp @@ -207,12 +207,15 @@ OpenGLSWFrameBuffer::OpenGLSWFrameBuffer(void *hMonitor, int width, int height, const char *glversion = (const char*)glGetString(GL_VERSION); bool isGLES = (glversion && strlen(glversion) > 10 && memcmp(glversion, "OpenGL ES ", 10) == 0); + UCVarValue value; // GL 3.0 is mostly broken on MESA drivers which really are the only relevant case here that doesn't fulfill the requirements based on version number alone. #ifdef _WIN32 - gl_legacy_mode = !ogl_IsVersionGEQ(3, 0); + value.Bool = !ogl_IsVersionGEQ(3, 0); #else - gl_legacy_mode = !ogl_IsVersionGEQ(3, 1); + value.Bool = !ogl_IsVersionGEQ(3, 1); #endif + gl_legacy_mode.ForceSet (value, CVAR_Bool); + if (!isGLES && ogl_IsVersionGEQ(3, 0) == 0) { Printf("OpenGL acceleration requires at least OpenGL 3.0. No Acceleration will be used.\n"); diff --git a/src/p_map.cpp b/src/p_map.cpp index 66becf1fe5..0aa3b58ad2 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5884,7 +5884,10 @@ bool P_AdjustFloorCeil(AActor *thing, FChangePosition *cpos) } bool isgood = P_CheckPosition(thing, thing->Pos(), tm); - if (!(thing->flags4 & MF4_ACTLIKEBRIDGE)) + + // This is essentially utterly broken because it even uses the return from a failed P_CheckPosition but the entire logic will break down if that isn't done. + // However, if tm.floorz is greater than tm.ceilingz we have a real problem that needs to be dealt with exolicitly. + if (!(thing->flags4 & MF4_ACTLIKEBRIDGE) && tm.floorz <= tm.ceilingz) { thing->floorz = tm.floorz; thing->ceilingz = tm.ceilingz; diff --git a/src/scripting/vm/vm.h b/src/scripting/vm/vm.h index 9ebc86f003..765ba45552 100644 --- a/src/scripting/vm/vm.h +++ b/src/scripting/vm/vm.h @@ -579,7 +579,7 @@ class AActor; // callingstate - State this action was called from #define PARAM_ACTION_PROLOGUE(type) \ PARAM_PROLOGUE; \ - PARAM_OBJECT (self, AActor); \ + PARAM_OBJECT_NOT_NULL (self, AActor); \ PARAM_OBJECT (stateowner, type) \ PARAM_POINTER (stateinfo, FStateParamInfo) \ @@ -588,12 +588,12 @@ class AActor; #define PARAM_SELF_PROLOGUE(type) \ PARAM_PROLOGUE; \ - PARAM_OBJECT(self, type); + PARAM_OBJECT_NOT_NULL(self, type); // for structs we cannot do a class validation #define PARAM_SELF_STRUCT_PROLOGUE(type) \ PARAM_PROLOGUE; \ - PARAM_POINTER(self, type); + PARAM_POINTER_NOT_NULL(self, type); class PFunction; diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 49d23250e2..b60c17616f 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1060,7 +1060,7 @@ void DCanvas::Dim(PalEntry color, float damount, int x1, int y1, int w, int h) h -= (cliptop - y1); y1 = cliptop; } - if (h > clipheight) w = clipheight; + if (h > clipheight) h = clipheight; if (h <= 0) return; } DoDim(color, damount, x1, y1, w, h);