2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-04-20 14:44:18 -07:00
|
|
|
|
2019-09-23 12:00:23 -07:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/Audio/CSfxManager.hpp"
|
|
|
|
#include "Runtime/World/CActor.hpp"
|
2016-04-20 14:44:18 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2018-12-07 21:30:43 -08:00
|
|
|
|
|
|
|
class CScriptSound : public CActor {
|
|
|
|
static bool sFirstInFrame;
|
|
|
|
|
|
|
|
float xe8_occUpdateTimer = 0.f;
|
|
|
|
CSfxHandle xec_sfxHandle;
|
|
|
|
float xf0_maxVol = 0.f;
|
|
|
|
float xf2_maxVolUpd = 0.f;
|
|
|
|
float xf4_maxVolUpdDelta = 0.f;
|
|
|
|
float xf8_updateTimer = 0.f;
|
|
|
|
float xfc_startDelay;
|
|
|
|
u16 x100_soundId;
|
|
|
|
float x104_maxDist;
|
|
|
|
float x108_distComp;
|
|
|
|
float x10c_minVol;
|
|
|
|
float x10e_vol;
|
|
|
|
s16 x110_;
|
|
|
|
s16 x112_prio;
|
|
|
|
float x114_pan;
|
2020-10-24 16:00:39 -07:00
|
|
|
short x116_;
|
2018-12-07 21:30:43 -08:00
|
|
|
float x118_pitch;
|
2020-04-19 21:57:50 -07:00
|
|
|
bool x11c_24_playRequested : 1 = false;
|
2020-04-10 22:50:10 -07:00
|
|
|
bool x11c_25_looped : 1;
|
|
|
|
bool x11c_26_nonEmitter : 1;
|
|
|
|
bool x11c_27_autoStart : 1;
|
|
|
|
bool x11c_28_occlusionTest : 1;
|
|
|
|
bool x11c_29_acoustics : 1;
|
|
|
|
bool x11c_30_worldSfx : 1;
|
2020-04-19 21:57:50 -07:00
|
|
|
bool x11c_31_selfFree : 1 = false;
|
2020-04-10 22:50:10 -07:00
|
|
|
bool x11d_24_allowDuplicates : 1;
|
2020-04-19 21:57:50 -07:00
|
|
|
bool x11d_25_processedThisFrame : 1 = false;
|
2017-01-24 09:23:10 -08:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
static float GetOccludedVolumeAmount(const zeus::CVector3f& pos, const CStateManager& mgr);
|
2017-11-26 21:06:53 -08:00
|
|
|
|
2016-04-20 14:44:18 -07:00
|
|
|
public:
|
2021-05-26 07:00:57 -07:00
|
|
|
DEFINE_ENTITY
|
2018-12-07 21:30:43 -08:00
|
|
|
CScriptSound(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, u16 soundId,
|
|
|
|
bool active, float maxDist, float distComp, float startDelay, u32 minVol, u32 vol, u32 w3, u32 prio,
|
|
|
|
u32 pan, u32 w6, bool looped, bool nonEmitter, bool autoStart, bool occlusionTest, bool acoustics,
|
|
|
|
bool worldSfx, bool allowDuplicates, s32 pitch);
|
|
|
|
|
2019-08-09 05:45:18 -07:00
|
|
|
void Accept(IVisitor& visitor) override;
|
2020-04-05 04:54:02 -07:00
|
|
|
void AddToRenderer(const zeus::CFrustum&, CStateManager&) override {}
|
2019-08-09 05:45:18 -07:00
|
|
|
void PreThink(float, CStateManager&) override;
|
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
2018-12-07 21:30:43 -08:00
|
|
|
void PlaySound(CStateManager&);
|
|
|
|
void StopSound(CStateManager&);
|
2016-04-20 14:44:18 -07:00
|
|
|
};
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|