mirror of
https://github.com/zeldaret/oot.git
synced 2025-06-08 09:31:52 +00:00
Child Ruto Part 4: Eye and mouth index enums (#2571)
* Child Ruto Part 4: Eye and mouth index enums * Suggested changes * Rename struct variables
This commit is contained in:
parent
c6dbebfcd2
commit
b37f62fc1f
2 changed files with 42 additions and 27 deletions
|
@ -90,6 +90,21 @@ void EnRu1_DrawNothing(EnRu1* this, PlayState* play);
|
|||
void EnRu1_DrawOpa(EnRu1* this, PlayState* play);
|
||||
void EnRu1_DrawXlu(EnRu1* this, PlayState* play);
|
||||
|
||||
typedef enum EnRu1Eyes {
|
||||
/* 0 */ ENRU1_EYES_OPEN,
|
||||
/* 1 */ ENRU1_EYES_HALF_BLINK,
|
||||
/* 2 */ ENRU1_EYES_CLOSED,
|
||||
/* 3 */ ENRU1_EYES_UP,
|
||||
/* 4 */ ENRU1_EYES_GAZING,
|
||||
/* 5 */ ENRU1_EYES_BLUSH,
|
||||
} EnRu1Eyes;
|
||||
|
||||
typedef enum EnRu1Mouth {
|
||||
/* 0 */ ENRU1_MOUTH_SMILING,
|
||||
/* 1 */ ENRU1_MOUTH_FROWNING,
|
||||
/* 2 */ ENRU1_MOUTH_OPEN,
|
||||
} EnRu1Mouth;
|
||||
|
||||
typedef enum EnRu1WaterState {
|
||||
/* 0 */ ENRU1_WATER_OUTSIDE,
|
||||
/* 1 */ ENRU1_WATER_IMMERSED,
|
||||
|
@ -237,24 +252,24 @@ void EnRu1_Destroy(Actor* thisx, PlayState* play) {
|
|||
void EnRu1_UpdateEyes(EnRu1* this) {
|
||||
s32 pad[3];
|
||||
s16* blinkTimer = &this->blinkTimer;
|
||||
s16* eyeIndex = &this->eyeIndex;
|
||||
s16* eyes = &this->eyes;
|
||||
|
||||
if (DECR(*blinkTimer) == 0) {
|
||||
*blinkTimer = Rand_S16Offset(60, 60);
|
||||
}
|
||||
|
||||
*eyeIndex = *blinkTimer;
|
||||
if (*eyeIndex >= 3) {
|
||||
*eyeIndex = 0;
|
||||
*eyes = *blinkTimer;
|
||||
if (*eyes >= ENRU1_EYES_UP) {
|
||||
*eyes = ENRU1_EYES_OPEN;
|
||||
}
|
||||
}
|
||||
|
||||
void EnRu1_SetEyeIndex(EnRu1* this, s16 eyeIndex) {
|
||||
this->eyeIndex = eyeIndex;
|
||||
void EnRu1_SetEyes(EnRu1* this, s16 eyes) {
|
||||
this->eyes = eyes;
|
||||
}
|
||||
|
||||
void EnRu1_SetMouthIndex(EnRu1* this, s16 mouthIndex) {
|
||||
this->mouthIndex = mouthIndex;
|
||||
void EnRu1_SetMouth(EnRu1* this, s16 mouth) {
|
||||
this->mouth = mouth;
|
||||
}
|
||||
|
||||
void func_80AEAECC(EnRu1* this, PlayState* play) {
|
||||
|
@ -436,8 +451,8 @@ void EnRu1_InitOutsideJabuJabu(EnRu1* this, PlayState* play) {
|
|||
EnRu1_AnimationChange(this, &gRutoChildWaitHandsBehindBackAnim, ANIMMODE_LOOP, 0, false);
|
||||
this->action = 0;
|
||||
this->drawConfig = 1;
|
||||
EnRu1_SetEyeIndex(this, 4);
|
||||
EnRu1_SetMouthIndex(this, 0);
|
||||
EnRu1_SetEyes(this, ENRU1_EYES_GAZING);
|
||||
EnRu1_SetMouth(this, ENRU1_MOUTH_SMILING);
|
||||
}
|
||||
|
||||
CsCmdActorCue* EnRu1_GetCueChannel3(PlayState* play) {
|
||||
|
@ -793,7 +808,7 @@ void EnRu1_InitInJabuJabuHolesRoom(EnRu1* this, PlayState* play) {
|
|||
if (!GET_INFTABLE(INFTABLE_141)) {
|
||||
EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false);
|
||||
this->action = 7;
|
||||
EnRu1_SetMouthIndex(this, 1);
|
||||
EnRu1_SetMouth(this, ENRU1_MOUTH_FROWNING);
|
||||
} else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) {
|
||||
if (!func_80AEB020(this, play)) {
|
||||
s8 actorRoom;
|
||||
|
@ -1038,8 +1053,8 @@ void EnRu1_InitInBossRoom(EnRu1* this, PlayState* play) {
|
|||
EnRu1_AnimationChange(this, &gRutoChildWaitHandsOnHipsAnim, ANIMMODE_LOOP, 0, false);
|
||||
this->action = 15;
|
||||
this->actor.shape.yOffset = -10000.0f;
|
||||
EnRu1_SetEyeIndex(this, 5);
|
||||
EnRu1_SetMouthIndex(this, 2);
|
||||
EnRu1_SetEyes(this, ENRU1_EYES_BLUSH);
|
||||
EnRu1_SetMouth(this, ENRU1_MOUTH_OPEN);
|
||||
}
|
||||
|
||||
void func_80AECE04(EnRu1* this, PlayState* play) {
|
||||
|
@ -1968,8 +1983,8 @@ void func_80AEF51C(EnRu1* this) {
|
|||
|
||||
void func_80AEF540(EnRu1* this) {
|
||||
if (EnRu1_GetPlatformCamSetting(this) == 2) {
|
||||
EnRu1_SetEyeIndex(this, 3);
|
||||
EnRu1_SetMouthIndex(this, 2);
|
||||
EnRu1_SetEyes(this, ENRU1_EYES_UP);
|
||||
EnRu1_SetMouth(this, ENRU1_MOUTH_OPEN);
|
||||
if (this->skelAnime.mode != 2) {
|
||||
EnRu1_AnimationChange(this, &gRutoChildShutterAnim, ANIMMODE_ONCE, -8.0f, false);
|
||||
func_80AEF51C(this);
|
||||
|
@ -1983,8 +1998,8 @@ void func_80AEF5B8(EnRu1* this) {
|
|||
if (D_80AF1938 == 0) {
|
||||
curFrame = this->skelAnime.curFrame;
|
||||
if (curFrame >= 60.0f) {
|
||||
EnRu1_SetEyeIndex(this, 3);
|
||||
EnRu1_SetMouthIndex(this, 0);
|
||||
EnRu1_SetEyes(this, ENRU1_EYES_UP);
|
||||
EnRu1_SetMouth(this, ENRU1_MOUTH_SMILING);
|
||||
func_80AED57C(this);
|
||||
D_80AF1938 = 1;
|
||||
}
|
||||
|
@ -2380,11 +2395,11 @@ void EnRu1_DrawNothing(EnRu1* this, PlayState* play) {
|
|||
|
||||
void EnRu1_DrawOpa(EnRu1* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
s16 eyeIndex = this->eyeIndex;
|
||||
void* eyeTex = sEyeTextures[eyeIndex];
|
||||
s16 mouthIndex = this->mouthIndex;
|
||||
s16 eyes = this->eyes;
|
||||
void* eyeTex = sEyeTextures[eyes];
|
||||
s16 mouth = this->mouth;
|
||||
SkelAnime* skelAnime = &this->skelAnime;
|
||||
void* mouthTex = sMouthTextures[mouthIndex];
|
||||
void* mouthTex = sMouthTextures[mouth];
|
||||
s32 pad1;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_ru1.c", 1282);
|
||||
|
@ -2405,11 +2420,11 @@ void EnRu1_DrawOpa(EnRu1* this, PlayState* play) {
|
|||
|
||||
void EnRu1_DrawXlu(EnRu1* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
s16 eyeIndex = this->eyeIndex;
|
||||
void* eyeTex = sEyeTextures[eyeIndex];
|
||||
s16 mouthIndex = this->mouthIndex;
|
||||
s16 eyes = this->eyes;
|
||||
void* eyeTex = sEyeTextures[eyes];
|
||||
s16 mouth = this->mouth;
|
||||
SkelAnime* skelAnime = &this->skelAnime;
|
||||
void* mouthTex = sMouthTextures[mouthIndex];
|
||||
void* mouthTex = sMouthTextures[mouth];
|
||||
s32 pad1;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_ru1.c", 1324);
|
||||
|
|
|
@ -21,9 +21,9 @@ typedef struct EnRu1 {
|
|||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ Vec3s jointTable[17];
|
||||
/* 0x01F6 */ Vec3s morphTable[17];
|
||||
/* 0x025C */ s16 eyeIndex;
|
||||
/* 0x025C */ s16 eyes;
|
||||
/* 0x025E */ s16 blinkTimer;
|
||||
/* 0x0260 */ s16 mouthIndex;
|
||||
/* 0x0260 */ s16 mouth;
|
||||
/* 0x0264 */ s32 action;
|
||||
/* 0x0268 */ s32 drawConfig;
|
||||
/* 0x026C */ f32 unk_26C;
|
||||
|
|
Loading…
Add table
Reference in a new issue