From 555845222d19482b6b3c38c6f8874195d4c00f90 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 26 May 2020 10:02:16 +0300 Subject: [PATCH 1/5] - fixed fullscreen toggle via shortcut --- src/g_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index d5662767c5a..7cdebeee85e 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1102,7 +1102,7 @@ void G_Ticker () if (ToggleFullscreen) { ToggleFullscreen = false; - AddCommandString ("toggle fullscreen"); + AddCommandString ("toggle vid_fullscreen"); } // do things to change the game state From 2a063c96da97b8f5eeed517fecf5d6ba15fed73d Mon Sep 17 00:00:00 2001 From: Alexander Kromm Date: Wed, 27 May 2020 00:02:34 +0700 Subject: [PATCH 2/5] more descriptive message for server CVAR change attempt in netgame Rationale: while the previous description contains the name of a CVAR, it doesn't specify that it's a CVAR. Unsuspecting user may be not aware that the engine or a mod contains such a CVAR. --- src/d_netinfo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 00ad7e62cec..9cd0302b22a 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -629,7 +629,7 @@ bool D_SendServerInfoChange (FBaseCVar *cvar, UCVarValue value, ECVarType type) { if (netgame && !players[consoleplayer].settings_controller) { - Printf("Only setting controllers can change %s\n", cvar->GetName()); + Printf("Only setting controllers can change server CVAR %s\n", cvar->GetName()); cvar->MarkSafe(); return true; } @@ -659,7 +659,10 @@ bool D_SendServerFlagChange (FBaseCVar *cvar, int bitnum, bool set, bool silent) { if (netgame && !players[consoleplayer].settings_controller) { - if (!silent) Printf("Only setting controllers can change %s\n", cvar->GetName()); + if (!silent) + { + Printf("Only setting controllers can change server CVAR %s\n", cvar->GetName()); + } return true; } From 332dfa4d6fb33fb9cd106c3d1d274d14887b5724 Mon Sep 17 00:00:00 2001 From: drfrag Date: Wed, 27 May 2020 18:41:34 +0200 Subject: [PATCH 3/5] - Remove wrong GL includes. --- src/common/platform/win32/win32basevideo.cpp | 5 ----- src/rendering/hwrenderer/hw_entrypoint.cpp | 1 - 2 files changed, 6 deletions(-) diff --git a/src/common/platform/win32/win32basevideo.cpp b/src/common/platform/win32/win32basevideo.cpp index fe2ba3b9a37..de149ae9b5b 100644 --- a/src/common/platform/win32/win32basevideo.cpp +++ b/src/common/platform/win32/win32basevideo.cpp @@ -33,10 +33,7 @@ */ #include -#include -#include "wglext.h" -#include "gl_sysfb.h" #include "hardware.h" #include "x86.h" #include "templates.h" @@ -52,8 +49,6 @@ #include "win32basevideo.h" #include "cmdlib.h" -#include "gl_framebuffer.h" - CVAR(Int, vid_adapter, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) //========================================================================== diff --git a/src/rendering/hwrenderer/hw_entrypoint.cpp b/src/rendering/hwrenderer/hw_entrypoint.cpp index e1ad075a375..c11e3d7d5c9 100644 --- a/src/rendering/hwrenderer/hw_entrypoint.cpp +++ b/src/rendering/hwrenderer/hw_entrypoint.cpp @@ -25,7 +25,6 @@ ** */ -#include "gl_system.h" #include "gi.h" #include "a_dynlight.h" #include "m_png.h" From 8c539539dfa23837f99ffc1dce4425807933c4f0 Mon Sep 17 00:00:00 2001 From: drfrag Date: Fri, 29 May 2020 13:01:34 +0200 Subject: [PATCH 4/5] - Fixed crash on maps with out of range sidedef and sector numbers, adapted from PRBoom. --- src/maploader/maploader.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index 23424555694..961159590c7 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -1702,13 +1702,6 @@ void MapLoader::LoadLineDefs (MapData * map) } else { - // patch missing first sides instead of crashing out. - // Visual glitches are better than not being able to play. - if (LittleShort(mld->sidenum[0]) == NO_INDEX) - { - Printf("Line %d has no first side.\n", i); - mld->sidenum[0] = 0; - } sidecount++; if (LittleShort(mld->sidenum[1]) != NO_INDEX) sidecount++; @@ -1747,6 +1740,22 @@ void MapLoader::LoadLineDefs (MapData * map) ProcessEDLinedef(ld, mld->tag); } #endif + // cph 2006/09/30 - fix sidedef errors right away. + for (int j=0; j < 2; j++) + { + if (LittleShort(mld->sidenum[j]) != NO_INDEX && mld->sidenum[j] >= Level->sides.Size()) + { + mld->sidenum[j] = 0; // dummy sidedef + Printf("Linedef %d has a bad sidedef\n", i); + } + } + // patch missing first sides instead of crashing out. + // Visual glitches are better than not being able to play. + if (LittleShort(mld->sidenum[0]) == NO_INDEX) + { + Printf("Line %d has no first side.\n", i); + mld->sidenum[0] = 0; + } ld->v1 = &Level->vertexes[LittleShort(mld->v1)]; ld->v2 = &Level->vertexes[LittleShort(mld->v2)]; @@ -2180,11 +2189,11 @@ void MapLoader::LoadSideDefs2 (MapData *map, FMissingTextureTracker &missingtex) // killough 4/4/98: allow sidedef texture names to be overloaded // killough 4/11/98: refined to allow colormaps to work as wall // textures if invalid as colormaps but valid as textures. - + // cph 2006/09/30 - catch out-of-range sector numbers; use sector 0 instead if ((unsigned)LittleShort(msd->sector)>=Level->sectors.Size()) { Printf (PRINT_HIGH, "Sidedef %d has a bad sector\n", i); - sd->sector = sec = nullptr; + sd->sector = sec = &Level->sectors[0]; } else { From 80c5b4d37b86cd7f8e64c25a0201b5bec0b7bc5e Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 18 Jan 2020 01:45:42 +0100 Subject: [PATCH 5/5] Add a cvar to control weapon bobbing while firing This simulates a feature found in Crispy Doom, which keeps the weapon bobbing while firing. This leads to a "smoother" appearance which may look a bit prettier to some people. The default value of 0 preserves the old behavior. --- src/common/engine/namedef.h | 1 + src/d_netinfo.cpp | 2 ++ src/playsim/d_player.h | 4 ++++ src/playsim/p_user.cpp | 6 ++++++ wadsrc/static/menudef.txt | 1 + wadsrc/static/zscript/actors/player/player.zs | 21 ++++++++++--------- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/common/engine/namedef.h b/src/common/engine/namedef.h index 7d7cff000ef..9e20b35c237 100644 --- a/src/common/engine/namedef.h +++ b/src/common/engine/namedef.h @@ -810,6 +810,7 @@ xx(MoveBob) xx(StillBob) xx(ClassicFlight) xx(WBobSpeed) +xx(WBobFire) xx(PlayerClass) xx(MonsterClass) xx(MorphedMonster) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 9cd0302b22a..f2fb30bee70 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -65,6 +65,7 @@ CVAR (Bool, neverswitchonpickup, false, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, movebob, 0.25f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, stillbob, 0.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, wbobspeed, 1.f, CVAR_USERINFO | CVAR_ARCHIVE); +CVAR (Float, wbobfire, 0.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (String, playerclass, "Fighter", CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Bool, classicflight, false, CVAR_USERINFO | CVAR_ARCHIVE); @@ -80,6 +81,7 @@ enum INFO_MoveBob, INFO_StillBob, INFO_WBobSpeed, + INFO_WBobFire, INFO_PlayerClass, INFO_ColorSet, INFO_ClassicFlight, diff --git a/src/playsim/d_player.h b/src/playsim/d_player.h index 95ab1b89337..20f2d2f3b95 100644 --- a/src/playsim/d_player.h +++ b/src/playsim/d_player.h @@ -232,6 +232,10 @@ struct userinfo_t : TMap { return *static_cast(*CheckKey(NAME_WBobSpeed)); } + double GetWBobFire() const + { + return *static_cast(*CheckKey(NAME_WBobFire)); + } int GetPlayerClassNum() const { return *static_cast(*CheckKey(NAME_PlayerClass)); diff --git a/src/playsim/p_user.cpp b/src/playsim/p_user.cpp index f4a4e344d16..539a259112c 100644 --- a/src/playsim/p_user.cpp +++ b/src/playsim/p_user.cpp @@ -790,6 +790,12 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, GetWBobSpeed) ACTION_RETURN_FLOAT(self->userinfo.GetWBobSpeed()); } +DEFINE_ACTION_FUNCTION(_PlayerInfo, GetWBobFire) +{ + PARAM_SELF_STRUCT_PROLOGUE(player_t); + ACTION_RETURN_FLOAT(self->userinfo.GetWBobFire()); +} + DEFINE_ACTION_FUNCTION(_PlayerInfo, GetMoveBob) { PARAM_SELF_STRUCT_PROLOGUE(player_t); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 3de49f9404a..ce03c396ac3 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1046,6 +1046,7 @@ OptionMenu "HUDOptions" protected Slider "$DSPLYMNU_MOVEBOB", "movebob", 0, 1.0, 0.05, 2 Slider "$DSPLYMNU_STILLBOB", "stillbob", 0, 1.0, 0.05, 2 Slider "$DSPLYMNU_BOBSPEED", "wbobspeed", 0, 2.0, 0.1 + Slider "$DSPLYMNU_BOBFIRE", "wbobfire", 0, 1.0, 0.1 StaticText " " Slider "$DSPLYMNU_MENUDIM", "dimamount", 0, 1.0, 0.05, 2 ColorPicker "$DSPLYMNU_DIMCOLOR", "dimcolor" diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index 3a57277393c..d47b0918269 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -2301,8 +2301,6 @@ class PlayerPawn : Actor Vector2 p1, p2, r; Vector2 result; - float bobtarget; - let player = self.player; if (!player) return (0, 0); let weapon = player.ReadyWeapon; @@ -2326,17 +2324,16 @@ class PlayerPawn : Actor // [RH] Smooth transitions between bobbing and not-bobbing frames. // This also fixes the bug where you can "stick" a weapon off-center by // shooting it when it's at the peak of its swing. - bobtarget = double((player.WeaponState & WF_WEAPONBOBBING) ? player.bob : 0.); - if (curbob != bobtarget) + if (curbob != player.bob) { - if (abs(bobtarget - curbob) <= 1) + if (abs(player.bob - curbob) <= 1) { - curbob = bobtarget; + curbob = player.bob; } else { - double zoom = MAX(1., abs(curbob - bobtarget) / 40); - if (curbob > bobtarget) + double zoom = MAX(1., abs(curbob - player.bob) / 40); + if (curbob > player.bob) { curbob -= zoom; } @@ -2347,11 +2344,14 @@ class PlayerPawn : Actor } } + // The weapon bobbing intensity while firing can be adjusted by the player. + double BobIntensity = (player.WeaponState & WF_WEAPONBOBBING) ? 1. : player.GetWBobFire(); + if (curbob != 0) { //[SP] Added in decorate player.viewbob checks - double bobx = (player.bob * Rangex * ViewBob); - double boby = (player.bob * Rangey * ViewBob); + double bobx = (player.bob * BobIntensity * Rangex * ViewBob); + double boby = (player.bob * BobIntensity * Rangey * ViewBob); switch (bobstyle) { case Bob_Normal: @@ -2710,6 +2710,7 @@ struct PlayerInfo native play // self is what internally is known as player_t native float GetAutoaim() const; native bool GetNoAutostartMap() const; native double GetWBobSpeed() const; + native double GetWBobFire() const; native double GetMoveBob() const; native double GetStillBob() const; native void SetFOV(float fov);