1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-08 08:55:17 +00:00

En_Horse OK (#554)

* En_Horse OK

* Remove reloc

* WIP

* Use EnIn

* Documentation

* Documentation

* Remove debug prints

* Warnings

* Cleanup

* Unused asm

* Review comment

* Review comments and reformat

* More review comments

* Rename flags

* Review changes

Co-authored-by: Fig02 <fig02srl@gmail.com>
This commit is contained in:
Synray 2021-04-11 18:23:40 -07:00 committed by GitHub
parent d22b746128
commit 7f94088a3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
140 changed files with 3880 additions and 12777 deletions

View file

@ -1020,7 +1020,7 @@ void func_8002DE74(GlobalContext* globalCtx, Player* player) {
}
}
void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* horse) {
void Actor_MountHorse(GlobalContext* globalCtx, Player* player, Actor* horse) {
player->rideActor = horse;
player->stateFlags1 |= 0x800000;
horse->child = &player->actor;
@ -1607,28 +1607,28 @@ void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) {
}
}
u32 Actor_HasChild(GlobalContext* globalCtx, Actor* actor) {
if (actor->child != NULL) {
s32 Actor_IsMounted(GlobalContext* globalCtx, Actor* horse) {
if (horse->child != NULL) {
return true;
} else {
return false;
}
}
u32 func_8002F63C(GlobalContext* globalCtx, Actor* horse, s32 arg2) {
u32 Actor_SetRideActor(GlobalContext* globalCtx, Actor* horse, s32 mountSide) {
Player* player = PLAYER;
if (!(player->stateFlags1 & 0x003C7880)) {
player->rideActor = horse;
player->unk_43C = arg2;
player->mountSide = mountSide;
return true;
}
return false;
}
u32 Actor_HasNoChild(GlobalContext* globalCtx, Actor* actor) {
if (actor->child == NULL) {
s32 Actor_NotMounted(GlobalContext* globalCtx, Actor* horse) {
if (horse->child == NULL) {
return true;
} else {
return false;

View file

@ -1184,7 +1184,7 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecSph* eyeAtDir, f32 yOffset, f32* yP
player = camera->player;
Actor_GetWorldPosShapeRot(&horsePosRot, player->rideActor);
if (EN_HORSE_CHECK_5((EnHorse*)player->rideActor)) {
if (EN_HORSE_CHECK_JUMPING((EnHorse*)player->rideActor)) {
horsePosRot.pos.y -= 49.f;
*yPosOffset = Camera_LERPCeilF(horsePosRot.pos.y, *yPosOffset, 0.1f, 0.2f);
camera->atLERPStepScale = Camera_LERPCeilF(0.4f, camera->atLERPStepScale, 0.2f, 0.02f);

View file

@ -42,9 +42,9 @@ typedef struct {
void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
s32 i;
HorseSpawn horseSpawns[] = {
{ 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
{ 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
{ 99, 0x03A0, 0x0000, 0xF718, 0, 2 },
{ SCENE_SPOT00, -460, 100, 6640, 0, 2 }, { SCENE_SPOT06, -1929, -1025, 768, 0, 2 },
{ SCENE_SPOT09, 2566, -259, 767, 0, 2 }, { SCENE_SPOT12, -328, 10, 953, 0, 2 },
{ SCENE_SPOT20, 928, 0, -2280, 0, 2 },
};
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
@ -55,7 +55,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
}
func_8002DECC(globalCtx, player, player->rideActor);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
gSaveContext.horseData.scene = globalCtx->sceneNum;
@ -168,7 +168,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
}
func_8002DECC(globalCtx, player, player->rideActor);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
gSaveContext.horseData.scene = globalCtx->sceneNum;
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
@ -179,7 +179,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
__assert("player->ride.actor != NULL", "../z_horse.c", 582);
}
func_8002DECC(globalCtx, player, player->rideActor);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
gSaveContext.horseData.scene = globalCtx->sceneNum;
@ -211,7 +211,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
}
func_8002DECC(globalCtx, player, player->rideActor);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
} else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) {
Vec3f sp54;
@ -234,7 +234,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
player->actor.shape.rot.x = player->actor.shape.rot.z = 0;
player->actor.shape.rot.y = D_8011F9B8[i].angle;
func_8002DECC(globalCtx, player, player->rideActor);
Actor_MountHorse(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
sp54.x = player->actor.world.pos.x - 200.0f;

View file

@ -3332,7 +3332,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
phi_s1 = ZREG(14);
for (phi_s3 = 1; phi_s3 < 7; phi_s3++) {
// Carrot Color (based on availability)
if ((interfaceCtx->unk_23A == 0) || (interfaceCtx->unk_23A < phi_s3)) {
if ((interfaceCtx->numHorseBoosts == 0) || (interfaceCtx->numHorseBoosts < phi_s3)) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 150, 255, interfaceCtx->aAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha);