From 7206bfcfbc8ca0a26234f7a807abf3907999fa3f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 26 Jan 2018 09:53:31 +0200 Subject: [PATCH 01/38] Made software fuzz shader compatible with supported OpenGL versions Use array constructors because initializer list is a core feature since OpenGL 4.2 --- wadsrc/static/shaders/glsl/fuzz_software.fp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wadsrc/static/shaders/glsl/fuzz_software.fp b/wadsrc/static/shaders/glsl/fuzz_software.fp index cf905bb6ee9..b17b49b8a0d 100644 --- a/wadsrc/static/shaders/glsl/fuzz_software.fp +++ b/wadsrc/static/shaders/glsl/fuzz_software.fp @@ -6,8 +6,8 @@ uniform float timer; #define FRACBITS 16 #define fixed_t int -int fuzz_random_x_offset[FUZZ_RANDOM_X_SIZE] = -{ +int fuzz_random_x_offset[FUZZ_RANDOM_X_SIZE] = int[] +( 75, 76, 21, 91, 56, 33, 62, 99, 61, 79, 95, 54, 41, 18, 69, 43, 49, 59, 10, 84, 94, 17, 57, 46, 9, 39, 55, 34,100, 81, @@ -18,16 +18,16 @@ int fuzz_random_x_offset[FUZZ_RANDOM_X_SIZE] = 65, 15, 97, 20, 67, 74, 98, 85, 60, 68, 19, 26, 8, 87, 86, 64, 11, 37, 31, 47, 25, 5, 50, 51, 23, 2, 93, 70, 40, 45 -}; +); -int fuzzoffset[FUZZTABLE] = -{ +int fuzzoffset[FUZZTABLE] = int[] +( 6, 11, 6, 11, 6, 6, 11, 6, 6, 11, 6, 6, 6, 11, 6, 6, 6, 11, 15, 18, 21, 6, 11, 15, 6, 6, 6, 6, 11, 6, 11, 6, 6, 11, 15, 6, 6, 11, 15, 18, 21, 6, 6, 6, 6, 11, 6, 6, 11, 6 -}; +); vec4 ProcessTexel() { From 577c6b033eefb426a95005964863abf3ff5297b6 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 26 Jan 2018 10:10:51 +0200 Subject: [PATCH 02/38] Changed quad stereo mode restart notification Restart requirement for quad stereo mode should be output to console because CVAR can be toggled directly from it Long option names break menu layout on some aspect ratios like 16:10 --- src/gl/stereo3d/gl_stereo_cvars.cpp | 6 +++++- wadsrc/static/language.enu | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gl/stereo3d/gl_stereo_cvars.cpp b/src/gl/stereo3d/gl_stereo_cvars.cpp index 201e33590eb..47b7ff2170f 100644 --- a/src/gl/stereo3d/gl_stereo_cvars.cpp +++ b/src/gl/stereo3d/gl_stereo_cvars.cpp @@ -32,6 +32,7 @@ #include "gl/stereo3d/gl_sidebyside3d.h" #include "gl/stereo3d/gl_interleaved3d.h" #include "gl/system/gl_cvars.h" +#include "version.h" // Set up 3D-specific console variables: CVAR(Int, vr_mode, 0, CVAR_GLOBALCONFIG) @@ -42,7 +43,10 @@ CVAR(Bool, vr_swap_eyes, false, CVAR_GLOBALCONFIG) // For broadest GL compatibility, require user to explicitly enable quad-buffered stereo mode. // Setting vr_enable_quadbuffered_stereo does not automatically invoke quad-buffered stereo, // but makes it possible for subsequent "vr_mode 7" to invoke quad-buffered stereo -CVAR(Bool, vr_enable_quadbuffered, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Bool, vr_enable_quadbuffered, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +{ + Printf("You must restart " GAMENAME " to switch quad stereo mode\n"); +} // intraocular distance in meters CVAR(Float, vr_ipd, 0.062f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // METERS diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 7b5eed9a05b..50143655289 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2729,7 +2729,7 @@ GLPREFMNU_AMBLIGHT = "Ambient light level"; GLPREFMNU_RENDERQUALITY = "Rendering quality"; GLPREFMNU_MENUBLUR = "Menu Blur"; GLPREFMNU_VRMODE = "Stereo 3D VR"; -GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo (Requires Restart)"; +GLPREFMNU_VRQUADSTEREO = "Enable Quad Stereo"; GLPREFMNU_MULTISAMPLE = "Multisample"; GLPREFMNU_TONEMAP = "Tonemap Mode"; GLPREFMNU_BLOOM = "Bloom effect"; From a77b253cbac9803a7680c38ab5e90023c9df97d9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 26 Jan 2018 10:29:37 +0200 Subject: [PATCH 03/38] Fixed Sector.SetYScale() function in ZScript https://forum.zdoom.org/viewtopic.php?t=59224 --- src/p_sectors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 369c5de61bb..fb4789e17eb 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -1659,7 +1659,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt) PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_INT(pos); PARAM_FLOAT(o); - self->SetXScale(pos, o); + self->SetYScale(pos, o); return 0; } From 866d42d26e09305f6cdb040aa0bfe921e2c8451d Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 26 Jan 2018 03:31:52 -0500 Subject: [PATCH 04/38] - add README.md file for Github friendliness --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000000..0a8bc960b80 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Welcome to GZDoom! + +[![Build Status](https://travis-ci.org/coelckers/gzdoom.svg?branch=master)](https://travis-ci.org/coelckers/gzdoom) + +## GZDoom is a modder-friendly OpenGL source port based on the DOOM engine + +Copyright (c) 1998-2018 ZDoom + GZDoom teams, and contributors + +Doom Source (c) 1997 id Software, Raven Software, and contributors + +Please see license files for individual contributor licenses + +Special thanks to Coraline of the 3DGE team for allowing us to use her README.md as a template for this one. + +### Licensed under the GPL v3 (or greater) +##### https://www.gnu.org/licenses/quick-guide-gplv3.en.html +--- + +## How to build GZDoom + +To build GZDoom, please see the [wiki](https://zdoom.org/wiki/) and see the "Programmer's Corner" on the bottom-right corner of the page to build for your plaform. + From 8cfb1cba7c7a5c0e899bb28e74547480bcf0560a Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 26 Jan 2018 04:50:07 -0500 Subject: [PATCH 05/38] - add AppVeyor badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a8bc960b80..5d55239b622 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Welcome to GZDoom! -[![Build Status](https://travis-ci.org/coelckers/gzdoom.svg?branch=master)](https://travis-ci.org/coelckers/gzdoom) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/coelckers/gzdoom?branch=master&svg=true)](https://ci.appveyor.com/project/coelckers/gzdoom) [![Build Status](https://travis-ci.org/coelckers/gzdoom.svg?branch=master)](https://travis-ci.org/coelckers/gzdoom) ## GZDoom is a modder-friendly OpenGL source port based on the DOOM engine From 92547028f3456b65f0edc4d049d4b5f5f2a03221 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Fri, 26 Jan 2018 19:46:08 +0100 Subject: [PATCH 06/38] Exports sky textures to ZScript (readonly, needs setter function due to the setup required) and speeds, along with a ChangeSky function for setting the textures. --- src/g_level.cpp | 20 ++++++++++++++++++++ wadsrc/static/zscript/base.txt | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 0b211f3e605..17f76a67d09 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2028,6 +2028,10 @@ DEFINE_FIELD(FLevelLocals, F1Pic) DEFINE_FIELD(FLevelLocals, maptype) DEFINE_FIELD(FLevelLocals, Music) DEFINE_FIELD(FLevelLocals, musicorder) +DEFINE_FIELD(FLevelLocals, skytexture1) +DEFINE_FIELD(FLevelLocals, skytexture2) +DEFINE_FIELD(FLevelLocals, skyspeed1) +DEFINE_FIELD(FLevelLocals, skyspeed2) DEFINE_FIELD(FLevelLocals, total_secrets) DEFINE_FIELD(FLevelLocals, found_secrets) DEFINE_FIELD(FLevelLocals, total_items) @@ -2093,3 +2097,19 @@ CCMD(skyfog) } } + +//========================================================================== +// +// ZScript counterpart to ACS ChangeSky, uses TextureIDs +// +//========================================================================== +DEFINE_ACTION_FUNCTION(FLevelLocals, ChangeSky) +{ + PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); + PARAM_INT(sky1); + PARAM_INT(sky2); + sky1texture = self->skytexture1 = FSetTextureID(sky1); + sky2texture = self->skytexture2 = FSetTextureID(sky2); + R_InitSkyMap(); + return 0; +} diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index bef1751da84..503efa453de 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -591,6 +591,10 @@ struct LevelLocals native native readonly int maptype; native readonly String Music; native readonly int musicorder; + native readonly TextureID skytexture1; + native readonly TextureID skytexture2; + native float skyspeed1; + native float skyspeed2; native int total_secrets; native int found_secrets; native int total_items; @@ -640,7 +644,9 @@ struct LevelLocals native native static clearscope vector3 Vec3Diff(vector3 v1, vector3 v2); native String GetChecksum() const; - + + native void ChangeSky( TextureID sky1, TextureID sky2 ); + String TimeFormatted(bool totals = false) { int sec = Thinker.Tics2Seconds(totals? totaltime : time); From 2d8731508bc9a130ae0ff26300962c5b099259c9 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 26 Jan 2018 23:18:13 -0500 Subject: [PATCH 07/38] - minor typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d55239b622..f04f324f7fb 100644 --- a/README.md +++ b/README.md @@ -18,5 +18,5 @@ Special thanks to Coraline of the 3DGE team for allowing us to use her README.md ## How to build GZDoom -To build GZDoom, please see the [wiki](https://zdoom.org/wiki/) and see the "Programmer's Corner" on the bottom-right corner of the page to build for your plaform. +To build GZDoom, please see the [wiki](https://zdoom.org/wiki/) and see the "Programmer's Corner" on the bottom-right corner of the page to build for your platform. From 7ceb70bcc1eae16989c7bd8a518976fb996c03c1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Jan 2018 09:32:26 +0100 Subject: [PATCH 08/38] - renamed 'Tracer' class to 'LineTracer', because 'Tracer' is a too common name that had been used by some mods. --- src/p_trace.cpp | 20 ++++++++++---------- src/p_trace.h | 4 ++-- wadsrc/static/zscript/base.txt | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/p_trace.cpp b/src/p_trace.cpp index d00a5c4cc07..fd79861ec2e 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -955,8 +955,8 @@ static bool EditTraceResult (uint32_t flags, FTraceResults &res) // [ZZ] here go the methods for the ZScript interface // //========================================================================== -IMPLEMENT_CLASS(DTracer, false, false) -DEFINE_FIELD_X(Tracer, DTracer, Results) +IMPLEMENT_CLASS(DLineTracer, false, false) +DEFINE_FIELD(DLineTracer, Results) // define TraceResults fields DEFINE_FIELD_NAMED_X(TraceResults, FTraceResults, Sector, HitSector) @@ -978,9 +978,9 @@ DEFINE_FIELD_X(TraceResults, FTraceResults, CrossedWaterPos) DEFINE_FIELD_X(TraceResults, FTraceResults, Crossed3DWater) DEFINE_FIELD_X(TraceResults, FTraceResults, Crossed3DWaterPos) -DEFINE_ACTION_FUNCTION(DTracer, Trace) +DEFINE_ACTION_FUNCTION(DLineTracer, Trace) { - PARAM_SELF_PROLOGUE(DTracer); + PARAM_SELF_PROLOGUE(DLineTracer); /*bool Trace(const DVector3 &start, sector_t *sector, const DVector3 &direction, double maxDist, ActorFlags ActorMask, uint32_t WallMask, AActor *ignore, FTraceResults &res, uint32_t traceFlags = 0, ETraceStatus(*callback)(FTraceResults &res, void *) = NULL, void *callbackdata = NULL);*/ @@ -1001,13 +1001,13 @@ DEFINE_ACTION_FUNCTION(DTracer, Trace) // Trace(vector3 start, Sector sector, vector3 direction, double maxDist, ETraceFlags traceFlags) bool res = Trace(DVector3(start_x, start_y, start_z), sector, DVector3(direction_x, direction_y, direction_z), maxDist, - (ActorFlag)0xFFFFFFFF, 0xFFFFFFFF, nullptr, self->Results, traceFlags, &DTracer::TraceCallback, self); + (ActorFlag)0xFFFFFFFF, 0xFFFFFFFF, nullptr, self->Results, traceFlags, &DLineTracer::TraceCallback, self); ACTION_RETURN_BOOL(res); } -ETraceStatus DTracer::TraceCallback(FTraceResults& res, void* pthis) +ETraceStatus DLineTracer::TraceCallback(FTraceResults& res, void* pthis) { - DTracer* self = (DTracer*)pthis; + DLineTracer* self = (DLineTracer*)pthis; // "res" here should refer to self->Results anyway. // patch results a bit. modders don't expect it to work like this most likely. @@ -1036,13 +1036,13 @@ ETraceStatus DTracer::TraceCallback(FTraceResults& res, void* pthis) return self->CallZScriptCallback(); } -ETraceStatus DTracer::CallZScriptCallback() +ETraceStatus DLineTracer::CallZScriptCallback() { - IFVIRTUAL(DTracer, TraceCallback) + IFVIRTUAL(DLineTracer, TraceCallback) { int status; VMReturn results[1] = { &status }; - VMValue params[1] = { (DTracer*)this }; + VMValue params[1] = { (DLineTracer*)this }; VMCall(func, params, 1, results, 1); return (ETraceStatus)status; } diff --git a/src/p_trace.h b/src/p_trace.h index af4187f7858..0a61cc72588 100644 --- a/src/p_trace.h +++ b/src/p_trace.h @@ -113,9 +113,9 @@ bool Trace(const DVector3 &start, sector_t *sector, const DVector3 &direction, d ETraceStatus(*callback)(FTraceResults &res, void *) = NULL, void *callbackdata = NULL); // [ZZ] this is the object that's used for ZScript -class DTracer : public DObject +class DLineTracer : public DObject { - DECLARE_CLASS(DTracer, DObject) + DECLARE_CLASS(DLineTracer, DObject) public: FTraceResults Results; static ETraceStatus TraceCallback(FTraceResults& res, void* pthis); diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 503efa453de..5d30435b59e 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -524,7 +524,7 @@ struct TraceResults native native vector3 Crossed3DWaterPos; } -class Tracer : Object native +class LineTracer : Object native { native @TraceResults Results; native bool Trace(vector3 start, Sector sec, vector3 direction, double maxDist, ETraceFlags traceFlags); From 1794774f2279c561018fd5b3fd6618766697782d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Jan 2018 09:54:33 +0100 Subject: [PATCH 09/38] - ScriptedMarine already exists as a name so most literal occurences in the source could be replaced with more efficient direct use of the name. --- src/p_acs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index e2fccad141f..a1493962ccb 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -9852,7 +9852,7 @@ int DLevelScript::RunScript () if (STACK(2) != 0) { AActor *marine; - NActorIterator iterator("ScriptedMarine", STACK(2)); + NActorIterator iterator(NAME_ScriptedMarine, STACK(2)); while ((marine = iterator.Next()) != NULL) { @@ -9861,7 +9861,7 @@ int DLevelScript::RunScript () } else { - if (activator != nullptr && activator->IsKindOf (PClass::FindClass("ScriptedMarine"))) + if (activator != nullptr && activator->IsKindOf (NAME_ScriptedMarine))) { SetMarineWeapon(activator, STACK(1)); } @@ -9878,7 +9878,7 @@ int DLevelScript::RunScript () if (STACK(2) != 0) { AActor *marine; - NActorIterator iterator("ScriptedMarine", STACK(2)); + NActorIterator iterator(NAME_ScriptedMarine, STACK(2)); while ((marine = iterator.Next()) != NULL) { @@ -9887,7 +9887,7 @@ int DLevelScript::RunScript () } else { - if (activator != nullptr && activator->IsKindOf("ScriptedMarine")) + if (activator != nullptr && activator->IsKindOf(NAME_ScriptedMarine)) { SetMarineSprite(activator, type); } From d207f426c126652640ebec554ed38d6546fe6593 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Jan 2018 12:49:52 +0100 Subject: [PATCH 10/38] Typo. --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index a1493962ccb..3e5358a3cea 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -9861,7 +9861,7 @@ int DLevelScript::RunScript () } else { - if (activator != nullptr && activator->IsKindOf (NAME_ScriptedMarine))) + if (activator != nullptr && activator->IsKindOf (NAME_ScriptedMarine)) { SetMarineWeapon(activator, STACK(1)); } From f346709937e94ed1aca1039ad7083a0968e94647 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 28 Jan 2018 08:37:56 +0100 Subject: [PATCH 11/38] - new rocket smoke sprites by Talon1024. The old ones which are from Heretic have been removed as a consequence. --- wadsrc/static/credits/rsmk.txt | 3 +++ wadsrc/static/sprites/rsmka0.png | Bin 0 -> 992 bytes wadsrc/static/sprites/rsmkb0.png | Bin 0 -> 1176 bytes wadsrc/static/sprites/rsmkc0.png | Bin 0 -> 1269 bytes wadsrc/static/sprites/rsmkd0.png | Bin 0 -> 1103 bytes wadsrc/static/sprites/rsmke0.png | Bin 0 -> 1166 bytes wadsrc_extra/static/sprites/rsmka0.png | Bin 376 -> 0 bytes wadsrc_extra/static/sprites/rsmkb0.png | Bin 388 -> 0 bytes wadsrc_extra/static/sprites/rsmkc0.png | Bin 550 -> 0 bytes wadsrc_extra/static/sprites/rsmkd0.png | Bin 380 -> 0 bytes wadsrc_extra/static/sprites/rsmke0.png | Bin 255 -> 0 bytes 11 files changed, 3 insertions(+) create mode 100644 wadsrc/static/credits/rsmk.txt create mode 100644 wadsrc/static/sprites/rsmka0.png create mode 100644 wadsrc/static/sprites/rsmkb0.png create mode 100644 wadsrc/static/sprites/rsmkc0.png create mode 100644 wadsrc/static/sprites/rsmkd0.png create mode 100644 wadsrc/static/sprites/rsmke0.png delete mode 100644 wadsrc_extra/static/sprites/rsmka0.png delete mode 100644 wadsrc_extra/static/sprites/rsmkb0.png delete mode 100644 wadsrc_extra/static/sprites/rsmkc0.png delete mode 100644 wadsrc_extra/static/sprites/rsmkd0.png delete mode 100644 wadsrc_extra/static/sprites/rsmke0.png diff --git a/wadsrc/static/credits/rsmk.txt b/wadsrc/static/credits/rsmk.txt new file mode 100644 index 00000000000..e37c2008667 --- /dev/null +++ b/wadsrc/static/credits/rsmk.txt @@ -0,0 +1,3 @@ +These sprites were made by Talon1024 and have been put in the public domain: + +https://forum.zdoom.org/viewtopic.php?f=15&t=59245 diff --git a/wadsrc/static/sprites/rsmka0.png b/wadsrc/static/sprites/rsmka0.png new file mode 100644 index 0000000000000000000000000000000000000000..8387c22445f98532f8083d00a8e838b4c5d22444 GIT binary patch literal 992 zcmV<610Vc}P)aNY}$>7{xzJMq>7e(H zloE&t>$;-Wif!A#%y7=(cswG60Pj5jAf<%Q&rgL>c-S8n%t|S+*1}q=5D*cZbJ{sG zqqT-oiV8qD>Ah?GG)?`9gL$5bnL9Ish+wVNu49Y{A;4OTloB3~2aGWYA)xpEM85YP z#u)V8alKx@C)gh%LI?rFFd&2g=NyPg3H9EqYDy_6rJ&Xd=Nt})1BeLTd(>L{`FtiV zz|3G~c<(Vy6Jm@{9w?>27z1nVlYEUaaLyrwfYa#&X2v|v$T{PDKL4HI{r$bi7-6kd zSbmynFH7f~VlPDiz*>tC0&>pE5zB+#yS_|BY9N6jrG(x)_71PLYTUMMSe8X0lm-6NkeA)>;q|N-0XBOd?H*D2y>^t>N)_fSI+KCz*=WN-4NpF7V!KA!bIc6-0z# z7!YIBV#0?wd0khP?CEssJdR`kX>TcLt$ivY3fp@{5{la;x%^nj68#I&Ap{%_2i5y9 z3|d%Rn{!4fMVDL%0n4)JG|c?Xf$SRZJz|XT-Yc2=>9%b{&KZx#11Tk}>#7jR4in-5 zfaiIp*VorB8h?3t!SQ(105Os*GJ!;r%X(mD7-O^<;gkWu7^6lLjmv&2rRXBG)+#)r zCNY|LL0m8XQ6ESW09e-*UteF^xiLl)dGE0-i*8MMch991Qj*03&N*Bz7wtyWC2+}- zv)1bV-+w;$etClEdcD##O&tJo&T!5tt}>$W70IG>pIr!HGlv9<-vmo-dao7b)1}>2xAOg*CD0Edr#MO zIOoXooI7{!aQE(ACX)$52=rpHpe#!kiv{!foT4a@Qc{*BtJR7ZFJAcZc#O4{s;aoW zykvWOo2F?vJUsM52*T~Xr|)~defuWv-@i|u=jgI5na}6^`SXXDFJF4^Jpf86j4@0m z6VfzAN(sQLSFe2E_h_w2(-h|%UDu(MB27~Oe*E~sjT<+(efu`z`}gmho}TjX;X|Kg z834mDpp+uZGLj@gDFr}PRn&Ej_a3b^0A*S7=FJ=N`0-<36a`8tR;v|XzkU__`}^qW zbjo6}U>F8AFQpVpDZKa8bsgWQX&Tp@bM$@BlP6ESlrqXBgkZT`vRbXslgWhh^K+z> z7-ImgHL&k{f+Sg%VT?ft!7vOs=kVS$3>laCqL|udCp(n&z?Q=)9Eyp8iD`_A&^qiG))W|8ZV_pN{QB*zVGASwryFh zR-B%mqAxEmW9FM5ZR*_jJ#E|KoFhpRj4^1f>AEf^ve{&7Emv1p{QLJ0eRg&hHw8Mh z){&sFF=NwW>o<4o*rIhIB&!79rWD>Ou0kSNMByD;_O35$`QD^5I z!!XcwT|A(!>!^UZb?cT7ZWTh{oWokn*49=$)H%m`y~a6*)*5RqP1De}Eq&i3gotD< zmrMG-$9vD`&!2_fG}orq0nvbBmSxwFtg0&VzA0O%`qQURVtad=YX>;zVphhO=*le1 z$n%^$&!bF0lrKDo_s7S_Vmh5Noleo4(=hPgG!0s7oO4mjP*IwuakK~KL-paldGjXY z@tCcxt?LH_=DqjVq%y`(*L7@Qm|IfH7_?~`nx^6H+qYsg8c`GlMNy!`qSiW=84wK; zg(}LjjO*d2({&wf+tPJi^i5sY7-Pt?4Dsd57Y+^%d{Gq9k!{-oV6BZKTL?i_RdF^M zW1?f%>vgPT7zR#GPQ<-?_t@LpL+|hJ^ZxyNaddR#t+g@xK+rG@vGG+^0Wcbk;g}SKLOWZ4zRxG$sh`hOG`EkLzGgydGkgz z8V%AkWoBjur4+qhkL~Sk#^bRs9s~hF5U{+wYyq^^jK^b!!y!T`#s2<2o12^5x^>G+ zDY4d~wPs^uLu6S-wOS=jQw|RgxpU`^6+$3{z!h6vT^03uog_)9R;$$Oby}?!ayT5) z@At9RVyy)riXx&YVtIMlT5B=JV67z#L&7k`TI-7oAqawiTCK*#ix+7&n`Bu=nx=@Y ztu223{7Jvx=j7ysPN!qDEc2?2F#x`xF$S%*7ve;1Y;1_RxjC*}xx%?~=ZK;R@$utF z4h{||%aX^BAKN5J{&p3DvMfTN6PL@ZiA%E2Sh1L;C$blgWg7 zy^d(LS~d(ruOLYh;yCt^2qB2$m|Cqy9LJ1CBadTQmaML>iX=%e#$b%0)oO9$#tkl9 zxPW;7{ylf^-nC&EdVB5{$1zEgP^;BwwOUwf84Ly-9UU>5Oi)UZ=Q*!ly%No46QvYq z&Ya=u)vL5xEySl!pV-^me zW4hh02*Z#@qrt+$0<*KT$eEd$Q)oHVqA2p0XpCVxo%#!OXPpQsCBJ|FMoLK>$KI9r z_U#+rzkg>m8u9SqLmNdANs^Ex2|@_cG^J9h_{%iLpp;@X8c`I5k49?^!20^SxOC|f zmoHyN?Ck8YySs}qhVghzyWO^xN`)-TyaU(Bv8|M%C<;$aQ54?2JJaoUg$#ng7b?s0 zlx1tJXZl~xT>;0sF@_f}UWg}8o>+%%yWO_Z+065tlamwQT`A@Bbw~n!QB5Wj%CbDw zcx`P>JbLuVx^v>|*RSmC>~M5+#LCKwXFiG|;yCuh$;6%a<=~ZEbPy-aYG-xtyhxo)%Z^ z-;ad57pL6qAunQof1iVc19o?JX}8-pO;e09&P$+$+C>| z=g%`gKTn?L{@dxWE6WnCHSgZN6KR@~=Q)GHfR&XM>+*HEzkdB%EG{lGH#diH%$8+I zuh(O9bCcV*Z`+qIUkWKDN-3n2RI61gl?v5rl|0Ys_xl_k9@6P_Y#4?BJb(UN+`M^{ fg@pwwl?s0VtxNU5Cdtz)00000NkvXXu0mjf@wHu+ literal 0 HcmV?d00001 diff --git a/wadsrc/static/sprites/rsmkd0.png b/wadsrc/static/sprites/rsmkd0.png new file mode 100644 index 0000000000000000000000000000000000000000..08d3c95e5347eb2a31c9a160f0c41d95f1d8ae94 GIT binary patch literal 1103 zcmV-V1hD&wP)Z-0D z(slyG?T8^lSwyUOB*Z2=Sh664Lrh2zLJAgpB-roZ*T%+?#)W zb&l@voh!b6{mQp*-+27^u}_kOrfC=q1|rXMI-L&27}7LFYmIY`s;Y>h2UhyiiMyoOHNNuIX*u2 ztE;O-QG`;8*=)v>Cr`X`&Jl(oTI>IrIp;V!Iuh1ePESucKR;(@XUA);SzcZyNfNZy z?PNj-l#~*s6j2nlqZ?z|(eB;5M-)X&r&C_OeCfO0E=nn+lz8tciUQ{x7Z(@2efw6Z zZnsNSRRDPJ+g%QaLvjE9eb(02xV*fiCBU0o3b0YMO8t>x_OjDv#%zqGVORaJQJ5ke5hF?C&IjN$nBSVU2TT3=tM zX&SDtulfG{J5QfJ^;wqToMU@?TTCVsuCK2FsHzHM3_%bOMG-;>(lo^wgOn1jH7br{ zrqe0o@tCcxEr0XoP0}>QImgM#iJ#48Et{`jzZP0+thGFU{@gFX_|&8ib&IxrfE1lJQTaTyB=UP8i|dK4e~rk z{rK^NU%!44h9TBkthMca77{K73#} z9D46P07@y8Qe;_%QVL@XP17)+&#CL0x~_4~0dRPDDB?IK&vSac9&2lBh>eX6ueENk zwZJEi<5svpWs#=3t^sh)ad2=TvMghHd71U~b;N@Q5B#E&h3ShIFT`Ll@FyoHqAW}H z_xHUJ0)XA!U9or)&z?PNweQ}&6PufxsH&<^O5we4_Y=o4qtQs*xN(D`C>RchVu4DM zBqT}Fq7(!H0NrkvPN#z!jYeVta8VR2q9~>OmrbSUcDn>YfYzEY3@OW!@pz0<3TrLz z-@g}k@80Fsty`#v4<8bSAy-#dOePa%vl;XG9HkUZ)3gwK?~zhstz|NqaCCI!rIhUL z?TI|k>G%6AEiIw$+_?ilmSqG%fKsY8T)Z|R1VV_`xF`y&wE*;bJ^KAVS(YKC(?*3u46KpFq_S&s*2TWh41^guFG<{WM^l`oSvSFhYuez8jWb% zmZB(dT^HZ?k!4w;l;Y*fmu9h82*+_~+m$>#&eE^hFv~5cq$3#&CK%VC)rPypXR8>X4 z-$(ZQeFlR8MN!~54oQ*_MG;XHF`Z6nnua{jIXO8IVHjfDHdOrP$iqVl*1D*=$%YmlQ?8)zuXr zKYlcu%?8goz(440Re?Ck8AqoX6Cwf+|e+qSVRi>~WvnufM*kxD6& zB*C_Ax~{_*Lz<@Kc}~+bY;SLy;c&?F=g-ae@85;vH~@H_ht`^|>(E-?9#j+suU@?} zTU%RXSw zMxzna=@iFtD9e(r>)7Al7w_M{H(8b;guoa>k|Zdlux*<-jxomEhE_^RS(beG@IiQ< z2k?)BWmyOzux*?9d~S}9k3~@wynXxDSeC`%;i2$-|5m_VWzsYy3_~`X4MkDlc^;N! zp|xf{pBvY8`SRt9@H~&EX*f7I5CHvtpMJlO=XuC9O|dMCs;U53E|>hjgJoF)VB0pv z7yx|VCk#V^AYd>U5JeGEO2m^VPmGk3)oR6Ju@J9czcxolM`AXcVcRxYma$&1+1=eW zZQF8sdMZYv5re^iIF6B0(liZC(;yx{er%+atk-KkeflJVAYeQm|KoTET?m1ck~ogJ z8|Jz$Wm$54eNCR{h)0henZv_FvAer#gbp_szkl42MJR z-@i{B$2g8d*L5UG!r#AtQA#0x{P=-oS!7v;)|&Bn%y2j)O;eseeQL(zFbmC6s=VV9MG;-sVcRxRO2ROt*XuDD3^+MC5$pAuy}dnC*ELy| gQP=gqcYSB|Ked=c7Cb`LPyhe`07*qoM6N<$g5wAo>i_@% literal 0 HcmV?d00001 diff --git a/wadsrc_extra/static/sprites/rsmka0.png b/wadsrc_extra/static/sprites/rsmka0.png deleted file mode 100644 index 761e0917098045c068c8ca7e4c9153c3c3989a1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s3?yAI>n{UR>H$6>t_=G6t{yIaety!*()RZD zZfQ_sBls&ZhyCd(%l zU)GAIMFOJx=)F8tgeUG^gE^W|=jzwTEu#db3< z7TUgBlab-jTK(oVTUk=q_GIr}Y8C3q&2(h#0za?ote^c>M_4h3=`GYyx1BlLC2Oi# zf1=&3%J#Khyp?>xsjc7cosW3Jvet0+l!Bfm6I7o##EPA>>`UG=)5m?^y6i(*jQt-b zss8!vRXo9HrgS$$%gykl=M~@AdA{gAvevSCuJDOVJ4Cx*aqYOhE#t@kQoH6G0*jm3 S&ANczX7F_Nb6Mw<&;$T@OO28M diff --git a/wadsrc_extra/static/sprites/rsmkb0.png b/wadsrc_extra/static/sprites/rsmkb0.png deleted file mode 100644 index 0bcfef43da50b027cb05b4f74ac5caf6939161aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 388 zcmV-~0ek+5P)0@?kEP)EFT{qsS+uH00001bW%=J06^y0W&i*H z2xoFZVgLXD6#xJLCy%zk{{R31oJmAMRCwBrm05BFArM280L^y)`$kej4GvI~{sHWV zdO>A>&FBbiqHpfe8F6mz>`L^NJzj}ZHJ;J0E?t&=dF~}BQzL*tC@kFWZR!sZL!LX)r5+?_=O0s z81y4Q!+P{9OemDYXaDRF>&^}}22e1%1Nc)=+0>V#bU2Q9k=3*8L;m4lr&C;>6@i^7 zK(;y2Z0Mf^bTyI{?Rw487&xPE=^M?0Hhh{<`Z+J7X80!Sjjhva%b0r`Y~t9uI{ol= zojLTCmujXr&`-=MVsBopxnHiK{6Yo#yssBzZbNu4oby#1odAYz9anw5DrXMUyLtNu o8N+;!t(`Y^_1-)Cf89;>7qx~R3&zXcRR91007*qoM6N<$g3HkDivR!s diff --git a/wadsrc_extra/static/sprites/rsmkd0.png b/wadsrc_extra/static/sprites/rsmkd0.png deleted file mode 100644 index 60827b6dcb39fd10f742d8060c4ad1921b165d7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 380 zcmeAS@N?(olHy`uVBq!ia0vp^DnP8n!3-oB+Pk*{N%a7q5LX6$eK$8ZKR-WL4;OoT zdue59Ya44LBO`Nja{~hdd3kvq9UT=F6}=3m^FS?(B|(0{3=Yq3qyae`=|zr7Kw21x z)yhAzo&?hGJzX3_DsC;Ed@=8+0f+N$Q%;G`|L^ZUbhj#UiOHpB?o}HcRgb&vz0GG> zT>kp?dH4MsMk_=gD>5m_D>SvNO5$C5nw57d`-wUF>WpjsE_%l}wH)!;zI$<*3}eH_ z*>^+PL(@H$oz;=Im>ME-1K0b`5lull-142eV}-L@-BssH`8kP_O9gU znVHk(7g(*{^{nonwf~dY6W=wa3q;Iyc^3XN*UbIg6*e!fRlBS`m6KMSO`I9O>Wnz6 X6W_^T;bR6suQPbM`njxgN@xNAM){2x diff --git a/wadsrc_extra/static/sprites/rsmke0.png b/wadsrc_extra/static/sprites/rsmke0.png deleted file mode 100644 index 9d5652bd2556813eb6da09cb0fe703238d6dd2f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^B0wz7!3-q58RK68DfIxK5LX6$eOC_`dwY9nWobV@ zKQ}iw0|Ntdb8~AOYa=5g6%`d79UXaj`OWg{tAJV>(u*9EfHXT0 zE7p8nr~#ylJY5_^DsG*5R=^F&^75X&z zJ3E}JTOSa5JSi@H+FuL*tBf<>ZdcXZ>T4)4kC&Ol%qRZY&#Nj9Ps2siI6Bwy8b0SW wDl5HV68$9T?ep&(?^{oLrs*fG{b9HN<1Ch4FFH;|0c~gSboFyt=akR{0CL1rssI20 From 410749cf67af63eba21720b78e5fa8d3f34e25fa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 28 Jan 2018 08:44:40 +0100 Subject: [PATCH 12/38] - compatibility node rebuild for Doom2's MAP25 https://forum.zdoom.org/viewtopic.php?f=15&t=59256 --- wadsrc/static/compatibility.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 245c450529d..b4f411bf819 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -685,6 +685,10 @@ EBDAC00E9D25D884B2C8F4B1F0390539 // doom2.wad map21 setsectoroffset 50 ceil -56 setsectoroffset 54 ceil -56 } +94893A0DC429A22ADC4B3A73DA537E16 // DOOM2.WAD map25 +{ + rebuildnodes +} 110F84DE041052B59307FAF0293E6BC0 // Doom II, map27 { setsectorspecial 93 0 From 600362572155721fc2c3c757d557511a1837253c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 28 Jan 2018 11:41:00 +0200 Subject: [PATCH 13/38] Silenced quad stereo message during startup --- src/gl/stereo3d/gl_stereo_cvars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/stereo3d/gl_stereo_cvars.cpp b/src/gl/stereo3d/gl_stereo_cvars.cpp index 47b7ff2170f..e7ce699f550 100644 --- a/src/gl/stereo3d/gl_stereo_cvars.cpp +++ b/src/gl/stereo3d/gl_stereo_cvars.cpp @@ -43,7 +43,7 @@ CVAR(Bool, vr_swap_eyes, false, CVAR_GLOBALCONFIG) // For broadest GL compatibility, require user to explicitly enable quad-buffered stereo mode. // Setting vr_enable_quadbuffered_stereo does not automatically invoke quad-buffered stereo, // but makes it possible for subsequent "vr_mode 7" to invoke quad-buffered stereo -CUSTOM_CVAR(Bool, vr_enable_quadbuffered, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Bool, vr_enable_quadbuffered, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { Printf("You must restart " GAMENAME " to switch quad stereo mode\n"); } From c1d2b548208a1c384c2f9e52432915ce1dc53b2a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 28 Jan 2018 11:51:39 +0100 Subject: [PATCH 14/38] - let TexMan.GetName return the actual name for a texture that was created from a full path name. --- src/textures/texturemanager.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 5039f48b60e..613aa3be9fd 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -1206,8 +1206,21 @@ DEFINE_ACTION_FUNCTION(_TexMan, GetName) { PARAM_PROLOGUE; PARAM_INT(texid); - const FTexture* const tex = TexMan.ByIndex(texid); - ACTION_RETURN_STRING(nullptr == tex ? FString() : tex->Name); + auto tex = TexMan.ByIndex(texid); + FString retval; + + if (tex != nullptr) + { + if (tex->Name.IsNotEmpty()) retval = tex->Name; + else + { + // Textures for full path names do not have their own name, they merely link to the source lump. + auto lump = tex->GetSourceLump(); + if (Wads.GetLinkedTexture(lump) == tex) + retval = Wads.GetLumpFullName(lump); + } + } + ACTION_RETURN_STRING(retval); } //========================================================================== From 11ec3b1de02e85feae0a5b99178d59166e8f438b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 28 Jan 2018 14:34:31 +0200 Subject: [PATCH 15/38] Added compatibility option for Demonfear MAP22 Bridge beyond red skull door was raising too high --- wadsrc/static/compatibility.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index b4f411bf819..ff360f96b4d 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -848,3 +848,8 @@ CA3773ED313E8899311F3DD0CA195A68 // e3m6 setthingz 403 168 setthingz 404 168 } + +6D4156EE0D12B77AD143A37C4D3DCF98 // dmonfear.wad map22 +{ + shorttex +} From 55c6a14059717992a04a9e21ee637d0f24ac5292 Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Wed, 24 Jan 2018 05:31:48 +0100 Subject: [PATCH 16/38] Added simple fatal error window for Linux There are three variants: KDE dialog, GTK+ window, SDL message box https://forum.zdoom.org/viewtopic.php?t=57880 --- src/CMakeLists.txt | 2 +- src/posix/sdl/i_main.cpp | 8 ++ src/posix/sdl/i_system.cpp | 36 +++++++++ .../{iwadpicker_gtk.cpp => gtk_dialogs.cpp} | 74 ++++++++++++++++++- 4 files changed, 118 insertions(+), 2 deletions(-) rename src/posix/unix/{iwadpicker_gtk.cpp => gtk_dialogs.cpp} (83%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8610691abc6..5740e3f6e81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -511,7 +511,7 @@ set( PLAT_SDL_SOURCES posix/sdl/st_start.cpp ) set( PLAT_UNIX_SOURCES posix/unix/i_specialpaths.cpp - posix/unix/iwadpicker_gtk.cpp ) + posix/unix/gtk_dialogs.cpp ) set( PLAT_OSX_SOURCES posix/osx/iwadpicker_cocoa.mm posix/osx/i_specialpaths.mm diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 21f58e71e91..95ed8322eb2 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -73,6 +73,10 @@ extern "C" int cc_install_handlers(int, char**, int, int*, const char*, int(*)(c void Mac_I_FatalError(const char* errortext); #endif +#ifdef __linux__ +void Linux_I_FatalError(const char* errortext); +#endif + // PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- @@ -268,6 +272,10 @@ int main (int argc, char **argv) Mac_I_FatalError(error.GetMessage()); #endif // __APPLE__ +#ifdef __linux__ + Linux_I_FatalError(error.GetMessage()); +#endif // __linux__ + exit (-1); } catch (...) diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index b71acb8f8d7..f980e259838 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -79,6 +79,7 @@ extern "C" #ifndef NO_GTK bool I_GtkAvailable (); int I_PickIWad_Gtk (WadStuff *wads, int numwads, bool showwin, int defaultiwad); +void I_FatalError_Gtk(const char* errortext); #elif defined(__APPLE__) int I_PickIWad_Cocoa (WadStuff *wads, int numwads, bool showwin, int defaultiwad); #endif @@ -157,6 +158,37 @@ bool gameisdead; void Mac_I_FatalError(const char* errortext); #endif +#ifdef __linux__ +void Linux_I_FatalError(const char* errortext) +{ + // Close window or exit fullscreen and release mouse capture + SDL_Quit(); + + const char *str; + if((str=getenv("KDE_FULL_SESSION")) && strcmp(str, "true") == 0) + { + FString cmd; + cmd << "kdialog --title \"" GAMESIG " "; + cmd << GetVersionString() << ": No IWAD found\" "; + cmd << "--msgbox \"" << errortext << "\""; + popen(cmd, "r"); + } +#ifndef NO_GTK + else if (I_GtkAvailable()) + { + I_FatalError_Gtk(errortext); + } +#endif + else + { + FString message; + message << GAMESIG " "; + message << GetVersionString() << ": No IWAD found"; + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, message, errortext, NULL); + } +} +#endif + void I_FatalError (const char *error, ...) { static bool alreadyThrown = false; @@ -175,6 +207,10 @@ void I_FatalError (const char *error, ...) #ifdef __APPLE__ Mac_I_FatalError(errortext); #endif // __APPLE__ + +#ifdef __linux__ + Linux_I_FatalError(errortext); +#endif // Record error to log (if logging) if (Logfile) diff --git a/src/posix/unix/iwadpicker_gtk.cpp b/src/posix/unix/gtk_dialogs.cpp similarity index 83% rename from src/posix/unix/iwadpicker_gtk.cpp rename to src/posix/unix/gtk_dialogs.cpp index ebaab609f8f..658f8cbc5d1 100644 --- a/src/posix/unix/iwadpicker_gtk.cpp +++ b/src/posix/unix/gtk_dialogs.cpp @@ -1,5 +1,5 @@ /* -** iwadpicker_gtk.cpp +** gtk_dialogs.cpp ** **--------------------------------------------------------------------------- ** Copyright 2008-2016 Braden Obrzut @@ -126,12 +126,16 @@ DYN_GTK_SYM(gtk_window_new); DYN_GTK_SYM(gtk_window_set_gravity); DYN_GTK_SYM(gtk_window_set_position); DYN_GTK_SYM(gtk_window_set_title); +DYN_GTK_SYM(gtk_window_set_resizable); +DYN_GTK_SYM(gtk_dialog_run); +DYN_GTK_SYM(gtk_dialog_get_type); // Gtk3 Only DYN_GTK_OPT3_SYM(gtk_box_new, GtkWidget *(*)(GtkOrientation, gint)); DYN_GTK_OPT3_SYM(gtk_button_box_new, GtkWidget *(*)(GtkOrientation)); DYN_GTK_OPT3_SYM(gtk_widget_set_halign, void(*)(GtkWidget *, GtkAlign)); DYN_GTK_OPT3_SYM(gtk_widget_set_valign, void(*)(GtkWidget *, GtkAlign)); +DYN_GTK_OPT3_SYM(gtk_message_dialog_new, GtkWidget* (*)(GtkWindow*, GtkDialogFlags, GtkMessageType, GtkButtonsType, const gchar*, ...)); // Gtk2 Only DYN_GTK_OPT2_SYM(gtk_misc_get_type, GType(*)()); @@ -342,6 +346,70 @@ static int PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad) return i; } +static void ShowError(const char* errortext) +{ + GtkWidget *window; + GtkWidget *widget; + GtkWidget *vbox = nullptr; + GtkWidget *bbox = nullptr; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title (GTK_WINDOW(window), "Fatal error"); + gtk_window_set_position (GTK_WINDOW(window), GTK_WIN_POS_CENTER); + gtk_window_set_gravity (GTK_WINDOW(window), GDK_GRAVITY_CENTER); + gtk_window_set_resizable (GTK_WINDOW(window), false); + gtk_container_set_border_width (GTK_CONTAINER(window), 10); + g_signal_connect (window, "delete_event", G_CALLBACK(gtk_main_quit), NULL); + g_signal_connect (window, "key_press_event", G_CALLBACK(CheckEscape), NULL); + + // Create the vbox container. + if (gtk_box_new) // Gtk3 + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); + else if (gtk_vbox_new) // Gtk2 + vbox = gtk_vbox_new (FALSE, 10); + + gtk_container_add (GTK_CONTAINER(window), vbox); + + // Create the label. + widget = gtk_label_new ((const gchar *) errortext); + gtk_box_pack_start (GTK_BOX(vbox), widget, false, false, 0); + + if (gtk_widget_set_halign && gtk_widget_set_valign) // Gtk3 + { + gtk_widget_set_halign (widget, GTK_ALIGN_START); + gtk_widget_set_valign (widget, GTK_ALIGN_START); + } + else if (gtk_misc_set_alignment && gtk_misc_get_type) // Gtk2 + gtk_misc_set_alignment (GTK_MISC(widget), 0, 0); + + // Create the Exit button box. + if (gtk_button_box_new) // Gtk3 + bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); + else if (gtk_hbutton_box_new) // Gtk2 + bbox = gtk_hbutton_box_new (); + + gtk_button_box_set_layout (GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); + gtk_box_set_spacing (GTK_BOX(bbox), 10); + gtk_box_pack_end (GTK_BOX(vbox), bbox, false, false, 0); + + // Create the cancel button. + widget = gtk_button_new_with_label ("Exit"); + gtk_box_pack_start (GTK_BOX(bbox), widget, false, false, 0); + g_signal_connect (widget, "clicked", G_CALLBACK(gtk_main_quit), &window); + + // Finally we can show everything. + gtk_widget_show_all (window); + + gtk_main (); + + if (GTK_IS_WINDOW(window)) + { + gtk_widget_destroy (window); + // If we don't do this, then the X window might not actually disappear. + while (g_main_context_iteration (NULL, FALSE)) {} + } +} + } // namespace Gtk int I_PickIWad_Gtk (WadStuff *wads, int numwads, bool showwin, int defaultiwad) @@ -349,6 +417,10 @@ int I_PickIWad_Gtk (WadStuff *wads, int numwads, bool showwin, int defaultiwad) return Gtk::PickIWad (wads, numwads, showwin, defaultiwad); } +void I_FatalError_Gtk(const char* errortext) { + Gtk::ShowError(errortext); +} + bool I_GtkAvailable() { using namespace Gtk; From 64921ea968bd7ab0a5b84f40feaa7e9224bfd718 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 28 Jan 2018 20:45:18 +0100 Subject: [PATCH 17/38] - use a more consistent setting for rendering fuzzy sprites with enhanced nightvision on. --- src/gl/scene/gl_sprite.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index e287c7215e2..c07aceed4c1 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -987,9 +987,8 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) RenderStyle.CheckFuzz(); if (RenderStyle.BlendOp == STYLEOP_Fuzz) { - if (gl_fuzztype != 0 && !gl.legacyMode) + if (gl_fuzztype != 0 && !gl.legacyMode && !(RenderStyle.Flags & STYLEF_InvertSource)) { - // Todo: implement shader selection here RenderStyle = LegacyRenderStyles[STYLE_Translucent]; OverrideShader = gl_fuzztype + 4; trans = 0.99f; // trans may not be 1 here From c7eea9b48040fad0a402c16d2a7cddaed0d4f408 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 29 Jan 2018 13:30:36 +0200 Subject: [PATCH 18/38] Marked a few more CCMDs as unsafe --- src/c_cmds.cpp | 2 +- src/g_game.cpp | 2 +- src/m_misc.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index efc11a3d240..842516ba342 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -681,7 +681,7 @@ UNSAFE_CCMD (crashout) #endif -CCMD (dir) +UNSAFE_CCMD (dir) { FString dir, path; char curdir[256]; diff --git a/src/g_game.cpp b/src/g_game.cpp index 0e44e830164..d0cf74be7c0 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2599,7 +2599,7 @@ void G_DeferedPlayDemo (const char *name) gameaction = (gameaction == ga_loadgame) ? ga_loadgameplaydemo : ga_playdemo; } -CCMD (playdemo) +UNSAFE_CCMD (playdemo) { if (netgame) { diff --git a/src/m_misc.cpp b/src/m_misc.cpp index eb51ec7b9a3..481f956b513 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -673,7 +673,7 @@ void M_ScreenShot (const char *filename) } } -CCMD (screenshot) +UNSAFE_CCMD (screenshot) { if (argv.argc() == 1) G_ScreenShot (NULL); From 1e9fdca755a563471f1129474ed425b2b4ef34ab Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 29 Jan 2018 15:20:35 +0200 Subject: [PATCH 19/38] Made unsafe execution context check for CVARs more strict This prevents changing of non-mod CVARs from unsafe context for various code paths including set and toggle CCMDs --- src/c_cvars.cpp | 6 ++++++ src/c_dispatch.cpp | 9 +-------- src/c_dispatch.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index d51dacdcb03..2444f2b3f1a 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -53,6 +53,7 @@ #include "colormatcher.h" #include "menu/menu.h" #include "vm.h" +#include "v_text.h" struct FLatchedValue { @@ -156,6 +157,11 @@ void FBaseCVar::SetGenericRep (UCVarValue value, ECVarType type) { return; } + else if (UnsafeExecutionContext && !(GetFlags() & CVAR_MOD)) + { + Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", GetName()); + return; + } else if ((Flags & CVAR_LATCH) && gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP) { FLatchedValue latch; diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index ec4571b53bd..bd468db5ee9 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -127,8 +127,7 @@ FButtonStatus Button_Mlook, Button_Klook, Button_Use, Button_AltAttack, Button_AM_PanLeft, Button_AM_PanRight, Button_AM_PanDown, Button_AM_PanUp, Button_AM_ZoomIn, Button_AM_ZoomOut; -bool ParsingKeyConf; -static bool UnsafeExecutionContext; +bool ParsingKeyConf, UnsafeExecutionContext; // To add new actions, go to the console and type "key ". // This will give you the key value to use in the first column. Then @@ -658,12 +657,6 @@ void C_DoCommand (const char *cmd, int keynum) if (args.argc() >= 2) { // Set the variable - if (UnsafeExecutionContext && !(var->GetFlags() & CVAR_MOD)) - { - Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", var->GetName()); - return; - } - var->CmdSet (args[1]); } else diff --git a/src/c_dispatch.h b/src/c_dispatch.h index dac14b818a1..aa82e20ba9a 100644 --- a/src/c_dispatch.h +++ b/src/c_dispatch.h @@ -200,7 +200,7 @@ extern FButtonStatus Button_Mlook, Button_Klook, Button_Use, Button_AltAttack, Button_User1, Button_User2, Button_User3, Button_User4, Button_AM_PanLeft, Button_AM_PanRight, Button_AM_PanDown, Button_AM_PanUp, Button_AM_ZoomIn, Button_AM_ZoomOut; -extern bool ParsingKeyConf; +extern bool ParsingKeyConf, UnsafeExecutionContext; void ResetButtonTriggers (); // Call ResetTriggers for all buttons void ResetButtonStates (); // Same as above, but also clear bDown From 6107f36ad225890d9c4da0369bd4c557fb40e3e4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 29 Jan 2018 18:00:55 +0100 Subject: [PATCH 20/38] - iterating through portal groups must check for situations where badly constructed maps let items end up in another portal group. --- src/p_maputl.cpp | 27 ++++++++++++++++++--------- src/p_maputl.h | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index 24c30375e26..6b19942e0ff 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -809,11 +809,13 @@ bool FMultiBlockLinesIterator::GoUp(double x, double y) { if (!cursector->PortalBlocksMovement(sector_t::ceiling)) { - startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::ceiling)); - portalflags = FFCF_NOFLOOR; - return true; + if (startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::ceiling))) + { + portalflags = FFCF_NOFLOOR; + return true; + } } - else continueup = false; + continueup = false; } return false; } @@ -830,11 +832,13 @@ bool FMultiBlockLinesIterator::GoDown(double x, double y) { if (!cursector->PortalBlocksMovement(sector_t::floor)) { - startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::floor)); - portalflags = FFCF_NOCEILING; - return true; + if (startIteratorForGroup(cursector->GetOppositePortalGroup(sector_t::floor))) + { + portalflags = FFCF_NOCEILING; + return true; + } } - else continuedown = false; + continuedown = false; } return false; } @@ -906,14 +910,19 @@ bool FMultiBlockLinesIterator::Next(FMultiBlockLinesIterator::CheckResult *item) // //=========================================================================== -void FMultiBlockLinesIterator::startIteratorForGroup(int group) +bool FMultiBlockLinesIterator::startIteratorForGroup(int group) { offset = Displacements.getOffset(basegroup, group); offset.X += checkpoint.X; offset.Y += checkpoint.Y; cursector = group == startsector->PortalGroup ? startsector : P_PointInSector(offset); + // If we ended up in a different group, + // presumably because the spot to be checked is too far outside the actual portal group, + // the search needs to abort. + if (cursector->PortalGroup != group) return false; bbox.setBox(offset.X, offset.Y, checkpoint.Z); blockIterator.init(bbox); + return true; } //=========================================================================== diff --git a/src/p_maputl.h b/src/p_maputl.h index 8ac3ea76af2..4dfa99e0f06 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -240,7 +240,7 @@ class FMultiBlockLinesIterator bool GoUp(double x, double y); bool GoDown(double x, double y); - void startIteratorForGroup(int group); + bool startIteratorForGroup(int group); public: From 2bb80e3d0b9a26d86f2ce70be40ab8dff865e811 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 29 Jan 2018 18:18:31 +0100 Subject: [PATCH 21/38] - fixed: Upon resurrection, a monster must check if the current setting of the link flags (NOBLOCKMAP and NOSECTOR) match the defaults. --- src/p_mobj.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 79f549dd38c..e0c9530d357 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -7766,7 +7766,13 @@ FState *AActor::GetRaiseState() void AActor::Revive() { AActor *info = GetDefault(); + FLinkContext ctx; + + bool flagchange = (flags & (MF_NOBLOCKMAP | MF_NOSECTOR)) != (info->flags & (MF_NOBLOCKMAP | MF_NOSECTOR)); + + if (flagchange) UnlinkFromWorld(&ctx); flags = info->flags; + if (flagchange) LinkToWorld(&ctx); flags2 = info->flags2; flags3 = info->flags3; flags4 = info->flags4; From 93686638b0ae515e1cd89763a19e5cb2c0d27a17 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 29 Jan 2018 18:54:06 +0100 Subject: [PATCH 22/38] - let fluid_reverb and fluid_chorus default to 'off'. --- src/sound/mididevices/music_fluidsynth_mididevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/mididevices/music_fluidsynth_mididevice.cpp b/src/sound/mididevices/music_fluidsynth_mididevice.cpp index 07102c43d6f..42244b61a73 100644 --- a/src/sound/mididevices/music_fluidsynth_mididevice.cpp +++ b/src/sound/mididevices/music_fluidsynth_mididevice.cpp @@ -124,13 +124,13 @@ CUSTOM_CVAR(Float, fluid_gain, 0.5, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) currSong->FluidSettingNum("synth.gain", self); } -CUSTOM_CVAR(Bool, fluid_reverb, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Bool, fluid_reverb, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) { if (currSong != NULL) currSong->FluidSettingInt("synth.reverb.active", self); } -CUSTOM_CVAR(Bool, fluid_chorus, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Bool, fluid_chorus, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) { if (currSong != NULL) currSong->FluidSettingInt("synth.chorus.active", self); From f4191f27cff1e4c490f29c69bcf630cfea3552a9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 30 Jan 2018 15:42:03 +0200 Subject: [PATCH 23/38] Marked two more CCMDs as unsafe --- src/p_glnodes.cpp | 2 +- src/s_sound.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index bd574ad8379..60c666e82ad 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -1216,7 +1216,7 @@ static bool CheckCachedNodes(MapData *map) return false; } -CCMD(clearnodecache) +UNSAFE_CCMD(clearnodecache) { TArray list; FString path = M_GetCachePath(false); diff --git a/src/s_sound.cpp b/src/s_sound.cpp index fede842b10b..d3f587b9488 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -2999,7 +2999,7 @@ CCMD (cd_resume) // //========================================================================== -CCMD (playlist) +UNSAFE_CCMD (playlist) { int argc = argv.argc(); From c8b6e5719e3d446683c0e266318152ba4f523c4b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 30 Jan 2018 15:56:45 +0200 Subject: [PATCH 24/38] Restore unsafe execution context to its previous value --- src/c_dispatch.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index bd468db5ee9..358a6a57831 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -129,6 +129,23 @@ FButtonStatus Button_Mlook, Button_Klook, Button_Use, Button_AltAttack, bool ParsingKeyConf, UnsafeExecutionContext; +class UnsafeExecutionScope +{ + const bool wasEnabled; + +public: + explicit UnsafeExecutionScope(const bool enable = true) + : wasEnabled(UnsafeExecutionContext) + { + UnsafeExecutionContext = enable; + } + + ~UnsafeExecutionScope() + { + UnsafeExecutionContext = wasEnabled; + } +}; + // To add new actions, go to the console and type "key ". // This will give you the key value to use in the first column. Then // insert your new action into this list so that the keys remain sorted @@ -226,10 +243,8 @@ void DWaitingCommand::Tick () { if (--TicsLeft == 0) { - const bool wasUnsafe = UnsafeExecutionContext; - UnsafeExecutionContext = IsUnsafe; + UnsafeExecutionScope scope; AddCommandString (Command); - UnsafeExecutionContext = wasUnsafe; Destroy (); } } @@ -677,9 +692,8 @@ DEFINE_ACTION_FUNCTION(DOptionMenuItemCommand, DoCommand) if (CurrentMenu == nullptr) return 0; PARAM_PROLOGUE; PARAM_STRING(cmd); - UnsafeExecutionContext = true; + UnsafeExecutionScope scope; C_DoCommand(cmd); - UnsafeExecutionContext = false; return 0; } @@ -1508,9 +1522,8 @@ void FConsoleAlias::SafeDelete () void FUnsafeConsoleAlias::Run (FCommandLine &args, APlayerPawn *instigator, int key) { - UnsafeExecutionContext = true; + UnsafeExecutionScope scope; FConsoleAlias::Run(args, instigator, key); - UnsafeExecutionContext = false; } void FExecList::AddCommand(const char *cmd, const char *file) From d9323b97404dcac48ac1b0226e23c69b8009afb6 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 30 Jan 2018 16:02:30 +0200 Subject: [PATCH 25/38] Marked internal menu commands as safe This fixes soundfont/patchset/config selection menus in advanced sound options --- src/c_dispatch.cpp | 3 ++- src/menu/menu.cpp | 3 +++ wadsrc/static/zscript/menu/optionmenuitems.txt | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 358a6a57831..cb1fb47e1d4 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -692,7 +692,8 @@ DEFINE_ACTION_FUNCTION(DOptionMenuItemCommand, DoCommand) if (CurrentMenu == nullptr) return 0; PARAM_PROLOGUE; PARAM_STRING(cmd); - UnsafeExecutionScope scope; + PARAM_BOOL(unsafe); + UnsafeExecutionScope scope(unsafe); C_DoCommand(cmd); return 0; } diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 86ec78abf21..f03c37eb73c 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -58,6 +58,7 @@ #include "vm.h" #include "events.h" #include "gl/renderer/gl_renderer.h" // for menu blur +#include "scripting/types.h" // // Todo: Move these elsewhere @@ -1180,6 +1181,8 @@ DMenuItemBase * CreateOptionMenuItemCommand(const char *label, FName cmd, bool c VMValue params[] = { p, &namestr, cmd.GetIndex(), centered }; auto f = dyn_cast(c->FindSymbol("Init", false)); VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0); + auto unsafe = dyn_cast(c->FindSymbol("mUnsafe", false)); + unsafe->Type->SetValue(reinterpret_cast(p) + unsafe->Offset, 0); return (DMenuItemBase*)p; } diff --git a/wadsrc/static/zscript/menu/optionmenuitems.txt b/wadsrc/static/zscript/menu/optionmenuitems.txt index 4668ea06818..00fe4893cce 100644 --- a/wadsrc/static/zscript/menu/optionmenuitems.txt +++ b/wadsrc/static/zscript/menu/optionmenuitems.txt @@ -128,16 +128,18 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu { private String ccmd; // do not allow access to this from the outside. bool mCloseOnSelect; + private bool mUnsafe; OptionMenuItemCommand Init(String label, Name command, bool centered = false, bool closeonselect = false) { Super.Init(label, command, 0, centered); ccmd = command; mCloseOnSelect = closeonselect; + mUnsafe = true; return self; } - private native static void DoCommand(String cmd); // This is very intentionally limited to this menu item to prevent abuse. + private native static void DoCommand(String cmd, bool unsafe); // This is very intentionally limited to this menu item to prevent abuse. override bool Activate() { @@ -151,7 +153,7 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu if (m.GetItem(mAction) != self) return false; } Menu.MenuSound("menu/choose"); - DoCommand(ccmd); + DoCommand(ccmd, mUnsafe); if (mCloseOnSelect) { let curmenu = Menu.GetCurrentMenu(); From 35508bc8fbc1c07c23f225f906b3e07c0184057b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 30 Jan 2018 16:32:16 +0200 Subject: [PATCH 26/38] Fixed resetting CVARs via internal menu CCMDs This restores functionality of reset to defaults/saved menu options --- src/c_cvars.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 2444f2b3f1a..7edf126ab80 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -157,11 +157,6 @@ void FBaseCVar::SetGenericRep (UCVarValue value, ECVarType type) { return; } - else if (UnsafeExecutionContext && !(GetFlags() & CVAR_MOD)) - { - Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", GetName()); - return; - } else if ((Flags & CVAR_LATCH) && gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP) { FLatchedValue latch; @@ -1712,6 +1707,16 @@ void C_ArchiveCVars (FConfigFile *f, uint32_t filter) EXTERN_CVAR(Bool, sv_cheats); +static bool IsUnsafe(const FBaseCVar *const var) +{ + const bool unsafe = UnsafeExecutionContext && !(var->GetFlags() & CVAR_MOD); + if (unsafe) + { + Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", var->GetName()); + } + return unsafe; +} + void FBaseCVar::CmdSet (const char *newval) { if ((GetFlags() & CVAR_CHEAT) && !sv_cheats) @@ -1719,6 +1724,10 @@ void FBaseCVar::CmdSet (const char *newval) Printf("sv_cheats must be true to set this console variable.\n"); return; } + else if (IsUnsafe(this)) + { + return; + } UCVarValue val; @@ -1805,6 +1814,11 @@ CCMD (toggle) { if ( (var = FindCVar (argv[1], &prev)) ) { + if (IsUnsafe(var)) + { + return; + } + val = var->GetGenericRep (CVAR_Bool); val.Bool = !val.Bool; var->SetGenericRep (val, CVAR_Bool); From 8e90386567fd9ffc8d99733f7f1425103b63cd22 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 30 Jan 2018 22:03:55 +0100 Subject: [PATCH 27/38] - made Weapon.CheckAmmo and Weapon.DepleteAmmo virtual on the script side. --- src/g_inventory/a_weapons.cpp | 36 ++++++++++++++++++--- src/g_inventory/a_weapons.h | 2 ++ wadsrc/static/zscript/inventory/weapons.txt | 4 +-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/g_inventory/a_weapons.cpp b/src/g_inventory/a_weapons.cpp index 440c67f9b7e..ede52833893 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -220,7 +220,21 @@ void AWeapon::MarkPrecacheSounds() const // //=========================================================================== -bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo, int ammocount) +bool AWeapon::CheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo, int ammocount) +{ + IFVIRTUAL(AWeapon, CheckAmmo) + { + VMValue params[] = { (DObject*)this, fireMode, autoSwitch, requireAmmo, ammocount }; + VMReturn ret; + int retval; + ret.IntAt(&retval); + VMCall(func, params, 5, &ret, 1); + return !!retval; + } + return CheckAmmo(fireMode, autoSwitch, requireAmmo, ammocount); +} + +bool AWeapon::DoCheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo, int ammocount) { int altFire; int count1, count2; @@ -293,7 +307,7 @@ DEFINE_ACTION_FUNCTION(AWeapon, CheckAmmo) PARAM_BOOL(autoswitch); PARAM_BOOL_DEF(require); PARAM_INT_DEF(ammocnt); - ACTION_RETURN_BOOL(self->CheckAmmo(mode, autoswitch, require, ammocnt)); + ACTION_RETURN_BOOL(self->DoCheckAmmo(mode, autoswitch, require, ammocnt)); } //=========================================================================== @@ -306,7 +320,21 @@ DEFINE_ACTION_FUNCTION(AWeapon, CheckAmmo) // //=========================================================================== -bool AWeapon::DepleteAmmo (bool altFire, bool checkEnough, int ammouse) +bool AWeapon::DepleteAmmo(bool altFire, bool checkEnough, int ammouse) +{ + IFVIRTUAL(AWeapon, DepleteAmmo) + { + VMValue params[] = { (DObject*)this, AltFire, checkEnough, ammouse }; + VMReturn ret; + int retval; + ret.IntAt(&retval); + VMCall(func, params, 4, &ret, 1); + return !!retval; + } + return DoDepleteAmmo(altFire, checkEnough, ammouse); +} + +bool AWeapon::DoDepleteAmmo (bool altFire, bool checkEnough, int ammouse) { if (!((dmflags & DF_INFINITE_AMMO) || (Owner->FindInventory (PClass::FindActor(NAME_PowerInfiniteAmmo), true) != nullptr))) { @@ -357,7 +385,7 @@ DEFINE_ACTION_FUNCTION(AWeapon, DepleteAmmo) PARAM_BOOL(altfire); PARAM_BOOL_DEF(checkenough); PARAM_INT_DEF(ammouse); - ACTION_RETURN_BOOL(self->DepleteAmmo(altfire, checkenough, ammouse)); + ACTION_RETURN_BOOL(self->DoDepleteAmmo(altfire, checkenough, ammouse)); } diff --git a/src/g_inventory/a_weapons.h b/src/g_inventory/a_weapons.h index 9b397e402cb..4c6f6ab45f5 100644 --- a/src/g_inventory/a_weapons.h +++ b/src/g_inventory/a_weapons.h @@ -142,7 +142,9 @@ class AWeapon : public AStateProvider EitherFire }; bool CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo=false, int ammocount = -1); + bool DoCheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo, int ammocount); bool DepleteAmmo (bool altFire, bool checkEnough=true, int ammouse = -1); + bool DoDepleteAmmo(bool altFire, bool checkEnough, int ammouse); enum { diff --git a/wadsrc/static/zscript/inventory/weapons.txt b/wadsrc/static/zscript/inventory/weapons.txt index f837bf4e541..4786e44d7ab 100644 --- a/wadsrc/static/zscript/inventory/weapons.txt +++ b/wadsrc/static/zscript/inventory/weapons.txt @@ -78,8 +78,8 @@ class Weapon : StateProvider native Stop; } - native bool CheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo = false, int ammocount = -1); - native bool DepleteAmmo(bool altFire, bool checkEnough = true, int ammouse = -1); + native virtual bool CheckAmmo(int fireMode, bool autoSwitch, bool requireAmmo = false, int ammocount = -1); + native virtual bool DepleteAmmo(bool altFire, bool checkEnough = true, int ammouse = -1); virtual State GetReadyState () { From 1608e11f0dada848728fc980cf431b88017a774e Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Tue, 30 Jan 2018 22:22:57 -0500 Subject: [PATCH 28/38] Fix typo that made DepleteAmmo always use Secondary Ammo https://forum.zdoom.org/viewtopic.php?f=2&p=1038209 --- src/g_inventory/a_weapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_inventory/a_weapons.cpp b/src/g_inventory/a_weapons.cpp index ede52833893..a0458ce3ea4 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -324,7 +324,7 @@ bool AWeapon::DepleteAmmo(bool altFire, bool checkEnough, int ammouse) { IFVIRTUAL(AWeapon, DepleteAmmo) { - VMValue params[] = { (DObject*)this, AltFire, checkEnough, ammouse }; + VMValue params[] = { (DObject*)this, altFire, checkEnough, ammouse }; VMReturn ret; int retval; ret.IntAt(&retval); From 9a9c90a5043202630bd1046feeecdfc2ae6bf909 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 31 Jan 2018 18:40:15 +0200 Subject: [PATCH 29/38] Fixed crash on exit caused by undefined class Referenced but undefined optional class does not abort loading with fatal error For example, incorrect MorphProjectile's PlayerClass or MonsterClass caused crash during shutdown --- src/dobjtype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 5f109e418c8..275c3814ebe 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -280,7 +280,7 @@ void PClass::StaticShutdown () // This must be done in two steps because the native classes are not ordered by inheritance, // so all meta data must be gone before deleting the actual class objects. - for (auto cls : AllClasses) cls->DestroyMeta(cls->Meta); + for (auto cls : AllClasses) if (cls->Meta != nullptr) cls->DestroyMeta(cls->Meta); for (auto cls : AllClasses) delete cls; // Unless something went wrong, anything left here should be class and type objects only, which do not own any scripts. bShutdown = true; From 0f62cd67a511f41e89275506de3ae749fa2a1c20 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 3 Feb 2018 13:24:54 +0200 Subject: [PATCH 30/38] Added compatibility entry for Ultimate Simplicity MAP04 Now it's possible to get 100% kills on lower skill levels --- wadsrc/static/compatibility.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index ff360f96b4d..b7754018fac 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -376,6 +376,14 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 setlinespecial 1008 Door_Open 0 64 0 0 0 } +7ED9800213C00D6E7FB98652AB48B3DE // Ultimate Simplicity, map04 +{ + // Add missing map spots on easy and medium skills + // Demons will teleport into starting room making 100% kills possible + setthingskills 31 31 + setthingskills 32 31 +} + 1891E029994B023910CFE0B3209C3CDB // Ultimate Simplicity, map07 { // It is possible to get stuck on skill 0 or 1 when no shots have been fired From d5bc0a1fa9bc178d20be8411a1c3b54155486367 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 3 Feb 2018 14:39:01 +0200 Subject: [PATCH 31/38] Uniform way to guard ACS stack and variables ACS VM stack and map/world/global variables arrays are now checked for out of bounds access --- src/p_acs.cpp | 56 +++++++++++++++++++-------------------------------- src/p_acs.h | 31 ++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 3e5358a3cea..e36cecde786 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -835,12 +835,12 @@ inline int uallong(const int &foo) //============================================================================ // ACS variables with world scope -int32_t ACS_WorldVars[NUM_WORLDVARS]; -FWorldGlobalArray ACS_WorldArrays[NUM_WORLDVARS]; +static BoundsCheckingArray ACS_WorldVars; +static BoundsCheckingArray ACS_WorldArrays; // ACS variables with global scope -int32_t ACS_GlobalVars[NUM_GLOBALVARS]; -FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS]; +BoundsCheckingArray ACS_GlobalVars; +BoundsCheckingArray ACS_GlobalArrays; //---------------------------------------------------------------------------- // @@ -851,21 +851,7 @@ FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS]; // //---------------------------------------------------------------------------- -struct FACSStackMemory -{ - int32_t& operator[](const size_t index) - { - if (index >= STACK_SIZE) - { - I_Error("Corrupted stack pointer in ACS VM"); - } - - return buffer[index]; - } - -private: - int32_t buffer[STACK_SIZE]; -}; +using FACSStackMemory = BoundsCheckingArray; struct FACSStack { @@ -1470,10 +1456,10 @@ void ACSStringPool::UnlockForLevel(int lnum) void P_MarkWorldVarStrings() { - GlobalACSStrings.MarkStringArray(ACS_WorldVars, countof(ACS_WorldVars)); - for (size_t i = 0; i < countof(ACS_WorldArrays); ++i) + GlobalACSStrings.MarkStringArray(ACS_WorldVars.Pointer(), ACS_WorldVars.Size()); + for (size_t i = 0; i < ACS_WorldArrays.Size(); ++i) { - GlobalACSStrings.MarkStringMap(ACS_WorldArrays[i]); + GlobalACSStrings.MarkStringMap(ACS_WorldArrays.Pointer()[i]); } } @@ -1485,10 +1471,10 @@ void P_MarkWorldVarStrings() void P_MarkGlobalVarStrings() { - GlobalACSStrings.MarkStringArray(ACS_GlobalVars, countof(ACS_GlobalVars)); - for (size_t i = 0; i < countof(ACS_GlobalArrays); ++i) + GlobalACSStrings.MarkStringArray(ACS_GlobalVars.Pointer(), ACS_GlobalVars.Size()); + for (size_t i = 0; i < ACS_GlobalArrays.Size(); ++i) { - GlobalACSStrings.MarkStringMap(ACS_GlobalArrays[i]); + GlobalACSStrings.MarkStringMap(ACS_GlobalArrays.Pointer()[i]); } } @@ -1571,14 +1557,14 @@ void P_ClearACSVars(bool alsoglobal) { int i; - memset (ACS_WorldVars, 0, sizeof(ACS_WorldVars)); + ACS_WorldVars.Fill(0); for (i = 0; i < NUM_WORLDVARS; ++i) { ACS_WorldArrays[i].Clear (); } if (alsoglobal) { - memset (ACS_GlobalVars, 0, sizeof(ACS_GlobalVars)); + ACS_GlobalVars.Fill(0); for (i = 0; i < NUM_GLOBALVARS; ++i) { ACS_GlobalArrays[i].Clear (); @@ -1726,10 +1712,10 @@ static void ReadArrayVars (FSerializer &file, FWorldGlobalArray *vars, size_t co void P_ReadACSVars(FSerializer &arc) { - ReadVars (arc, ACS_WorldVars, NUM_WORLDVARS, "acsworldvars"); - ReadVars (arc, ACS_GlobalVars, NUM_GLOBALVARS, "acsglobalvars"); - ReadArrayVars (arc, ACS_WorldArrays, NUM_WORLDVARS, "acsworldarrays"); - ReadArrayVars (arc, ACS_GlobalArrays, NUM_GLOBALVARS, "acsglobalarrays"); + ReadVars (arc, ACS_WorldVars.Pointer(), NUM_WORLDVARS, "acsworldvars"); + ReadVars (arc, ACS_GlobalVars.Pointer(), NUM_GLOBALVARS, "acsglobalvars"); + ReadArrayVars (arc, ACS_WorldArrays.Pointer(), NUM_WORLDVARS, "acsworldarrays"); + ReadArrayVars (arc, ACS_GlobalArrays.Pointer(), NUM_GLOBALVARS, "acsglobalarrays"); GlobalACSStrings.ReadStrings(arc, "acsglobalstrings"); } @@ -1741,10 +1727,10 @@ void P_ReadACSVars(FSerializer &arc) void P_WriteACSVars(FSerializer &arc) { - WriteVars (arc, ACS_WorldVars, NUM_WORLDVARS, "acsworldvars"); - WriteVars (arc, ACS_GlobalVars, NUM_GLOBALVARS, "acsglobalvars"); - WriteArrayVars (arc, ACS_WorldArrays, NUM_WORLDVARS, "acsworldarrays"); - WriteArrayVars (arc, ACS_GlobalArrays, NUM_GLOBALVARS, "acsglobalarrays"); + WriteVars (arc, ACS_WorldVars.Pointer(), NUM_WORLDVARS, "acsworldvars"); + WriteVars (arc, ACS_GlobalVars.Pointer(), NUM_GLOBALVARS, "acsglobalvars"); + WriteArrayVars (arc, ACS_WorldArrays.Pointer(), NUM_WORLDVARS, "acsworldarrays"); + WriteArrayVars (arc, ACS_GlobalArrays.Pointer(), NUM_GLOBALVARS, "acsglobalarrays"); GlobalACSStrings.WriteStrings(arc, "acsglobalstrings"); } diff --git a/src/p_acs.h b/src/p_acs.h index 4f53ce1a373..7b0d18bd823 100644 --- a/src/p_acs.h +++ b/src/p_acs.h @@ -60,13 +60,32 @@ struct InitIntToZero }; typedef TMap, InitIntToZero> FWorldGlobalArray; -// ACS variables with world scope -extern int32_t ACS_WorldVars[NUM_WORLDVARS]; -extern FWorldGlobalArray ACS_WorldArrays[NUM_WORLDVARS]; +// Type of elements count is unsigned int instead of size_t to match ACSStringPool interface +template +struct BoundsCheckingArray +{ + T &operator[](const unsigned int index) + { + if (index >= N) + { + I_Error("Out of bounds memory access in ACS VM"); + } + + return buffer[index]; + } + + T *Pointer() { return buffer; } + unsigned int Size() const { return N; } + + void Fill(const T &value) { std::fill(std::begin(buffer), std::end(buffer), value); } + +private: + T buffer[N]; +}; // ACS variables with global scope -extern int32_t ACS_GlobalVars[NUM_GLOBALVARS]; -extern FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS]; +extern BoundsCheckingArray ACS_GlobalVars; +extern BoundsCheckingArray ACS_GlobalArrays; #define LIBRARYID_MASK 0xFFF00000 #define LIBRARYID_SHIFT 20 @@ -359,7 +378,7 @@ class FBehavior ACSProfileInfo *GetFunctionProfileData(ScriptFunction *func) { return GetFunctionProfileData((int)(func - (ScriptFunction *)Functions)); } const char *LookupString (uint32_t index) const; - int32_t *MapVars[NUM_MAPVARS]; + BoundsCheckingArray MapVars; static FBehavior *StaticLoadModule (int lumpnum, FileReader * fr=NULL, int len=0); static void StaticLoadDefaultModules (); From af7648a151a73e12fa0a10e6595b2517cadb4d63 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 3 Feb 2018 16:26:49 +0200 Subject: [PATCH 32/38] Made PlayerRespawn skill definition consistent Now it works the same as AllowRespawn map definition in MAPINFO --- src/g_level.cpp | 3 ++- wadsrc/static/zscript/shared/player.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 17f76a67d09..d6c712b241e 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -648,7 +648,8 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill // If this is co-op, respawn any dead players now so they can // keep their inventory on the next map. - if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN || sv_singleplayerrespawn) && !deathmatch && player->playerstate == PST_DEAD) + if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN || sv_singleplayerrespawn || !!G_SkillProperty(SKILLP_PlayerRespawn)) + && !deathmatch && player->playerstate == PST_DEAD) { // Copied from the end of P_DeathThink [[ player->cls = NULL; // Force a new class if the player is using a random class diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index d43a59ce27e..8ecce11cb2c 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -528,7 +528,7 @@ class PlayerPawn : Actor native if (level.time >= player.respawn_time || ((player.cmd.buttons & BT_USE) && player.Bot == NULL)) { player.cls = NULL; // Force a new class if the player is using a random class - player.playerstate = (multiplayer || (level.AllowRespawn) || sv_singleplayerrespawn)? PST_REBORN : PST_ENTER; + player.playerstate = (multiplayer || level.AllowRespawn || sv_singleplayerrespawn || G_SkillPropertyInt(SKILLP_PlayerRespawn)) ? PST_REBORN : PST_ENTER; if (special1 > 2) { special1 = 0; From 364ce773e3f9ba659772348d00e6a18adb55e2ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Feb 2018 08:49:41 +0100 Subject: [PATCH 33/38] - Update to UDMF spec. --- specs/udmf_zdoom.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 1851604614c..185d2a6defc 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -283,6 +283,7 @@ Note: All fields default to false unless mentioned otherwise. For things with ACS specials (80-86 and 226), if arg0str is present and non-null, it will be used as the name of the script to execute, and arg0 will be ignored. + On dynamic lights, arg0str can be used to set a color by name, this will supersede all args which are normally used to define a color. } @@ -426,6 +427,9 @@ floor_reflect and ceiling_reflect. 1.28 28.01.2017 sector material colors. +1.29 04.02.2018 +arg0str in dynamic lights. + =============================================================================== EOF =============================================================================== From ef867c3415cef8fbfb93c9a2bf3f84d4da324442 Mon Sep 17 00:00:00 2001 From: ZZYZX Date: Sun, 4 Feb 2018 09:57:06 +0200 Subject: [PATCH 34/38] Fixed arg0str for dynamic light actors --- src/p_mobj.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e0c9530d357..8e5e1d3a267 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -6101,6 +6101,9 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) if (mthing->arg0str != NAME_None) { PalEntry color = V_GetColor(nullptr, mthing->arg0str); + light->args[0] = color.r; + light->args[1] = color.g; + light->args[2] = color.b; } else if (light->lightflags & LF_SPOT) { From 32287511e238f56a5b05e2cdad22d3a18cdbc29a Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 4 Feb 2018 04:11:02 -0500 Subject: [PATCH 35/38] - change type 9854 to SpotLightFlickerRandomAttitive since its old definition was just a duplicate of another one. --- wadsrc/static/mapinfo/common.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index 1c1559b061b..b79ecd5f4f4 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -118,7 +118,7 @@ DoomEdNums 9851 = SpotLightPulseAdditive 9852 = SpotLightFlickerAdditive 9853 = SectorSpotLightAdditive - 9854 = SpotLightFlickerRandomSubtractive + 9854 = SpotLightFlickerRandomAdditive 9860 = SpotLightSubtractive 9861 = SpotLightPulseSubtractive 9862 = SpotLightFlickerSubtractive From 18ad975c7ae8f9548ef3bad3422f18db0d3ae980 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 4 Feb 2018 17:42:39 +0200 Subject: [PATCH 36/38] Added compatibility entry for Ultimate Simplicity MAP11 This eliminates potential blocker in level progression --- wadsrc/static/compatibility.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index b7754018fac..b78b4e66481 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -394,6 +394,13 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 setlinespecial 411 NoiseAlert 0 0 0 0 0 } +F0E6F30F57B0425F17E43600AA813E80 // Ultimate Simplicity, map11 +{ + // If door (sector #309) is closed it cannot be open again + // from one side potentially blocking level progression + clearlinespecial 2445 +} + 952CC8D03572E17BA550B01B366EFBB9 // Cheogsh map01 { // make the blue key spawn above the 3D floor From ed230080696916286af4884fc1db69522ee0dd76 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 7 Feb 2018 11:37:02 +0200 Subject: [PATCH 37/38] Fixed crash in stereoscopic modes caused by camera without player https://forum.zdoom.org/viewtopic.php?t=55039&start=381#p1039251 --- src/gl/scene/gl_scene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index a0bcb488216..178b39ff7c4 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -842,7 +842,7 @@ sector_t * GLSceneDrawer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, f stereo3dMode.SetUp(); for (int eye_ix = 0; eye_ix < stereo3dMode.eye_count(); ++eye_ix) { - if (eye_ix > 0) + if (eye_ix > 0 && camera->player) SetFixedColormap(camera->player); // reiterate color map for each eye, so night vision goggles work in both eyes const s3d::EyePose * eye = stereo3dMode.getEyePose(eye_ix); eye->SetUp(); From 7cbe8669b687b1c560bab4f69d2fd1d832b4286f Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 10 Feb 2018 00:06:47 +0100 Subject: [PATCH 38/38] - fix decals not getting lit by lights not having a target while still having the LF_DONTLIGHTSELF flag - fix decal light not being calculated from the center of the decal --- src/gl/scene/gl_decal.cpp | 2 +- src/gl/scene/gl_spritelight.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_decal.cpp b/src/gl/scene/gl_decal.cpp index cf231020949..0f3bc7ffb4f 100644 --- a/src/gl/scene/gl_decal.cpp +++ b/src/gl/scene/gl_decal.cpp @@ -289,7 +289,7 @@ void GLWall::DrawDecal(DBaseDecal *decal) // Note: This should be replaced with proper shader based lighting. double x, y; decal->GetXY(seg->sidedef, x, y); - gl_SetDynSpriteLight(NULL, x, y, zpos, sub); + gl_SetDynSpriteLight(nullptr, x, y, zpos - decalheight * 0.5f, sub); } // alpha color only has an effect when using an alpha texture. diff --git a/src/gl/scene/gl_spritelight.cpp b/src/gl/scene/gl_spritelight.cpp index ac7e6971e56..1415ce16c97 100644 --- a/src/gl/scene/gl_spritelight.cpp +++ b/src/gl/scene/gl_spritelight.cpp @@ -74,7 +74,7 @@ void gl_SetDynSpriteLight(AActor *self, float x, float y, float z, subsector_t * while (node) { light=node->lightsource; - if (light->visibletoplayer && !(light->flags2&MF2_DORMANT) && (!(light->lightflags&LF_DONTLIGHTSELF) || light->target != self) && !(light->lightflags&LF_DONTLIGHTACTORS)) + if (light->visibletoplayer && !(light->flags2&MF2_DORMANT) && (!(light->lightflags&LF_DONTLIGHTSELF) || light->target != self || !self) && !(light->lightflags&LF_DONTLIGHTACTORS)) { float dist; FVector3 L;