From 1ab9d154812a7c74127c34cc6047b4db76f2c4fc Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Wed, 11 Nov 2015 07:04:04 -0800 Subject: [PATCH 1/7] Make CheckActor*Texture also consider swimmable 3D floors An actor standing within a swimmable floor whose ceiling texture is X and on a solid floor whose texture is Y will now be reported as standing on both. --- src/p_acs.cpp | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 931f3a1277..bd594dd520 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4140,16 +4140,26 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b if (floor) { + fixed_t z = actor->z; // Looking through planes from top to bottom for (i = 0; i < numff; ++i) { F3DFloor *ff = sec->e->XFloor.ffloors[i]; + if (!(ff->flags & FF_EXISTS)) + continue; - if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) && - actor->Z() >= ff->top.plane->ZatPoint(actor)) - { // This floor is beneath our feet. + if (ff->flags & FF_SOLID && + secpic.isNull() && + z >= ff->top.plane->ZatPoint(actor->X(), actor->Y())) + { // This is the highest solid floor beneath our feet secpic = *ff->top.texture; - break; + } + else if (ff->flags & FF_SWIMMABLE && + tex == TexMan[*ff->top.texture] && + z <= ff->top.plane->ZatPoint(actor->x, actor->y) && + z >= ff->bottom.plane->ZatPoint(actor->x, actor->y)) + { // Having your feet within a liquid count as being "on" it + return true; } } if (i == numff) @@ -4165,11 +4175,21 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b { F3DFloor *ff = sec->e->XFloor.ffloors[i]; - if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) && - z <= ff->bottom.plane->ZatPoint(actor)) - { // This floor is above our eyes. - secpic = *ff->bottom.texture; - break; + if (!(ff->flags & FF_EXISTS)) + continue; + + if (ff->flags & FF_SOLID && + secpic.isNull() && + z <= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) + { // This is the lowest solid ceiling above our eyes + secpic = *ff->top.texture; + } + else if (ff->flags & FF_SWIMMABLE && + tex == TexMan[*ff->bottom.texture] && + z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) && + z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) + { // Having your eyes within a liquid count as being "under" it + return true; } } if (i < 0) From c08d865b1bdf7fbec184661a3ba34946c73e4819 Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Tue, 17 Nov 2015 15:01:58 -0800 Subject: [PATCH 2/7] Extend CheckActor*Texture to look at any non-solid floor Upon deep and personal reflection, I realize this is more consistent with the TERRAIN change I made. --- src/p_acs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index bd594dd520..2c3c4e1e30 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4154,7 +4154,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b { // This is the highest solid floor beneath our feet secpic = *ff->top.texture; } - else if (ff->flags & FF_SWIMMABLE && + else if (!(ff->flags & FF_SOLID) && tex == TexMan[*ff->top.texture] && z <= ff->top.plane->ZatPoint(actor->x, actor->y) && z >= ff->bottom.plane->ZatPoint(actor->x, actor->y)) @@ -4184,7 +4184,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b { // This is the lowest solid ceiling above our eyes secpic = *ff->top.texture; } - else if (ff->flags & FF_SWIMMABLE && + else if (!(ff->flags & FF_SOLID) && tex == TexMan[*ff->bottom.texture] && z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) && z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) From 85a82bc6e8243a8f0e83a951f45f1f249736fce1 Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Thu, 21 Jan 2016 16:45:58 -0800 Subject: [PATCH 3/7] Fix minor typo in comments --- src/p_acs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 2c3c4e1e30..8725303a0a 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4158,7 +4158,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b tex == TexMan[*ff->top.texture] && z <= ff->top.plane->ZatPoint(actor->x, actor->y) && z >= ff->bottom.plane->ZatPoint(actor->x, actor->y)) - { // Having your feet within a liquid count as being "on" it + { // Having your feet within a liquid counts as being "on" it return true; } } @@ -4188,7 +4188,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b tex == TexMan[*ff->bottom.texture] && z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) && z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) - { // Having your eyes within a liquid count as being "under" it + { // Having your eyes within a liquid counts as being "under" it return true; } } From 3e28b195ce38affb93e20c496bb58bb788d1b6f7 Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Thu, 21 Jan 2016 16:54:49 -0800 Subject: [PATCH 4/7] Fix a couple old uses of actor->x and friends --- src/p_acs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 8725303a0a..35116f7e6c 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4140,7 +4140,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b if (floor) { - fixed_t z = actor->z; + fixed_t z = actor->Z(); // Looking through planes from top to bottom for (i = 0; i < numff; ++i) { @@ -4156,8 +4156,8 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b } else if (!(ff->flags & FF_SOLID) && tex == TexMan[*ff->top.texture] && - z <= ff->top.plane->ZatPoint(actor->x, actor->y) && - z >= ff->bottom.plane->ZatPoint(actor->x, actor->y)) + z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) && + z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) { // Having your feet within a liquid counts as being "on" it return true; } From 24f6f1297ae9e66c6cdc3886601d6de97c2f619a Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Fri, 22 Jan 2016 16:38:29 -0800 Subject: [PATCH 5/7] Use ZatPoint(actor) --- src/p_acs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 35116f7e6c..f3931283a8 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4150,14 +4150,14 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b if (ff->flags & FF_SOLID && secpic.isNull() && - z >= ff->top.plane->ZatPoint(actor->X(), actor->Y())) + z >= ff->top.plane->ZatPoint(actor)) { // This is the highest solid floor beneath our feet secpic = *ff->top.texture; } else if (!(ff->flags & FF_SOLID) && tex == TexMan[*ff->top.texture] && - z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) && - z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) + z <= ff->top.plane->ZatPoint(actor) && + z >= ff->bottom.plane->ZatPoint(actor)) { // Having your feet within a liquid counts as being "on" it return true; } @@ -4180,14 +4180,14 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b if (ff->flags & FF_SOLID && secpic.isNull() && - z <= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) + z <= ff->bottom.plane->ZatPoint(actor)) { // This is the lowest solid ceiling above our eyes secpic = *ff->top.texture; } else if (!(ff->flags & FF_SOLID) && tex == TexMan[*ff->bottom.texture] && - z <= ff->top.plane->ZatPoint(actor->X(), actor->Y()) && - z >= ff->bottom.plane->ZatPoint(actor->X(), actor->Y())) + z <= ff->top.plane->ZatPoint(actor) && + z >= ff->bottom.plane->ZatPoint(actor)) { // Having your eyes within a liquid counts as being "under" it return true; } From 66f053f131262a319211a631ab4837a0b78c6455 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 2 Feb 2016 15:02:06 +0100 Subject: [PATCH 6/7] - on second thought: this shouldn't explode the speakers with too high values. --- src/sound/music_dumb.cpp | 6 +++++- wadsrc/static/menudef.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sound/music_dumb.cpp b/src/sound/music_dumb.cpp index 1e9b6d6fc7..5dc1001084 100644 --- a/src/sound/music_dumb.cpp +++ b/src/sound/music_dumb.cpp @@ -129,7 +129,11 @@ CVAR(Bool, mod_autochip, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR(Int, mod_autochip_size_force, 100, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR(Int, mod_autochip_size_scan, 500, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); CVAR(Int, mod_autochip_scan_threshold, 12, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); -CVAR(Float, mod_dumb_mastervolume, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); +CUSTOM_CVAR(Float, mod_dumb_mastervolume, 1.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +{ + if (self < 0.5f) self = 0.5f; + else if (self > 16.f) self = 16.f; +} // PRIVATE DATA DEFINITIONS ------------------------------------------------ diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 9bce780778..e3b71f6d07 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1651,7 +1651,7 @@ OptionMenu ModReplayerOptions Title "MODULE REPLAYER OPTIONS" Option "Replayer engine", "mod_dumb", "ModReplayers" StaticText " " - Slider "Master Volume", "mod_dumb_mastervolume", 1, 32, 1, 1 + Slider "Master Volume", "mod_dumb_mastervolume", 1, 16, 0.5, 1 Option "Sample rate", "mod_samplerate", "SampleRates", "mod_dumb" Option "Quality", "mod_interp", "ModQuality", "mod_dumb" Option "Volume ramping", "mod_volramp", "ModVolumeRamps", "mod_dumb" From f6b64430c3024f4f8d0177201ce284e10737d0b1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 3 Feb 2016 11:36:34 +0100 Subject: [PATCH 7/7] Revert "Merge tag 'a'" This reverts commit 37578f85b3c04cb0c6bb26069a80187698daffde, reversing changes made to 66f053f131262a319211a631ab4837a0b78c6455. After thoroughly checking the submission I had to conclude that it does more things wrong than right so better leave it out. --- src/p_acs.cpp | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index c7d409ff35..9737f8aa97 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4183,26 +4183,16 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b if (floor) { - fixed_t z = actor->Z(); // Looking through planes from top to bottom for (i = 0; i < numff; ++i) { F3DFloor *ff = sec->e->XFloor.ffloors[i]; - if (!(ff->flags & FF_EXISTS)) - continue; - if (ff->flags & FF_SOLID && - secpic.isNull() && - z >= ff->top.plane->ZatPoint(actor)) - { // This is the highest solid floor beneath our feet + if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) && + actor->Z() >= ff->top.plane->ZatPoint(actor)) + { // This floor is beneath our feet. secpic = *ff->top.texture; - } - else if (!(ff->flags & FF_SOLID) && - tex == TexMan[*ff->top.texture] && - z <= ff->top.plane->ZatPoint(actor) && - z >= ff->bottom.plane->ZatPoint(actor)) - { // Having your feet within a liquid counts as being "on" it - return true; + break; } } if (i == numff) @@ -4218,21 +4208,11 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b { F3DFloor *ff = sec->e->XFloor.ffloors[i]; - if (!(ff->flags & FF_EXISTS)) - continue; - - if (ff->flags & FF_SOLID && - secpic.isNull() && + if ((ff->flags & (FF_EXISTS | FF_SOLID)) == (FF_EXISTS | FF_SOLID) && z <= ff->bottom.plane->ZatPoint(actor)) - { // This is the lowest solid ceiling above our eyes - secpic = *ff->top.texture; - } - else if (!(ff->flags & FF_SOLID) && - tex == TexMan[*ff->bottom.texture] && - z <= ff->top.plane->ZatPoint(actor) && - z >= ff->bottom.plane->ZatPoint(actor)) - { // Having your eyes within a liquid counts as being "under" it - return true; + { // This floor is above our eyes. + secpic = *ff->bottom.texture; + break; } } if (i < 0)