renamed all occurences of "link" to "player"

This commit is contained in:
theo3
2020-08-08 14:59:11 -07:00
parent 0cb4a64f67
commit ac67812a25
287 changed files with 3534 additions and 3534 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
@@ -28,7 +28,7 @@ void Anju(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitializeAnimation(this,(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this,(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "room.h"
typedef struct {
@@ -118,8 +118,8 @@ void sub_0806346C(Entity* this) {
s32 iVar2;
s32 iVar3;
iVar3 = (gLinkEntity.x.HALF.HI - this->x.HALF.HI);
iVar2 = (gLinkEntity.y.HALF.HI - this->y.HALF.HI);
iVar3 = (gPlayerEntity.x.HALF.HI - this->x.HALF.HI);
iVar2 = (gPlayerEntity.y.HALF.HI - this->y.HALF.HI);
iVar3 += 0x30;
iVar2 += 0x18;
@@ -139,7 +139,7 @@ void sub_0806346C(Entity* this) {
iVar3 >>= 4;
iVar2 >>= 4;
bVar1 = gUnk_0810C8F0[(gLinkEntity.animationState >> 1) + iVar3 * 4 + iVar2 * 0x18];
bVar1 = gUnk_0810C8F0[(gPlayerEntity.animationState >> 1) + iVar3 * 4 + iVar2 * 0x18];
if (bVar1 != this->entityType.parameter) {
gUnk_0810C89C_struct* temp = &gUnk_0810C89C[bVar1];
sub_08078850(this, 1, temp->unk_04, temp);
+3 -3
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "structures.h"
extern void (*gUnk_081140D4[])(Entity*);
@@ -37,10 +37,10 @@ void sub_0806CF30(Entity* this) {
case 0:
case 1:
if (gScreenTransition.frameCount % 4 == 0) {
if (gLinkEntity.x.HALF.HI < this->x.HALF.HI && this->field_0x68.HWORD - 32 < this->x.HALF.HI) {
if (gPlayerEntity.x.HALF.HI < this->x.HALF.HI && this->field_0x68.HWORD - 32 < this->x.HALF.HI) {
this->x.HALF.HI--;
}
if (gLinkEntity.x.HALF.HI > this->x.HALF.HI && this->field_0x68.HWORD + 32 > this->x.HALF.HI) {
if (gPlayerEntity.x.HALF.HI > this->x.HALF.HI && this->field_0x68.HWORD + 32 > this->x.HALF.HI) {
this->x.HALF.HI++;
}
}
+5 -5
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
#include "flags.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "textbox.h"
@@ -122,7 +122,7 @@ void FUN_08068b2c(Entity* this) {
if (this->interactType == '\x02') {
this->action = 2;
this->interactType = '\0';
uVar1 = sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
uVar1 = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
InitAnimationForceUpdate(this, uVar1);
sub_0806F118(this);
} else {
@@ -345,16 +345,16 @@ void sub_08068E78(Entity* this) {
}
void sub_08068E90(Entity* this) {
LinkState* s = &gLinkState;
PlayerState* s = &gPlayerState;
*(u16*)&s->field_0xac = (1 << (gUnk_08111740[this->actionDelay] - 1)) | *(u16*)&s->field_0xac;
}
void sub_08068EB4(void) {
gLinkState.field_0xab = 0;
gPlayerState.field_0xab = 0;
}
void sub_08068EC4(Entity* param_1, Entity* param_2) {
if (gUnk_08111740[param_1->actionDelay] == gLinkState.field_0xab) {
if (gUnk_08111740[param_1->actionDelay] == gPlayerState.field_0xab) {
*(u16*)&param_2->flags = gUnk_0811172A[param_1->actionDelay];
*(u32*)&param_2->animationState = 1;
} else {
+2 -2
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "sprite.h"
#include "link.h"
#include "player.h"
extern void DeleteThisEntity();
extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
@@ -35,7 +35,7 @@ void Carpenter(Entity* this) {
this->action = 2;
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + 4 + (this->entityType.form * 8));
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 + (this->entityType.form * 8));
sub_0806F118(this);
} else {
sub_0807DDAC(this, 0);
+4 -4
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
extern void sub_0806ED78(Entity*);
extern void sub_0806920C(Entity*);
@@ -19,7 +19,7 @@ extern u32 gUnk_08111938[];
extern void PlaySFX(u32);
extern u32 Random();
extern u32 UpdateFuseInteraction(Entity*);
extern LinkState gLinkState;
extern PlayerState gPlayerState;
void Cow(Entity* ent) {
gUnk_08111914[ent->action](ent);
@@ -191,7 +191,7 @@ void Cow_ShowDialogue(Entity* ent) {
void sub_0806920C(Entity* ent) {
// TODO: figure out what bitfield flag this is
u32 var0 = gLinkState.flags.all & 0x80;
u32 var0 = gPlayerState.flags.all & 0x80;
u32 var1 = -var0 >> 0x1F;
if (var1 != ent->field_0x6c.HALF.HI) {
@@ -210,7 +210,7 @@ void sub_0806924C(Entity* ent) {
s8 itype = ent->interactType;
if (itype != 0) {
// TODO: figure out what bitfield flag this is
if ((gLinkState.flags.all & 0x80) != 0) {
if ((gPlayerState.flags.all & 0x80) != 0) {
if (itype == 2) {
ent->action = 4;
sub_0806F118(ent);
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
@@ -36,7 +36,7 @@ void Dampe(Entity* this) {
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + 4);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4);
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "functions.h"
void sub_08065A64(Entity* this);
@@ -56,7 +56,7 @@ void sub_08065A50(Entity* this) {
void sub_08065A64(Entity* this) {
u32 uVar2;
uVar2 = -(gLinkState.flags.all & 0x80) >> 0x1f;
uVar2 = -(gPlayerState.flags.all & 0x80) >> 0x1f;
if (uVar2 != this->field_0x68.HALF.HI) {
if (uVar2 == 0) {
sub_08078778(this);
@@ -69,7 +69,7 @@ void sub_08065A64(Entity* this) {
void sub_08065AA4(Entity* this) {
if (this->interactType != 0) {
if (gLinkState.flags.all & 0x80) {
if (gPlayerState.flags.all & 0x80) {
if (this->interactType == 2) {
this->action = 4;
sub_0806F118(this);
@@ -78,7 +78,7 @@ void sub_08065AA4(Entity* this) {
sub_0805E3A0(this, 2);
sub_08065A50(this);
}
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_08065A50(this);
sub_080791D0();
+2 -2
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
#include "npc.h"
#include "link.h"
#include "player.h"
extern void sub_0805E3A0(Entity*, u32);
extern u32 sub_0801E99C(Entity*);
@@ -41,7 +41,7 @@ void sub_0805FE48(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
}
else {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "npc.h"
#include "flags.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "structures.h"
extern void sub_0805E3A0(Entity*, u32);
+2 -2
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "npc.h"
#include "link.h"
#include "player.h"
extern void sub_0805E3A0(Entity*, u32);
extern u32 sub_0801E99C(Entity*);
@@ -26,7 +26,7 @@ void Gentari(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "flags.h"
#include "textbox.h"
#include "room.h"
@@ -93,7 +93,7 @@ void sub_08063DC8(Entity* this) {
if ((this->entityType).form == 0xff) {
this->action = 2;
this->actionDelay = 0x1e;
this->animationState = sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
this->animationState = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
InitAnimationForceUpdate(this, this->animationState + 4);
} else {
sub_0806EE20(this);
@@ -106,7 +106,7 @@ void sub_08063DC8(Entity* this) {
if (this->interactType != 0) {
this->action = 3;
this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_08064428(this);
}
}
@@ -166,7 +166,7 @@ void sub_08063F20(Entity* this) {
if (this->interactType != 0) {
this->action++;
this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + *(s8*)&this->field_0x70);
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + *(s8*)&this->field_0x70);
sub_08064428(this);
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
#include "functions.h"
#include "entity.h"
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
extern void (*gUnk_0810FF5C[])(Entity* this);
extern void (*gUnk_0810FF64[])(Entity* this);
@@ -41,7 +41,7 @@ void sub_080658BC(Entity* this) {
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
@@ -41,7 +41,7 @@ void MayorHagen(Entity *this)
this->action = v;
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
InitAnimationForceUpdate(this,4 + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this,4 + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
break;
}
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "flags.h"
#include "textbox.h"
#include "npc.h"
@@ -40,7 +40,7 @@ void Mutoh(Entity* this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + 4);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4);
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -3,7 +3,7 @@
#include "functions.h"
#include "npc.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "structures.h"
@@ -145,14 +145,14 @@ void sub_08060528(Entity *this)
this->action = 3;
this->interactType = 0;
sub_0806F118(this);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
}
else {
if (this->interactType != 0) {
this->action = 2;
this->interactType = 0;
sub_080606D8(this);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
}
else {
sub_0807DD94(this, 0);
@@ -192,7 +192,7 @@ void sub_08060528(Entity *this)
sub_080606C0(this);
}
if ((-1 < this->height.WORD) &&
((gLinkEntity.collisionLayer == 0 || (this->collisionLayer == gLinkEntity.collisionLayer)))) {
((gPlayerEntity.collisionLayer == 0 || (this->collisionLayer == gPlayerEntity.collisionLayer)))) {
sub_0806ED78(this);
}
sub_0800451C(this);
+1 -1
View File
@@ -49,7 +49,7 @@ void Smith(Entity *this)
this->action = 4;
this->interactType = 0;
iVar4 = (this->animIndex == 0xc) ? 8 : 0;
iVar2 = sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
iVar2 = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
InitAnimationForceUpdate(this, iVar2 + iVar4);
sub_0806F118(this);
}
+2 -2
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "textbox.h"
#include "functions.h"
#include "link.h"
#include "player.h"
extern void (*gUnk_0810FEC4[])(Entity* this);
extern void (*gUnk_0810FEBC[])(Entity* this);
@@ -126,7 +126,7 @@ void sub_080656D4(Entity* this) {
void sub_0806574C(Entity* this) {
u32 j;
j = (this->animIndex & ~3) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
j = (this->animIndex & ~3) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
if (this->animIndex != j) {
InitAnimationForceUpdate(this, j);
}
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
typedef struct {
u8 filler[8];
@@ -41,7 +41,7 @@ void Teachers(Entity* this) {
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this,
(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+1 -1
View File
@@ -50,7 +50,7 @@ void sub_0806ABFC(Entity *this)
s32 unk;
u8 field_0x68;
Entity *link = &gLinkEntity;
Entity *link = &gPlayerEntity;
if (sub_080041A0(this, link, 0x18, 0x18)) {
unk = GetFacingDirection(this, link) & (u8)0x1e;
}
+3 -3
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "npc.h"
#include "link.h"
#include "player.h"
#include "textbox.h"
#include "flags.h"
#include "structures.h"
@@ -145,7 +145,7 @@ void sub_08061D64(Entity* this) {
this->interactType = 0;
sub_0806F118(this);
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
@@ -158,7 +158,7 @@ void sub_08061D64(Entity* this) {
this->interactType = 0;
sub_08062048(this);
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
}
}
}
+2 -2
View File
@@ -20,7 +20,7 @@ extern void sub_0806F62C(Entity*, u32, u32);
extern void PlaySFX(u32);
extern void SetTileType(u32, u32, u32);
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
extern RoomControls gRoomControls;
extern void (*gUnk_08110BD8[])(Entity* ent);
@@ -86,7 +86,7 @@ void sub_08066D94(Entity* ent) {
SetGlobalFlag(ZELDA_CHASE);
npc = CreateNPC(0x2E, 0, 0);
if (npc != NULL) {
npc->animationState = gLinkEntity.animationState;
npc->animationState = gPlayerEntity.animationState;
npc->flags |= 0x20;
npc->animationState = GetAnimationState(ent);
roomID = gRoomControls.roomID;