diff --git a/src/actor.h b/src/actor.h index 043f07ae5f..be3f28ec61 100644 --- a/src/actor.h +++ b/src/actor.h @@ -401,6 +401,7 @@ enum ActorFlag7 enum ActorFlag8 { MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do + MF8_INSCROLLSEC = 0x00000002, // actor is partially inside a scrolling sector }; // --- mobj.renderflags --- diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index c7ab0eeb28..98f5afa801 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -750,6 +750,7 @@ void GLFlat::ProcessSector(sector_t * frontsector) // is no longer necessary. ceiling = true; + Colormap = frontsector->Colormap; for (k = 0; k < (int)x.ffloors.Size(); k++) { rover = x.ffloors[k]; diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index 308d741bb3..e24ac553b2 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -213,6 +213,16 @@ void gl_LoadExtensions() gl.glslversion = 0; gl.flags |= RFL_NO_CLIP_PLANES; } + else if (gl.glslversion < 1.4f && !CheckExtension("GL_ARB_uniform_buffer_object")) + { + // Some old ATI drivers report OpenGL 3.1 with GLSL version 1.3 and no support for uniform buffers. + // We have no choice but to force them down to OpenGL 2.x. + gl.legacyMode = true; + gl.lightmethod = LM_LEGACY; + gl.buffermethod = BM_LEGACY; + gl.glslversion = 0; + gl.flags |= RFL_NO_CLIP_PLANES; + } else { gl.legacyMode = false; diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 81a1bc5d62..7163b7548d 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -814,7 +814,7 @@ void P_DrawRailTrail(AActor *source, TArray &portalhits, int color1, // Create the inner trail. if (color2 != -1 && r_rail_trailsparsity > 0 && spawnclass == NULL) { - double stepsize = 3 * r_rail_spiralsparsity * sparsity; + double stepsize = 3 * r_rail_trailsparsity * sparsity; int trail_steps = xs_FloorToInt(steps * r_rail_trailsparsity / sparsity); color2 = color2 == 0 ? -1 : ParticleColor(color2); @@ -891,7 +891,7 @@ void P_DrawRailTrail(AActor *source, TArray &portalhits, int color1, if (sparsity < 1) sparsity = 32; - double stepsize = 3 * r_rail_spiralsparsity * sparsity; + double stepsize = sparsity; int trail_steps = (int)((steps * 3) / sparsity); DVector3 diff(0, 0, 0); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c2aa09682f..13af2837c4 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4098,6 +4098,7 @@ void AActor::Tick () CheckPortalTransition(false); LinkToWorld(&ctx); } + flags8 &= ~MF8_INSCROLLSEC; } else { @@ -4250,12 +4251,16 @@ void AActor::Tick () // [RH] Consider carrying sectors here DVector2 cumm(0, 0); - if ((level.Scrolls.Size() != 0 || player != NULL) && !(flags & MF_NOCLIP) && !(flags & MF_NOSECTOR)) + + if ((((flags8 & MF8_INSCROLLSEC) && level.Scrolls.Size() > 0) || player != NULL) && !(flags & MF_NOCLIP) && !(flags & MF_NOSECTOR)) { double height, waterheight; // killough 4/4/98: add waterheight const msecnode_t *node; int countx, county; + // Clear the flag for the next frame. + flags8 &= ~MF8_INSCROLLSEC; + // killough 3/7/98: Carry things on floor // killough 3/20/98: use new sector list which reflects true members // killough 3/27/98: fix carrier bug @@ -5079,6 +5084,8 @@ AActor *AActor::StaticSpawn (PClassActor *type, const DVector3 &pos, replace_t a { level.total_secrets++; } + // force scroller check in the first tic. + actor->flags8 |= MF8_INSCROLLSEC; return actor; } diff --git a/src/p_scroll.cpp b/src/p_scroll.cpp index f2661a2a1d..d8666d9a7e 100644 --- a/src/p_scroll.cpp +++ b/src/p_scroll.cpp @@ -256,6 +256,11 @@ void DScroller::Tick () case EScroll::sc_carry: level.Scrolls[m_Affectee].X += dx; level.Scrolls[m_Affectee].Y += dy; + // mark all potentially affected things here so that the very expensive calculation loop in AActor::Tick does not need to run for actors which do not touch a scrolling sector. + for (auto n = level.sectors[m_Affectee].touching_thinglist; n; n = n->m_snext) + { + n->m_thing->flags8 |= MF8_INSCROLLSEC; + } break; case EScroll::sc_carry_ceiling: // to be added later diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index d8fef49324..1c418b91b4 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -32,6 +32,7 @@ */ #include "i_common.h" +#include "s_sound.h" #include #include @@ -125,6 +126,7 @@ void popterm() void Mac_I_FatalError(const char* const message) { I_SetMainWindowVisible(false); + S_StopMusic(true); FConsoleWindow::GetInstance().ShowFatalError(message); } diff --git a/src/scripting/vm/vmexec.cpp b/src/scripting/vm/vmexec.cpp index 0bad8c0554..eb212a6466 100644 --- a/src/scripting/vm/vmexec.cpp +++ b/src/scripting/vm/vmexec.cpp @@ -104,14 +104,6 @@ void ThrowVMException(VMException *x); if (a == NULL) { ThrowAbortException(x, nullptr); } \ ptr = (VM_SBYTE *)a + o -static const VM_UWORD ZapTable[16] = -{ - 0x00000000, 0x000000FF, 0x0000FF00, 0x0000FFFF, - 0x00FF0000, 0x00FF00FF, 0x00FFFF00, 0x00FFFFFF, - 0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF00FFFF, - 0xFFFF0000, 0xFFFF00FF, 0xFFFFFF00, 0xFFFFFFFF -}; - #ifdef NDEBUG #define WAS_NDEBUG 1 #else diff --git a/src/scripting/vm/vmexec.h b/src/scripting/vm/vmexec.h index 452414c99f..7e8a53a6a9 100644 --- a/src/scripting/vm/vmexec.h +++ b/src/scripting/vm/vmexec.h @@ -1195,28 +1195,6 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret) reg.d[a] = ~reg.d[B]; NEXTOP; - OP(SEXT): - ASSERTD(a); ASSERTD(B); - reg.d[a] = (VM_SWORD)(reg.d[B] << C) >> C; - NEXTOP; - - OP(ZAP_R): - ASSERTD(a); ASSERTD(B); ASSERTD(C); - reg.d[a] = reg.d[B] & ZapTable[(reg.d[C] & 15) ^ 15]; - NEXTOP; - OP(ZAP_I): - ASSERTD(a); ASSERTD(B); - reg.d[a] = reg.d[B] & ZapTable[(C & 15) ^ 15]; - NEXTOP; - OP(ZAPNOT_R): - ASSERTD(a); ASSERTD(B); ASSERTD(C); - reg.d[a] = reg.d[B] & ZapTable[reg.d[C] & 15]; - NEXTOP; - OP(ZAPNOT_I): - ASSERTD(a); ASSERTD(B); - reg.d[a] = reg.d[B] & ZapTable[C & 15]; - NEXTOP; - OP(EQ_R): ASSERTD(B); ASSERTD(C); CMPJMP(reg.d[B] == reg.d[C]); diff --git a/src/scripting/vm/vmops.h b/src/scripting/vm/vmops.h index dac9075805..fb0a9e50e4 100644 --- a/src/scripting/vm/vmops.h +++ b/src/scripting/vm/vmops.h @@ -174,11 +174,6 @@ xx(MAX_RK, max, RIRIKI, MAX_RR, 4, REGT_INT), xx(ABS, abs, RIRI, NOP, 0, 0), // dA = abs(dB) xx(NEG, neg, RIRI, NOP, 0, 0), // dA = -dB xx(NOT, not, RIRI, NOP, 0, 0), // dA = ~dB -xx(SEXT, sext, RIRII8, NOP, 0, 0), // dA = dB, sign extended by shifting left then right by C -xx(ZAP_R, zap, RIRIRI, NOP, 0, 0), // dA = dB, with bytes zeroed where bits in C/dC are one -xx(ZAP_I, zap, RIRII8, NOP, 0, 0), -xx(ZAPNOT_R, zapnot, RIRIRI, NOP, 0, 0), // dA = dB, with bytes zeroed where bits in C/dC are zero -xx(ZAPNOT_I, zapnot, RIRII8, NOP, 0, 0), xx(EQ_R, beq, CIRR, NOP, 0, 0), // if ((dB == dkC) != A) then pc++ xx(EQ_K, beq, CIRK, EQ_R, 4, REGT_INT), xx(LT_RR, blt, CIRR, NOP, 0, 0), // if ((dkB < dkC) != A) then pc++ diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index c82fb19694..4ae1595ef3 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -81,6 +81,7 @@ #include "doomstat.h" #include "r_utility.h" #include "g_levellocals.h" +#include "s_sound.h" #include "stats.h" #include "st_start.h" @@ -1060,6 +1061,7 @@ void DoMain (HINSTANCE hInstance) { I_ShutdownGraphics (); RestoreConView (); + S_StopMusic(true); I_FlushBufferedConsoleStuff(); if (error.GetMessage ()) {