Rename playerTick to playerTickThirdPerson and decompile new playerTick

This commit is contained in:
Ryan Dwyer 2022-01-14 21:42:12 +10:00
parent 5b73af1645
commit 57eb3ed384
14 changed files with 1030 additions and 8190 deletions

View File

@ -569,7 +569,7 @@ bool eyespyTryLaunch(void)
chr->soundtimer = PALDOWN(10);
g_Vars.currentplayer->eyespy->init = 0;
g_Vars.currentplayer->eyespy->held = false;
g_Vars.currentplayer->eyespy->up.x = 0;
g_Vars.currentplayer->eyespy->up.y = 1;
g_Vars.currentplayer->eyespy->up.z = 0;
@ -638,7 +638,7 @@ bool eyespyTryLaunch(void)
if (insafe || !cdTestAToB4(&testfrompos, g_Vars.currentplayer->prop->rooms,
&g_Vars.currentplayer->eyespy->prop->pos, CDTYPE_ALL, 15)) {
// Launch failed due to not enough physical space, or we're in the G5 safe
g_Vars.currentplayer->eyespy->initialised = false;
g_Vars.currentplayer->eyespy->deployed = false;
chr->prevpos.x = g_Vars.currentplayer->eyespy->prop->pos.x = playerpos.f[0];
chr->prevpos.y = g_Vars.currentplayer->eyespy->prop->pos.y = g_Vars.currentplayer->eyespy->oldground + g_Vars.currentplayer->eyespy->height;
@ -652,7 +652,7 @@ bool eyespyTryLaunch(void)
launched = false;
} else {
// Launch successful
g_Vars.currentplayer->eyespy->initialised = true;
g_Vars.currentplayer->eyespy->deployed = true;
sndStart(var80095200, SFX_DETONATE, 0, -1, -1, -1, -1, -1);
@ -5758,8 +5758,8 @@ glabel var7f1adb00
//
// // 04c
// if (!invHasSingleWeaponIncAllGuns(WEAPON_EYESPY)) {
// g_Vars.currentplayer->eyespy->initialised = false;
// g_Vars.currentplayer->eyespy->init = true;
// g_Vars.currentplayer->eyespy->deployed = false;
// g_Vars.currentplayer->eyespy->held = true;
// g_Vars.currentplayer->eyespy->active = false;
//
// chr->chrflags |= CHRCFLAG_HIDDEN;
@ -6065,8 +6065,8 @@ glabel var7f1adb00
//
// // Handle pickup
// if (g_EyespyPickup) {
// g_Vars.currentplayer->eyespy->initialised = false;
// g_Vars.currentplayer->eyespy->init = true;
// g_Vars.currentplayer->eyespy->deployed = false;
// g_Vars.currentplayer->eyespy->held = true;
// g_Vars.currentplayer->eyespy->active = false;
//
// chr->chrflags |= CHRCFLAG_HIDDEN;

View File

@ -7134,7 +7134,7 @@ s32 chrTick(struct prop *prop)
if (race == RACE_EYESPY) {
struct eyespy *eyespy = chrToEyespy(chr);
if (eyespy && eyespy->initialised) {
if (eyespy && eyespy->deployed) {
if (eyespy == g_Vars.currentplayer->eyespy && eyespy->active) {
onscreen = false;
} else {
@ -8236,7 +8236,7 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool withalpha)
eyespy = chrToEyespy(chr);
if (eyespy) {
if (!eyespy->initialised) {
if (!eyespy->deployed) {
return gdl;
}

View File

@ -420,8 +420,8 @@ void currentPlayerInitEyespy(void)
g_Vars.currentplayer->eyespy->verta = 0;
g_Vars.currentplayer->eyespy->cosverta = 1;
g_Vars.currentplayer->eyespy->sinverta = 0;
g_Vars.currentplayer->eyespy->init = true;
g_Vars.currentplayer->eyespy->initialised = false;
g_Vars.currentplayer->eyespy->held = true;
g_Vars.currentplayer->eyespy->deployed = false;
g_Vars.currentplayer->eyespy->active = false;
g_Vars.currentplayer->eyespy->buttonheld = false;
g_Vars.currentplayer->eyespy->camerabuttonheld = false;

File diff suppressed because it is too large Load Diff

View File

@ -3914,7 +3914,7 @@ Gfx *lvRender(Gfx *gdl)
}
}
if (g_Vars.currentplayer->visionmode == VISIONMODE_3) {
if (g_Vars.currentplayer->visionmode == VISIONMODE_SLAYERROCKETSTATIC) {
gdl = bviewRenderStatic(gdl, 0x4fffffff, 255);
g_Vars.currentplayer->visionmode = VISIONMODE_NORMAL;
}
@ -9433,16 +9433,16 @@ const char var7f1b774c[] = "pos:%s%s %.2f %.2f %.2f\n";
const char var7f1b7768[] = "";
const char var7f1b776c[] = "";
void lvRecordDistanceMoved(void)
void lvTickPlayer(void)
{
f32 xdiff;
f32 zdiff;
if (var80075d64 == 2) {
if (var80075d68 == 2) {
func0f0bd904(true);
playerTick(true);
} else {
func0f0bd904(false);
playerTick(false);
}
}

View File

@ -2035,7 +2035,7 @@ glabel var7f1ab190pf
/* f06381c: 962e035e */ lhu $t6,0x35e($s1)
/* f063820: 0fc5260c */ jal splatTick
/* f063824: 02002025 */ move $a0,$s0
/* f063828: 0fc30a3b */ jal playerTick
/* f063828: 0fc30a3b */ jal playerTickThirdPerson
/* f06382c: 02002025 */ move $a0,$s0
/* f063830: 00403025 */ move $a2,$v0
.PF0f063834:
@ -2210,7 +2210,7 @@ glabel var7f1ab190pf
/* f063a9c: 8faf0034 */ lw $t7,0x34($sp)
/* f063aa0: 0fc5260c */ jal splatTick
/* f063aa4: 02002025 */ move $a0,$s0
/* f063aa8: 0fc30a3b */ jal playerTick
/* f063aa8: 0fc30a3b */ jal playerTickThirdPerson
/* f063aac: 02002025 */ move $a0,$s0
/* f063ab0: 00403025 */ move $a2,$v0
.PF0f063ab4:
@ -3021,7 +3021,7 @@ glabel propsTick
/* f0635b0: 962e035e */ lhu $t6,0x35e($s1)
/* f0635b4: 0fc522e0 */ jal splatTick
/* f0635b8: 02002025 */ or $a0,$s0,$zero
/* f0635bc: 0fc308d9 */ jal playerTick
/* f0635bc: 0fc308d9 */ jal playerTickThirdPerson
/* f0635c0: 02002025 */ or $a0,$s0,$zero
/* f0635c4: 00403025 */ or $a2,$v0,$zero
.L0f0635c8:
@ -3190,7 +3190,7 @@ glabel propsTick
/* f063818: 8faf0034 */ lw $t7,0x34($sp)
/* f06381c: 0fc522e0 */ jal splatTick
/* f063820: 02002025 */ or $a0,$s0,$zero
/* f063824: 0fc308d9 */ jal playerTick
/* f063824: 0fc308d9 */ jal playerTickThirdPerson
/* f063828: 02002025 */ or $a0,$s0,$zero
/* f06382c: 00403025 */ or $a2,$v0,$zero
.L0f063830:
@ -3994,7 +3994,7 @@ glabel propsTick
/* f062824: 962e035e */ lhu $t6,0x35e($s1)
/* f062828: 0fc50cd4 */ jal splatTick
/* f06282c: 02002025 */ or $a0,$s0,$zero
/* f062830: 0fc2ffcb */ jal playerTick
/* f062830: 0fc2ffcb */ jal playerTickThirdPerson
/* f062834: 02002025 */ or $a0,$s0,$zero
/* f062838: 00403025 */ or $a2,$v0,$zero
.NB0f06283c:
@ -4163,7 +4163,7 @@ glabel propsTick
/* f062a8c: 8faf0034 */ lw $t7,0x34($sp)
/* f062a90: 0fc50cd4 */ jal splatTick
/* f062a94: 02002025 */ or $a0,$s0,$zero
/* f062a98: 0fc2ffcb */ jal playerTick
/* f062a98: 0fc2ffcb */ jal playerTickThirdPerson
/* f062a9c: 02002025 */ or $a0,$s0,$zero
/* f062aa0: 00403025 */ or $a2,$v0,$zero
.NB0f062aa4:
@ -4820,7 +4820,7 @@ glabel propsTick
// op = smokeTick(prop);
// } else if (prop->type == PROPTYPE_PLAYER) {
// splatTick(prop);
// op = playerTick(prop);
// op = playerTickThirdPerson(prop);
// }
// }
//
@ -4892,7 +4892,7 @@ glabel propsTick
// op = smokeTick(prop);
// } else if (prop->type == PROPTYPE_PLAYER) {
// splatTick(prop);
// op = playerTick(prop);
// op = playerTickThirdPerson(prop);
// }
//
// // 844
@ -5544,12 +5544,12 @@ void autoaimTick(void)
aimpos[1] = top;
}
// Don't use this prop if it's an uninitialised eyespy, or if
// Don't use this prop if it's an undeployed eyespy, or if
// the threat is outside of the aim limits
if (chr && chr->race == RACE_EYESPY) {
struct eyespy *eyespy = chrToEyespy(chr);
if (eyespy == NULL || !eyespy->initialised) {
if (eyespy == NULL || !eyespy->deployed) {
bestprop = NULL;
aimpos[0] = aimpos[1] = 0;
}

View File

@ -16143,7 +16143,7 @@ glabel var7f1aa2c4
// for (i = 0; i < PLAYERCOUNT(); i++) {
// if (g_Vars.players[i]->slayerrocket == (struct weaponobj *)obj) {
// g_Vars.players[i]->slayerrocket = NULL;
// g_Vars.players[i]->visionmode = VISIONMODE_3;
// g_Vars.players[i]->visionmode = VISIONMODE_SLAYERROCKETSTATIC;
// }
// }
// }
@ -16177,7 +16177,7 @@ glabel var7f1aa2c4
// for (i = 0; i < PLAYERCOUNT(); i++) {
// if (g_Vars.players[i]->slayerrocket == (struct weaponobj *)obj) {
// g_Vars.players[i]->slayerrocket = NULL;
// g_Vars.players[i]->visionmode = VISIONMODE_3;
// g_Vars.players[i]->visionmode = VISIONMODE_SLAYERROCKETSTATIC;
// }
// }
// }
@ -16195,7 +16195,7 @@ glabel var7f1aa2c4
// for (i = 0; i < PLAYERCOUNT(); i++) {
// if (g_Vars.players[i]->slayerrocket == (struct weaponobj *)obj) {
// g_Vars.players[i]->slayerrocket = NULL;
// g_Vars.players[i]->visionmode = VISIONMODE_3;
// g_Vars.players[i]->visionmode = VISIONMODE_SLAYERROCKETSTATIC;
// }
// }
// }
@ -16318,7 +16318,7 @@ glabel var7f1aa2c4
// for (i = 0; i < PLAYERCOUNT(); i++) {
// if (g_Vars.players[i]->slayerrocket == (struct weaponobj *)obj) {
// g_Vars.players[i]->slayerrocket = NULL;
// g_Vars.players[i]->visionmode = VISIONMODE_3;
// g_Vars.players[i]->visionmode = VISIONMODE_SLAYERROCKETSTATIC;
// }
// }
// } else {
@ -16437,7 +16437,7 @@ glabel var7f1aa2c4
// for (i = 0; i < PLAYERCOUNT(); i++) {
// if (g_Vars.players[i]->slayerrocket == (struct weaponobj *)obj) {
// g_Vars.players[i]->slayerrocket = NULL;
// g_Vars.players[i]->visionmode = VISIONMODE_3;
// g_Vars.players[i]->visionmode = VISIONMODE_SLAYERROCKETSTATIC;
// }
// }
// }

View File

@ -131,7 +131,7 @@ bool sightIsReactiveToProp(struct prop *prop)
if (chr && chr->race == RACE_EYESPY) {
struct eyespy *eyespy = chrToEyespy(chr);
if (!eyespy || !eyespy->initialised) {
if (!eyespy || !eyespy->deployed) {
return false;
}
}

View File

@ -7461,8 +7461,8 @@ void dtRestorePlayer(void)
if (g_Vars.currentplayer->eyespy) {
struct chrdata *chr = g_Vars.currentplayer->eyespy->prop->chr;
g_Vars.currentplayer->eyespy->initialised = false;
g_Vars.currentplayer->eyespy->init = true;
g_Vars.currentplayer->eyespy->deployed = false;
g_Vars.currentplayer->eyespy->held = true;
g_Vars.currentplayer->eyespy->active = false;
chr->chrflags |= CHRCFLAG_HIDDEN;

View File

@ -3959,10 +3959,10 @@
#define VIRES_LO 0
#define VIRES_HI 1
#define VISIONMODE_NORMAL 0
#define VISIONMODE_XRAY 1
#define VISIONMODE_SLAYERROCKET 2
#define VISIONMODE_3 3
#define VISIONMODE_NORMAL 0
#define VISIONMODE_XRAY 1
#define VISIONMODE_SLAYERROCKET 2
#define VISIONMODE_SLAYERROCKETSTATIC 3
#define VOICEBOX_MALE0 0
#define VOICEBOX_MALE1 1

View File

@ -53,7 +53,7 @@ f32 func0f0bd358(void);
void func0f0bd3c4(void);
void currentPlayerTickTeleport(f32 *arg0);
void currentPlayerConfigureVi(void);
void func0f0bd904(bool arg0);
void playerTick(bool arg0);
void func0f0bfc7c(struct coord *cam_pos, struct coord *cam_look, struct coord *cam_up);
Gfx *currentPlayerUpdateShootRot(Gfx *gdl);
void currentPlayerDisplayShield(void);
@ -76,7 +76,7 @@ f32 currentPlayerGetShieldFrac(void);
void currentPlayerSetShieldFrac(f32 frac);
s32 getMissionTime(void);
s32 playerTickBeams(struct prop *prop);
s32 playerTick(struct prop *prop);
s32 playerTickThirdPerson(struct prop *prop);
void func0f0c2a58(struct chrdata *chr, s32 crouchpos, f32 speedsideways, f32 speedforwards, f32 speedtheta, f32 *angleoffset, struct attackanimconfig **animcfg);
Gfx *playerRender(struct prop *prop, Gfx *gdl, bool withalpha);
Gfx *currentPlayerLoadMatrix(Gfx *gdl);

View File

@ -23,7 +23,7 @@ s32 sub54321(s32 value);
void lvUpdateCutsceneTime(void);
s32 lvGetSlowMotionType(void);
void lvTick(void);
void lvRecordDistanceMoved(void);
void lvTickPlayer(void);
void lvCheckPauseStateChanged(void);
void lvSetPaused(bool paused);
void lvConfigureFade(u32 color, s16 num_frames);

View File

@ -2099,10 +2099,10 @@ struct eyespy {
/*0x28*/ f32 verta;
/*0x2c*/ f32 cosverta;
/*0x30*/ f32 sinverta;
/*0x34*/ u8 init;
/*0x35*/ u8 initialised;
/*0x34*/ u8 held; // the eyespy is held by the player (opposite of deployed)
/*0x35*/ u8 deployed; // the eyespy is deployed in the stage somewhere
/*0x36*/ s8 startuptimer60;
/*0x37*/ s8 active;
/*0x37*/ s8 active; // player is currently controlling the eyespy
/*0x38*/ s8 buttonheld;
/*0x39*/ s8 camerabuttonheld;
/*0x3a*/ s16 bobdir;

View File

@ -2643,7 +2643,7 @@ void mainTick(void)
g_Vars.currentplayer->viewwidth, g_Vars.currentplayer->viewheight);
}
lvRecordDistanceMoved();
lvTickPlayer();
}
}
@ -2880,7 +2880,7 @@ glabel mainTick
/* ebf4: 0c002feb */ jal viSetFovAspectAndSize
/* ebf8: 84470632 */ lh $a3,0x632($v0)
.NB0000ebfc:
/* ebfc: 0fc59e2f */ jal lvRecordDistanceMoved
/* ebfc: 0fc59e2f */ jal lvTickPlayer
/* ec00: 00000000 */ sll $zero,$zero,0x0
/* ec04: 8e0d006c */ lw $t5,0x6c($s0)
/* ec08: 26310001 */ addiu $s1,$s1,0x1
@ -3122,7 +3122,7 @@ u32 var8005f690nb[] = {
// g_Vars.currentplayer->viewwidth, g_Vars.currentplayer->viewheight);
// }
//
// lvRecordDistanceMoved();
// lvTickPlayer();
// }
// }
//