mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 16:22:41 +02:00
Merge branch 'port-net' into add-crosshair-size-option
This commit is contained in:
31 files changed
+616
-169
No files matched your search
+12
-2
@@ -112,6 +112,10 @@ static void bgunProcessInputAltButton(struct movedata *data, s8 contpad, s32 i)
|
||||
static inline void bmoveProcessRemoteInput(const bool allowc1buttons)
|
||||
{
|
||||
struct player *pl = g_Vars.currentplayer;
|
||||
if (!pl->client) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct netplayermove *inmove = &pl->client->inmove[0];
|
||||
struct netplayermove *inmoveprev = &pl->client->inmove[1];
|
||||
s32 moveticks = inmove->tick - inmoveprev->tick;
|
||||
@@ -899,14 +903,17 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
||||
const f32 mlookscale = g_Vars.lvupdate240 ? (4.f / (f32)g_Vars.lvupdate240) : 4.f;
|
||||
const bool allowmlook = (g_Vars.currentplayernum == 0) && (allowc1x || allowc1y);
|
||||
bool allowmcross = false;
|
||||
#endif
|
||||
|
||||
if (g_Vars.currentplayer->isremote) {
|
||||
controlmode = optionsGetControlMode(g_Vars.currentplayerstats->mpindex);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_Vars.currentplayer->isremote || controlmode == CONTROLMODE_NA) {
|
||||
bmoveProcessRemoteInput(allowc1buttons);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
controlmode = optionsGetControlMode(g_Vars.currentplayerstats->mpindex);
|
||||
weaponnum = bgunGetWeaponNum(HAND_RIGHT);
|
||||
canmanualzoom = weaponHasAimFlag(weaponnum, INVAIMFLAG_MANUALZOOM);
|
||||
contpad1 = optionsGetContpadNum1(g_Vars.currentplayerstats->mpindex);
|
||||
@@ -1421,6 +1428,9 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
||||
aimoffhist[i] = !aimonhist[i];
|
||||
}
|
||||
|
||||
#ifdef AVOID_UB
|
||||
if (numsamples)
|
||||
#endif
|
||||
g_Vars.currentplayer->insightaimmode = aimonhist[numsamples - 1];
|
||||
}
|
||||
|
||||
|
||||
@@ -265,8 +265,10 @@ void challengePerformSanityChecks(void)
|
||||
g_Vars.mphilltime = 10;
|
||||
}
|
||||
} else if (!challengeIsFeatureUnlocked(MPFEATURE_8BOTS)) {
|
||||
// Limit to 4 players and 4 simulants
|
||||
#if MAX_PLAYERS > 4
|
||||
// Limit to 4 players and 4 simulants in local games
|
||||
#ifndef PLATFORM_N64
|
||||
g_MpSetup.chrslots &= (g_NetMode ? 0x0fff : 0x0f0f);
|
||||
#elif MAX_PLAYERS > 4
|
||||
g_MpSetup.chrslots &= 0x0f0f;
|
||||
#else
|
||||
g_MpSetup.chrslots &= 0x00ff;
|
||||
|
||||
@@ -2592,6 +2592,16 @@ MenuItemHandlerResult filemgrChooseAgentListMenuHandler(s32 operation, struct me
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_FileAutoSelect >= 0 && g_FileLists[0] && g_FileLists[0]->numfiles > 0) {
|
||||
const u32 tmp = data->list.value;
|
||||
data->list.value = g_FileAutoSelect;
|
||||
g_FileAutoSelect = -1;
|
||||
filemgrChooseAgentListMenuHandler(MENUOP_SET, item, data);
|
||||
data->list.value = tmp;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MENUOP_GETOPTIONCOUNT:
|
||||
data->list.value = g_FileLists[0]->numfiles + 1;
|
||||
|
||||
@@ -398,9 +398,11 @@ u16 weaponGetFileNum(s32 weaponnum)
|
||||
}
|
||||
|
||||
if (weapon) {
|
||||
#ifdef PLATFORM_N64
|
||||
if (PLAYERCOUNT() >= 2) {
|
||||
return weapon->lo_model;
|
||||
}
|
||||
#endif
|
||||
|
||||
return weapon->hi_model;
|
||||
}
|
||||
|
||||
+2
-2
@@ -349,7 +349,7 @@ void lvReset(s32 stagenum)
|
||||
}
|
||||
|
||||
if (g_Vars.mplayerisrunning == false) {
|
||||
g_Vars.playerstats[0].mpindex = 4;
|
||||
g_Vars.playerstats[0].mpindex = MAX_PLAYERS;
|
||||
g_PlayerConfigsArray[MAX_PLAYERS].contpad1 = 0;
|
||||
g_PlayerConfigsArray[MAX_PLAYERS].contpad2 = 1;
|
||||
}
|
||||
@@ -1700,7 +1700,7 @@ Gfx *lvRender(Gfx *gdl)
|
||||
artifactsTick();
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if ((g_NetMode && i) || i > MAX_LOCAL_PLAYERS) {
|
||||
if ((g_NetMode && i) || i >= MAX_LOCAL_PLAYERS) {
|
||||
gdl = savedgdl;
|
||||
}
|
||||
#endif
|
||||
|
||||
+71
-56
@@ -45,6 +45,10 @@ struct menudialogdef g_CinemaMenuDialog;
|
||||
#ifndef PLATFORM_N64
|
||||
extern struct menudialogdef g_ExtendedMenuDialog;
|
||||
extern struct menudialogdef g_NetMenuDialog;
|
||||
extern MenuItemHandlerResult menuhandlerJoinGame(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
extern MenuItemHandlerResult menuhandlerJoinStart(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
extern MenuItemHandlerResult menuhandlerHostGame(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
extern MenuItemHandlerResult menuhandlerHostStart(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
#endif
|
||||
|
||||
char *menuTextCurrentStageName(struct menuitem *item)
|
||||
@@ -2686,7 +2690,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_205, // "Sight on Screen"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerSightOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -2694,7 +2698,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_206, // "Always Show Target"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAlwaysShowTarget,
|
||||
},
|
||||
{
|
||||
@@ -2702,7 +2706,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_207, // "Show Zoom Range"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowZoomRange,
|
||||
},
|
||||
{
|
||||
@@ -2710,7 +2714,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_208, // "Ammo on Screen"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAmmoOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -2718,7 +2722,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_209, // "Show Gun Function"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowGunFunction,
|
||||
},
|
||||
{
|
||||
@@ -2726,7 +2730,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_210, // "Paintball"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerPaintball,
|
||||
},
|
||||
{
|
||||
@@ -2734,7 +2738,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_169, // "In-Game Subtitles"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerInGameSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -2742,7 +2746,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_168, // "Cutscene Subtitles"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerCutsceneSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -2750,7 +2754,7 @@ struct menuitem g_MissionDisplayOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_212, // "Show Mission Time"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowMissionTime,
|
||||
},
|
||||
{
|
||||
@@ -2787,7 +2791,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_145, // "Sight on Screen"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerSightOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -2795,7 +2799,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_146, // "Target"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAlwaysShowTarget,
|
||||
},
|
||||
{
|
||||
@@ -2803,7 +2807,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_147, // "Zoom Range"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowZoomRange,
|
||||
},
|
||||
{
|
||||
@@ -2811,7 +2815,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_148, // "Show Ammo"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAmmoOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -2819,7 +2823,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_149, // "Gun Function"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowGunFunction,
|
||||
},
|
||||
{
|
||||
@@ -2827,7 +2831,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_150, // "Paintball"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerPaintball,
|
||||
},
|
||||
{
|
||||
@@ -2839,7 +2843,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
#else
|
||||
L_MPWEAPONS_169, // "In-Game Subtitles"
|
||||
#endif
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerInGameSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -2851,7 +2855,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
#else
|
||||
L_MPWEAPONS_168, // "Cutscene Subtitles"
|
||||
#endif
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerCutsceneSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -2859,7 +2863,7 @@ struct menuitem g_2PMissionDisplayOptionsVMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_152, // "Mission Time"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowMissionTime,
|
||||
},
|
||||
{
|
||||
@@ -2896,7 +2900,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_205, // "Sight on Screen"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerSightOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -2904,7 +2908,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_206, // "Always Show Target"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAlwaysShowTarget,
|
||||
},
|
||||
{
|
||||
@@ -2912,7 +2916,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_207, // "Show Zoom Range"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowZoomRange,
|
||||
},
|
||||
{
|
||||
@@ -2920,7 +2924,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_208, // "Ammo on Screen"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAmmoOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -2928,7 +2932,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_209, // "Show Gun Function"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowGunFunction,
|
||||
},
|
||||
{
|
||||
@@ -2936,7 +2940,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_210, // "Paintball"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerPaintball,
|
||||
},
|
||||
{
|
||||
@@ -2944,7 +2948,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_169, // "In-Game Subtitles"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerInGameSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -2952,7 +2956,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_168, // "Cutscene Subtitles"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerCutsceneSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -2960,7 +2964,7 @@ struct menuitem g_CiDisplayMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_212, // "Show Mission Time"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerShowMissionTime,
|
||||
},
|
||||
{
|
||||
@@ -2999,7 +3003,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_205, // "Sight on Screen"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerSightOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -3007,7 +3011,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_206, // "Always Show Target"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerAlwaysShowTarget,
|
||||
},
|
||||
{
|
||||
@@ -3015,7 +3019,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_207, // "Show Zoom Range"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerShowZoomRange,
|
||||
},
|
||||
{
|
||||
@@ -3023,7 +3027,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_208, // "Ammo on Screen"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerAmmoOnScreen,
|
||||
},
|
||||
{
|
||||
@@ -3031,7 +3035,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_209, // "Show Gun Function"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerShowGunFunction,
|
||||
},
|
||||
{
|
||||
@@ -3039,7 +3043,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_210, // "Paintball"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerPaintball,
|
||||
},
|
||||
{
|
||||
@@ -3047,7 +3051,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_169, // "In-Game Subtitles"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerInGameSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -3055,7 +3059,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_168, // "Cutscene Subtitles"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerCutsceneSubtitles,
|
||||
},
|
||||
{
|
||||
@@ -3063,7 +3067,7 @@ struct menuitem g_CiDisplayPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_212, // "Show Mission Time"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerShowMissionTime,
|
||||
},
|
||||
{
|
||||
@@ -3108,7 +3112,7 @@ struct menuitem g_MissionControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_195, // "Reverse Pitch"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerReversePitch,
|
||||
},
|
||||
{
|
||||
@@ -3116,7 +3120,7 @@ struct menuitem g_MissionControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_196, // "Look Ahead"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerLookAhead,
|
||||
},
|
||||
{
|
||||
@@ -3124,7 +3128,7 @@ struct menuitem g_MissionControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_197, // "Head Roll"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerHeadRoll,
|
||||
},
|
||||
{
|
||||
@@ -3132,7 +3136,7 @@ struct menuitem g_MissionControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_198, // "Auto-Aim"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAutoAim,
|
||||
},
|
||||
{
|
||||
@@ -3140,7 +3144,7 @@ struct menuitem g_MissionControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_199, // "Aim Control"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAimControl,
|
||||
},
|
||||
{
|
||||
@@ -3186,7 +3190,7 @@ struct menuitem g_CiControlOptionsMenuItems2[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_271, // ""
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerReversePitch,
|
||||
},
|
||||
{
|
||||
@@ -3194,7 +3198,7 @@ struct menuitem g_CiControlOptionsMenuItems2[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_272, // ""
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerLookAhead,
|
||||
},
|
||||
{
|
||||
@@ -3202,7 +3206,7 @@ struct menuitem g_CiControlOptionsMenuItems2[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_273, // ""
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerHeadRoll,
|
||||
},
|
||||
{
|
||||
@@ -3210,7 +3214,7 @@ struct menuitem g_CiControlOptionsMenuItems2[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_274, // ""
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAutoAim,
|
||||
},
|
||||
{
|
||||
@@ -3218,7 +3222,7 @@ struct menuitem g_CiControlOptionsMenuItems2[] = {
|
||||
0,
|
||||
0,
|
||||
L_MPWEAPONS_275, // ""
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAimControl,
|
||||
},
|
||||
{
|
||||
@@ -3264,7 +3268,7 @@ struct menuitem g_CiControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_195, // "Reverse Pitch"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerReversePitch,
|
||||
},
|
||||
{
|
||||
@@ -3272,7 +3276,7 @@ struct menuitem g_CiControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_196, // "Look Ahead"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerLookAhead,
|
||||
},
|
||||
{
|
||||
@@ -3280,7 +3284,7 @@ struct menuitem g_CiControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_197, // "Head Roll"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerHeadRoll,
|
||||
},
|
||||
{
|
||||
@@ -3288,7 +3292,7 @@ struct menuitem g_CiControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_198, // "Auto-Aim"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAutoAim,
|
||||
},
|
||||
{
|
||||
@@ -3296,7 +3300,7 @@ struct menuitem g_CiControlOptionsMenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_199, // "Aim Control"
|
||||
0x00000004,
|
||||
MAX_PLAYERS,
|
||||
menuhandlerAimControl,
|
||||
},
|
||||
{
|
||||
@@ -3341,7 +3345,7 @@ struct menuitem g_CiControlPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_195, // "Reverse Pitch"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerReversePitch,
|
||||
},
|
||||
{
|
||||
@@ -3349,7 +3353,7 @@ struct menuitem g_CiControlPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_196, // "Look Ahead"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerLookAhead,
|
||||
},
|
||||
{
|
||||
@@ -3357,7 +3361,7 @@ struct menuitem g_CiControlPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_197, // "Head Roll"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerHeadRoll,
|
||||
},
|
||||
{
|
||||
@@ -3365,7 +3369,7 @@ struct menuitem g_CiControlPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_198, // "Auto-Aim"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerAutoAim,
|
||||
},
|
||||
{
|
||||
@@ -3373,7 +3377,7 @@ struct menuitem g_CiControlPlayer2MenuItems[] = {
|
||||
0,
|
||||
0,
|
||||
L_OPTIONS_199, // "Aim Control"
|
||||
0x00000005,
|
||||
MAX_PLAYERS + 1,
|
||||
menuhandlerAimControl,
|
||||
},
|
||||
{
|
||||
@@ -4881,6 +4885,17 @@ MenuDialogHandlerResult menudialogMainMenu(s32 operation, struct menudialogdef *
|
||||
g_MissionConfig.iscoop = false;
|
||||
g_MissionConfig.isanti = false;
|
||||
}
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_NetJoinLatch) {
|
||||
menuhandlerJoinGame(MENUOP_SET, NULL, NULL);
|
||||
menuhandlerJoinStart(MENUOP_SET, NULL, NULL);
|
||||
g_NetJoinLatch = false;
|
||||
} else if (g_NetHostLatch) {
|
||||
menuhandlerHostGame(MENUOP_SET, NULL, NULL);
|
||||
menuhandlerHostStart(MENUOP_SET, NULL, NULL);
|
||||
g_NetHostLatch = false;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -5379,7 +5379,7 @@ Gfx *menuRender(Gfx *gdl)
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_NetMode) {
|
||||
if (g_NetMode == NETMODE_SERVER) {
|
||||
sprintf(text, "Server: %d/%d", g_NetNumClients, g_NetMaxClients);
|
||||
sprintf(text, "Server: %d/%d %04x", g_NetNumClients, g_NetMaxClients, g_MpSetup.chrslots);
|
||||
} else {
|
||||
sprintf(text, "Client: ID %u", g_NetLocalClient->id);
|
||||
}
|
||||
|
||||
@@ -321,6 +321,18 @@ void menuTick(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_NetMode == NETMODE_SERVER && g_MenuData.unk008 == -1) {
|
||||
s32 slot = 1;
|
||||
for (i = 1; i < g_NetMaxClients; ++i) {
|
||||
if (g_NetClients[i].state >= CLSTATE_LOBBY) {
|
||||
g_MpSetup.chrslots |= (1 << slot);
|
||||
++slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mpCalculateLockIfLastWinnerOrLoser();
|
||||
challengePerformSanityChecks();
|
||||
}
|
||||
|
||||
@@ -192,9 +192,11 @@ void mpStartMatch(void)
|
||||
if (g_NetMode == NETMODE_SERVER) {
|
||||
g_MpSetup.chrslots &= 0xff00;
|
||||
g_MpSetup.chrslots |= 1;
|
||||
s32 slot = 1;
|
||||
for (s32 i = 1; i < g_NetMaxClients; ++i) {
|
||||
if (g_NetClients[i].state >= CLSTATE_LOBBY) {
|
||||
g_MpSetup.chrslots |= (1 << i);
|
||||
g_MpSetup.chrslots |= (1 << slot);
|
||||
++slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3001,13 +3003,6 @@ struct mpchrconfig *mpGetChrConfigBySlotNum(s32 slot)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
// ignore chrslots while setting up a netgame
|
||||
if (!result && g_NetMode && slot < g_NetMaxClients && g_NetClients[slot].state >= CLSTATE_LOBBY) {
|
||||
result = &g_PlayerConfigsArray[slot].base;
|
||||
}
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3323,7 +3318,7 @@ s32 func0f18d074(s32 index)
|
||||
|
||||
for (i = 0; i < MAX_BOTS; i++) {
|
||||
if (&g_BotConfigsArray[i].base == g_MpAllChrConfigPtrs[index]) {
|
||||
return i + 4;
|
||||
return i + MAX_PLAYERS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "data.h"
|
||||
#include "gbiex.h"
|
||||
#include "types.h"
|
||||
#ifndef PLATFORM_N64
|
||||
#include "net/net.h"
|
||||
#endif
|
||||
|
||||
struct menuitem g_MpCharacterMenuItems[];
|
||||
struct menudialogdef g_MpAddSimulantMenuDialog;
|
||||
@@ -2297,6 +2300,15 @@ MenuItemHandlerResult menuhandlerMpHandicapPlayer(s32 operation, struct menuitem
|
||||
char *mpMenuTextHandicapPlayerName(struct menuitem *item)
|
||||
{
|
||||
if (g_MpSetup.chrslots & (1 << item->param)) {
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_NetMode) {
|
||||
// use client names directly, as the config names are not set yet
|
||||
struct netclient *cl = netClientForPlayerNum(item->param);
|
||||
if (cl) {
|
||||
return cl->settings.name;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return g_PlayerConfigsArray[item->param].base.name;
|
||||
}
|
||||
|
||||
@@ -2598,6 +2610,40 @@ struct menuitem g_MpHandicapsMenuItems[] = {
|
||||
0x000000ff,
|
||||
menuhandlerMpHandicapPlayer,
|
||||
},
|
||||
#if MAX_PLAYERS > 4
|
||||
{
|
||||
MENUITEMTYPE_SLIDER,
|
||||
4,
|
||||
MENUITEMFLAG_LESSLEFTPADDING | MENUITEMFLAG_LOCKABLEMINOR,
|
||||
(uintptr_t)&mpMenuTextHandicapPlayerName,
|
||||
0x000000ff,
|
||||
menuhandlerMpHandicapPlayer,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SLIDER,
|
||||
5,
|
||||
MENUITEMFLAG_LESSLEFTPADDING | MENUITEMFLAG_LOCKABLEMINOR,
|
||||
(uintptr_t)&mpMenuTextHandicapPlayerName,
|
||||
0x000000ff,
|
||||
menuhandlerMpHandicapPlayer,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SLIDER,
|
||||
6,
|
||||
MENUITEMFLAG_LESSLEFTPADDING | MENUITEMFLAG_LOCKABLEMINOR,
|
||||
(uintptr_t)&mpMenuTextHandicapPlayerName,
|
||||
0x000000ff,
|
||||
menuhandlerMpHandicapPlayer,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SLIDER,
|
||||
7,
|
||||
MENUITEMFLAG_LESSLEFTPADDING | MENUITEMFLAG_LOCKABLEMINOR,
|
||||
(uintptr_t)&mpMenuTextHandicapPlayerName,
|
||||
0x000000ff,
|
||||
menuhandlerMpHandicapPlayer,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_SEPARATOR,
|
||||
0,
|
||||
@@ -3407,6 +3453,15 @@ char *mpMenuTextChrNameForTeamSetup(struct menuitem *item)
|
||||
struct mpchrconfig *mpchr = mpGetChrConfigBySlotNum(item->param);
|
||||
|
||||
if (mpchr) {
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_NetMode) {
|
||||
// use client names directly, as the config names are not set yet
|
||||
struct netclient *cl = netClientForPlayerNum(item->param);
|
||||
if (cl) {
|
||||
return cl->settings.name;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return mpchr->name;
|
||||
}
|
||||
|
||||
|
||||
+20
-4
@@ -184,7 +184,10 @@ u32 var80070748 = 0;
|
||||
u32 var8007074c = 0;
|
||||
|
||||
bool g_PlayersWithControl[] = {
|
||||
true, true, true, true,
|
||||
#if MAX_PLAYERS > 4
|
||||
true, true, true, true
|
||||
#endif
|
||||
};
|
||||
|
||||
bool g_PlayerInvincible = false;
|
||||
@@ -3507,6 +3510,11 @@ void playerTick(bool arg0)
|
||||
bool pause = false;
|
||||
f32 newspeed;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (mode == CONTROLMODE_NA) {
|
||||
// TODO
|
||||
} else
|
||||
#endif
|
||||
if (mode == CONTROLMODE_23
|
||||
|| mode == CONTROLMODE_24
|
||||
|| mode == CONTROLMODE_22
|
||||
@@ -5886,10 +5894,6 @@ f32 playerGetZoomFovMult(s32 playernum)
|
||||
return g_PlayerExtCfg[playernum % MAX_LOCAL_PLAYERS].fovzoommult;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if MAX_PLAYERS > 4
|
||||
|
||||
s32 playerGetCount(void)
|
||||
{
|
||||
s32 count = 0;
|
||||
@@ -5899,4 +5903,16 @@ s32 playerGetCount(void)
|
||||
return count;
|
||||
}
|
||||
|
||||
s32 playerGetLocalCount(void)
|
||||
{
|
||||
if (g_NetMode) {
|
||||
return 1;
|
||||
}
|
||||
const s32 playercount = playerGetCount();
|
||||
if (playercount > MAX_LOCAL_PLAYERS) {
|
||||
return MAX_LOCAL_PLAYERS;
|
||||
}
|
||||
return playercount;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -148,6 +148,12 @@ void playerReset(void)
|
||||
g_PlayersWithControl[1] = true;
|
||||
g_PlayersWithControl[2] = true;
|
||||
g_PlayersWithControl[3] = true;
|
||||
#if MAX_PLAYERS > 4
|
||||
g_PlayersWithControl[4] = true;
|
||||
g_PlayersWithControl[5] = true;
|
||||
g_PlayersWithControl[6] = true;
|
||||
g_PlayersWithControl[7] = true;
|
||||
#endif
|
||||
g_PlayerInvincible = false;
|
||||
|
||||
playerSetTickMode(TICKMODE_GE_FADEIN);
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ void frametimeCalculate(void)
|
||||
#ifdef PLATFORM_N64
|
||||
g_Vars.mininc60 = 1;
|
||||
#else
|
||||
g_Vars.mininc60 = g_NetMode ? 1 : g_TickRateDiv;
|
||||
g_Vars.mininc60 = g_TickRateDiv;
|
||||
#endif
|
||||
|
||||
frametimeApply(diffframe60, diffframe240, count);
|
||||
|
||||
@@ -4728,7 +4728,7 @@ enum weaponnum {
|
||||
#define NETMODE_SERVER 1
|
||||
#define NETMODE_CLIENT 2
|
||||
|
||||
#define LOCALPLAYERCOUNT() (g_NetMode ? 1 : PLAYERCOUNT())
|
||||
#define LOCALPLAYERCOUNT() playerGetLocalCount()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -552,6 +552,7 @@ extern bool g_BlurFbDirty;
|
||||
extern s32 g_TickRateDiv;
|
||||
extern s32 g_MusicDisableMpDeath;
|
||||
extern s32 g_BgunGeMuzzleFlashes;
|
||||
extern s32 g_FileAutoSelect;
|
||||
|
||||
extern s32 g_NetMode;
|
||||
|
||||
@@ -562,6 +563,7 @@ extern s32 g_NetMode;
|
||||
#define TEX_FILTER_2D g_TexFilter2D
|
||||
|
||||
s32 playerGetCount(void);
|
||||
s32 playerGetLocalCount(void);
|
||||
|
||||
#else // PLATFORM_N64
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ struct sndstate *playerSndStart(s32 arg0, s16 sound, struct sndstate **handle, s
|
||||
|
||||
#if MAX_PLAYERS > 4
|
||||
s32 playerGetCount(void);
|
||||
s32 playerGetLocalCount(void);
|
||||
#endif
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
|
||||
Reference in new issue
Block a user