From 3f48ecd479ac03b0d1a663f0c89ffd87cc5ed51c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 22 Oct 2019 02:15:24 +0200 Subject: [PATCH] - 5 more Blood exclusive CVARs. --- source/blood/src/config.cpp | 11 +--------- source/blood/src/config.h | 5 ----- source/blood/src/controls.cpp | 2 +- source/blood/src/menu.cpp | 40 +++++++++++++++++------------------ source/blood/src/view.cpp | 16 +++++++------- source/common/gamecvars.cpp | 27 +++++++++-------------- source/common/gamecvars.h | 6 ++++++ 7 files changed, 46 insertions(+), 61 deletions(-) diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 0506cd575..e52e4fd16 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -83,20 +83,15 @@ int32_t gDetail; int32_t gMouseAim; int32_t gWeaponSwitch; int32_t gAutoRun; -int32_t gViewInterpolate; -int32_t gViewHBobbing; -int32_t gViewVBobbing; int32_t gFollowMap; int32_t gOverlayMap; int32_t gRotateMap; -int32_t gSlopeTilting; int32_t gMessageState; int32_t gMessageCount; int32_t gMessageTime; int32_t gMessageFont; int32_t gbAdultContent; char gzAdultPassword[9]; -int32_t gShowWeapon; int32_t gMouseSensitivity; int32_t gMouseAiming; int32_t gMouseAimingFlipped; @@ -350,19 +345,15 @@ void CONFIG_SetDefaults(void) gTurnSpeed = 92; gDetail = 4; gAutoRun = 0; - gViewInterpolate = 1; - gViewHBobbing = 1; - gViewVBobbing = 1; gFollowMap = 1; gOverlayMap = 0; gRotateMap = 0; - gSlopeTilting = 0; + gMessageState = 1; gMessageCount = 4; gMessageTime = 5; gMessageFont = 0; gbAdultContent = 0; - gShowWeapon = 0; gzAdultPassword[0] = 0; gMouseAimingFlipped = 0; diff --git a/source/blood/src/config.h b/source/blood/src/config.h index ab2fdff85..81539ba37 100644 --- a/source/blood/src/config.h +++ b/source/blood/src/config.h @@ -64,20 +64,15 @@ extern int32_t gTurnSpeed; extern int32_t gDetail; extern int32_t gWeaponSwitch; extern int32_t gAutoRun; -extern int32_t gViewInterpolate; -extern int32_t gViewHBobbing; -extern int32_t gViewVBobbing; extern int32_t gFollowMap; extern int32_t gOverlayMap; extern int32_t gRotateMap; -extern int32_t gSlopeTilting; extern int32_t gMessageState; extern int32_t gMessageCount; extern int32_t gMessageTime; extern int32_t gMessageFont; extern int32_t gbAdultContent; extern char gzAdultPassword[9]; -extern int32_t gShowWeapon; extern int32_t gMouseSensitivity; extern int32_t gMouseAiming; extern int32_t gMouseAimingFlipped; diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index 309cf7b51..fda0041d3 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -295,7 +295,7 @@ void ctrlGetInput(void) if (BUTTON(gamefunc_Show_Opponents_Weapon)) { CONTROL_ClearButton(gamefunc_Show_Opponents_Weapon); - gShowWeapon = !gShowWeapon; + cl_showweapon = !cl_showweapon; } if (BUTTON(gamefunc_Jump)) diff --git a/source/blood/src/menu.cpp b/source/blood/src/menu.cpp index 8b6f6d528..f806f6998 100644 --- a/source/blood/src/menu.cpp +++ b/source/blood/src/menu.cpp @@ -228,10 +228,10 @@ CGameMenuItemSlider sliderSound("SOUND:", 3, 66, 80, 180, snd_fxvolume, 0, 256, CGameMenuItemSlider sliderCDAudio("CD AUDIO:", 3, 66, 90, 180, CDVolume, 0, 256, 48, SetCDVol, -1, -1); CGameMenuItemZBool bool3DAudio("3D AUDIO:", 3, 66, 100, 180, snd_doppler, SetDoppler, NULL, NULL); CGameMenuItemZBool boolCrosshair("CROSSHAIR:", 3, 66, 110, 180, cl_crosshair, SetCrosshair, NULL, NULL); -CGameMenuItemZBool boolShowWeapons("SHOW WEAPONS:", 3, 66, 120, 180, gShowWeapon, SetShowWeapons, NULL, NULL); -CGameMenuItemZBool boolSlopeTilting("SLOPE TILTING:", 3, 66, 130, 180, gSlopeTilting, SetSlopeTilting, NULL, NULL); -CGameMenuItemZBool boolViewBobbing("VIEW BOBBING:", 3, 66, 140, 180, gViewVBobbing, SetViewBobbing, NULL, NULL); -CGameMenuItemZBool boolViewSwaying("VIEW SWAYING:", 3, 66, 150, 180, gViewHBobbing, SetViewSwaying, NULL, NULL); +CGameMenuItemZBool boolShowWeapons("SHOW WEAPONS:", 3, 66, 120, 180, cl_showweapon, SetShowWeapons, NULL, NULL); +CGameMenuItemZBool boolSlopeTilting("SLOPE TILTING:", 3, 66, 130, 180, cl_slopetilting, SetSlopeTilting, NULL, NULL); +CGameMenuItemZBool boolViewBobbing("VIEW BOBBING:", 3, 66, 140, 180, cl_viewvbob, SetViewBobbing, NULL, NULL); +CGameMenuItemZBool boolViewSwaying("VIEW SWAYING:", 3, 66, 150, 180, cl_viewhbob, SetViewSwaying, NULL, NULL); CGameMenuItem7EE34 itemOption2("VIDEO MODE...", 3, 0, 160, 320, 1); CGameMenuItemChain itemChainParentalLock("PARENTAL LOCK", 3, 0, 170, 320, 1, &menuParentalLock, -1, NULL, 0); @@ -403,10 +403,10 @@ CGameMenuItemTitle itemOptionsGameTitle("GAME SETUP", 1, 160, 20, 2038); CGameMenuItemZBool itemOptionsGameBoolWeaponsV10X("V1.0x WEAPONS BALANCE:", 3, 66, 130, 180, gWeaponsV10x, SetWeaponsV10X, NULL, NULL); /////////////////// -CGameMenuItemZBool itemOptionsGameBoolShowWeapons("SHOW WEAPONS:", 3, 66, 70, 180, gShowWeapon, SetShowWeapons, NULL, NULL); -CGameMenuItemZBool itemOptionsGameBoolSlopeTilting("SLOPE TILTING:", 3, 66, 80, 180, gSlopeTilting, SetSlopeTilting, NULL, NULL); -CGameMenuItemZBool itemOptionsGameBoolViewBobbing("VIEW BOBBING:", 3, 66, 90, 180, gViewVBobbing, SetViewBobbing, NULL, NULL); -CGameMenuItemZBool itemOptionsGameBoolViewSwaying("VIEW SWAYING:", 3, 66, 100, 180, gViewHBobbing, SetViewSwaying, NULL, NULL); +CGameMenuItemZBool itemOptionsGameBoolShowWeapons("SHOW WEAPONS:", 3, 66, 70, 180, cl_showweapon, SetShowWeapons, NULL, NULL); +CGameMenuItemZBool itemOptionsGameBoolSlopeTilting("SLOPE TILTING:", 3, 66, 80, 180, cl_slopetilting, SetSlopeTilting, NULL, NULL); +CGameMenuItemZBool itemOptionsGameBoolViewBobbing("VIEW BOBBING:", 3, 66, 90, 180, cl_viewvbob, SetViewBobbing, NULL, NULL); +CGameMenuItemZBool itemOptionsGameBoolViewSwaying("VIEW SWAYING:", 3, 66, 100, 180, cl_viewhbob, SetViewSwaying, NULL, NULL); CGameMenuItemZCycle itemOptionsGameBoolAutoAim("AUTO AIM:", 3, 66, 110, 180, 0, SetAutoAim, pzAutoAimStrings, ARRAY_SSIZE(pzAutoAimStrings), 0); CGameMenuItemZCycle itemOptionsGameWeaponSwitch("EQUIP PICKUPS:", 3, 66, 120, 180, 0, SetWeaponSwitch, pzWeaponSwitchStrings, ARRAY_SSIZE(pzWeaponSwitchStrings), 0); CGameMenuItemChain itemOptionsGameChainParentalLock("PARENTAL LOCK", 3, 0, 120, 320, 1, &menuParentalLock, -1, NULL, 0); @@ -752,10 +752,10 @@ void SetupOptionsOldMenu(void) sliderSound.nValue = ClipRange(snd_fxvolume, sliderSound.nRangeLow, sliderSound.nRangeHigh); bool3DAudio.at20 = snd_doppler; boolCrosshair.at20 = cl_crosshair; - boolShowWeapons.at20 = gShowWeapon; - boolSlopeTilting.at20 = gSlopeTilting; - boolViewBobbing.at20 = gViewVBobbing; - boolViewSwaying.at20 = gViewHBobbing; + boolShowWeapons.at20 = cl_showweapon; + boolSlopeTilting.at20 = cl_slopetilting; + boolViewBobbing.at20 = cl_viewvbob; + boolViewSwaying.at20 = cl_viewhbob; boolMessages.at20 = gGameMessageMgr.state; menuOptionsOld.Add(&itemOptionsTitle, false); menuOptionsOld.Add(&itemOption1, true); @@ -1118,10 +1118,10 @@ void SetupOptionsMenu(void) //menuOptionsGame.Add(&itemOptionsGameChainParentalLock, false); menuOptionsGame.Add(&itemBloodQAV, false); - itemOptionsGameBoolShowWeapons.at20 = gShowWeapon; - itemOptionsGameBoolSlopeTilting.at20 = gSlopeTilting; - itemOptionsGameBoolViewBobbing.at20 = gViewVBobbing; - itemOptionsGameBoolViewSwaying.at20 = gViewHBobbing; + itemOptionsGameBoolShowWeapons.at20 = cl_showweapon; + itemOptionsGameBoolSlopeTilting.at20 = cl_slopetilting; + itemOptionsGameBoolViewBobbing.at20 = cl_viewvbob; + itemOptionsGameBoolViewSwaying.at20 = cl_viewhbob; itemOptionsGameBoolAutoAim.m_nFocus = cl_autoaim; itemOptionsGameWeaponSwitch.m_nFocus = (gWeaponSwitch&1) ? ((gWeaponSwitch&2) ? 1 : 2) : 0; @@ -1401,22 +1401,22 @@ void SetWeaponsV10X(CGameMenuItemZBool* pItem) void SetShowWeapons(CGameMenuItemZBool *pItem) { - gShowWeapon = pItem->at20; + cl_showweapon = pItem->at20; } void SetSlopeTilting(CGameMenuItemZBool *pItem) { - gSlopeTilting = pItem->at20; + cl_slopetilting = pItem->at20; } void SetViewBobbing(CGameMenuItemZBool *pItem) { - gViewVBobbing = pItem->at20; + cl_viewvbob = pItem->at20; } void SetViewSwaying(CGameMenuItemZBool *pItem) { - gViewHBobbing = pItem->at20; + cl_viewhbob = pItem->at20; } void SetDetail(CGameMenuItemSlider *pItem) diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index ebc678dbe..303933b8c 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -2208,7 +2208,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t } int nSprite = pTSprite->owner; - if (gViewInterpolate && TestBitString(gInterpolateSprite, nSprite) && !(pTSprite->flags&512)) + if (cl_interpolate && TestBitString(gInterpolateSprite, nSprite) && !(pTSprite->flags&512)) { LOCATION *pPrevLoc = &gPrevSpriteLoc[nSprite]; pTSprite->x = interpolate(pPrevLoc->x, pTSprite->x, gInterpolate); @@ -2514,7 +2514,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t viewAddEffect(nTSprite, VIEW_EFFECT_13); } - if (gShowWeapon && gGameOptions.nGameType > 0 && gView) { + if (cl_showweapon && gGameOptions.nGameType > 0 && gView) { viewAddEffect(nTSprite, VIEW_EFFECT_12); } @@ -3062,7 +3062,7 @@ void viewDrawScreen(void) { gInterpolate = ClipRange(gInterpolate, 0, 65536); } - if (gViewInterpolate) + if (cl_interpolate) { CalcInterpolations(); } @@ -3093,7 +3093,7 @@ void viewDrawScreen(void) int v4c = gView->at53; int v48 = gView->at4f; int nSectnum = gView->pSprite->sectnum; - if (gViewInterpolate) + if (cl_interpolate) { if (numplayers > 1 && gView == gMe && gPrediction && gMe->pXSprite->health > 0) { @@ -3137,16 +3137,16 @@ void viewDrawScreen(void) q16horiz += fix16_from_int(mulscale30(0x40000000-Cos(gView->at35e<<2), 30)); if (gViewPos == 0) { - if (gViewHBobbing) + if (cl_viewhbob) { cX -= mulscale30(v74, Sin(fix16_to_int(cA)))>>4; cY += mulscale30(v74, Cos(fix16_to_int(cA)))>>4; } - if (gViewVBobbing) + if (cl_viewvbob) { cZ += v8c; } - if (gSlopeTilting) + if (cl_slopetilting) { q16horiz += q16slopehoriz; } @@ -3581,7 +3581,7 @@ RORHACK: { viewDrawText(0, errMsg, 160, 20, 0, 0, 1, 0); } - if (gViewInterpolate) + if (cl_interpolate) { RestoreInterpolations(); } diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index 5ccc1debe..dfa0cbb35 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -22,9 +22,17 @@ CVARD(Bool, cl_obituaries, true, CVAR_ARCHIVE, "enable/disable multiplayer death CVARD(Bool, cl_democams, true, CVAR_ARCHIVE, "enable/disable demo playback cameras") // Not implemented for Blood CVARD(Bool, cl_idplayers, true, CVAR_ARCHIVE, "enable/disable name display when aiming at opponents") // Not implemented for Blood CVARD(Bool, cl_showcoords, false, 0, "show your position in the game world") // This is a debug oprion in its current form, not implemented in Blood -CVARD(Bool, cl_viewbob, true, CVAR_ARCHIVE, "enable/disable player head bobbing") // Not implemented for Blood CVARD(Bool, cl_weaponsway, true, CVAR_ARCHIVE, "enable/disable player weapon swaying") // Not implemented for Blood +// Todo: Consolidate these to be consistent across games? +CVARD(Bool, cl_viewbob, true, CVAR_ARCHIVE, "enable/disable player head bobbing") // Not implemented for Blood +CVARD(Bool, cl_viewhbob, true, CVAR_ARCHIVE, "enable/disable view horizontal bobbing") // Only implemented in Blood +CVARD(Bool, cl_viewvbob, true, CVAR_ARCHIVE, "enable/disable view vertical bobbing") // Only implemented in Blood + +CVARD(Bool, cl_interpolate, true, CVAR_ARCHIVE, "enable/disable view interpolation") // only implemented in Blood +CVARD(Bool, cl_slopetilting, false, CVAR_ARCHIVE, "enable/disable slope tilting") // only implemented in Blood +CVARD(Bool, cl_showweapon, true, CVAR_ARCHIVE, "enable/disable show weapons") // only implemented in Blood + CUSTOM_CVARD(Int, cl_autoaim, 1, CVAR_ARCHIVE, "enable/disable weapon autoaim") { if (self < 0 || self > (playing_blood? 2 : 3)) self = 1; // The Shadow Warrior backend only has a bool for this. @@ -169,9 +177,6 @@ CUSTOM_CVARD(Int, mus_volume, 255, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "controls mus { "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 }, - { "vid_gamma","adjusts gamma component of gamma ramp",(void *)&g_videoGamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_contrast","adjusts contrast component of gamma ramp",(void *)&g_videoContrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_brightness","adjusts brightness component of gamma ramp",(void *)&g_videoBrightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, { "wchoice","sets weapon autoselection order", (void *)ud.wchoice, CVAR_STRING|CVAR_FUNCPTR, 0, MAX_WEAPONS }, }; @@ -253,10 +258,7 @@ CUSTOM_CVARD(Int, mus_volume, 255, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "controls mus { "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 }, - { "vid_gamma","adjusts gamma component of gamma ramp",(void *)&g_videoGamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_contrast","adjusts contrast component of gamma ramp",(void *)&g_videoContrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_brightness","adjusts brightness component of gamma ramp",(void *)&g_videoBrightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "wchoice","sets weapon autoselection order", (void *)ud.wchoice, CVAR_STRING|CVAR_FUNCPTR, 0, MAX_WEAPONS }, + { "wchoice","sets weapon autoselection order", (void *)ud.wchoice, CVAR_STRING|CVAR_FUNCPTR, 0, MAX_WEAPONS }, }; osdcmd_cheatsinfo_stat.cheatnum = -1; @@ -282,11 +284,6 @@ int32_t registerosdcommands(void) char buffer[256]; static osdcvardata_t cvars_game[] = { - { "cl_interpolate", "enable/disable view interpolation", (void *)&gViewInterpolate, CVAR_BOOL, 0, 1 }, - { "cl_viewhbob", "enable/disable view horizontal bobbing", (void *)&gViewHBobbing, CVAR_BOOL, 0, 1 }, - { "cl_viewvbob", "enable/disable view vertical bobbing", (void *)&gViewVBobbing, CVAR_BOOL, 0, 1 }, - { "cl_slopetilting", "enable/disable slope tilting", (void *)&gSlopeTilting, CVAR_BOOL, 0, 1 }, - { "cl_showweapon", "enable/disable show weapons", (void *)&gShowWeapon, CVAR_BOOL, 0, 1 }, { "cl_weaponswitch", "enable/disable auto weapon switching", (void *)&gWeaponSwitch, CVAR_INT|CVAR_MULTI, 0, 3 }, // @@ -347,10 +344,6 @@ int32_t registerosdcommands(void) // // { "skill","changes the game skill setting", (void *)&ud.m_player_skill, CVAR_INT|CVAR_FUNCPTR|CVAR_NOSAVE/*|CVAR_NOMULTI*/, 0, 5 }, // - - { "vid_gamma","adjusts gamma component of gamma ramp",(void *)&g_videoGamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_contrast","adjusts contrast component of gamma ramp",(void *)&g_videoContrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, - { "vid_brightness","adjusts brightness component of gamma ramp",(void *)&g_videoBrightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 }, // { "wchoice","sets weapon autoselection order", (void *)ud.wchoice, CVAR_STRING|CVAR_FUNCPTR, 0, MAX_WEAPONS }, }; // diff --git a/source/common/gamecvars.h b/source/common/gamecvars.h index 5b5310bf2..fa168bb10 100644 --- a/source/common/gamecvars.h +++ b/source/common/gamecvars.h @@ -16,6 +16,12 @@ EXTERN_CVAR(Bool, cl_idplayers) EXTERN_CVAR(Bool, cl_showcoords) EXTERN_CVAR(Bool, cl_viewbob) EXTERN_CVAR(Bool, cl_weaponsway) +EXTERN_CVAR(Bool, cl_viewhbob) +EXTERN_CVAR(Bool, cl_viewvbob) +EXTERN_CVAR(Bool, cl_interpolate) +EXTERN_CVAR(Bool, cl_slopetilting) +EXTERN_CVAR(Bool, cl_showweapon) + EXTERN_CVAR(Bool, demorec_diffcompress_cvar) EXTERN_CVAR(Bool, demorec_synccompress_cvar) EXTERN_CVAR(Bool, demorec_seeds_cvar)