-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document Player's Face and z_actor FaceChange functions #1777
base: main
Are you sure you want to change the base?
Changes from all commits
f6376a9
bcee8b5
6bb09c8
564029c
a5a9bf8
9b8176d
ee9db14
1093bdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef FACE_CHANGE_H | ||
#define FACE_CHANGE_H | ||
|
||
typedef struct FaceChange { | ||
/* 0x0 */ s16 face; | ||
/* 0x2 */ s16 timer; | ||
} FaceChange; // size = 0x4 | ||
|
||
s16 FaceChange_UpdateBlinking(FaceChange* faceChange, s16 blinkIntervalBase, s16 blinkIntervalRandRange, s16 blinkDuration); | ||
s16 FaceChange_UpdateBlinkingAlt(FaceChange* faceChange, s16 blinkIntervalBase, s16 blinkIntervalRandRange, s16 blinkDuration); | ||
s16 FaceChange_UpdateRandomSet(FaceChange* faceChange, s16 changeTimerBase, s16 changeTimerRandRange, s16 faceSetRange); | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
#include "z64interface.h" | ||
#include "z64item.h" | ||
#include "z64light.h" | ||
#include "face_change.h" | ||
|
||
struct Player; | ||
struct PlayState; | ||
|
@@ -473,44 +474,50 @@ typedef enum PlayerModelGroup { | |
/* 15 */ PLAYER_MODELGROUP_MAX | ||
} PlayerModelGroup; | ||
|
||
typedef enum PlayerEyeIndex { | ||
typedef struct PlayerFaceIndices { | ||
/* 0x0 */ u8 eyeIndex; | ||
/* 0x1 */ u8 mouthIndex; | ||
} PlayerFaceIndices; // size = 0x2 | ||
|
||
typedef enum PlayerEyes { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In OoT, they also opted to not use a macro to access the eyes and mouth data from animations i.e. they don’t use |
||
/* 0 */ PLAYER_EYES_OPEN, | ||
/* 1 */ PLAYER_EYES_HALF, | ||
/* 2 */ PLAYER_EYES_CLOSED, | ||
/* 3 */ PLAYER_EYES_ROLL_RIGHT, | ||
/* 4 */ PLAYER_EYES_ROLL_LEFT, | ||
/* 5 */ PLAYER_EYES_ROLL_UP, | ||
/* 6 */ PLAYER_EYES_ROLL_DOWN, | ||
/* 7 */ PLAYER_EYES_7, | ||
/* 3 */ PLAYER_EYES_RIGHT, | ||
/* 4 */ PLAYER_EYES_LEFT, | ||
Comment on lines
+486
to
+487
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In OoT, PLAYER_EYES_RIGHT and PLAYER_EYES_LEFT are swapped but it’s the same texture as MM. So I think it’s wrong in OoT and swapped. But it’s also a matter of perspective too. Could someone else verify which is left and which is right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We name assets from the actor's perspective. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to bring this up so OoT is aware they might have the eyes swapped. |
||
/* 5 */ PLAYER_EYES_UP, | ||
/* 6 */ PLAYER_EYES_DOWN, | ||
/* 7 */ PLAYER_EYES_WINCING, // For Goron, this is a surprised eye | ||
/* 8 */ PLAYER_EYES_MAX | ||
} PlayerEyeIndex; | ||
} PlayerEyes; | ||
|
||
typedef enum PlayerMouthIndex { | ||
typedef enum PlayerMouth { | ||
/* 0 */ PLAYER_MOUTH_CLOSED, | ||
/* 1 */ PLAYER_MOUTH_TEETH, | ||
/* 2 */ PLAYER_MOUTH_ANGRY, | ||
/* 3 */ PLAYER_MOUTH_HAPPY, | ||
/* 1 */ PLAYER_MOUTH_HALF, | ||
/* 2 */ PLAYER_MOUTH_OPEN, | ||
/* 3 */ PLAYER_MOUTH_SMILE, | ||
/* 4 */ PLAYER_MOUTH_MAX | ||
} PlayerMouthIndex; | ||
|
||
typedef enum PlayerFacialExpression { | ||
/* 0 */ PLAYER_FACE_0, | ||
/* 1 */ PLAYER_FACE_1, | ||
/* 2 */ PLAYER_FACE_2, | ||
/* 3 */ PLAYER_FACE_3, | ||
/* 4 */ PLAYER_FACE_4, | ||
/* 5 */ PLAYER_FACE_5, | ||
/* 6 */ PLAYER_FACE_6, | ||
/* 7 */ PLAYER_FACE_7, | ||
/* 8 */ PLAYER_FACE_8, | ||
/* 9 */ PLAYER_FACE_9, | ||
/* 10 */ PLAYER_FACE_10, | ||
/* 11 */ PLAYER_FACE_11, | ||
/* 12 */ PLAYER_FACE_12, | ||
/* 13 */ PLAYER_FACE_13, | ||
/* 14 */ PLAYER_FACE_14, | ||
/* 15 */ PLAYER_FACE_15 | ||
} PlayerFacialExpression; | ||
} PlayerMouth; | ||
|
||
typedef enum PlayerFace { | ||
/* 0 */ PLAYER_FACE_NEUTRAL, | ||
/* 1 */ PLAYER_FACE_NEUTRAL_BLINKING_HALF, | ||
/* 2 */ PLAYER_FACE_NEUTRAL_BLINKING_CLOSED, | ||
/* 3 */ PLAYER_FACE_NEUTRAL_2, | ||
/* 4 */ PLAYER_FACE_NEUTRAL_BLINKING_HALF_2, | ||
/* 5 */ PLAYER_FACE_NEUTRAL_BLINKING_CLOSED_2, | ||
/* 6 */ PLAYER_FACE_LOOK_LEFT, | ||
/* 7 */ PLAYER_FACE_SURPRISED, | ||
/* 8 */ PLAYER_FACE_HURT, | ||
/* 9 */ PLAYER_FACE_GASP, | ||
/* 10 */ PLAYER_FACE_LOOK_RIGHT, | ||
/* 11 */ PLAYER_FACE_LOOK_LEFT_2, | ||
/* 12 */ PLAYER_FACE_EYES_CLOSED_MOUTH_OPEN, | ||
/* 13 */ PLAYER_FACE_OPENING, | ||
/* 14 */ PLAYER_FACE_EYES_AND_MOUTH_OPEN, | ||
/* 15 */ PLAYER_FACE_SMILE, | ||
/* 16 */ PLAYER_FACE_MAX | ||
} PlayerFace; | ||
|
||
typedef enum PlayerLimb { | ||
/* 0x00 */ PLAYER_LIMB_NONE, | ||
|
@@ -1165,7 +1172,7 @@ typedef struct Player { | |
/* 0x2C8 */ SkelAnime unk_2C8; | ||
/* 0x30C */ Vec3s jointTable[5]; | ||
/* 0x32A */ Vec3s morphTable[5]; | ||
/* 0x348 */ BlinkInfo blinkInfo; | ||
/* 0x348 */ FaceChange faceChange; | ||
/* 0x34C */ Actor* heldActor; | ||
/* 0x350 */ PosRot leftHandWorld; | ||
/* 0x364 */ Actor* rightHandActor; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In OoT, they opted to use an enum and a 2D array instead of a struct. i.e.
I like the struct version better, but open to opinions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the struct looks nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree that the struct looks nicer, but do you know if this option was discussed in OoT? I would much prefer to have the same implementation for this.