From 5b1d03cbbb25e3ebf3d84e53a90d64914148be1c Mon Sep 17 00:00:00 2001 From: Not actually throwaway <98854201+throwaway29292@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:44:00 +0200 Subject: [PATCH 1/2] Add an option in Combat Simulator to disable the blur effect from melee damage This effect might be annoyning or eye straining for some people so i believe it's a good idea to implement this option. There is still some free space in the MP Options bitfield for future expansion. --- src/game/lv.c | 7 +++++++ src/game/mplayer/scenarios/capturethecase.inc | 8 ++++++++ src/game/mplayer/scenarios/combat.inc | 8 ++++++++ src/game/mplayer/scenarios/hackthatmac.inc | 8 ++++++++ src/game/mplayer/scenarios/holdthebriefcase.inc | 8 ++++++++ src/game/mplayer/scenarios/kingofthehill.inc | 8 ++++++++ src/game/mplayer/scenarios/popacap.inc | 8 ++++++++ src/include/constants.h | 1 + 8 files changed, 56 insertions(+) diff --git a/src/game/lv.c b/src/game/lv.c index 1c746b77d..1762b2af2 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -1127,6 +1127,13 @@ Gfx *lvRender(Gfx *gdl) chr->blurdrugamount = 0; chr->blurnumtimesdied = 0; } +#ifndef PLATFORM_N64 //set the drug blur to 0 if it's disabled in MP settings. There might be a better way to block it from occuring, but this one works just fine + + if(g_Vars.mplayerisrunning && (g_MpSetup.options & MPOPTION_NODRUGBLUR)) + { + bluramount = 0; + } +#endif } } diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 0e82d542a..2addfbfde 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -69,6 +69,14 @@ struct menuitem g_CtcOptionsMenuItems[] = { MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No melee/tranquilizer blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, #endif { MENUITEMTYPE_CHECKBOX, diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 7d096a55c..76da12a16 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -64,6 +64,14 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No melee/tranquilizer blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, #endif { MENUITEMTYPE_SEPARATOR, diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index 1ca58458a..bc55d75b8 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -67,6 +67,14 @@ struct menuitem g_HtmOptionsMenuItems[] = { MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No melee/tranquilizer blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, #endif { MENUITEMTYPE_CHECKBOX, diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index fe9cc0bd6..a0692c5e9 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -67,6 +67,14 @@ struct menuitem g_HtbOptionsMenuItems[] = { MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No melee/tranquilizer blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, #endif { MENUITEMTYPE_CHECKBOX, diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 120024f19..2d7857580 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -88,6 +88,14 @@ struct menuitem g_KohOptionsMenuItems[] = { MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No melee/tranquilizer blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, #endif { MENUITEMTYPE_CHECKBOX, diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index 7da8ed521..faea5dd70 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -65,6 +65,14 @@ struct menuitem g_PacOptionsMenuItems[] = { MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No melee/tranquilizer blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, #endif { MENUITEMTYPE_CHECKBOX, diff --git a/src/include/constants.h b/src/include/constants.h index e51ec894a..e42e8f93a 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2890,6 +2890,7 @@ #define MPOPTION_PAC_HIGHLIGHTTARGET 0x00080000 #define MPOPTION_PAC_SHOWONRADAR 0x00100000 #define MPOPTION_SPAWNWITHWEAPON 0x00200000 +#define MPOPTION_NODRUGBLUR 0x00400000 #define MPPAUSEMODE_UNPAUSED 0 #define MPPAUSEMODE_PAUSED 1 From 70b02da1633653a3bd4c7f287827302aeb481494 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 14 May 2024 11:12:49 +0200 Subject: [PATCH 2/2] port: fix long option names and whitespace --- src/game/lv.c | 8 ++++---- src/game/mplayer/scenarios/capturethecase.inc | 4 ++-- src/game/mplayer/scenarios/combat.inc | 4 ++-- src/game/mplayer/scenarios/hackthatmac.inc | 4 ++-- src/game/mplayer/scenarios/holdthebriefcase.inc | 4 ++-- src/game/mplayer/scenarios/kingofthehill.inc | 4 ++-- src/game/mplayer/scenarios/popacap.inc | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/game/lv.c b/src/game/lv.c index e4b066709..c3273c6c6 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -1127,10 +1127,10 @@ Gfx *lvRender(Gfx *gdl) chr->blurdrugamount = 0; chr->blurnumtimesdied = 0; } -#ifndef PLATFORM_N64 //set the drug blur to 0 if it's disabled in MP settings. There might be a better way to block it from occuring, but this one works just fine - - if(g_Vars.mplayerisrunning && (g_MpSetup.options & MPOPTION_NODRUGBLUR)) - { + +#ifndef PLATFORM_N64 + // reset the drug blur to 0 if it's disabled in MP settings + if (g_Vars.mplayerisrunning && (g_MpSetup.options & MPOPTION_NODRUGBLUR)) { bluramount = 0; } #endif diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 2addfbfde..529fd2916 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -65,7 +65,7 @@ struct menuitem g_CtcOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Weapon", + (uintptr_t)"Spawn With Gun", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, @@ -73,7 +73,7 @@ struct menuitem g_CtcOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No melee/tranquilizer blur", + (uintptr_t)"No Drug Blur", MPOPTION_NODRUGBLUR, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 76da12a16..9e58b6b65 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -60,7 +60,7 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Weapon", + (uintptr_t)"Spawn With Gun", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, @@ -68,7 +68,7 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No melee/tranquilizer blur", + (uintptr_t)"No Drug Blur", MPOPTION_NODRUGBLUR, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index bc55d75b8..a158bf9d5 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -63,7 +63,7 @@ struct menuitem g_HtmOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Weapon", + (uintptr_t)"Spawn With Gun", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, @@ -71,7 +71,7 @@ struct menuitem g_HtmOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No melee/tranquilizer blur", + (uintptr_t)"No Drug Blur", MPOPTION_NODRUGBLUR, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index a0692c5e9..39f98a728 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -63,7 +63,7 @@ struct menuitem g_HtbOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Weapon", + (uintptr_t)"Spawn With Gun", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, @@ -71,7 +71,7 @@ struct menuitem g_HtbOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No melee/tranquilizer blur", + (uintptr_t)"No Drug Blur", MPOPTION_NODRUGBLUR, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 2d7857580..2a4d5c7aa 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -84,7 +84,7 @@ struct menuitem g_KohOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Weapon", + (uintptr_t)"Spawn With Gun", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, @@ -92,7 +92,7 @@ struct menuitem g_KohOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No melee/tranquilizer blur", + (uintptr_t)"No Drug Blur", MPOPTION_NODRUGBLUR, menuhandlerMpCheckboxOption, }, diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index faea5dd70..26221b569 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -61,7 +61,7 @@ struct menuitem g_PacOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Spawn With Weapon", + (uintptr_t)"Spawn With Gun", MPOPTION_SPAWNWITHWEAPON, menuhandlerMpCheckboxOption, }, @@ -69,7 +69,7 @@ struct menuitem g_PacOptionsMenuItems[] = { MENUITEMTYPE_CHECKBOX, 0, MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No melee/tranquilizer blur", + (uintptr_t)"No Drug Blur", MPOPTION_NODRUGBLUR, menuhandlerMpCheckboxOption, },