From 52992009db005cb513323eedefec47f7bfc525c1 Mon Sep 17 00:00:00 2001 From: Raf <> Date: Fri, 4 Apr 2025 01:49:15 +0800 Subject: [PATCH 1/6] port: no door option in multiplayer, moved the extra settings to a new sibling dialog --- src/game/mplayer/scenarios/capturethecase.inc | 39 ++------------ src/game/mplayer/scenarios/combat.inc | 38 ++----------- src/game/mplayer/scenarios/hackthatmac.inc | 38 ++----------- .../mplayer/scenarios/holdthebriefcase.inc | 38 ++----------- src/game/mplayer/scenarios/kingofthehill.inc | 38 ++----------- src/game/mplayer/scenarios/popacap.inc | 38 ++----------- src/game/mplayer/setup.c | 53 +++++++++++++++++++ src/game/setup.c | 43 +++++++++++++-- src/include/constants.h | 1 + 9 files changed, 113 insertions(+), 213 deletions(-) diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 79a205f80..4570d4a5b 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -11,6 +11,8 @@ * Players cannot score unless their briefcase is at the home base. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_CtcOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -60,40 +62,6 @@ struct menuitem g_CtcOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -143,7 +111,8 @@ struct menudialogdef g_CtcOptionsMenuDialog = { g_CtcOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, +// NULL, }; struct weaponobj g_CtcTokenObj0; diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 2f398579e..60f2393a7 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -6,6 +6,8 @@ * There are no callback functions or special logic. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_MpCombatOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -55,40 +57,6 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_SEPARATOR, 0, @@ -138,5 +106,5 @@ struct menudialogdef g_MpCombatOptionsMenuDialog = { g_MpCombatOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index ce182c1d1..637075a0b 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -7,6 +7,8 @@ * cannot use weapons while uplinking. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + #define HTM_NUM_TERMINALS 1 struct menuitem g_HtmOptionsMenuItems[] = { @@ -58,40 +60,6 @@ struct menuitem g_HtmOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -149,7 +117,7 @@ struct menudialogdef g_HtmOptionsMenuDialog = { g_HtmOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; struct weaponobj g_HtmUplinkObj; diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index f5ac62e40..0d45164ec 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -9,6 +9,8 @@ * slightly slower but still have full access to their weaponry. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_HtbOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -58,40 +60,6 @@ struct menuitem g_HtbOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -149,7 +117,7 @@ struct menudialogdef g_HtbOptionsMenuDialog = { g_HtbOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; struct defaultobj *var800869ec = NULL; diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 0160c7632..fbf8eb8ee 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -13,6 +13,8 @@ * Points are awarded to each player in the hill at the time that it is won. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + MenuItemHandlerResult menuhandlerMpHillTime(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { @@ -79,40 +81,6 @@ struct menuitem g_KohOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -178,7 +146,7 @@ struct menudialogdef g_KohOptionsMenuDialog = { g_KohOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; void kohReadSave(struct savebuffer *buffer) diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index 1e51adb64..2936a61af 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -7,6 +7,8 @@ * chosen as the victim. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_PacOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -56,40 +58,6 @@ struct menuitem g_PacOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -147,7 +115,7 @@ struct menudialogdef g_PacOptionsMenuDialog = { g_PacOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; void pacReset(void) diff --git a/src/game/mplayer/setup.c b/src/game/mplayer/setup.c index 962d05392..1362c9527 100644 --- a/src/game/mplayer/setup.c +++ b/src/game/mplayer/setup.c @@ -6118,3 +6118,56 @@ void func0f17fcb0(s32 silent) sndStart(var80095200, SFX_EXPLOSION_809A, NULL, -1, -1, -1, -1, -1); } } + +struct menuitem g_MpExtGameOptionsMenuItems[] = { + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Doors", + MPOPTION_NODOORS, + menuhandlerMpCheckboxOption, + }, + { MENUITEMTYPE_END }, +}; + +struct menudialogdef g_ExtGameOptionsMenuDialog = { + MENUDIALOGTYPE_DEFAULT, + (uintptr_t) "More Options\n", + g_MpExtGameOptionsMenuItems, + NULL, + MENUDIALOGFLAG_LITERAL_TEXT, + NULL, +}; diff --git a/src/game/setup.c b/src/game/setup.c index ece95f0e8..ac8b9c45a 100644 --- a/src/game/setup.c +++ b/src/game/setup.c @@ -1460,6 +1460,34 @@ void setupLoadFiles(s32 stagenum) g_Vars.maxprops = numobjs + numchrs + extra + 40; } +static void setupMarkLiftDoors() +{ + s32 index = 0; + + struct defaultobj *obj = (struct defaultobj *)g_StageSetup.props; + while (obj->type != OBJTYPE_END) { + if (obj->type == OBJTYPE_LIFT) { + struct liftobj *lift = (struct liftobj *)obj; + for (int i = 0; i < ARRAYCOUNT(lift->doors); i++) { + if (lift->doors[i]) { + s32 doorindex = index + *(s32*)&lift->doors[i]; + struct doorobj *door = (struct doorobj *)setupGetCmdByIndex(doorindex); + // we use this 'extra1' field here to mark the door, since its not used anywhere else + door->extra1 = 1; + + if (door->sibling) { + s32 siblingidx = *(s32 *) &door->sibling + doorindex; + struct doorobj *sibling = (struct doorobj *) setupGetCmdByIndex(siblingidx); + sibling->extra1 = 1; + } + } + } + } + obj = (struct defaultobj *) ((u32 *) obj + setupGetCmdLength((u32 *) obj)); + index++; + } +} + void setupCreateProps(s32 stagenum) { s32 withchrs = !argFindByPrefix(1, "-nochr") && !argFindByPrefix(1, "-noprop"); @@ -1532,6 +1560,10 @@ void setupCreateProps(s32 stagenum) botmgrRemoveAll(); index = 0; + if (g_MpSetup.options & MPOPTION_NODOORS) { + setupMarkLiftDoors(); + } + obj = (struct defaultobj *)g_StageSetup.props; while (obj->type != OBJTYPE_END) { @@ -1552,11 +1584,16 @@ void setupCreateProps(s32 stagenum) bodyAllocateChr(stagenum, (struct packedchr *) obj, index); } break; - case OBJTYPE_DOOR: - if (withobjs && (obj->flags2 & diffflag) == 0) { - setupCreateDoor((struct doorobj *)obj, index); + case OBJTYPE_DOOR: { + struct doorobj *door = (struct doorobj *) obj; + bool nodoors = (g_MpSetup.options & MPOPTION_NODOORS) != 0; + // dont skip doors that are locked or are lift doors + bool skipdoor = nodoors && g_Vars.normmplayerisrunning && door->keyflags == 0 && door->extra1 == 0; + if (!skipdoor && withobjs && (obj->flags2 & diffflag) == 0) { + setupCreateDoor((struct doorobj *) obj, index); } break; + } case OBJTYPE_DOORSCALE: { struct doorscaleobj *scale = (struct doorscaleobj *)obj; diff --git a/src/include/constants.h b/src/include/constants.h index 2ff7b0658..8cfe58c73 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2898,6 +2898,7 @@ #define MPOPTION_AUTORANDOMWEAPON_END 0x01000000 #define MPOPTION_FRIENDLYFIRE 0x02000000 #define MPOPTION_NOPLAYERONRADAR 0x04000000 +#define MPOPTION_NODOORS 0x08000000 #define MPPAUSEMODE_UNPAUSED 0 #define MPPAUSEMODE_PAUSED 1 From 0973f703011487a83d9249fa0e5700e73db8ad71 Mon Sep 17 00:00:00 2001 From: Raf Date: Wed, 28 May 2025 20:55:01 -0300 Subject: [PATCH 2/6] port-no-doors: reverted the menu changes --- src/game/mplayer/scenarios/capturethecase.inc | 39 ++++++++++++++-- src/game/mplayer/scenarios/combat.inc | 38 ++++++++++++++-- src/game/mplayer/scenarios/hackthatmac.inc | 38 ++++++++++++++-- .../mplayer/scenarios/holdthebriefcase.inc | 38 ++++++++++++++-- src/game/mplayer/scenarios/kingofthehill.inc | 45 ++++++++++++++++--- src/game/mplayer/scenarios/popacap.inc | 38 ++++++++++++++-- 6 files changed, 213 insertions(+), 23 deletions(-) diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 4570d4a5b..79a205f80 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -11,8 +11,6 @@ * Players cannot score unless their briefcase is at the home base. */ -extern struct menudialogdef g_ExtGameOptionsMenuDialog; - struct menuitem g_CtcOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -62,6 +60,40 @@ struct menuitem g_CtcOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -111,8 +143,7 @@ struct menudialogdef g_CtcOptionsMenuDialog = { g_CtcOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - &g_ExtGameOptionsMenuDialog, -// NULL, + NULL, }; struct weaponobj g_CtcTokenObj0; diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 60f2393a7..2f398579e 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -6,8 +6,6 @@ * There are no callback functions or special logic. */ -extern struct menudialogdef g_ExtGameOptionsMenuDialog; - struct menuitem g_MpCombatOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -57,6 +55,40 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_SEPARATOR, 0, @@ -106,5 +138,5 @@ struct menudialogdef g_MpCombatOptionsMenuDialog = { g_MpCombatOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - &g_ExtGameOptionsMenuDialog, + NULL, }; diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index 637075a0b..ce182c1d1 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -7,8 +7,6 @@ * cannot use weapons while uplinking. */ -extern struct menudialogdef g_ExtGameOptionsMenuDialog; - #define HTM_NUM_TERMINALS 1 struct menuitem g_HtmOptionsMenuItems[] = { @@ -60,6 +58,40 @@ struct menuitem g_HtmOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -117,7 +149,7 @@ struct menudialogdef g_HtmOptionsMenuDialog = { g_HtmOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - &g_ExtGameOptionsMenuDialog, + NULL, }; struct weaponobj g_HtmUplinkObj; diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index 0d45164ec..f5ac62e40 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -9,8 +9,6 @@ * slightly slower but still have full access to their weaponry. */ -extern struct menudialogdef g_ExtGameOptionsMenuDialog; - struct menuitem g_HtbOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -60,6 +58,40 @@ struct menuitem g_HtbOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -117,7 +149,7 @@ struct menudialogdef g_HtbOptionsMenuDialog = { g_HtbOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - &g_ExtGameOptionsMenuDialog, + NULL, }; struct defaultobj *var800869ec = NULL; diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 6c8f41aa6..0160c7632 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -13,8 +13,6 @@ * Points are awarded to each player in the hill at the time that it is won. */ -extern struct menudialogdef g_ExtGameOptionsMenuDialog; - MenuItemHandlerResult menuhandlerMpHillTime(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { @@ -81,6 +79,40 @@ struct menuitem g_KohOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -146,18 +178,17 @@ struct menudialogdef g_KohOptionsMenuDialog = { g_KohOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - &g_ExtGameOptionsMenuDialog, + NULL, }; -void kohReadSave(struct savebuffer *buffer, u8 version) +void kohReadSave(struct savebuffer *buffer) { - u8 sz = version > 0 ? 32 : 8; - g_Vars.mphilltime = savebufferReadBits(buffer, sz); + g_Vars.mphilltime = savebufferReadBits(buffer, 8); } void kohWriteSave(struct savebuffer *buffer) { - savebufferOr(buffer, g_Vars.mphilltime, 32); + savebufferOr(buffer, g_Vars.mphilltime, 8); } void kohInit(void) diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index 2936a61af..1e51adb64 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -7,8 +7,6 @@ * chosen as the victim. */ -extern struct menudialogdef g_ExtGameOptionsMenuDialog; - struct menuitem g_PacOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -58,6 +56,40 @@ struct menuitem g_PacOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, +#ifndef PLATFORM_N64 + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Start Armed", + MPOPTION_SPAWNWITHWEAPON, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Drug Blur", + MPOPTION_NODRUGBLUR, + menuhandlerMpCheckboxOption, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR, + L_OPTIONS_257, // "Friendly Fire" + MPOPTION_FRIENDLYFIRE, + menuhandlerMpDisplayTeam, + }, + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"No Player on Radar", + MPOPTION_NOPLAYERONRADAR, + menuhandlerMpCheckboxOption, + }, +#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -115,7 +147,7 @@ struct menudialogdef g_PacOptionsMenuDialog = { g_PacOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - &g_ExtGameOptionsMenuDialog, + NULL, }; void pacReset(void) From c866940873522a449fea37d178a481f0bd1d8872 Mon Sep 17 00:00:00 2001 From: Raf Date: Wed, 28 May 2025 20:56:26 -0300 Subject: [PATCH 3/6] port-no-doors: a couple code quality improvements --- src/game/setup.c | 2 +- src/include/constants.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/setup.c b/src/game/setup.c index ac8b9c45a..a9f2e25b6 100644 --- a/src/game/setup.c +++ b/src/game/setup.c @@ -1590,7 +1590,7 @@ void setupCreateProps(s32 stagenum) // dont skip doors that are locked or are lift doors bool skipdoor = nodoors && g_Vars.normmplayerisrunning && door->keyflags == 0 && door->extra1 == 0; if (!skipdoor && withobjs && (obj->flags2 & diffflag) == 0) { - setupCreateDoor((struct doorobj *) obj, index); + setupCreateDoor(door, index); } break; } diff --git a/src/include/constants.h b/src/include/constants.h index 5759a8eeb..df2201a6b 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2898,7 +2898,7 @@ #define MPOPTION_AUTORANDOMWEAPON_END 0x01000000 #define MPOPTION_FRIENDLYFIRE 0x02000000 #define MPOPTION_NOPLAYERONRADAR 0x04000000 -#define MPOPTION_NODOORS 0x08000000 +#define MPOPTION_NODOORS 0x08000000 #define MPPAUSEMODE_UNPAUSED 0 #define MPPAUSEMODE_PAUSED 1 From a70868fba05b520cffc72bfca013746b82b0723f Mon Sep 17 00:00:00 2001 From: Raf Date: Wed, 28 May 2025 20:59:36 -0300 Subject: [PATCH 4/6] port-no-doors: moved new MP options to a new menu --- src/game/mplayer/scenarios/capturethecase.inc | 39 ++-------------- src/game/mplayer/scenarios/combat.inc | 38 ++-------------- src/game/mplayer/scenarios/hackthatmac.inc | 38 ++-------------- .../mplayer/scenarios/holdthebriefcase.inc | 38 ++-------------- src/game/mplayer/scenarios/kingofthehill.inc | 45 +++---------------- src/game/mplayer/scenarios/popacap.inc | 38 ++-------------- 6 files changed, 23 insertions(+), 213 deletions(-) diff --git a/src/game/mplayer/scenarios/capturethecase.inc b/src/game/mplayer/scenarios/capturethecase.inc index 79a205f80..4570d4a5b 100644 --- a/src/game/mplayer/scenarios/capturethecase.inc +++ b/src/game/mplayer/scenarios/capturethecase.inc @@ -11,6 +11,8 @@ * Players cannot score unless their briefcase is at the home base. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_CtcOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -60,40 +62,6 @@ struct menuitem g_CtcOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -143,7 +111,8 @@ struct menudialogdef g_CtcOptionsMenuDialog = { g_CtcOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, +// NULL, }; struct weaponobj g_CtcTokenObj0; diff --git a/src/game/mplayer/scenarios/combat.inc b/src/game/mplayer/scenarios/combat.inc index 2f398579e..60f2393a7 100644 --- a/src/game/mplayer/scenarios/combat.inc +++ b/src/game/mplayer/scenarios/combat.inc @@ -6,6 +6,8 @@ * There are no callback functions or special logic. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_MpCombatOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -55,40 +57,6 @@ struct menuitem g_MpCombatOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_SEPARATOR, 0, @@ -138,5 +106,5 @@ struct menudialogdef g_MpCombatOptionsMenuDialog = { g_MpCombatOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; diff --git a/src/game/mplayer/scenarios/hackthatmac.inc b/src/game/mplayer/scenarios/hackthatmac.inc index ce182c1d1..637075a0b 100644 --- a/src/game/mplayer/scenarios/hackthatmac.inc +++ b/src/game/mplayer/scenarios/hackthatmac.inc @@ -7,6 +7,8 @@ * cannot use weapons while uplinking. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + #define HTM_NUM_TERMINALS 1 struct menuitem g_HtmOptionsMenuItems[] = { @@ -58,40 +60,6 @@ struct menuitem g_HtmOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -149,7 +117,7 @@ struct menudialogdef g_HtmOptionsMenuDialog = { g_HtmOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; struct weaponobj g_HtmUplinkObj; diff --git a/src/game/mplayer/scenarios/holdthebriefcase.inc b/src/game/mplayer/scenarios/holdthebriefcase.inc index f5ac62e40..0d45164ec 100644 --- a/src/game/mplayer/scenarios/holdthebriefcase.inc +++ b/src/game/mplayer/scenarios/holdthebriefcase.inc @@ -9,6 +9,8 @@ * slightly slower but still have full access to their weaponry. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_HtbOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -58,40 +60,6 @@ struct menuitem g_HtbOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -149,7 +117,7 @@ struct menudialogdef g_HtbOptionsMenuDialog = { g_HtbOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; struct defaultobj *var800869ec = NULL; diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 0160c7632..6c8f41aa6 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -13,6 +13,8 @@ * Points are awarded to each player in the hill at the time that it is won. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + MenuItemHandlerResult menuhandlerMpHillTime(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { @@ -79,40 +81,6 @@ struct menuitem g_KohOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -178,17 +146,18 @@ struct menudialogdef g_KohOptionsMenuDialog = { g_KohOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; -void kohReadSave(struct savebuffer *buffer) +void kohReadSave(struct savebuffer *buffer, u8 version) { - g_Vars.mphilltime = savebufferReadBits(buffer, 8); + u8 sz = version > 0 ? 32 : 8; + g_Vars.mphilltime = savebufferReadBits(buffer, sz); } void kohWriteSave(struct savebuffer *buffer) { - savebufferOr(buffer, g_Vars.mphilltime, 8); + savebufferOr(buffer, g_Vars.mphilltime, 32); } void kohInit(void) diff --git a/src/game/mplayer/scenarios/popacap.inc b/src/game/mplayer/scenarios/popacap.inc index 1e51adb64..2936a61af 100644 --- a/src/game/mplayer/scenarios/popacap.inc +++ b/src/game/mplayer/scenarios/popacap.inc @@ -7,6 +7,8 @@ * chosen as the victim. */ +extern struct menudialogdef g_ExtGameOptionsMenuDialog; + struct menuitem g_PacOptionsMenuItems[] = { { MENUITEMTYPE_CHECKBOX, @@ -56,40 +58,6 @@ struct menuitem g_PacOptionsMenuItems[] = { MPOPTION_NOAUTOAIM, menuhandlerMpCheckboxOption, }, -#ifndef PLATFORM_N64 - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"Start Armed", - MPOPTION_SPAWNWITHWEAPON, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Drug Blur", - MPOPTION_NODRUGBLUR, - menuhandlerMpCheckboxOption, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR, - L_OPTIONS_257, // "Friendly Fire" - MPOPTION_FRIENDLYFIRE, - menuhandlerMpDisplayTeam, - }, - { - MENUITEMTYPE_CHECKBOX, - 0, - MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT, - (uintptr_t)"No Player on Radar", - MPOPTION_NOPLAYERONRADAR, - menuhandlerMpCheckboxOption, - }, -#endif { MENUITEMTYPE_CHECKBOX, 0, @@ -147,7 +115,7 @@ struct menudialogdef g_PacOptionsMenuDialog = { g_PacOptionsMenuItems, mpOptionsMenuDialog, MENUDIALOGFLAG_MPLOCKABLE, - NULL, + &g_ExtGameOptionsMenuDialog, }; void pacReset(void) From 33aa74738636d8b3eff7251161a884c99dc9b785 Mon Sep 17 00:00:00 2001 From: Raf Date: Wed, 28 May 2025 21:00:16 -0300 Subject: [PATCH 5/6] port: enabled colors in the cmake build output --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 440e899e0..b65f9c77a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,6 +187,7 @@ add_compile_options( -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-variable + -fdiagnostics-color=always ) # C specific flags From 79a47809da1f2694d5164c442aaeccc4e453a309 Mon Sep 17 00:00:00 2001 From: Raf Date: Wed, 28 May 2025 21:08:17 -0300 Subject: [PATCH 6/6] port-no-doors: another code quality improvement --- src/game/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/setup.c b/src/game/setup.c index a9f2e25b6..568984461 100644 --- a/src/game/setup.c +++ b/src/game/setup.c @@ -1560,7 +1560,9 @@ void setupCreateProps(s32 stagenum) botmgrRemoveAll(); index = 0; - if (g_MpSetup.options & MPOPTION_NODOORS) { + bool nodoors = (g_MpSetup.options & MPOPTION_NODOORS) != 0; + + if (nodoors) { setupMarkLiftDoors(); } @@ -1586,7 +1588,6 @@ void setupCreateProps(s32 stagenum) break; case OBJTYPE_DOOR: { struct doorobj *door = (struct doorobj *) obj; - bool nodoors = (g_MpSetup.options & MPOPTION_NODOORS) != 0; // dont skip doors that are locked or are lift doors bool skipdoor = nodoors && g_Vars.normmplayerisrunning && door->keyflags == 0 && door->extra1 == 0; if (!skipdoor && withobjs && (obj->flags2 & diffflag) == 0) {