From ff897997d6f9a29168000244b37eed76ab6aa855 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 20 Feb 2018 12:20:18 +0200 Subject: [PATCH 01/10] Fixed hang when TiMidity++ executable failed to launch https://forum.zdoom.org/viewtopic.php?t=59539 --- src/sound/mididevices/music_timiditypp_mididevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index 42733ce38..a254776ec 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -692,6 +692,10 @@ bool TimidityPPMIDIDevice::FillStream(SoundStream *stream, void *buff, int len, } break; } + else if (r == 0 && errno != 0) + { + break; + } got += r; } while(got < len); if(got < len) From 420602e15402a56e857f0eff6b1c8bb0ec129664 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 20 Feb 2018 05:35:18 -0500 Subject: [PATCH 02/10] - check for deathmatch starts before forcing an unfriendly player to use them. --- src/p_setup.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 937f77fa8..4f2a64bde 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -4138,15 +4138,18 @@ void P_SetupLevel (const char *lumpname, int position) // [SP] move unfriendly players around // horribly hacky - yes, this needs rewritten. - for (i = 0; i < MAXPLAYERS; ++i) + if (level.deathmatchstarts.Size () > 0) { - if (playeringame[i] && players[i].mo != NULL) + for (i = 0; i < MAXPLAYERS; ++i) { - if (!(players[i].mo->flags & MF_FRIENDLY)) + if (playeringame[i] && players[i].mo != NULL) { - AActor * oldSpawn = players[i].mo; - G_DeathMatchSpawnPlayer (i); - oldSpawn->Destroy(); + if (!(players[i].mo->flags & MF_FRIENDLY)) + { + AActor * oldSpawn = players[i].mo; + G_DeathMatchSpawnPlayer (i); + oldSpawn->Destroy(); + } } } } From 74357ced0c0ee2e78d6b68af8116c158111c7a27 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 21 Feb 2018 15:17:02 +0200 Subject: [PATCH 03/10] Fixed read of potentially junk values in ZScript parser The following ill-formed ZScript code might crash targets with sizeof(int) != sizeof(void*) like 64-bit Intel class test { void func() { if (true) ( return; ) } } --- src/scripting/zscript/zcc_parser.cpp | 1 + src/scripting/zscript/zcc_parser.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/scripting/zscript/zcc_parser.cpp b/src/scripting/zscript/zcc_parser.cpp index cb927bb50..02d78021b 100644 --- a/src/scripting/zscript/zcc_parser.cpp +++ b/src/scripting/zscript/zcc_parser.cpp @@ -267,6 +267,7 @@ static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void while (sc.GetToken()) { + value.Largest = 0; value.SourceLoc = sc.GetMessageLine(); switch (sc.TokenType) { diff --git a/src/scripting/zscript/zcc_parser.h b/src/scripting/zscript/zcc_parser.h index 3c1e55805..5f0889fd2 100644 --- a/src/scripting/zscript/zcc_parser.h +++ b/src/scripting/zscript/zcc_parser.h @@ -7,11 +7,31 @@ struct ZCCToken { + template + struct TLargest; + + template + struct TLargest + { + using Type = T; + }; + + template + struct TLargest + { + using Type = typename TLargest< + typename std::conditional< + (sizeof(T) > sizeof(U)), T, U + >::type, Ts... + >::Type; + }; + union { int Int; double Float; FString *String; + TLargest::Type Largest; }; int SourceLoc; From 9bf11155eb0b8635dd8489928387d265097316cd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 22 Feb 2018 08:40:32 +0100 Subject: [PATCH 04/10] Ignore .DS_Store for macOS --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 80c2238ae..85af54469 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ .vs /src/gl/unused /mapfiles_release/*.map +.DS_Store From 12eb760ff4905196a54d8b1196760f4e176be797 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 22 Feb 2018 16:52:45 +0200 Subject: [PATCH 05/10] Do not abort if Korax target destroyed before attack begins https://forum.zdoom.org/viewtopic.php?t=59551 --- wadsrc/static/zscript/hexen/korax.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wadsrc/static/zscript/hexen/korax.txt b/wadsrc/static/zscript/hexen/korax.txt index 8f313bc19..b94664bea 100644 --- a/wadsrc/static/zscript/hexen/korax.txt +++ b/wadsrc/static/zscript/hexen/korax.txt @@ -244,6 +244,11 @@ class Korax : Actor void A_KoraxMissile() { + if (!target) + { + return; + } + static const class choices[] = { "WraithFX1", "Demon1FX1", "Demon2FX1", "FireDemonMissile", "CentaurFX", "SerpentFX" @@ -282,6 +287,11 @@ class Korax : Actor void KoraxFire (Class type, int arm) { + if (!target) + { + return; + } + static const int extension[] = { KORAX_ARM_EXTENSION_SHORT, From 1679065a5d975f314b96fcde6d2b50274a974cef Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 24 Feb 2018 16:23:55 +0200 Subject: [PATCH 06/10] Exposed Actor.ACS_ScriptCall() function This method can be used with arbitrary actor object like thing.ACS_ScriptCall("script") CallACS() and ACS_NamedExecuteWithResult() intrinsics work only within self actor context --- wadsrc/static/zscript/actor.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index dbea3fd47..7c9140788 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -1177,7 +1177,7 @@ class Actor : Thinker native { return ACS_LockedExecuteDoor(-int(script), mapnum, arg1, arg2, lock); } - int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0) + int ACS_ScriptCall(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0) { return ACS_ExecuteWithResult(-int(script), arg1, arg2, arg3, arg4); } From 76ff1adb282839f3abe9e425ef33826cf6537e08 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 24 Feb 2018 17:44:39 +0200 Subject: [PATCH 07/10] Disabled reverb editor's test environment by default https://forum.zdoom.org/viewtopic.php?t=59583 --- src/s_environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_environment.cpp b/src/s_environment.cpp index ac268bc5f..0618d72e3 100644 --- a/src/s_environment.cpp +++ b/src/s_environment.cpp @@ -677,7 +677,7 @@ void S_UnloadReverbDef () Environments = &Off; } -CUSTOM_CVAR(Bool, eaxedit_test, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) +CUSTOM_CVAR(Bool, eaxedit_test, false, CVAR_NOINITCALL) { if (self) { From 3436b80232c0f97eaa355b3db1f1305998476835 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 24 Feb 2018 17:50:13 +0200 Subject: [PATCH 08/10] Added SHARE_DIR search path back https://github.com/coelckers/gzdoom/pull/377#issuecomment-368235506 --- src/gameconfigfile.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 5053fd033..d0a5c22e3 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -149,6 +149,7 @@ FGameConfigFile::FGameConfigFile () SetValueForKey ("Path", "$PROGDIR", true); #else SetValueForKey ("Path", "$HOME/" GAME_DIR, true); + SetValueForKey ("Path", SHARE_DIR, true); SetValueForKey ("Path", "/usr/local/share/doom", true); SetValueForKey ("Path", "/usr/local/share/games/doom", true); SetValueForKey ("Path", "/usr/share/doom", true); From fb1f8a604580727d86dfa6dde3139d8879833a11 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 24 Feb 2018 22:03:23 +0200 Subject: [PATCH 09/10] Restored ACS_NamedExecuteWithResult for DECORATE https://forum.zdoom.org/viewtopic.php?t=59250 --- wadsrc/static/zscript/actor.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 7c9140788..fa0644755 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -1177,7 +1177,7 @@ class Actor : Thinker native { return ACS_LockedExecuteDoor(-int(script), mapnum, arg1, arg2, lock); } - int ACS_ScriptCall(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0) + int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0) { return ACS_ExecuteWithResult(-int(script), arg1, arg2, arg3, arg4); } @@ -1185,6 +1185,10 @@ class Actor : Thinker native { return ACS_ExecuteAlways(-int(script), mapnum, arg1, arg2, arg3); } + int ACS_ScriptCall(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0) + { + return ACS_ExecuteWithResult(-int(script), arg1, arg2, arg3, arg4); + } States(Actor, Overlay, Weapon, Item) { From 07f168a58bb82c81280eb65fa497742ab6b2ff3a Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 24 Feb 2018 16:04:20 -0500 Subject: [PATCH 10/10] - additional check for tween-tic particle rendering, prevents jitter with timefreeze powerup --- src/gl/scene/gl_sprite.cpp | 2 +- src/polyrenderer/scene/poly_particle.cpp | 2 +- src/swrenderer/things/r_particle.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index cfaa34f6f..74e5b8ed9 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -1211,7 +1211,7 @@ void GLSprite::ProcessParticle (particle_t *particle, sector_t *sector)//, int s } double timefrac = r_viewpoint.TicFrac; - if (paused || bglobal.freeze) + if (paused || bglobal.freeze || (level.flags2 & LEVEL2_FROZEN)) timefrac = 0.; float xvf = (particle->Vel.X) * timefrac; float yvf = (particle->Vel.Y) * timefrac; diff --git a/src/polyrenderer/scene/poly_particle.cpp b/src/polyrenderer/scene/poly_particle.cpp index 0ab3beb22..942ef1346 100644 --- a/src/polyrenderer/scene/poly_particle.cpp +++ b/src/polyrenderer/scene/poly_particle.cpp @@ -35,7 +35,7 @@ EXTERN_CVAR(Int, gl_particles_style) void RenderPolyParticle::Render(PolyRenderThread *thread, const TriMatrix &worldToClip, const PolyClipPlane &clipPlane, particle_t *particle, subsector_t *sub, uint32_t stencilValue) { double timefrac = r_viewpoint.TicFrac; - if (paused || bglobal.freeze) + if (paused || bglobal.freeze || (level.flags2 & LEVEL2_FROZEN)) timefrac = 0.; DVector3 pos = particle->Pos + (particle->Vel * timefrac); double psize = particle->size / 8.0; diff --git a/src/swrenderer/things/r_particle.cpp b/src/swrenderer/things/r_particle.cpp index 7c2d88f48..ee791b56b 100644 --- a/src/swrenderer/things/r_particle.cpp +++ b/src/swrenderer/things/r_particle.cpp @@ -79,7 +79,7 @@ namespace swrenderer sector_t* heightsec = NULL; double timefrac = r_viewpoint.TicFrac; - if (paused || bglobal.freeze) + if (paused || bglobal.freeze || (level.flags2 & LEVEL2_FROZEN)) timefrac = 0.; double ippx = particle->Pos.X + particle->Vel.X * timefrac;