From 73d1d20d8933197c04222b2f80d3b6303bbfb0f5 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sat, 14 Mar 2026 16:43:20 +0100 Subject: [PATCH] Fix JAUSoundAnimation --- .../JSystem/JAudio2/JAUSoundAnimator.h | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h b/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h index b9e1d433c9..e81cd70ee4 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h @@ -2,6 +2,7 @@ #define JAUSOUNDANIMATOR_H #include "JSystem/JAudio2/JAISound.h" +#include "dusk/offset_ptr.h" class JAUSoundAnimation; @@ -62,10 +63,10 @@ public: } /* 0x00 */ JAISoundID mSoundId; - /* 0x04 */ f32 field_0x04; - /* 0x08 */ f32 field_0x08; - /* 0x0C */ f32 field_0x0c; - /* 0x10 */ u32 mFlags; + /* 0x04 */ BE(f32) field_0x04; + /* 0x08 */ BE(f32) field_0x08; + /* 0x0C */ BE(f32) field_0x0c; + /* 0x10 */ BE(u32) mFlags; /* 0x14 */ u8 field_0x14; /* 0x15 */ u8 field_0x15; /* 0x16 */ u8 field_0x16; @@ -97,23 +98,31 @@ public: int getEndSoundIndex(f32) const; u16 getNumSounds() const { +#if TARGET_PC + return mNumSounds; +#else if (mControl != NULL) { return mControl->getNumSounds(this); } else { return mNumSounds; } +#endif } const JAUSoundAnimationSound* getSound(int i_index) const { +#if TARGET_PC + return &mSounds + i_index; +#else if (mControl != NULL) { return mControl->getSound(this, i_index); } else { return &mSounds + i_index; } +#endif } - /* 0x0 */ u16 mNumSounds; - /* 0x4 */ JAUSoundAnimationControl* mControl; + /* 0x0 */ BE(u16) mNumSounds; + /* 0x4 */ OFFSET_PTR(JAUSoundAnimationControl) mControl; /* 0x8 */ JAUSoundAnimationSound mSounds; // actually an array };