EnBjt OK and documented (#912)

* OK, data imported

* Fix some typos

* Start docs

* Struct almost finished

* Start object, add state enum

* undefined_syms

* Finish object, name some more stuff

* Name a few states and another function

* PlayState

* Minor tweaks in z_room and z_sub_s

* Complete documentation

* spec

* Review 1

* functions.txt

* Schedule result enum

* Rename schedule results

* Review

* Remove update comments

* Inventory_DeleteItem

* PLAYER_STATE

* Format

* Review

* Update struct name
This commit is contained in:
EllipticEllipsis
2022-07-22 05:17:06 +01:00
committed by GitHub
parent cbeeeb172a
commit c8c55a15d3
14 changed files with 508 additions and 86 deletions
+8 -8
View File
@@ -651,15 +651,15 @@ void Lib_PlaySfxAtPos(Vec3f* pos, u16 sfxId) {
Audio_PlaySfxAtPos(pos, sfxId);
}
void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 a, Vec3f* src, Vec3f* dst) {
f32 sp1C;
f32 f0;
void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 rotAngle, Vec3f* src, Vec3f* dst) {
f32 cos;
f32 sin;
sp1C = Math_CosS(a);
f0 = Math_SinS(a);
dst->x = translation->x + (src->x * sp1C + src->z * f0);
cos = Math_CosS(rotAngle);
sin = Math_SinS(rotAngle);
dst->x = translation->x + (src->x * cos + src->z * sin);
dst->y = translation->y + src->y;
dst->z = translation->z + (src->z * sp1C - src->x * f0);
dst->z = translation->z + (src->z * cos - src->x * sin);
}
void Lib_LerpRGB(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst) {
@@ -688,7 +688,7 @@ f32 Math_Vec3f_StepTo(Vec3f* start, Vec3f* target, f32 speed) {
start->z = start->z + f2 * diff.z;
} else {
Math_Vec3f_Copy(start, target);
f0 = 0;
f0 = 0.0f;
}
return f0;
+1 -1
View File
@@ -143,7 +143,7 @@ void func_8012EBF8(PlayState* play, RoomContext* roomCtx) {
roomCtx->prevRoom.segment = NULL;
func_800BA798(play, &play->actorCtx);
Actor_SpawnTransitionActors(play, &play->actorCtx);
if (-1 < roomCtx->currRoom.num) {
if (roomCtx->currRoom.num > -1) {
Map_InitRoomData(play, roomCtx->currRoom.num);
Minimap_SavePlayerRoomInitInfo(play);
}
+12 -3
View File
@@ -830,43 +830,52 @@ s32 func_8013C964(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 it
xzRange = actor->xzDistToPlayer + 1.0f;
ret = Actor_PickUp(actor, play, itemId, xzRange, yRange);
break;
case 2:
if ((fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange)) {
ret = func_800B8500(actor, play, xzRange, yRange, itemId);
}
break;
case 3:
//! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) {
ret = func_800B8500(actor, play, xzRange, yRange, itemId);
}
break;
case 4:
yRange = fabsf(actor->playerHeightRel) + 1.0f;
xzRange = actor->xzDistToPlayer + 1.0f;
xzDistToPlayerTemp = actor->xzDistToPlayer;
actor->xzDistToPlayer = 0.0f;
actor->flags |= 0x10000;
actor->flags |= ACTOR_FLAG_10000;
ret = func_800B8500(actor, play, xzRange, yRange, itemId);
actor->xzDistToPlayer = xzDistToPlayerTemp;
break;
case 5:
//! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT)) &&
(fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange) && actor->isTargeted) {
actor->flags |= 0x10000;
actor->flags |= ACTOR_FLAG_10000;
ret = func_800B8500(actor, play, xzRange, yRange, itemId);
}
break;
case 6:
//! @bug: Both x and y conditionals are always true, || should be an &&
if (((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT)) &&
(fabsf(actor->playerHeightRel) <= yRange) && (actor->xzDistToPlayer <= xzRange)) {
actor->flags |= 0x10000;
actor->flags |= ACTOR_FLAG_10000;
ret = func_800B8500(actor, play, xzRange, yRange, itemId);
}
break;
default:
break;
}
return ret;
}