forked from Ports/perfect_dark
Merge branch 'fgs-port' into port-enh-mpsetupfile
This commit is contained in:
commit
0316317aa3
12 files changed
+128
-99
No files matched your search
+29
-2
@@ -31,7 +31,7 @@ char var800a41c0[26];
|
||||
char var800a41c0[24];
|
||||
#endif
|
||||
|
||||
u8 g_IrScanlines[2][480];
|
||||
u8 g_IrScanlines[4][480];
|
||||
|
||||
#if VERSION < VERSION_NTSC_1_0
|
||||
u8 var800a8b58nb[0x1c0];
|
||||
@@ -2356,6 +2356,10 @@ Gfx *bviewDrawIrLens(Gfx *gdl)
|
||||
gSPSetExtraGeometryModeEXT(gdl++, G_MODULATE_EXT);
|
||||
#endif
|
||||
|
||||
// fixes off by one error w/ two top players
|
||||
if (g_Vars.currentplayernum == 0 || g_Vars.currentplayernum == 1) {
|
||||
scanbottom++;
|
||||
}
|
||||
for (i = scantop; i < scanbottom; i++) {
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
if (i & 1) {
|
||||
@@ -2392,6 +2396,10 @@ Gfx *bviewDrawIrLens(Gfx *gdl)
|
||||
s32 semicirclewidth = sqrtf(sqinnerradius - (s32) (f0 * f0)) * (viewwidth / (f32) SCREEN_WIDTH_LO);
|
||||
s32 semicircleright = viewcentrex + semicirclewidth;
|
||||
s32 rightsidewidth = viewwidth - semicircleright;
|
||||
// if playernum is 1 or 3, shift to the right by viewwidth
|
||||
if (g_Vars.currentplayernum == 1 || g_Vars.currentplayernum == 3) {
|
||||
rightsidewidth += viewwidth;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_N64
|
||||
// Left and right of semicircle
|
||||
@@ -2405,14 +2413,22 @@ Gfx *bviewDrawIrLens(Gfx *gdl)
|
||||
gdl = bviewCopyPixels(gdl, fb, i, 5, i, 1.0f, viewleft, viewwidth);
|
||||
}
|
||||
#else
|
||||
// Left and right of semicircle
|
||||
|
||||
// Scanlines to the left and right of the semicircle
|
||||
gDPFillRectangle(gdl++, viewleft, i, viewcentrex, i + 1);
|
||||
if (PLAYERCOUNT() <= 2 && g_Vars.currentplayernum == 0 && i == viewcentrey) {
|
||||
semicircleright -= 1;
|
||||
}
|
||||
else if (PLAYERCOUNT() > 2 && (g_Vars.currentplayernum == 1 || g_Vars.currentplayernum == 3 ) && i == viewcentrey) {
|
||||
semicircleright -= 1;
|
||||
}
|
||||
gDPFillRectangle(gdl++, semicircleright, i, semicircleright + rightsidewidth, i + 1);
|
||||
|
||||
// The semicircle itself has a static colour
|
||||
gDPSetPrimColorViaWord(gdl++, 0, 0, 0xee0000ff);
|
||||
gDPFillRectangle(gdl++, viewcentrex, i, viewcentrex + semicirclewidth, i + 1);
|
||||
} else {
|
||||
// scanlines above and below the semicircle
|
||||
gDPFillRectangle(gdl++, viewleft, i, viewleft + viewwidth, i + 1);
|
||||
}
|
||||
#endif
|
||||
@@ -2781,6 +2797,10 @@ Gfx *bviewDrawIrBinoculars(Gfx *gdl)
|
||||
s32 viewleft = viGetViewLeft();
|
||||
s32 viewright = viewleft + viewwidth;
|
||||
s32 viewbottom = viewtop + viewheight;
|
||||
// fixes off by one error w/ two top players
|
||||
if (g_Vars.currentplayernum == 0 || g_Vars.currentplayernum == 1) {
|
||||
viewbottom++;
|
||||
}
|
||||
s32 leftx = viewleft + viewwidth / 3;
|
||||
s32 rightx = viewleft + (viewwidth * 2) / 3;
|
||||
s32 centrey = (viewtop + viewbottom) / 2;
|
||||
@@ -2798,6 +2818,13 @@ Gfx *bviewDrawIrBinoculars(Gfx *gdl)
|
||||
for (y = viewtop; y < viewbottom; y++) {
|
||||
s32 ytocentre = centrey - y;
|
||||
s32 sqytocentre = ytocentre * ytocentre;
|
||||
if (PLAYERCOUNT() <= 2) {
|
||||
sqytocentre += 1;
|
||||
} else if (PLAYERCOUNT() > 2) {
|
||||
if (g_Vars.currentplayernum == 1 || g_Vars.currentplayernum == 3) {
|
||||
sqytocentre += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (sqytocentre < sqradius) {
|
||||
s32 xoffset = (viewwidth / (f32) SCREEN_WIDTH_LO) * sqrtf(sqradius - sqytocentre);
|
||||
|
||||
+2
-2
@@ -5118,7 +5118,7 @@ struct weapon invitem_nightvision = {
|
||||
L_GUN_059, // name
|
||||
L_GUN_000, // manufacturer
|
||||
L_GUN_191, // description
|
||||
WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000080 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_UNDROPPABLE,
|
||||
WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000080 | WEAPONFLAG_UNDROPPABLE,
|
||||
};
|
||||
|
||||
struct weaponfunc invfunc_horizonscanner_primary = {
|
||||
@@ -5344,7 +5344,7 @@ struct weapon invitem_irscanner = {
|
||||
L_GUN_069, // name
|
||||
L_GUN_000, // manufacturer
|
||||
L_GUN_194, // description
|
||||
WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_DUALWIELD | WEAPONFLAG_UNDROPPABLE,
|
||||
WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_UNDROPPABLE,
|
||||
};
|
||||
|
||||
struct weaponfunc invfunc_disguise_primary = {
|
||||
|
||||
+15
-13
@@ -103,23 +103,25 @@ struct mpweapon g_MpWeapons[NUM_MPWEAPONS] = {
|
||||
#ifndef PLATFORM_N64
|
||||
// fix X-Ray Scanner model
|
||||
/*0x22*/ { WEAPON_XRAYSCANNER, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_XRAYSCANNER, MODEL_XRAYSPECS, 256 },
|
||||
/*0x23*/ { WEAPON_NIGHTVISION, 0, 0, 0, 0, 1, 0, MODEL_CHRNIGHTSIGHT, 256 },
|
||||
/*0x24*/ { WEAPON_IRSCANNER, 0, 0, 0, 0, 1, 0, MODEL_MISC_IRSPECS, 256 },
|
||||
#else
|
||||
/*0x22*/ { WEAPON_XRAYSCANNER, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_XRAYSCANNER, MODEL_CHRNIGHTSIGHT, 256 },
|
||||
#endif
|
||||
/*0x23*/ { WEAPON_CLOAKINGDEVICE, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_CLOAKINGDEVICE, MODEL_CHRCLOAKER, 256 },
|
||||
/*0x24*/ { WEAPON_COMBATBOOST, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_COMBATBOOST, MODEL_CHRSPEEDPILL, 256 },
|
||||
/*0x25*/ { WEAPON_CLOAKINGDEVICE, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_CLOAKINGDEVICE, MODEL_CHRCLOAKER, 256 },
|
||||
/*0x26*/ { WEAPON_COMBATBOOST, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_COMBATBOOST, MODEL_CHRSPEEDPILL, 256 },
|
||||
#ifndef PLATFORM_N64
|
||||
/*0x25*/ { WEAPON_PP9I, AMMOTYPE_PISTOL, 80, 0, 0, 1, 0, MODEL_CHRWPPK, 256 },
|
||||
/*0x26*/ { WEAPON_CC13, AMMOTYPE_PISTOL, 80, 0, 0, 1, 0, MODEL_CHRTT33, 256 },
|
||||
/*0x27*/ { WEAPON_KL01313, AMMOTYPE_SMG, 100, 0, 0, 1, 0, MODEL_CHRSKORPION, 256 },
|
||||
/*0x28*/ { WEAPON_KF7SPECIAL, AMMOTYPE_RIFLE, 100, 0, 0, 1, 0, MODEL_CHRKALASH, 256 },
|
||||
/*0x29*/ { WEAPON_ZZT, AMMOTYPE_SMG, 100, 0, 0, 1, 0, MODEL_CHRUZI, 256 },
|
||||
/*0x2a*/ { WEAPON_DMC, AMMOTYPE_SMG, 100, 0, 0, 1, 0, MODEL_CHRMP5K, 256 },
|
||||
/*0x2b*/ { WEAPON_AR53, AMMOTYPE_RIFLE, 150, 0, 0, 1, 0, MODEL_CHRM16, 256 },
|
||||
/*0x2c*/ { WEAPON_RCP45, AMMOTYPE_SMG, 150, 0, 0, 1, 0, MODEL_CHRFNP90, 256 },
|
||||
/*0x27*/ { WEAPON_PP9I, AMMOTYPE_PISTOL, 80, 0, 0, 1, 0, MODEL_CHRWPPK, 256 },
|
||||
/*0x28*/ { WEAPON_CC13, AMMOTYPE_PISTOL, 80, 0, 0, 1, 0, MODEL_CHRTT33, 256 },
|
||||
/*0x29*/ { WEAPON_KL01313, AMMOTYPE_SMG, 100, 0, 0, 1, 0, MODEL_CHRSKORPION, 256 },
|
||||
/*0x2a*/ { WEAPON_KF7SPECIAL, AMMOTYPE_RIFLE, 100, 0, 0, 1, 0, MODEL_CHRKALASH, 256 },
|
||||
/*0x2b*/ { WEAPON_ZZT, AMMOTYPE_SMG, 100, 0, 0, 1, 0, MODEL_CHRUZI, 256 },
|
||||
/*0x2c*/ { WEAPON_DMC, AMMOTYPE_SMG, 100, 0, 0, 1, 0, MODEL_CHRMP5K, 256 },
|
||||
/*0x2d*/ { WEAPON_AR53, AMMOTYPE_RIFLE, 150, 0, 0, 1, 0, MODEL_CHRM16, 256 },
|
||||
/*0x2e*/ { WEAPON_RCP45, AMMOTYPE_SMG, 150, 0, 0, 1, 0, MODEL_CHRFNP90, 256 },
|
||||
#endif
|
||||
/*0x2d*/ { WEAPON_MPSHIELD, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_SHIELD, MODEL_CHRSHIELD, 256 },
|
||||
/*0x2e*/ { WEAPON_DISABLED }, // 0x25 on N64
|
||||
/*0x2f*/ { WEAPON_MPSHIELD, 0, 0, 0, 0, 1, MPFEATURE_WEAPON_SHIELD, MODEL_CHRSHIELD, 256 },
|
||||
/*0x30*/ { WEAPON_DISABLED }, // 0x25 on N64
|
||||
};
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
@@ -141,7 +143,7 @@ struct mpweapon g_MpWeapons[NUM_MPWEAPONS] = {
|
||||
.usereloads = false, \
|
||||
}
|
||||
|
||||
struct extplayerconfig g_PlayerExtCfg[MAX_PLAYERS] = {
|
||||
struct extplayerconfig g_PlayerExtCfg[MAX_PLAYERS] = {
|
||||
PLAYER_EXT_CFG_DEFAULT,
|
||||
PLAYER_EXT_CFG_DEFAULT,
|
||||
PLAYER_EXT_CFG_DEFAULT,
|
||||
|
||||
@@ -1239,7 +1239,10 @@ MenuItemHandlerResult mpSelectRandomWeaponListHandler(s32 operation, struct menu
|
||||
case 0:
|
||||
// Select Dark
|
||||
for (i = 0; i < ARRAYCOUNT(g_MpWeapons); i++) {
|
||||
if ((i >= MPWEAPON_NONE && i <= MPWEAPON_COMBATBOOST) || i >= MPWEAPON_SHIELD) {
|
||||
if ((i >= MPWEAPON_NONE && i <= MPWEAPON_XRAYSCANNER)
|
||||
|| i == MPWEAPON_CLOAKINGDEVICE
|
||||
|| i == MPWEAPON_COMBATBOOST
|
||||
|| i >= MPWEAPON_SHIELD) {
|
||||
g_MpWeaponSetRandomFilters[i] = 1;
|
||||
} else {
|
||||
g_MpWeaponSetRandomFilters[i] = 0;
|
||||
|
||||
+2
-2
@@ -1616,9 +1616,9 @@ void propCalculateShadeColour(struct prop *prop, u8 *nextcol, u16 floorcol)
|
||||
{
|
||||
s32 shade = func0f068fc8(prop, 0);
|
||||
|
||||
// fix props flickering in split screen when one of the players has night vision on
|
||||
// fix props flickering in split screen when one of the players has night vision or IR Goggles on
|
||||
if (prop->type != PROPTYPE_PLAYER || g_Vars.currentplayer->prop != prop) {
|
||||
if (USINGDEVICE(DEVICE_NIGHTVISION)) {
|
||||
if (USINGDEVICE(DEVICE_NIGHTVISION) || USINGDEVICE(DEVICE_IRSCANNER)) {
|
||||
if (prop->rooms[0] >= 0) {
|
||||
shade = g_Rooms[prop->rooms[0]].br_settled_regional;
|
||||
}
|
||||
|
||||
+16
-14
@@ -2993,7 +2993,7 @@
|
||||
#define MPWEAPON_SHIELD (VERSION == VERSION_JPN_FINAL ? 0x24 : 0x25)
|
||||
#define MPWEAPON_DISABLED (VERSION == VERSION_JPN_FINAL ? 0x25 : 0x26)
|
||||
#define NUM_MPWEAPONS (VERSION == VERSION_JPN_FINAL ? 0x26 : 0x27)
|
||||
#else // add all classic weapons to multiplayer and allow combat knife in JPN
|
||||
#else // add all classic weapons to multiplayer and allow combat knife in JPN and add IR Scanner and Night Vision
|
||||
#define MPWEAPON_COMBATKNIFE 0x19
|
||||
#define MPWEAPON_CROSSBOW 0x1a
|
||||
#define MPWEAPON_TRANQUILIZER 0x1b
|
||||
@@ -3004,19 +3004,21 @@
|
||||
#define MPWEAPON_REMOTEMINE 0x20
|
||||
#define MPWEAPON_LASER 0x21
|
||||
#define MPWEAPON_XRAYSCANNER 0x22
|
||||
#define MPWEAPON_CLOAKINGDEVICE 0x23
|
||||
#define MPWEAPON_COMBATBOOST 0x24
|
||||
#define MPWEAPON_PP9I 0x25
|
||||
#define MPWEAPON_CC13 0x26
|
||||
#define MPWEAPON_KL01313 0x27
|
||||
#define MPWEAPON_KF7SPECIAL 0x28
|
||||
#define MPWEAPON_ZZT 0x29
|
||||
#define MPWEAPON_DMC 0x2a
|
||||
#define MPWEAPON_AR53 0x2b
|
||||
#define MPWEAPON_RCP45 0x2c
|
||||
#define MPWEAPON_SHIELD 0x2d
|
||||
#define MPWEAPON_DISABLED 0x2e
|
||||
#define NUM_MPWEAPONS 0x2f
|
||||
#define MPWEAPON_NIGHTVISION 0x23
|
||||
#define MPWEAPON_IRSCANNER 0x24
|
||||
#define MPWEAPON_CLOAKINGDEVICE 0x25
|
||||
#define MPWEAPON_COMBATBOOST 0x26
|
||||
#define MPWEAPON_PP9I 0x27
|
||||
#define MPWEAPON_CC13 0x28
|
||||
#define MPWEAPON_KL01313 0x29
|
||||
#define MPWEAPON_KF7SPECIAL 0x2a
|
||||
#define MPWEAPON_ZZT 0x2b
|
||||
#define MPWEAPON_DMC 0x2c
|
||||
#define MPWEAPON_AR53 0x2d
|
||||
#define MPWEAPON_RCP45 0x2e
|
||||
#define MPWEAPON_SHIELD 0x2f
|
||||
#define MPWEAPON_DISABLED 0x30
|
||||
#define NUM_MPWEAPONS 0x31
|
||||
#endif
|
||||
|
||||
#define MUSICEVENTTYPE_PLAY 1
|
||||
|
||||
Reference in new issue
Block a user