From a37db1c4d70b1b3867d7454a149f0d32c4ff5d78 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Dec 2016 00:32:54 +0100 Subject: [PATCH 1/5] - fixed: All missiles which can bounce off actors need the CANPASS/PASSMOBJ flag so setting this in the 'bouncetype' property is insufficient, it needs to be done when the actor has been completely parsed. --- src/scripting/thingdef.cpp | 9 +++++++++ src/scripting/thingdef_properties.cpp | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/scripting/thingdef.cpp b/src/scripting/thingdef.cpp index 355cc87f3..ef26d8a50 100644 --- a/src/scripting/thingdef.cpp +++ b/src/scripting/thingdef.cpp @@ -425,6 +425,15 @@ void LoadActors() CheckForUnsafeStates(ti); } + // ensure that all actor bouncers have PASSMOBJ set. + auto defaults = GetDefaultByType(ti); + if (defaults->BounceFlags & (BOUNCE_Actors | BOUNCE_AllActors)) + { + // PASSMOBJ is irrelevant for normal missiles, but not for bouncers. + defaults->flags2 |= MF2_PASSMOBJ; + } + + } if (FScriptPosition::ErrorCounter > 0) { diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index 27b7ab2d3..e54a00963 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -1216,11 +1216,6 @@ DEFINE_PROPERTY(bouncetype, S, Actor) } defaults->BounceFlags &= ~(BOUNCE_TypeMask | BOUNCE_UseSeeSound); defaults->BounceFlags |= flags[match]; - if (defaults->BounceFlags & (BOUNCE_Actors | BOUNCE_AllActors)) - { - // PASSMOBJ is irrelevant for normal missiles, but not for bouncers. - defaults->flags2 |= MF2_PASSMOBJ; - } } //========================================================================== From 2f9d5e285dfd04875bc36648fac25988beabd1f1 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 27 Dec 2016 12:56:21 +0200 Subject: [PATCH 2/5] Removed deprecated code from macOS SDL backend --- src/posix/sdl/i_main.cpp | 48 ---------------------------------------- 1 file changed, 48 deletions(-) diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index cb9ed5872..ca704340d 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -41,10 +41,6 @@ #include #include #include -#if defined(__MACH__) && !defined(NOASM) -#include -#include -#endif #include "doomerrors.h" #include "m_argv.h" @@ -185,46 +181,6 @@ static int DoomSpecificInfo (char *buffer, char *end) return p; } -#if defined(__MACH__) && !defined(NOASM) -// NASM won't let us create custom sections for Mach-O. Whether that's a limitation of NASM -// or of Mach-O, I don't know, but since we're using NASM for the assembly, it doesn't much -// matter. -extern "C" -{ - extern void *rtext_a_start, *rtext_a_end; - extern void *rtext_tmap_start, *rtext_tmap_end; - extern void *rtext_tmap2_start, *rtext_tmap2_end; - extern void *rtext_tmap3_start, *rtext_tmap3_end; -}; - -static void unprotect_pages(long pagesize, void *start, void *end) -{ - char *page = (char *)((intptr_t)start & ~(pagesize - 1)); - size_t len = (char *)end - (char *)start; - if (mprotect(page, len, PROT_READ|PROT_WRITE|PROT_EXEC) != 0) - { - fprintf(stderr, "mprotect failed\n"); - exit(1); - } -} - -static void unprotect_rtext() -{ - static void *const pages[] = - { - rtext_a_start, rtext_a_end, - rtext_tmap_start, rtext_tmap_end, - rtext_tmap2_start, rtext_tmap2_end, - rtext_tmap3_start, rtext_tmap3_end - }; - long pagesize = sysconf(_SC_PAGESIZE); - for (void *const *p = pages; p < &pages[countof(pages)]; p += 2) - { - unprotect_pages(pagesize, p[0], p[1]); - } -} -#endif - void I_StartupJoysticks(); void I_ShutdownJoysticks(); @@ -243,10 +199,6 @@ int main (int argc, char **argv) seteuid (getuid ()); std::set_new_handler (NewFailure); -#if defined(__MACH__) && !defined(NOASM) - unprotect_rtext(); -#endif - // Set LC_NUMERIC environment variable in case some library decides to // clear the setlocale call at least this will be correct. // Note that the LANG environment variable is overridden by LC_* From 4da8b1a3b7e52600965f7cac74949472d438ea4f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Dec 2016 13:04:07 +0100 Subject: [PATCH 3/5] - delete r_ headers from portal.cpp. --- src/portal.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/portal.cpp b/src/portal.cpp index 121b05e19..0a21f1914 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -40,8 +40,6 @@ #include "p_local.h" #include "p_blockmap.h" #include "p_lnspec.h" -#include "r_bsp.h" -#include "r_segs.h" #include "c_cvars.h" #include "m_bbox.h" #include "p_tags.h" From 4bf19fb665bd4a32068916eda1bc89b40b99a506 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Dec 2016 15:34:44 +0100 Subject: [PATCH 4/5] - don't let monsters block teleports of non-solid inventory items. Doom's code never considered such a possibility and would consider the move blocking, despite the item being non-solid. --- src/p_map.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_map.cpp b/src/p_map.cpp index 913840e59..9b21a4c02 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -455,6 +455,10 @@ bool P_TeleportMove(AActor* thing, const DVector3 &pos, bool telefrag, bool modi if (!P_CanCollideWith(tmf.thing, th)) continue; + // Don't let players and monsters block item teleports (all other actor types will still block.) + if (thing->IsKindOf(RUNTIME_CLASS(AInventory)) && !(thing->flags & MF_SOLID) && ((th->flags3 & MF3_ISMONSTER) || th->player != nullptr)) + continue; + // monsters don't stomp things except on boss level // [RH] Some Heretic/Hexen monsters can telestomp // ... and some items can never be telefragged while others will be telefragged by everything that teleports upon them. From e956d19769c2cf78f95fc6f8cc15f4a34f56d495 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Dec 2016 15:44:06 +0100 Subject: [PATCH 5/5] - preserve the factor set by I_SetMusicVolume when starting new music. --- src/sound/i_music.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sound/i_music.cpp b/src/sound/i_music.cpp index 630c80da5..b87ea670f 100644 --- a/src/sound/i_music.cpp +++ b/src/sound/i_music.cpp @@ -227,7 +227,12 @@ void MusInfo::Start(bool loop, float rel_vol, int subsong) { if (nomusic) return; - if (rel_vol > 0.f) saved_relative_volume = relative_volume = rel_vol; + if (rel_vol > 0.f) + { + float factor = relative_volume / saved_relative_volume; + saved_relative_volume = rel_vol; + relative_volume = saved_relative_volume * factor; + } Stop (); Play (loop, subsong); m_NotStartedYet = false;