Amuse API changes

This commit is contained in:
Jack Andersen 2018-08-27 19:44:16 -10:00
parent 34fdcd0a56
commit 5a60a0acfc
12 changed files with 40 additions and 26 deletions

View File

@ -2,13 +2,28 @@
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Editor/locale" vcs="Git" />
<mapping directory="$PROJECT_DIR$/NESEmulator/fixNES" vcs="Git" />
<mapping directory="$PROJECT_DIR$/amuse" vcs="Git" /> <mapping directory="$PROJECT_DIR$/amuse" vcs="Git" />
<mapping directory="$PROJECT_DIR$/assetnameparser/tinyxml2" vcs="Git" /> <mapping directory="$PROJECT_DIR$/assetnameparser/tinyxml2" vcs="Git" />
<mapping directory="$PROJECT_DIR$/cotire" vcs="Git" />
<mapping directory="$PROJECT_DIR$/discord-rpc" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl-gui" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl-gui/quazip" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/athena" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/boo" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/boo/glslang" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/boo/logvisor" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/libSquish" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/libjpeg-turbo" vcs="Git" />
<mapping directory="$PROJECT_DIR$/jbus" vcs="Git" /> <mapping directory="$PROJECT_DIR$/jbus" vcs="Git" />
<mapping directory="$PROJECT_DIR$/kabufuda" vcs="Git" /> <mapping directory="$PROJECT_DIR$/kabufuda" vcs="Git" />
<mapping directory="$PROJECT_DIR$/nod" vcs="Git" /> <mapping directory="$PROJECT_DIR$/nod" vcs="Git" />
<mapping directory="$PROJECT_DIR$/nod/logvisor" vcs="Git" /> <mapping directory="$PROJECT_DIR$/nod/logvisor" vcs="Git" />
<mapping directory="$PROJECT_DIR$/rapidjson" vcs="Git" />
<mapping directory="$PROJECT_DIR$/rapidjson/thirdparty/gtest" vcs="Git" />
<mapping directory="$PROJECT_DIR$/sanitizers-cmake" vcs="Git" />
<mapping directory="$PROJECT_DIR$/specter" vcs="Git" /> <mapping directory="$PROJECT_DIR$/specter" vcs="Git" />
<mapping directory="$PROJECT_DIR$/specter/freetype2" vcs="Git" /> <mapping directory="$PROJECT_DIR$/specter/freetype2" vcs="Git" />
<mapping directory="$PROJECT_DIR$/specter/zeus" vcs="Git" /> <mapping directory="$PROJECT_DIR$/specter/zeus" vcs="Git" />

View File

@ -12,7 +12,8 @@ void SCLY::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs)
layerCount = rs.readUint32Big(); layerCount = rs.readUint32Big();
rs.enumerateBig(layerSizes, layerCount); rs.enumerateBig(layerSizes, layerCount);
atUint32 i = 0; atUint32 i = 0;
rs.enumerate<ScriptLayer>(layers, layerCount, [&i,this](athena::io::IStreamReader& rs, ScriptLayer& layer) { rs.enumerate<ScriptLayer>(layers, layerCount,
[&i,this](athena::io::IStreamReader& rs, ScriptLayer& layer) {
atUint64 start = rs.position(); atUint64 start = rs.position();
layer.read(rs); layer.read(rs);
rs.seek(start + layerSizes[i++], athena::Begin); rs.seek(start + layerSizes[i++], athena::Begin);

View File

@ -390,10 +390,9 @@ bool ViewManager::proc()
gfxQ->execute(); gfxQ->execute();
if (g_ResFactory) if (g_ResFactory)
g_ResFactory->AsyncIdle(); g_ResFactory->AsyncIdle();
m_voiceEngine->pumpAndMixVoices();
if (!m_skipWait || !hecl::com_developer->toBoolean()) if (!m_skipWait || !hecl::com_developer->toBoolean())
m_mainWindow->waitForRetrace(m_voiceEngine.get()); m_mainWindow->waitForRetrace();
else
m_voiceEngine->pumpAndMixVoices();
CBooModel::ClearModelUniformCounters(); CBooModel::ClearModelUniformCounters();
CGraphics::TickRenderTimings(); CGraphics::TickRenderTimings();
++logvisor::FrameIndex; ++logvisor::FrameIndex;

View File

@ -25,13 +25,13 @@ public:
class CMidiWrapper class CMidiWrapper
{ {
std::shared_ptr<amuse::Sequencer> x0_sequencer; amuse::ObjToken<amuse::Sequencer> x0_sequencer;
//CSfxHandle x4_handle; //CSfxHandle x4_handle;
u16 x8_songId; u16 x8_songId;
bool xa_available = true; bool xa_available = true;
public: public:
const std::shared_ptr<amuse::Sequencer>& GetAudioSysHandle() const { return x0_sequencer; } amuse::ObjToken<amuse::Sequencer> GetAudioSysHandle() const { return x0_sequencer; }
void SetAudioSysHandle(const std::shared_ptr<amuse::Sequencer>& sequencer) { x0_sequencer = sequencer; } void SetAudioSysHandle(amuse::ObjToken<amuse::Sequencer> sequencer) { x0_sequencer = sequencer; }
//const CSfxHandle& GetManagerHandle() const { return x4_handle; } //const CSfxHandle& GetManagerHandle() const { return x4_handle; }
//void SetMidiHandle(const CSfxHandle& handle) { x4_handle = handle; } //void SetMidiHandle(const CSfxHandle& handle) { x4_handle = handle; }
bool IsAvailable() const { return xa_available; } bool IsAvailable() const { return xa_available; }

View File

@ -37,7 +37,7 @@ bool CSfxManager::m_auxProcessingEnabled = false;
float CSfxManager::m_reverbAmount = 1.f; float CSfxManager::m_reverbAmount = 1.f;
CSfxManager::EAuxEffect CSfxManager::m_activeEffect = CSfxManager::EAuxEffect::None; CSfxManager::EAuxEffect CSfxManager::m_activeEffect = CSfxManager::EAuxEffect::None;
CSfxManager::EAuxEffect CSfxManager::m_nextEffect = CSfxManager::EAuxEffect::None; CSfxManager::EAuxEffect CSfxManager::m_nextEffect = CSfxManager::EAuxEffect::None;
std::shared_ptr<amuse::Listener> CSfxManager::m_listener; amuse::ObjToken<amuse::Listener> CSfxManager::m_listener;
u16 CSfxManager::kMaxPriority; u16 CSfxManager::kMaxPriority;
u16 CSfxManager::kMedPriority; u16 CSfxManager::kMedPriority;

View File

@ -106,7 +106,7 @@ public:
virtual void Stop()=0; virtual void Stop()=0;
virtual bool Ready()=0; virtual bool Ready()=0;
virtual ESfxAudibility GetAudible(const zeus::CVector3f&)=0; virtual ESfxAudibility GetAudible(const zeus::CVector3f&)=0;
virtual const std::shared_ptr<amuse::Voice>& GetVoice() const=0; virtual amuse::ObjToken<amuse::Voice> GetVoice() const=0;
virtual u16 GetSfxId() const=0; virtual u16 GetSfxId() const=0;
virtual void UpdateEmitterSilent()=0; virtual void UpdateEmitterSilent()=0;
virtual void UpdateEmitter()=0; virtual void UpdateEmitter()=0;
@ -132,7 +132,7 @@ public:
{ {
float x1a_reverb; float x1a_reverb;
CAudioSys::C3DEmitterParmData x24_parmData; CAudioSys::C3DEmitterParmData x24_parmData;
std::shared_ptr<amuse::Emitter> x50_emitterHandle; amuse::ObjToken<amuse::Emitter> x50_emitterHandle;
bool x54_ready = true; bool x54_ready = true;
float x55_cachedMaxVol; float x55_cachedMaxVol;
public: public:
@ -141,14 +141,14 @@ public:
void Stop(); void Stop();
bool Ready(); bool Ready();
ESfxAudibility GetAudible(const zeus::CVector3f&); ESfxAudibility GetAudible(const zeus::CVector3f&);
const std::shared_ptr<amuse::Voice>& GetVoice() const { return x50_emitterHandle->getVoice(); } amuse::ObjToken<amuse::Voice> GetVoice() const { return x50_emitterHandle->getVoice(); }
u16 GetSfxId() const; u16 GetSfxId() const;
void UpdateEmitterSilent(); void UpdateEmitterSilent();
void UpdateEmitter(); void UpdateEmitter();
void SetReverb(float rev); void SetReverb(float rev);
CAudioSys::C3DEmitterParmData& GetEmitterData() { return x24_parmData; } CAudioSys::C3DEmitterParmData& GetEmitterData() { return x24_parmData; }
const std::shared_ptr<amuse::Emitter>& GetHandle() const { return x50_emitterHandle; } amuse::ObjToken<amuse::Emitter> GetHandle() const { return x50_emitterHandle; }
CSfxEmitterWrapper(bool looped, s16 prio, const CAudioSys::C3DEmitterParmData& data, CSfxEmitterWrapper(bool looped, s16 prio, const CAudioSys::C3DEmitterParmData& data,
/*const CSfxHandle& handle,*/ bool useAcoustics, TAreaId area) /*const CSfxHandle& handle,*/ bool useAcoustics, TAreaId area)
@ -161,7 +161,7 @@ public:
class CSfxWrapper : public CBaseSfxWrapper class CSfxWrapper : public CBaseSfxWrapper
{ {
u16 x18_sfxId; u16 x18_sfxId;
std::shared_ptr<amuse::Voice> x1c_voiceHandle; amuse::ObjToken<amuse::Voice> x1c_voiceHandle;
float x20_vol; float x20_vol;
float x22_pan; float x22_pan;
bool x24_ready = true; bool x24_ready = true;
@ -171,7 +171,7 @@ public:
void Stop(); void Stop();
bool Ready(); bool Ready();
ESfxAudibility GetAudible(const zeus::CVector3f&) { return ESfxAudibility::Aud3; } ESfxAudibility GetAudible(const zeus::CVector3f&) { return ESfxAudibility::Aud3; }
const std::shared_ptr<amuse::Voice>& GetVoice() const { return x1c_voiceHandle; } amuse::ObjToken<amuse::Voice> GetVoice() const { return x1c_voiceHandle; }
u16 GetSfxId() const; u16 GetSfxId() const;
void UpdateEmitterSilent(); void UpdateEmitterSilent();
void UpdateEmitter(); void UpdateEmitter();
@ -196,7 +196,7 @@ public:
static float m_reverbAmount; static float m_reverbAmount;
static EAuxEffect m_activeEffect; static EAuxEffect m_activeEffect;
static EAuxEffect m_nextEffect; static EAuxEffect m_nextEffect;
static std::shared_ptr<amuse::Listener> m_listener; static amuse::ObjToken<amuse::Listener> m_listener;
static u16 kMaxPriority; static u16 kMaxPriority;
static u16 kMedPriority; static u16 kMedPriority;

View File

@ -70,11 +70,11 @@ private:
std::vector<zeus::CMatrix3f> x50_parentMatrices; std::vector<zeus::CMatrix3f> x50_parentMatrices;
std::vector<std::array<float, 8>> x60_advValues; std::vector<std::array<float, 8>> x60_advValues;
u32 x70_internalStartFrame = 0; int x70_internalStartFrame = 0;
u32 x74_curFrame = 0; int x74_curFrame = 0;
double x78_curSeconds = 0.f; double x78_curSeconds = 0.f;
float x80_timeDeltaScale; float x80_timeDeltaScale;
u32 x84_prevFrame = -1; int x84_prevFrame = -1;
bool x88_particleEmission = true; bool x88_particleEmission = true;
float x8c_generatorRemainder = 0.f; float x8c_generatorRemainder = 0.f;
int x90_MAXP = 0; int x90_MAXP = 0;

View File

@ -24,7 +24,7 @@ bool CMVEImplosion::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVector3f&
float d; float d;
x10_minMag->GetValue(frame, d); x10_minMag->GetValue(frame, d);
if (x14_enableMinMag && dvm < d) if (x14_enableMinMag && dvm < d)
return false; return true;
if (0.f == dvm) if (0.f == dvm)
return false; return false;
@ -51,7 +51,7 @@ bool CMVEExponentialImplosion::GetValue(int frame, zeus::CVector3f& pVel, zeus::
float d; float d;
x10_minMag->GetValue(frame, d); x10_minMag->GetValue(frame, d);
if (x14_enableMinMag && dvm < d) if (x14_enableMinMag && dvm < d)
return false; return true;
if (0.f == dvm) if (0.f == dvm)
return false; return false;
@ -78,7 +78,7 @@ bool CMVELinearImplosion::GetValue(int frame, zeus::CVector3f& pVel, zeus::CVect
float d; float d;
x10_minMag->GetValue(frame, d); x10_minMag->GetValue(frame, d);
if (x14_enableMinMag && dvm < d) if (x14_enableMinMag && dvm < d)
return false; return true;
if (0.f == dvm) if (0.f == dvm)
return false; return false;

View File

@ -37,8 +37,9 @@ public:
{ {
float lt = g_ParticleLifetime != 0.0f ? g_ParticleLifetime : 1.0f; float lt = g_ParticleLifetime != 0.0f ? g_ParticleLifetime : 1.0f;
g_ParticleLifetimePercentageReal = 100.0f * frame / lt; g_ParticleLifetimePercentageReal = 100.0f * frame / lt;
g_ParticleLifetimePercentage = g_ParticleLifetimePercentageReal; g_ParticleLifetimePercentage = int(g_ParticleLifetimePercentageReal);
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage; g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
g_ParticleLifetimePercentage = zeus::clamp(0, g_ParticleLifetimePercentage, 100);
} }
static const std::array<float, 8>* g_particleAccessParameters; static const std::array<float, 8>* g_particleAccessParameters;

View File

@ -65,8 +65,6 @@ zeus::CVector3f CScriptDoor::GetOrbitPosition(const CStateManager& /*mgr*/) cons
/* ORIGINAL 0-00 OFFSET: 8007E550 */ /* ORIGINAL 0-00 OFFSET: 8007E550 */
void CScriptDoor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager &mgr) void CScriptDoor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager &mgr)
{ {
if (msg == EScriptObjectMessage::Start)
printf("");
switch (msg) switch (msg)
{ {
case EScriptObjectMessage::Close: case EScriptObjectMessage::Close:

2
amuse

@ -1 +1 @@
Subproject commit cdc720b8a7b7cade5f3ca22d98ee9c8aec16b8a8 Subproject commit 1884e0ca7afa8e4eb37db9ff99e14cc19e875405

2
hecl

@ -1 +1 @@
Subproject commit bc50b1b7d721c5d5d5ce87a11877ff7e94fe053f Subproject commit e6fd690fc181174d8d0b0341e3e45521fd19f80c