forked from Ports/perfect_dark
Merge branch 'port' of https://github.com/fgsfdsfgs/perfect_dark into port-debugger
This commit is contained in:
commit
8d5e94e121
19 files changed
+241
-64
No files matched your search
+36
-17
@@ -699,12 +699,42 @@ static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gfx_cm_to_opengl(cmt));
|
||||
}
|
||||
|
||||
static void gfx_opengl_set_depth_test_and_mask(bool depth_test, bool z_upd) {
|
||||
if (depth_test || z_upd) {
|
||||
static void gfx_opengl_set_depth_mode(bool depth_test, bool depth_update, bool depth_compare, bool depth_source_prim, uint16_t zmode) {
|
||||
if (depth_test) {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(z_upd ? GL_TRUE : GL_FALSE);
|
||||
glDepthFunc(depth_test ? GL_LEQUAL : GL_ALWAYS);
|
||||
current_depth_mask = z_upd;
|
||||
glDepthMask(depth_update ? GL_TRUE : GL_FALSE);
|
||||
current_depth_mask = depth_update;
|
||||
|
||||
if (depth_compare) {
|
||||
switch (zmode) {
|
||||
case ZMODE_INTER:
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(0, 0);
|
||||
break;
|
||||
|
||||
case ZMODE_OPA:
|
||||
case ZMODE_XLU:
|
||||
if (depth_source_prim) {
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
} else {
|
||||
glDepthFunc(GL_LESS);
|
||||
}
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(0, 0);
|
||||
break;
|
||||
|
||||
case ZMODE_DEC:
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(-2, -2);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(0, 0);
|
||||
}
|
||||
} else {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
@@ -714,16 +744,6 @@ static void gfx_opengl_set_depth_range(float znear, float zfar) {
|
||||
glDepthRange(znear, zfar);
|
||||
}
|
||||
|
||||
static void gfx_opengl_set_zmode_decal(bool zmode_decal) {
|
||||
if (zmode_decal) {
|
||||
glPolygonOffset(-2, -2);
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
} else {
|
||||
glPolygonOffset(0, 0);
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_opengl_set_viewport(int x, int y, int width, int height) {
|
||||
glViewport(x, y, width, height);
|
||||
}
|
||||
@@ -1156,9 +1176,8 @@ struct GfxRenderingAPI gfx_opengl_api = {
|
||||
gfx_opengl_select_texture,
|
||||
gfx_opengl_upload_texture,
|
||||
gfx_opengl_set_sampler_parameters,
|
||||
gfx_opengl_set_depth_test_and_mask,
|
||||
gfx_opengl_set_depth_mode,
|
||||
gfx_opengl_set_depth_range,
|
||||
gfx_opengl_set_zmode_decal,
|
||||
gfx_opengl_set_viewport,
|
||||
gfx_opengl_set_scissor,
|
||||
gfx_opengl_set_use_alpha,
|
||||
|
||||
+12
-14
@@ -197,9 +197,8 @@ static struct RDP {
|
||||
} rdp;
|
||||
|
||||
static struct RenderingState {
|
||||
uint8_t depth_test_and_mask; // 1: depth test, 2: depth mask
|
||||
uint8_t depth_mode;
|
||||
float depth_zfar;
|
||||
bool decal_mode;
|
||||
bool alpha_blend;
|
||||
bool modulate;
|
||||
struct XYWidthHeight viewport, scissor;
|
||||
@@ -1240,25 +1239,24 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo
|
||||
}
|
||||
}
|
||||
|
||||
bool depth_test = (rsp.geometry_mode & G_ZBUFFER) == G_ZBUFFER;
|
||||
bool depth_mask = (rdp.other_mode_l & Z_UPD) == Z_UPD;
|
||||
uint8_t depth_test_and_mask = (depth_test ? 1 : 0) | (depth_mask ? 2 : 0);
|
||||
if (depth_test_and_mask != rendering_state.depth_test_and_mask) {
|
||||
gfx_flush();
|
||||
gfx_rapi->set_depth_test_and_mask(depth_test, depth_mask);
|
||||
rendering_state.depth_test_and_mask = depth_test_and_mask;
|
||||
}
|
||||
if (rsp.depth_zfar != rendering_state.depth_zfar) {
|
||||
gfx_flush();
|
||||
gfx_rapi->set_depth_range(0.0f, rsp.depth_zfar);
|
||||
rendering_state.depth_zfar = rsp.depth_zfar;
|
||||
}
|
||||
|
||||
bool zmode_decal = (rdp.other_mode_l & ZMODE_DEC) == ZMODE_DEC;
|
||||
if (zmode_decal != rendering_state.decal_mode) {
|
||||
bool depth_test = ((rsp.geometry_mode & G_ZBUFFER) == G_ZBUFFER || (rdp.other_mode_l & G_ZS_PRIM) == G_ZS_PRIM) &&
|
||||
((rdp.other_mode_h & G_CYC_1CYCLE) == G_CYC_1CYCLE || (rdp.other_mode_h & G_CYC_2CYCLE) == G_CYC_2CYCLE);
|
||||
bool depth_update = (rdp.other_mode_l & Z_UPD) == Z_UPD;
|
||||
bool depth_compare = (rdp.other_mode_l & Z_CMP) == Z_CMP;
|
||||
bool depth_source_prim = (rdp.other_mode_l & G_ZS_PRIM) == G_ZS_PRIM /* && gDP.primDepth.z == 1.0f */;
|
||||
uint16_t zmode = rdp.other_mode_l & ZMODE_DEC;
|
||||
uint8_t depth_mode = (depth_test ? 1 : 0) | (depth_update ? 2 : 0) | (depth_compare ? 4 : 0) | (depth_source_prim ? 8 : 0) | (zmode >> 6);
|
||||
|
||||
if (depth_mode != rendering_state.depth_mode) {
|
||||
gfx_flush();
|
||||
gfx_rapi->set_zmode_decal(zmode_decal);
|
||||
rendering_state.decal_mode = zmode_decal;
|
||||
gfx_rapi->set_depth_mode(depth_test, depth_update, depth_compare, depth_source_prim, zmode);
|
||||
rendering_state.depth_mode = depth_mode;
|
||||
}
|
||||
|
||||
if (rdp.viewport_or_scissor_changed) {
|
||||
|
||||
@@ -27,9 +27,8 @@ struct GfxRenderingAPI {
|
||||
void (*select_texture)(int tile, uint32_t texture_id);
|
||||
void (*upload_texture)(const uint8_t* rgba32_buf, uint32_t width, uint32_t height);
|
||||
void (*set_sampler_parameters)(int sampler, bool linear_filter, uint32_t cms, uint32_t cmt);
|
||||
void (*set_depth_test_and_mask)(bool depth_test, bool z_upd);
|
||||
void (*set_depth_mode)(bool depth_test, bool depth_update, bool depth_compare, bool depth_source_prim, uint16_t zmode);
|
||||
void (*set_depth_range)(float znear, float zfar);
|
||||
void (*set_zmode_decal)(bool zmode_decal);
|
||||
void (*set_viewport)(int x, int y, int width, int height);
|
||||
void (*set_scissor)(int x, int y, int width, int height);
|
||||
void (*set_use_alpha)(bool use_alpha, bool modulate);
|
||||
|
||||
+15
-3
@@ -81,6 +81,12 @@ enum contkey {
|
||||
CK_TOTAL_COUNT
|
||||
};
|
||||
|
||||
enum mouselockmode {
|
||||
MLOCK_OFF = 0,
|
||||
MLOCK_ON = 1,
|
||||
MLOCK_AUTO = 2
|
||||
};
|
||||
|
||||
// returns bitmask of connected controllers or -1 if failed
|
||||
s32 inputInit(void);
|
||||
|
||||
@@ -201,8 +207,14 @@ void inputSetDefaultKeyBinds(s32 cidx, s32 n64mode);
|
||||
void inputClearLastKey(void);
|
||||
s32 inputGetLastKey(void);
|
||||
|
||||
// get/set Input.MouseDefaultLocked
|
||||
s32 inputGetMouseDefaultLocked(void);
|
||||
void inputSetMouseDefaultLocked(s32 defaultLocked);
|
||||
// get/set Input.MouseLockMode
|
||||
s32 inputGetMouseLockMode(void);
|
||||
void inputSetMouseLockMode(s32 lockmode);
|
||||
|
||||
// same as inputLockMouse but works only if mouse is enabled and lockmode == MLOCK_AUTO
|
||||
s32 inputAutoLockMouse(s32 wantlock);
|
||||
|
||||
// show/hide mouse cursor; if mouse lock is on the cursor is always hidden
|
||||
void inputMouseShowCursor(s32 show);
|
||||
|
||||
#endif
|
||||
+57
-10
@@ -29,6 +29,9 @@
|
||||
#define WHEEL_UP_MASK SDL_BUTTON(VK_MOUSE_WHEEL_UP - VK_MOUSE_BEGIN + 1)
|
||||
#define WHEEL_DN_MASK SDL_BUTTON(VK_MOUSE_WHEEL_DN - VK_MOUSE_BEGIN + 1)
|
||||
|
||||
#define CURSOR_HIDE_THRESHOLD 1
|
||||
#define CURSOR_HIDE_TIME 3000000 // us
|
||||
|
||||
static SDL_GameController *pads[INPUT_MAX_CONTROLLERS];
|
||||
|
||||
#define CONTROLLERCFG_DEFAULT { \
|
||||
@@ -71,13 +74,16 @@ static s32 connectedMask = 0;
|
||||
static s32 numJoysticks = 0;
|
||||
|
||||
static s32 mouseEnabled = 1;
|
||||
static s32 mouseLocked = 0;
|
||||
static s32 mouseDefaultLocked = 0;
|
||||
static s32 mouseX, mouseY;
|
||||
static s32 mouseDX, mouseDY;
|
||||
static u32 mouseButtons;
|
||||
static s32 mouseWheel = 0;
|
||||
|
||||
static s32 mouseLocked = 0;
|
||||
static s32 mouseLockMode = MLOCK_AUTO;
|
||||
static u64 mouseCursorTime = 0;
|
||||
static s32 mouseShowCursor = 1;
|
||||
|
||||
static f32 mouseSensX = 1.5f;
|
||||
static f32 mouseSensY = 1.5f;
|
||||
|
||||
@@ -675,7 +681,9 @@ s32 inputInit(void)
|
||||
inputSetDefaultKeyBinds(i, 0);
|
||||
}
|
||||
|
||||
inputLockMouse(mouseDefaultLocked);
|
||||
if (mouseLockMode != MLOCK_AUTO) {
|
||||
inputLockMouse(mouseLockMode);
|
||||
}
|
||||
|
||||
// update the axis maps
|
||||
// NOTE: by default sticks get swapped for 1.2: "right stick" here means left stick on your controller
|
||||
@@ -813,6 +821,23 @@ static inline void inputUpdateMouse(void)
|
||||
mouseDY = 0;
|
||||
mouseWheel = 0;
|
||||
mouseButtons = 0;
|
||||
if (!mouseShowCursor) {
|
||||
inputMouseShowCursor(1);
|
||||
}
|
||||
} else {
|
||||
// if MLOCK_AUTO is enabled, disable cursor if mouse is unlocked
|
||||
// and we haven't moved it for a few seconds
|
||||
if (mouseLockMode == MLOCK_AUTO && !mouseLocked) {
|
||||
if (abs(mouseDX) > CURSOR_HIDE_THRESHOLD || abs(mouseDY) > CURSOR_HIDE_THRESHOLD) {
|
||||
if (!mouseShowCursor) {
|
||||
inputMouseShowCursor(1);
|
||||
}
|
||||
} else if (sysGetMicroseconds() > mouseCursorTime) {
|
||||
if (mouseShowCursor) {
|
||||
inputMouseShowCursor(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1182,20 +1207,42 @@ s32 inputMouseIsEnabled(void)
|
||||
void inputMouseEnable(s32 enabled)
|
||||
{
|
||||
mouseEnabled = !!enabled;
|
||||
if (!mouseEnabled && mouseLocked) {
|
||||
if (!mouseEnabled && mouseLockMode != MLOCK_ON && mouseLocked) {
|
||||
inputLockMouse(0);
|
||||
}
|
||||
}
|
||||
|
||||
s32 inputGetMouseDefaultLocked(void)
|
||||
s32 inputAutoLockMouse(s32 wantlock)
|
||||
{
|
||||
return mouseDefaultLocked;
|
||||
if (mouseEnabled && mouseLockMode == MLOCK_AUTO) {
|
||||
inputLockMouse(wantlock);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void inputSetMouseDefaultLocked(s32 defaultLocked)
|
||||
void inputMouseShowCursor(s32 show)
|
||||
{
|
||||
mouseDefaultLocked = !!defaultLocked;
|
||||
inputLockMouse(mouseDefaultLocked);
|
||||
mouseShowCursor = !!show;
|
||||
SDL_ShowCursor(mouseShowCursor);
|
||||
if (show) {
|
||||
mouseCursorTime = sysGetMicroseconds() + CURSOR_HIDE_TIME;
|
||||
}
|
||||
}
|
||||
|
||||
s32 inputGetMouseLockMode(void)
|
||||
{
|
||||
return mouseLockMode;
|
||||
}
|
||||
|
||||
void inputSetMouseLockMode(s32 lockmode)
|
||||
{
|
||||
mouseLockMode = lockmode;
|
||||
if (lockmode == MLOCK_ON) {
|
||||
inputLockMouse(1);
|
||||
} else {
|
||||
inputLockMouse(0);
|
||||
}
|
||||
}
|
||||
|
||||
const char *inputGetContKeyName(u32 ck)
|
||||
@@ -1275,7 +1322,7 @@ s32 inputGetLastKey(void)
|
||||
PD_CONSTRUCTOR static void inputConfigInit(void)
|
||||
{
|
||||
configRegisterInt("Input.MouseEnabled", &mouseEnabled, 0, 1);
|
||||
configRegisterInt("Input.MouseDefaultLocked", &mouseDefaultLocked, 0, 1);
|
||||
configRegisterInt("Input.MouseLockMode", &mouseLockMode, MLOCK_OFF, MLOCK_AUTO);
|
||||
configRegisterFloat("Input.MouseSpeedX", &mouseSensX, -10.f, 10.f);
|
||||
configRegisterFloat("Input.MouseSpeedY", &mouseSensY, -10.f, 10.f);
|
||||
configRegisterInt("Input.FakeGamepads", &fakeControllers, 0, 4);
|
||||
|
||||
+19
-8
@@ -119,14 +119,25 @@ static MenuItemHandlerResult menuhandlerMouseAimLock(s32 operation, struct menui
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MenuItemHandlerResult menuhandlerMouseDefaultLocked(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
static MenuItemHandlerResult menuhandlerMouseLockMode(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
static const char *opts[] = {
|
||||
"Always Off",
|
||||
"Always On",
|
||||
"Auto"
|
||||
};
|
||||
|
||||
switch (operation) {
|
||||
case MENUOP_GET:
|
||||
return inputGetMouseDefaultLocked();
|
||||
case MENUOP_SET:
|
||||
inputSetMouseDefaultLocked(data->checkbox.value);
|
||||
case MENUOP_GETOPTIONCOUNT:
|
||||
data->dropdown.value = ARRAYCOUNT(opts);
|
||||
break;
|
||||
case MENUOP_GETOPTIONTEXT:
|
||||
return (intptr_t)opts[data->dropdown.value];
|
||||
case MENUOP_SET:
|
||||
inputSetMouseLockMode(data->checkbox.value);
|
||||
break;
|
||||
case MENUOP_GETSELECTEDINDEX:
|
||||
data->dropdown.value = inputGetMouseLockMode();
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -274,12 +285,12 @@ struct menuitem g_ExtendedMouseMenuItems[] = {
|
||||
menuhandlerMouseAimLock,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
MENUITEMTYPE_DROPDOWN,
|
||||
0,
|
||||
MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Grab Mouse Input by Default",
|
||||
(uintptr_t)"Mouse Lock Mode",
|
||||
0,
|
||||
menuhandlerMouseDefaultLocked,
|
||||
menuhandlerMouseLockMode,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
+2
-6
@@ -3473,9 +3473,7 @@ void menuClose(void)
|
||||
g_Menus[g_MpPlayerNum].openinhibit = 10;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (inputMouseIsEnabled()) {
|
||||
inputLockMouse(true);
|
||||
}
|
||||
inputAutoLockMouse(true);
|
||||
#endif
|
||||
|
||||
if (g_MenuData.root == MENUROOT_MPPAUSE) {
|
||||
@@ -3589,9 +3587,7 @@ void menuPushRootDialog(struct menudialogdef *dialogdef, s32 root)
|
||||
g_PlayersWithControl[g_Menus[g_MpPlayerNum].playernum] = false;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
if (inputMouseIsEnabled()) {
|
||||
inputLockMouse(false);
|
||||
}
|
||||
inputAutoLockMouse(false);
|
||||
#endif
|
||||
|
||||
func0f0f1494();
|
||||
|
||||
+26
-1
@@ -1372,7 +1372,7 @@ bool menuitemKeyboardTick(struct menuitem *item, struct menuinputs *inputs, u32
|
||||
if (dialog && g_MenuUsingMouse && !inputs->leftright && !inputs->updown) {
|
||||
const s32 dleft = dialog->x + 4;
|
||||
const s32 dright = dleft + 12 * 10;
|
||||
const s32 dtop = dialog->y + 13 + 12;
|
||||
const s32 dtop = menuitemGetTop(item, dialog) + 12;
|
||||
const s32 dbottom = dtop + 11 * 5;
|
||||
const s32 mx = inputs->mousex;
|
||||
const s32 my = inputs->mousey;
|
||||
@@ -4514,3 +4514,28 @@ Gfx *menuitemOverlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct menuitem *it
|
||||
|
||||
return gdl;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
|
||||
s32 menuitemGetTop(struct menuitem *item, struct menudialog *dialog)
|
||||
{
|
||||
struct menu *menu = &g_Menus[g_MpPlayerNum];
|
||||
s32 dtop = dialog->y + LINEHEIGHT + 1;
|
||||
|
||||
for (s32 i = 0; i < dialog->numcols; ++i) {
|
||||
const s32 colindex = i + dialog->colstart;
|
||||
|
||||
for (s32 j = 0; j < menu->cols[colindex].numrows; ++j) {
|
||||
const s32 rowindex = j + menu->cols[colindex].rowstart;
|
||||
struct menuitem *pitem = &dialog->definition->items[menu->rows[rowindex].itemindex];
|
||||
if (pitem == item) {
|
||||
return dtop;
|
||||
}
|
||||
dtop += menu->rows[rowindex].height;
|
||||
}
|
||||
}
|
||||
|
||||
return dtop;
|
||||
}
|
||||
|
||||
#endif
|
||||
+1
-3
@@ -33,9 +33,7 @@
|
||||
void menuStop(void)
|
||||
{
|
||||
#ifndef PLATFORM_N64
|
||||
if (inputMouseIsEnabled()) {
|
||||
inputLockMouse(true);
|
||||
}
|
||||
inputAutoLockMouse(true);
|
||||
#endif
|
||||
|
||||
if (var80062944) {
|
||||
|
||||
@@ -85,6 +85,14 @@ struct menuitem g_CtcOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -80,6 +80,14 @@ struct menuitem g_MpCombatOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_SEPARATOR,
|
||||
|
||||
@@ -83,6 +83,14 @@ struct menuitem g_HtmOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -83,6 +83,14 @@ struct menuitem g_HtbOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -104,6 +104,14 @@ struct menuitem g_KohOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -81,6 +81,14 @@ struct menuitem g_PacOptionsMenuItems[] = {
|
||||
MPOPTION_FRIENDLYFIRE,
|
||||
menuhandlerMpDisplayTeam,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"No Player on Radar",
|
||||
MPOPTION_NOPLAYERONRADAR,
|
||||
menuhandlerMpCheckboxOption,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
|
||||
@@ -1101,6 +1101,15 @@ void playerSpawn(void)
|
||||
}
|
||||
} else {
|
||||
#ifndef PLATFORM_N64
|
||||
if (cheatIsActive(CHEAT_CLOAKINGDEVICE)) {
|
||||
invGiveSingleWeapon(WEAPON_CLOAKINGDEVICE);
|
||||
#if VERSION >= VERSION_PAL_FINAL
|
||||
bgunSetAmmoQuantity(AMMOTYPE_CLOAK, TICKS(7200));
|
||||
#else
|
||||
bgunSetAmmoQuantity(AMMOTYPE_CLOAK, 7200);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (cheatIsActive(CHEAT_PERFECTDARKNESS)) {
|
||||
invGiveSingleWeapon(WEAPON_NIGHTVISION);
|
||||
}
|
||||
|
||||
@@ -336,6 +336,9 @@ Gfx *radarRender(Gfx *gdl)
|
||||
gdl = func0f153134(gdl);
|
||||
|
||||
// Draw dots for human players
|
||||
#ifndef PLATFORM_N64
|
||||
if (!(g_MpSetup.options & MPOPTION_NOPLAYERONRADAR)) {
|
||||
#endif
|
||||
for (i = 0; i < playercount; i++) {
|
||||
if (i != playernum) {
|
||||
if (g_Vars.players[i]->isdead == false
|
||||
@@ -356,6 +359,9 @@ Gfx *radarRender(Gfx *gdl)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef PLATFORM_N64
|
||||
}
|
||||
#endif
|
||||
|
||||
// Draw dots for coop AI buddies
|
||||
if (!g_Vars.normmplayerisrunning && g_MissionConfig.iscoop) {
|
||||
@@ -377,7 +383,11 @@ Gfx *radarRender(Gfx *gdl)
|
||||
}
|
||||
|
||||
// Draw dots for MP simulants
|
||||
#ifdef PLATFORM_N64
|
||||
if (g_Vars.normmplayerisrunning) {
|
||||
#else
|
||||
if (g_Vars.normmplayerisrunning && !(g_MpSetup.options & MPOPTION_NOPLAYERONRADAR)) {
|
||||
#endif
|
||||
for (i = 0; i < g_BotCount; i++) {
|
||||
if (!chrIsDead(g_MpBotChrPtrs[i])
|
||||
&& (g_MpBotChrPtrs[i]->hidden & CHRHFLAG_CLOAKED) == 0
|
||||
|
||||
@@ -2895,6 +2895,7 @@
|
||||
#define MPOPTION_AUTORANDOMWEAPON_START 0x00800000
|
||||
#define MPOPTION_AUTORANDOMWEAPON_END 0x01000000
|
||||
#define MPOPTION_FRIENDLYFIRE 0x02000000
|
||||
#define MPOPTION_NOPLAYERONRADAR 0x04000000
|
||||
|
||||
#define MPPAUSEMODE_UNPAUSED 0
|
||||
#define MPPAUSEMODE_PAUSED 1
|
||||
|
||||
@@ -83,4 +83,8 @@ bool menuitemTick(struct menuitem *item, struct menudialog *dialog, struct menui
|
||||
void menuitemInit(struct menuitem *item, union menuitemdata *data);
|
||||
Gfx *menuitemOverlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct menuitem *item, struct menudialog *dialog, union menuitemdata *data);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
s32 menuitemGetTop(struct menuitem *item, struct menudialog *dialog);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user