mirror of
https://github.com/zeldaret/oot.git
synced 2025-06-07 17:11:50 +00:00
sPlayerFaces as array of structs instead of 2d array (#2559)
This commit is contained in:
parent
d62bf87542
commit
8a95f90b20
2 changed files with 7 additions and 8 deletions
|
@ -269,11 +269,10 @@ typedef enum PlayerDoorType {
|
|||
/* 3 */ PLAYER_DOORTYPE_FAKE
|
||||
} PlayerDoorType;
|
||||
|
||||
typedef enum PlayerFacePart {
|
||||
/* 0 */ PLAYER_FACEPART_EYES,
|
||||
/* 1 */ PLAYER_FACEPART_MOUTH,
|
||||
/* 2 */ PLAYER_FACEPART_MAX
|
||||
} PlayerFacePart;
|
||||
typedef struct PlayerFaceIndices {
|
||||
/* 0x0 */ u8 eyeIndex;
|
||||
/* 0x1 */ u8 mouthIndex;
|
||||
} PlayerFaceIndices; // size = 0x2
|
||||
|
||||
typedef enum PlayerEyes {
|
||||
/* 0 */ PLAYER_EYES_OPEN,
|
||||
|
|
|
@ -970,7 +970,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) {
|
|||
return envHazard + 1;
|
||||
}
|
||||
|
||||
u8 sPlayerFaces[PLAYER_FACE_MAX][PLAYER_FACEPART_MAX] = {
|
||||
PlayerFaceIndices sPlayerFaces[PLAYER_FACE_MAX] = {
|
||||
// The first 6 faces defined must be default blinking faces. See relevant code in `Player_UpdateCommon`.
|
||||
{ PLAYER_EYES_OPEN, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_NEUTRAL
|
||||
{ PLAYER_EYES_HALF, PLAYER_MOUTH_CLOSED }, // PLAYER_FACE_NEUTRAL_BLINKING_HALF
|
||||
|
@ -1093,7 +1093,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL
|
|||
|
||||
// If the eyes index provided by the animation is negative, use the value provided by the `face` argument instead
|
||||
if (eyesIndex < 0) {
|
||||
eyesIndex = sPlayerFaces[face][PLAYER_FACEPART_EYES];
|
||||
eyesIndex = sPlayerFaces[face].eyeIndex;
|
||||
}
|
||||
|
||||
#ifndef AVOID_UB
|
||||
|
@ -1104,7 +1104,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL
|
|||
|
||||
// If the mouth index provided by the animation is negative, use the value provided by the `face` argument instead
|
||||
if (mouthIndex < 0) {
|
||||
mouthIndex = sPlayerFaces[face][PLAYER_FACEPART_MOUTH];
|
||||
mouthIndex = sPlayerFaces[face].mouthIndex;
|
||||
}
|
||||
|
||||
#ifndef AVOID_UB
|
||||
|
|
Loading…
Add table
Reference in a new issue