mirror of
https://github.com/zeldaret/ss
synced 2026-06-05 03:07:49 -04:00
A bit more
This commit is contained in:
@@ -2407,7 +2407,13 @@ d/snd/mgr/d_snd_mgr_effect.cpp:
|
||||
.text start:0x8036C6B0 end:0x8037F8B4 align:16
|
||||
|
||||
d/snd/mgr/d_snd_mgr_unk_5.cpp:
|
||||
.text start:0x8037F8C0 end:0x803864C8 align:16
|
||||
.text start:0x8037F8C0 end:0x80382150 align:16
|
||||
|
||||
d/snd/d_snd_anim_sound.cpp:
|
||||
.text start:0x80382150 end:0x8038240C align:16
|
||||
|
||||
d/snd/mgr/d_snd_mgr_unk_14.cpp:
|
||||
.text start:0x80382410 end:0x803864C8 align:16
|
||||
.ctors start:0x804DB91C end:0x804DB920
|
||||
|
||||
d/snd/mgr/d_snd_mgr_unk_13.cpp:
|
||||
|
||||
@@ -19840,16 +19840,16 @@ __cl__22SoundPropertiesCheckerFRQ34nw4r3snd11SoundHandle = .text:0x8035A600; //
|
||||
__dt__11dSndActor_cFv = .text:0x8035A840; // type:function size:0x58 scope:weak
|
||||
__ct__13dSnd3DActor_cFPvUc = .text:0x8035A8A0; // type:function size:0xE8
|
||||
d_vt_0x34__13dSnd3DActor_cFRCQ34nw4r4math4VEC3 = .text:0x8035A990; // type:function size:0x40
|
||||
fn_8035A9D0 = .text:0x8035A9D0; // type:function size:0x2C
|
||||
resetCachedRelativePositions__13dSnd3DActor_cFv = .text:0x8035A9D0; // type:function size:0x2C
|
||||
fn_8035AA00 = .text:0x8035AA00; // type:function size:0x30
|
||||
updatePositionRelativeToListener__13dSnd3DActor_cFv = .text:0x8035AA30; // type:function size:0x44
|
||||
calculatePositionRelativeToListener__13dSnd3DActor_cFv = .text:0x8035AA80; // type:function size:0x28
|
||||
updateDistanceToListener__13dSnd3DActor_cFv = .text:0x8035AAB0; // type:function size:0x50
|
||||
fn_8035AB00 = .text:0x8035AB00; // type:function size:0x54
|
||||
fn_8035AB60 = .text:0x8035AB60; // type:function size:0x78
|
||||
fn_8035ABE0 = .text:0x8035ABE0; // type:function size:0x44
|
||||
fn_8035AC30 = .text:0x8035AC30; // type:function size:0x28
|
||||
fn_8035AC60 = .text:0x8035AC60; // type:function size:0x50
|
||||
updatePositionTransformedByListener__13dSnd3DActor_cFv = .text:0x8035AB00; // type:function size:0x54
|
||||
updateCameraDirectionDot__13dSnd3DActor_cFv = .text:0x8035AB60; // type:function size:0x78
|
||||
updatePositionRelativeToCameraTarget__13dSnd3DActor_cFv = .text:0x8035ABE0; // type:function size:0x44
|
||||
calculatePositionRelativeToCameraTarget__13dSnd3DActor_cFv = .text:0x8035AC30; // type:function size:0x28
|
||||
updateDistanceToCameraTarget__13dSnd3DActor_cFv = .text:0x8035AC60; // type:function size:0x50
|
||||
updatePositionRelativeToPlayer__13dSnd3DActor_cFv = .text:0x8035ACB0; // type:function size:0xBC
|
||||
getPositionRelativeToPlayer__13dSnd3DActor_cFv = .text:0x8035AD70; // type:function size:0x3C
|
||||
updateDistanceToPlayer__13dSnd3DActor_cFv = .text:0x8035ADB0; // type:function size:0xFC
|
||||
|
||||
@@ -717,6 +717,8 @@ config.libs = [
|
||||
Object(Matching, "d/snd/d_snd_control_player.cpp"),
|
||||
Object(NonMatching, "d/snd/mgr/d_snd_mgr_effect.cpp"),
|
||||
Object(NonMatching, "d/snd/mgr/d_snd_mgr_unk_5.cpp"),
|
||||
Object(NonMatching, "d/snd/d_snd_anim_sound.cpp"),
|
||||
Object(NonMatching, "d/snd/mgr/d_snd_mgr_unk_14.cpp"),
|
||||
Object(NonMatching, "d/snd/mgr/d_snd_mgr_unk_13.cpp"),
|
||||
Object(NonMatching, "d/snd/d_snd_source.cpp"),
|
||||
Object(NonMatching, "d/snd/mgr/d_snd_mgr_unk_7.cpp"),
|
||||
|
||||
@@ -41,6 +41,13 @@ public:
|
||||
virtual void d_vt_0x58() = 0;
|
||||
virtual void d_vt_0x5C() = 0;
|
||||
|
||||
void resetCachedRelativePositions();
|
||||
|
||||
void updatePositionTransformedByListener();
|
||||
void updateCameraDirectionDot();
|
||||
void updatePositionRelativeToCameraTarget();
|
||||
void calculatePositionRelativeToCameraTarget();
|
||||
void updateDistanceToCameraTarget();
|
||||
void calculatePositionRelativeToListener();
|
||||
void updatePositionRelativeToListener();
|
||||
void updateDistanceToListener();
|
||||
@@ -72,11 +79,12 @@ protected:
|
||||
/* 0x8C */ f32 a_field_0x8C;
|
||||
/* 0x90 */ f32 a_field_0x90;
|
||||
/* 0x94 */ f32 mDistanceToListener;
|
||||
/* 0x98 */ f32 a_field_0x98;
|
||||
/* 0x98 */ f32 mCameraDirectionDot;
|
||||
/* 0x9C */ f32 a_field_0x9C;
|
||||
/* 0xA0 */ nw4r::math::VEC3 mPositionRelativeToListener;
|
||||
/* 0xAC */ nw4r::math::VEC3 mPositionTransformedByListener;
|
||||
/* 0xB8 */ u8 a_0xB8[0xC8 - 0xB8];
|
||||
/* 0xB8 */ f32 mDistanceToCameraTarget;
|
||||
/* 0xBC */ nw4r::math::VEC3 mPositionRelativeToCameraTarget;
|
||||
/* 0xC8 */ UNKTYPE *a_field_0xC8;
|
||||
/* 0xCC */ u16 mFlags;
|
||||
/* 0xD0 */ nw4r::math::VEC3 mPositionRelativeToPlayer;
|
||||
|
||||
@@ -46,10 +46,18 @@ public:
|
||||
return mCameraTargetPosition;
|
||||
}
|
||||
|
||||
const mVec3_c &getNrmCameraDirection() const {
|
||||
return mCameraDirectionNormalized;
|
||||
}
|
||||
|
||||
const nw4r::math::VEC3 &getSndListenerPos() const {
|
||||
return mListener.GetPosition();
|
||||
}
|
||||
|
||||
const nw4r::math::MTX34 &getSndListenerMatrix() const {
|
||||
return mListener.GetMatrix();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void updateListenerPos(f32);
|
||||
|
||||
@@ -16,7 +16,6 @@ extern "C" void fn_8035E310(dSndPlayerMgr_c *);
|
||||
extern "C" void fn_8035E820(dSndPlayerMgr_c *);
|
||||
extern "C" void fn_8035E880(dSndPlayerMgr_c *);
|
||||
extern "C" void fn_8035E790(dSndPlayerMgr_c *, UNKWORD, void *);
|
||||
extern "C" bool fn_8035ED90(dSndPlayerMgr_c *, u8);
|
||||
|
||||
extern "C" void *ENEMY_SOUND_MGR;
|
||||
extern "C" void fn_80362150(void *, u16);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/snd/d_snd_3d_manager.h"
|
||||
#include "d/snd/d_snd_player_mgr.h"
|
||||
#include "nw4r/math/math_types.h"
|
||||
#include "toBeSorted/music_mgrs.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -21,7 +21,7 @@ dSnd3DActor_c::dSnd3DActor_c(UNKTYPE *a1, u8 a2)
|
||||
a_field_0x8C(0.0f),
|
||||
a_field_0x90(INFINITY),
|
||||
mDistanceToListener(INFINITY),
|
||||
a_field_0x98(0.0f),
|
||||
mCameraDirectionDot(0.0f),
|
||||
a_field_0x9C(0.0f),
|
||||
a_field_0xC8(a1),
|
||||
mFlags(0),
|
||||
@@ -30,7 +30,7 @@ dSnd3DActor_c::dSnd3DActor_c(UNKTYPE *a1, u8 a2)
|
||||
resetFloats();
|
||||
// Portability hazard
|
||||
SetUserParam(reinterpret_cast<u32>(this));
|
||||
if (fn_8035ED90(BGM_MGR, a2)) {
|
||||
if (dSndPlayerMgr_c::GetInstance()->canUseThisPlayer(a2)) {
|
||||
a_field_0x7F = 1;
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,20 @@ void dSnd3DActor_c::updatePositionRelativeToListener() {
|
||||
}
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::resetCachedRelativePositions() {
|
||||
mPositionRelativeToPlayer.x = INFINITY;
|
||||
mPositionRelativeToPlayer.y = INFINITY;
|
||||
mPositionRelativeToPlayer.z = INFINITY;
|
||||
|
||||
mPositionRelativeToListener.x = INFINITY;
|
||||
mPositionRelativeToListener.y = INFINITY;
|
||||
mPositionRelativeToListener.z = INFINITY;
|
||||
|
||||
mPositionTransformedByListener.x = INFINITY;
|
||||
mPositionTransformedByListener.y = INFINITY;
|
||||
mPositionTransformedByListener.z = INFINITY;
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::calculatePositionRelativeToListener() {
|
||||
nw4r::math::VEC3Sub(
|
||||
&mPositionRelativeToListener, &GetPosition(), &dSnd3DManager_c::GetInstance()->getSndListenerPos()
|
||||
@@ -62,6 +76,46 @@ void dSnd3DActor_c::updateDistanceToListener() {
|
||||
}
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::updatePositionTransformedByListener() {
|
||||
if (!checkFlag(0x10)) {
|
||||
MTXMultVec(
|
||||
dSnd3DManager_c::GetInstance()->getSndListenerMatrix(), GetPosition(), mPositionTransformedByListener
|
||||
);
|
||||
setFlag(0x10);
|
||||
}
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::updateCameraDirectionDot() {
|
||||
if (!checkFlag(0x20)) {
|
||||
updatePositionRelativeToListener();
|
||||
nw4r::math::VEC3 norm;
|
||||
VECNormalize(mPositionRelativeToListener, norm);
|
||||
mCameraDirectionDot = nw4r::math::VEC3Dot(&norm, dSnd3DManager_c::GetInstance()->getNrmCameraDirection());
|
||||
setFlag(0x20);
|
||||
}
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::updatePositionRelativeToCameraTarget() {
|
||||
if (!checkFlag(0x4)) {
|
||||
calculatePositionRelativeToCameraTarget();
|
||||
setFlag(0x4);
|
||||
}
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::calculatePositionRelativeToCameraTarget() {
|
||||
nw4r::math::VEC3Sub(
|
||||
&mPositionRelativeToCameraTarget, &GetPosition(), dSnd3DManager_c::GetInstance()->getCameraTargetPos()
|
||||
);
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::updateDistanceToCameraTarget() {
|
||||
if (!checkFlag(8)) {
|
||||
updatePositionRelativeToCameraTarget();
|
||||
mDistanceToCameraTarget = VEC3Len(&mPositionRelativeToCameraTarget);
|
||||
setFlag(8);
|
||||
}
|
||||
}
|
||||
|
||||
void dSnd3DActor_c::updatePositionRelativeToPlayer() {
|
||||
if (!checkFlag(0x40)) {
|
||||
nw4r::math::VEC3 linkTranslation = dAcPy_c::GetLink()->getCenterTranslation();
|
||||
@@ -98,6 +152,8 @@ f32 dSnd3DActor_c::getDistanceToPlayer() {
|
||||
return mDistanceToPlayer;
|
||||
}
|
||||
|
||||
// here are functions that are probably in part copied from nw4r::snd::Sound3DCalculator
|
||||
|
||||
bool dSnd3DActor_c::hasPlayingSounds() const {
|
||||
for (int i = 0; i < ACTOR_PLAYER_COUNT; i++) {
|
||||
if (GetPlayingSoundCount(i) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user