From 0bdc2f59ada74e6b9f5213e87f46cefec868ff1a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 01:15:45 +0100 Subject: [PATCH 01/19] - added new Stairs_BuildUpDoomCrush special from Eternity and used it to fix the bad implementation to make Doom's turbo stairs crush. This also removes the crushing from Generic_Stairs entirely, just like it was in Boom. --- src/actionspecials.h | 1 + src/p_floor.cpp | 2 +- src/p_lnspec.cpp | 7 +++++++ src/p_spec.h | 3 ++- wadsrc/static/xlat/base.txt | 8 ++++---- wadsrc/static/xlat/strife.txt | 4 ++-- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/actionspecials.h b/src/actionspecials.h index 9b9c38cb97..3edb1671d3 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -258,5 +258,6 @@ DEFINE_SPECIAL(Ceiling_LowerByTexture, 269, 2, 4, 4) DEFINE_SPECIAL(Stairs_BuildDownDoom, 270, 5, 5, 5) DEFINE_SPECIAL(Stairs_BuildUpDoomSync, 271, 4, 4, 4) DEFINE_SPECIAL(Stairs_BuildDownDoomSync, 272, 4, 4, 4) +DEFINE_SPECIAL(Stairs_BuildUpDoomCrush, 273, 5, 5, 5) #undef DEFINE_SPECIAL diff --git a/src/p_floor.cpp b/src/p_floor.cpp index fbfa70f2e7..68602ab0ae 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -626,7 +626,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, floor->m_PauseTime = 0; floor->m_StepTime = floor->m_PerStepTime = persteptime; - floor->m_Crush = (!(usespecials & DFloor::stairUseSpecials) && speed == 4) ? 10 : -1; //jff 2/27/98 fix uninitialized crush field + floor->m_Crush = (usespecials & DFloor::stairCrush) ? 10 : -1; //jff 2/27/98 fix uninitialized crush field floor->m_Hexencrush = false; floor->m_Speed = speed; diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index d368739e16..819ea372e2 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -591,6 +591,13 @@ FUNC(LS_Stairs_BuildUpDoom) arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0); } +FUNC(LS_Stairs_BuildUpDoomCrush) +// Stairs_BuildUpDoom (tag, speed, height, delay, reset) +{ + return EV_BuildStairs(arg0, DFloor::buildUp, ln, + arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairCrush); +} + FUNC(LS_Stairs_BuildDownDoom) // Stair_BuildDownDoom (tag, speed, height, delay, reset) { diff --git a/src/p_spec.h b/src/p_spec.h index ea98c82c14..a2fd0727ac 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -503,7 +503,8 @@ class DFloor : public DMovingFloor enum EStairType { stairUseSpecials = 1, - stairSync = 2 + stairSync = 2, + stairCrush = 4, }; DFloor (sector_t *sec); diff --git a/wadsrc/static/xlat/base.txt b/wadsrc/static/xlat/base.txt index 8a99ba3183..0fc02739ef 100644 --- a/wadsrc/static/xlat/base.txt +++ b/wadsrc/static/xlat/base.txt @@ -99,7 +99,7 @@ include "xlat/defines.i" 97 = WALK|REP|MONST, Teleport (0, tag) 98 = WALK|REP, Floor_LowerToHighest (tag, F_FAST, 136) 99 = USE|REP, Door_LockedRaise (tag, D_FAST, 0, BCard | CardIsSkull) -100 = WALK, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +100 = WALK, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 101 = USE, Floor_RaiseToLowestCeiling (tag, F_SLOW) 102 = USE, Floor_LowerToHighest (tag, F_SLOW, 128) 103 = USE, Door_Open (tag, D_SLOW) @@ -126,7 +126,7 @@ include "xlat/defines.i" 124 = WALK, Exit_Secret (0) 125 = MONWALK, Teleport (0, tag) 126 = MONWALK|REP, Teleport (0, tag) -127 = USE, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +127 = USE, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 128 = WALK|REP, Floor_RaiseToNearest (tag, F_SLOW) 129 = WALK|REP, Floor_RaiseToNearest (tag, F_FAST) 130 = WALK, Floor_RaiseToNearest (tag, F_FAST) @@ -259,9 +259,9 @@ include "xlat/defines.i" 254 = 0, Scroll_Texture_Model (lineid, 0) 255 = 0, Scroll_Texture_Offsets () 256 = WALK|REP, Stairs_BuildUpDoom (tag, ST_SLOW, 8, 0, 0) -257 = WALK|REP, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +257 = WALK|REP, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 258 = USE|REP, Stairs_BuildUpDoom (tag, ST_SLOW, 8, 0, 0) -259 = USE|REP, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +259 = USE|REP, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 260 = 0, TranslucentLine (lineid, 168) // Changed to better reflect the BOOM default 261 = 0, Transfer_CeilingLight (tag) 262 = WALK|MONST, Teleport_Line (tag, tag, 1) diff --git a/wadsrc/static/xlat/strife.txt b/wadsrc/static/xlat/strife.txt index 50fcb2ff8e..e4ae8244f1 100644 --- a/wadsrc/static/xlat/strife.txt +++ b/wadsrc/static/xlat/strife.txt @@ -120,7 +120,7 @@ RetailOnly = 121 104 = WALK, Light_MinNeighbor (tag) 108 = WALK, Door_Raise (tag, D_FAST, VDOORWAIT) 109 = WALK, Door_Open (tag, D_FAST) -100 = WALK, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +100 = WALK, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 197 = WALK|REP, ACS_ExecuteAlways (0, 0, 197, tag) 110 = WALK, Door_Close (tag, D_FAST) 119 = WALK, Floor_RaiseToNearest (tag, F_SLOW) @@ -255,7 +255,7 @@ RetailOnly = 121 112 = USE, Door_Open (tag, D_FAST) 113 = USE, Door_Close (tag, D_FAST) 122 = USE, Plat_DownWaitUpStayLip (tag, P_TURBO, PLATWAIT, 0) -127 = USE, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +127 = USE, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 131 = USE, Floor_RaiseToNearest (tag, F_FAST) 133 = USE, Door_LockedRaise (tag, D_FAST, 0, 4) 135 = USE, Door_LockedRaise (tag, D_FAST, 0, 11) From 748b1a6f66aee3b89bcd15f3587ba13040cacf18 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 18:53:02 +0100 Subject: [PATCH 02/19] - fixed bad variable assignment in Heresiarch. --- wadsrc/static/zscript/hexen/heresiarch.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/hexen/heresiarch.txt b/wadsrc/static/zscript/hexen/heresiarch.txt index db4860c349..74bccbf4c6 100644 --- a/wadsrc/static/zscript/hexen/heresiarch.txt +++ b/wadsrc/static/zscript/hexen/heresiarch.txt @@ -698,8 +698,8 @@ class SorcBall2 : SorcBall Actor parent = target; Actor mo = Spawn("SorcFX2", Pos + (0, 0, parent.Floorclip + Heresiarch.SORC_DEFENSE_HEIGHT), ALLOW_REPLACE); - bReflective = true; - bInvulnerable = true; + parent.bReflective = true; + parent.bInvulnerable = true; parent.args[0] = Heresiarch.SORC_DEFENSE_TIME; if (mo) mo.target = parent; } From f2ef2700425ae01a7908b8e27b1e561cd8745f66 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 19:07:26 +0100 Subject: [PATCH 03/19] - fixed: The check for virtual function overrides was never done if the overriding function had no qualifier at all. - fixed several occurences where an 'override' qualifier was missing. --- src/scripting/zscript/zcc_compile.cpp | 10 +++++++++- wadsrc/static/zscript/heretic/hereticartifacts.txt | 2 +- wadsrc/static/zscript/heretic/weaponblaster.txt | 2 +- wadsrc/static/zscript/heretic/weaponphoenix.txt | 2 +- wadsrc/static/zscript/heretic/weaponskullrod.txt | 2 +- wadsrc/static/zscript/hexen/heresiarch.txt | 2 +- wadsrc/static/zscript/shared/setcolor.txt | 2 +- wadsrc/static/zscript/strife/weapongrenade.txt | 2 +- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 9684ec9246..52cbc1d653 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2336,6 +2336,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool sym->Variants[0].Implementation->DefaultArgs = std::move(argdefaults); } + PClass *clstype = static_cast(c->Type()); if (varflags & VARF_Virtual) { if (sym->Variants[0].Implementation == nullptr) @@ -2349,7 +2350,6 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool } if (forclass) { - PClass *clstype = static_cast(c->Type()); int vindex = clstype->FindVirtualIndex(sym->SymbolName, sym->Variants[0].Proto); // specifying 'override' is necessary to prevent one of the biggest problem spots with virtual inheritance: Mismatching argument types. if (varflags & VARF_Override) @@ -2383,6 +2383,14 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool Error(p, "Virtual functions can only be defined for classes"); } } + else if (forclass) + { + int vindex = clstype->FindVirtualIndex(sym->SymbolName, sym->Variants[0].Proto); + if (vindex != -1) + { + Error(f, "Function %s attempts to override parent function without 'override' qualifier", FName(f->Name).GetChars()); + } + } } } diff --git a/wadsrc/static/zscript/heretic/hereticartifacts.txt b/wadsrc/static/zscript/heretic/hereticartifacts.txt index 20f52a2c93..3b7f14ad82 100644 --- a/wadsrc/static/zscript/heretic/hereticartifacts.txt +++ b/wadsrc/static/zscript/heretic/hereticartifacts.txt @@ -66,7 +66,7 @@ Class ArtiTomeOfPower : PowerupGiver Loop; } - bool Use (bool pickup) + override bool Use (bool pickup) { Playerinfo p = Owner.player; if (p && p.morphTics && (p.MorphStyle & MRF_UNDOBYTOMEOFPOWER)) diff --git a/wadsrc/static/zscript/heretic/weaponblaster.txt b/wadsrc/static/zscript/heretic/weaponblaster.txt index 913abffdb6..e7e1e92b55 100644 --- a/wadsrc/static/zscript/heretic/weaponblaster.txt +++ b/wadsrc/static/zscript/heretic/weaponblaster.txt @@ -220,7 +220,7 @@ class Ripper : Actor Stop; } - int DoSpecialDamage (Actor target, int damage, Name damagetype) + override int DoSpecialDamage (Actor target, int damage, Name damagetype) { if (target is "Ironlich") { // Less damage to Ironlich bosses diff --git a/wadsrc/static/zscript/heretic/weaponphoenix.txt b/wadsrc/static/zscript/heretic/weaponphoenix.txt index eb75acb1dd..558a257cdd 100644 --- a/wadsrc/static/zscript/heretic/weaponphoenix.txt +++ b/wadsrc/static/zscript/heretic/weaponphoenix.txt @@ -311,7 +311,7 @@ class PhoenixFX2 : Actor } - int DoSpecialDamage (Actor target, int damage, Name damagetype) + override int DoSpecialDamage (Actor target, int damage, Name damagetype) { if (target.player && Random[PhoenixFX2]() < 128) { // Freeze player for a bit diff --git a/wadsrc/static/zscript/heretic/weaponskullrod.txt b/wadsrc/static/zscript/heretic/weaponskullrod.txt index a8d77e1d8c..da959f7ae7 100644 --- a/wadsrc/static/zscript/heretic/weaponskullrod.txt +++ b/wadsrc/static/zscript/heretic/weaponskullrod.txt @@ -402,7 +402,7 @@ class RainPillar : Actor // Rain pillar 1 ------------------------------------------------------------ - int DoSpecialDamage (Actor target, int damage, Name damagetype) + override int DoSpecialDamage (Actor target, int damage, Name damagetype) { if (target.bBoss) { // Decrease damage for bosses diff --git a/wadsrc/static/zscript/hexen/heresiarch.txt b/wadsrc/static/zscript/hexen/heresiarch.txt index 74bccbf4c6..f89d2fb839 100644 --- a/wadsrc/static/zscript/hexen/heresiarch.txt +++ b/wadsrc/static/zscript/hexen/heresiarch.txt @@ -112,7 +112,7 @@ class Heresiarch : Actor Stop; } - void Die (Actor source, Actor inflictor, int dmgflags) + override void Die (Actor source, Actor inflictor, int dmgflags) { // The heresiarch just executes a script instead of a special upon death int script = special; diff --git a/wadsrc/static/zscript/shared/setcolor.txt b/wadsrc/static/zscript/shared/setcolor.txt index 18105ef543..2d9d3be576 100644 --- a/wadsrc/static/zscript/shared/setcolor.txt +++ b/wadsrc/static/zscript/shared/setcolor.txt @@ -28,7 +28,7 @@ class FadeSetter : Actor RenderStyle "None"; } - void PostBeginPlay() + override void PostBeginPlay() { Super.PostBeginPlay(); CurSector.SetFade(color(args[0], args[1], args[2])); diff --git a/wadsrc/static/zscript/strife/weapongrenade.txt b/wadsrc/static/zscript/strife/weapongrenade.txt index 7a775c57ba..21e568313c 100644 --- a/wadsrc/static/zscript/strife/weapongrenade.txt +++ b/wadsrc/static/zscript/strife/weapongrenade.txt @@ -241,7 +241,7 @@ class PhosphorousFire : Actor Stop; } - int DoSpecialDamage (Actor target, int damage, Name damagetype) + override int DoSpecialDamage (Actor target, int damage, Name damagetype) { if (target.bNoBlood) { From 6f507086511b5d75e04a9afe05b65b259ef30ece Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 19:34:04 +0100 Subject: [PATCH 04/19] - fixed: A single sight check iteration may not succeed if origin and end point are in different portal groups. All those may do is collect more portals. --- src/p_sight.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_sight.cpp b/src/p_sight.cpp index df02e2ebbd..1b53e38446 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -790,6 +790,7 @@ sightcounts[2]++; bool traverseres = P_SightTraverseIntercepts ( ); if (itres == -1) return false; // if the iterator had an early out there was no line of sight. The traverser was only called to collect more portals. + if (seeingthing->Sector->PortalGroup != portalgroup) return false; // We are in a different group than the seeingthing, so this trace cannot determine visibility alone. return traverseres; } @@ -819,6 +820,11 @@ bool P_CheckSight (AActor *t1, AActor *t2, int flags) return false; } + if (t2->player) + { + int a = 0; + } + const sector_t *s1 = t1->Sector; const sector_t *s2 = t2->Sector; int pnum = int(s1 - sectors) * numsectors + int(s2 - sectors); From 80374383a0fc76758954f906c6cb2c980e27c25a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 19:44:00 +0100 Subject: [PATCH 05/19] - fixed: Particles should disappear if their alpha goes below zero. --- src/p_effect.cpp | 2 +- src/p_sight.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/p_effect.cpp b/src/p_effect.cpp index eb872edc1f..0181ba0b63 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -272,7 +272,7 @@ void P_ThinkParticles () auto oldtrans = particle->alpha; particle->alpha -= particle->fadestep; particle->size += particle->sizestep; - if (oldtrans < particle->alpha || --particle->ttl <= 0 || (particle->size <= 0)) + if (particle->alpha <= 0 || oldtrans < particle->alpha || --particle->ttl <= 0 || (particle->size <= 0)) { // The particle has expired, so free it memset (particle, 0, sizeof(particle_t)); if (prev) diff --git a/src/p_sight.cpp b/src/p_sight.cpp index 1b53e38446..9337a24123 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -820,11 +820,6 @@ bool P_CheckSight (AActor *t1, AActor *t2, int flags) return false; } - if (t2->player) - { - int a = 0; - } - const sector_t *s1 = t1->Sector; const sector_t *s2 = t2->Sector; int pnum = int(s1 - sectors) * numsectors + int(s2 - sectors); From 5c14b80c8ec1a84406468982e94434bb7a099e00 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2017 21:39:17 +0100 Subject: [PATCH 06/19] - copied sight check fix. --- src/p_sight.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_sight.cpp b/src/p_sight.cpp index 9337a24123..f00e59e8ff 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -116,6 +116,7 @@ class SightCheck sightend = t2->PosRelative(task->portalgroup); sightstart.Z += t1->Height * 0.75; + portalgroup = task->portalgroup; Startfrac = task->Frac; Trace = { sightstart.X, sightstart.Y, sightend.X - sightstart.X, sightend.Y - sightstart.Y }; Lastztop = Lastzbottom = sightstart.Z; From 284ebd13b549b514bf22a4f1795510d08c171d54 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 9 Jan 2017 16:52:15 +0200 Subject: [PATCH 07/19] Autoaim is now updated when adjusting slider with mouse Fixes #208 Autoaim slider in Player Setup does not save if changed with cursor --- src/menu/playermenu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/menu/playermenu.cpp b/src/menu/playermenu.cpp index 9f5196367a..ea22fdd71d 100644 --- a/src/menu/playermenu.cpp +++ b/src/menu/playermenu.cpp @@ -1108,6 +1108,9 @@ bool DPlayerMenu::MouseEvent(int type, int x, int y) SendNewColor (RPART(color), GPART(color), v); } break; + case NAME_Autoaim: + AutoaimChanged(li); + break; } } return res; From 9a94613f5562d19526503e089481e3b127a3e900 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2017 21:26:19 +0100 Subject: [PATCH 08/19] - fixed: The Windows CreateFramebuffer methods need to check the desired screen size for an actual resolution when switching to fullscreen. --- src/win32/win32gliface.cpp | 5 +++++ src/win32/win32video.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index aa4755e483..c4b5b7b433 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -352,6 +352,11 @@ DFrameBuffer *Win32GLVideo::CreateFrameBuffer(int width, int height, bool fs, DF { Win32GLFrameBuffer *fb; + if (fs) + { + I_ClosestResolution(&width, &height, 32); + } + m_DisplayWidth = width; m_DisplayHeight = height; m_DisplayBits = 32; diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index 0d91ed1d04..015a344e09 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -641,6 +641,11 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool fullscr PalEntry flashColor; int flashAmount; + if (fullscreen) + { + I_ClosestResolution(&width, &height, D3D ? 32 : 8); + } + LOG4 ("CreateFB %d %d %d %p\n", width, height, fullscreen, old); if (old != NULL) From ea29e45ef5d66e26781e040a9bb5b62dee177bef Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Mon, 28 Nov 2016 00:25:43 +0100 Subject: [PATCH 09/19] - Fixed the wrong handling of empty command line argument. --- src/c_dispatch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index d112634d6a..296697ee76 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -1040,7 +1040,11 @@ FString BuildString (int argc, FString *argv) for (arg = 0; arg < argc; arg++) { - if (strchr(argv[arg], '"')) + if (argv[arg][0] == '\0') + { // It's an empty argument, we need to convert it to '""' + buf << "\"\" "; + } + else if (strchr(argv[arg], '"')) { // If it contains one or more quotes, we need to escape them. buf << '"'; long substr_start = 0, quotepos; From 9eb27303289a6a2b3ac740235f2359efefe2afbb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2017 23:23:26 +0100 Subject: [PATCH 10/19] - fixed: The stair builder code tried to access a member of a null pointer after finding no more stair sectors. # Conflicts: # src/p_floor.cpp --- src/p_floor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 68602ab0ae..5c21f771d6 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -663,9 +663,8 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, sec = tsec; continue; } - + newsecnum = tsec->Index(); } - newsecnum = (int)(tsec - sectors); } else { From 92c815074b8cb03a84b4f9ce5718a5f52cbc635f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 00:38:08 +0100 Subject: [PATCH 11/19] - added a workaround for a crashing condition in FThinkerIterator. It can actually happen that the thinker chain gets broken if an actor being iterated happens to destroy the immediately following actor in the chain as well. In that case both actors lose their chain links and the iterator cannot advance any further, the only solution to avoid a crash is to terminate the iteration of the current list. --- src/dthinker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index fd20a4e79a..11ba54dbc9 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -675,6 +675,9 @@ DThinker *FThinkerIterator::Next (bool exact) { return thinker; } + // This can actually happen when a Destroy call on 'thinker' happens to destroy 'm_CurrThinker'. + // In that case there is no chance to recover, we have to terminate the iteration of this list. + if (m_CurrThinker == nullptr) break; } } if ((m_SearchingFresh = !m_SearchingFresh)) From 1061b34721fe7b75891addf72dab9c28ab002c76 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 01:00:06 +0100 Subject: [PATCH 12/19] - added global per-mod precaching lists, to be defined in MAPINFO's Gameinfo section. --- src/gi.cpp | 3 +++ src/gi.h | 5 +++++ src/p_setup.cpp | 10 ++++++++++ src/s_sound.cpp | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/src/gi.cpp b/src/gi.cpp index 9d45d27242..c821288893 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -307,6 +307,9 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true) GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false) GAMEINFOKEY_STRINGARRAY(infoPages, "infoPage", 8, true) + GAMEINFOKEY_STRINGARRAY(PrecachedClasses, "precacheclasses", 0, false) + GAMEINFOKEY_STRINGARRAY(PrecachedTextures, "precachetextures", 0, false) + GAMEINFOKEY_STRINGARRAY(PrecachedSounds, "precachesounds", 0, false) GAMEINFOKEY_STRING(PauseSign, "pausesign") GAMEINFOKEY_STRING(quitSound, "quitSound") GAMEINFOKEY_STRING(BorderFlat, "borderFlat") diff --git a/src/gi.h b/src/gi.h index c5b8f79cfd..d9e81bcf11 100644 --- a/src/gi.h +++ b/src/gi.h @@ -36,6 +36,7 @@ #include "basictypes.h" #include "zstring.h" +#include "s_sound.h" // Flags are not user configurable and only depend on the standard IWADs #define GI_MAPxx 0x00000001 @@ -120,6 +121,10 @@ struct gameinfo_t TArray DefaultWeaponSlots[10]; TArray PlayerClasses; + TArray PrecachedClasses; + TArray PrecachedTextures; + TArray PrecachedSounds; + FString titleMusic; int titleOrder; float titleTime; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 7a026e172e..6e2d7ed6d1 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3383,6 +3383,11 @@ static void P_PrecacheLevel() actorhitlist[actor->GetClass()] = true; } + for (auto n : gameinfo.PrecachedClasses) + { + PClassActor *cls = PClass::FindActor(n); + if (cls != NULL) actorhitlist[cls] = true; + } for (unsigned i = 0; i < level.info->PrecacheClasses.Size(); i++) { // level.info can only store names, no class pointers. @@ -3419,6 +3424,11 @@ static void P_PrecacheLevel() hitlist[sky2texture.GetIndex()] |= FTextureManager::HIT_Sky; } + for (auto n : gameinfo.PrecachedTextures) + { + FTextureID tex = TexMan.CheckForTexture(n, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst); + if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall; + } for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++) { FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst); diff --git a/src/s_sound.cpp b/src/s_sound.cpp index be1b572f1c..1c7c5aea19 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -480,6 +480,10 @@ void S_PrecacheLevel () { actor->MarkPrecacheSounds(); } + for (auto i : gameinfo.PrecachedSounds) + { + level.info->PrecacheSounds[i].MarkUsed(); + } // Precache all extra sounds requested by this map. for (i = 0; i < level.info->PrecacheSounds.Size(); ++i) { From bc6530a3ce6da8fee7b2ee68dd553bf0ed6233ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 22:01:29 +0100 Subject: [PATCH 13/19] - fixed: Any inventory item that is about to be placed in an inventory must stop all its sounds. --- src/g_inventory/a_pickups.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/g_inventory/a_pickups.cpp b/src/g_inventory/a_pickups.cpp index 3c1d32d420..438293d403 100644 --- a/src/g_inventory/a_pickups.cpp +++ b/src/g_inventory/a_pickups.cpp @@ -644,6 +644,8 @@ void AInventory::BecomeItem () RemoveFromHash (); flags &= ~MF_SPECIAL; ChangeStatNum(STAT_INVENTORY); + // stop all sounds this item is playing. + for(int i = 1;i<=7;i++) S_StopSound(this, i); SetState (FindState("Held")); } From 62648ca29c32343c0612af36ee9be39e80f2dcce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 22:16:32 +0100 Subject: [PATCH 14/19] - fixed: 'stat music' tried to access a non-existent stream decoder for any music played through Timidity++ on OpenAL. --- src/sound/oalsound.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 53c471a316..1b34583f94 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -407,7 +407,7 @@ class OpenALSoundStream : public SoundStream virtual FString GetStats() { FString stats; - size_t pos, len; + size_t pos = 0, len = 0; ALfloat volume; ALint offset; ALint processed; @@ -429,28 +429,34 @@ class OpenALSoundStream : public SoundStream return stats; } - pos = Decoder->getSampleOffset(); - len = Decoder->getSampleLength(); + if (Decoder != nullptr) + { + pos = Decoder->getSampleOffset(); + len = Decoder->getSampleLength(); + } lock.unlock(); stats = (state == AL_INITIAL) ? "Buffering" : (state == AL_STOPPED) ? "Underrun" : (state == AL_PLAYING || state == AL_PAUSED) ? "Ready" : "Unknown state"; - if(state == AL_STOPPED) - offset = BufferCount * (Data.Size()/FrameSize); - else - { - size_t rem = queued*(Data.Size()/FrameSize) - offset; - if(pos > rem) pos -= rem; - else if(len > 0) pos += len - rem; - else pos = 0; - } - pos = (size_t)(pos * 1000.0 / SampleRate); - len = (size_t)(len * 1000.0 / SampleRate); - stats.AppendFormat(",%3u%% buffered", 100 - 100*offset/(BufferCount*(Data.Size()/FrameSize))); - stats.AppendFormat(", %zu.%03zu", pos/1000, pos%1000); - if(len > 0) - stats.AppendFormat(" / %zu.%03zu", len/1000, len%1000); + if (Decoder != nullptr) + { + if (state == AL_STOPPED) + offset = BufferCount * (Data.Size() / FrameSize); + else + { + size_t rem = queued*(Data.Size() / FrameSize) - offset; + if (pos > rem) pos -= rem; + else if (len > 0) pos += len - rem; + else pos = 0; + } + pos = (size_t)(pos * 1000.0 / SampleRate); + len = (size_t)(len * 1000.0 / SampleRate); + stats.AppendFormat(",%3u%% buffered", 100 - 100 * offset / (BufferCount*(Data.Size() / FrameSize))); + stats.AppendFormat(", %zu.%03zu", pos / 1000, pos % 1000); + if (len > 0) + stats.AppendFormat(" / %zu.%03zu", len / 1000, len % 1000); + } if(state == AL_PAUSED) stats += ", paused"; if(state == AL_PLAYING) From ff9513a814ca99f1a403865d4f3b38709b30ad00 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 22:21:57 +0100 Subject: [PATCH 15/19] Revert "- fixed: The stair builder code tried to access a member of a null pointer after finding no more stair sectors." This reverts commit 9eb27303289a6a2b3ac740235f2359efefe2afbb. This fix doesn't apply to 'maint'. --- src/p_floor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 5c21f771d6..68602ab0ae 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -663,8 +663,9 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, sec = tsec; continue; } - newsecnum = tsec->Index(); + } + newsecnum = (int)(tsec - sectors); } else { From 5ec33de8a79a20a2a521057ae2c8cc70ed5d6788 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Jan 2017 22:28:15 +0100 Subject: [PATCH 16/19] - removed r_columnmethod 1 because the code was broken and already gone from QZDoom. --- src/r_draw.cpp | 4 ++-- wadsrc/static/language.enu | 1 - wadsrc/static/menudef.txt | 7 ------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 8206c23918..10bc104c2e 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -435,7 +435,7 @@ namespace swrenderer { dc_colormap += fixedlightlev; } - return r_columnmethod ? DoDraw1 : DoDraw0; + return DoDraw0; } fglevel = GetAlpha(style.SrcAlpha, alpha); @@ -468,7 +468,7 @@ namespace swrenderer { return DontDraw; } - return r_columnmethod ? DoDraw1 : DoDraw0; + return DoDraw0; } ESPSResult R_SetPatchStyle(FRenderStyle style, float alpha, int translation, uint32_t color) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index fc611b3c0f..b7558d1b2f 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1779,7 +1779,6 @@ DSPLYMNU_SCREENSIZE = "Screen size"; DSPLYMNU_BRIGHTNESS = "Brightness"; DSPLYMNU_VSYNC = "Vertical Sync"; DSPLYMNU_CAPFPS = "Rendering Interpolation"; -DSPLYMNU_COLUMNMETHOD = "Column render mode"; DSPLYMNU_WIPETYPE = "Screen wipe style"; DSPLYMNU_SHOWENDOOM = "Show ENDOOM screen"; DSPLYMNU_BLOODFADE = "Blood Flash Intensity"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 06ad094d6d..47213a0f69 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -594,12 +594,6 @@ OptionMenu "JoystickConfigMenu" // //------------------------------------------------------------------------------------------- -OptionValue ColumnMethods -{ - 0.0, "$OPTVAL_ORIGINAL" - 1.0, "$OPTVAL_OPTIMIZED" -} - OptionValue SkyModes { 0.0, "$OPTVAL_NORMAL" @@ -684,7 +678,6 @@ OptionMenu "VideoOptions" Slider "$DSPLYMNU_BLOODFADE", "blood_fade_scalar", 0.0, 1.0, 0.05, 2 Slider "$DSPLYMNU_PICKUPFADE", "pickup_fade_scalar", 0.0, 1.0, 0.05, 2 Slider "$DSPLYMNU_WATERFADE", "underwater_fade_scalar", 0.0, 1.0, 0.05, 2 - Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods" StaticText " " Option "$DSPLYMNU_WIPETYPE", "wipetype", "Wipes" From b7460144b67a7dd335e81a4b70e6cf584ae68ff7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 Jan 2017 01:13:39 +0100 Subject: [PATCH 17/19] - fixed: Stairs_BuildUpDoomCrush wasn't in the special dispatcher list. --- src/p_lnspec.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 819ea372e2..0ce41e1264 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -3589,6 +3589,7 @@ static lnSpecFunc LineSpecials[] = /* 270 */ LS_Stairs_BuildDownDoom, /* 271 */ LS_Stairs_BuildUpDoomSync, /* 272 */ LS_Stairs_BuildDownDoomSync, + /* 273 */ LS_Stairs_BuildUpDoomCrush, }; From 98adc98e56e8b21adb93e7887073bcbda993db1f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 Jan 2017 01:23:08 +0100 Subject: [PATCH 18/19] - fixed the railgun's spiral duration was set incorrectly. --- src/p_effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 0181ba0b63..96295d6f53 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -763,7 +763,7 @@ void P_DrawRailTrail(AActor *source, TArray &portalhits, int color1, int spiralduration = (duration == 0) ? 35 : duration; p->alpha = 1.f; - p->ttl = duration; + p->ttl = spiralduration; p->fadestep = FADEFROMTTL(spiralduration); p->size = 3; p->bright = fullbright; From a1026ff03762bd30f0e5f5e076c7acdd46b819c3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 Jan 2017 01:24:16 +0100 Subject: [PATCH 19/19] This is 2.3.2. --- src/version.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/version.h b/src/version.h index 0b3e18f01b..2e0aeb3b88 100644 --- a/src/version.h +++ b/src/version.h @@ -41,12 +41,12 @@ const char *GetVersionString(); /** Lots of different version numbers **/ -#define VERSIONSTR "2.3.1" +#define VERSIONSTR "2.3.2" // The version as seen in the Windows resource -#define RC_FILEVERSION 2,3,1,0 -#define RC_PRODUCTVERSION 2,3,1,0 -#define RC_PRODUCTVERSION2 "2.3.1" +#define RC_FILEVERSION 2,3,2,0 +#define RC_PRODUCTVERSION 2,3,2,0 +#define RC_PRODUCTVERSION2 "2.3.2" // Version identifier for network games. // Bump it every time you do a release unless you're certain you