From c712d523b32cbc2d2fe72deea382a6dd9562f5a9 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 26 Oct 2023 12:56:19 -0700 Subject: [PATCH] Rename known fields Former-commit-id: 78bbe70ce243df22d010bd592b317ef5e7e3d427 --- include/Kyoto/Audio/CMidiManager.hpp | 8 +++--- src/Kyoto/Audio/CMidiManager.cpp | 38 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/Kyoto/Audio/CMidiManager.hpp b/include/Kyoto/Audio/CMidiManager.hpp index 4440eb73..febc07f9 100644 --- a/include/Kyoto/Audio/CMidiManager.hpp +++ b/include/Kyoto/Audio/CMidiManager.hpp @@ -23,10 +23,10 @@ public: void SetSongId(const short id); private: - u32 x0_; - CSfxHandle x4_; - short x8_; - bool xa_; + u32 x0_sysHandle; + CSfxHandle x4_midiHandle; + short x8_songId; + bool xa_available; }; class CMidiData { public: diff --git a/src/Kyoto/Audio/CMidiManager.cpp b/src/Kyoto/Audio/CMidiManager.cpp index cf93906a..5dd82bfe 100644 --- a/src/Kyoto/Audio/CMidiManager.cpp +++ b/src/Kyoto/Audio/CMidiManager.cpp @@ -8,28 +8,28 @@ rstl::reserved_vector< CMidiManager::CMidiWrapper, 3 > CMidiManager::mMidiWrappers; -CMidiManager::CMidiWrapper::CMidiWrapper() : x0_(0), xa_(1) {} +CMidiManager::CMidiWrapper::CMidiWrapper() : x0_sysHandle(0), xa_available(true) {} -const CSfxHandle& CMidiManager::CMidiWrapper::GetManagerHandle() const { return x4_; } +const CSfxHandle& CMidiManager::CMidiWrapper::GetManagerHandle() const { return x4_midiHandle; } -const u32 CMidiManager::CMidiWrapper::GetAudioSysHandle() const { return x0_; } +const u32 CMidiManager::CMidiWrapper::GetAudioSysHandle() const { return x0_sysHandle; } -const bool CMidiManager::CMidiWrapper::IsAvailable() const { return xa_; } +const bool CMidiManager::CMidiWrapper::IsAvailable() const { return xa_available; } -const short CMidiManager::CMidiWrapper::GetSongId() const { return x8_; } +const short CMidiManager::CMidiWrapper::GetSongId() const { return x8_songId; } -void CMidiManager::CMidiWrapper::SetAvailable(const bool v) { xa_ = v; } +void CMidiManager::CMidiWrapper::SetAvailable(const bool v) { xa_available = v; } -void CMidiManager::CMidiWrapper::SetAudioSysHandle(const u32 handle) { x0_ = handle; } +void CMidiManager::CMidiWrapper::SetAudioSysHandle(const u32 handle) { x0_sysHandle = handle; } -void CMidiManager::CMidiWrapper::SetMidiHandle(const CSfxHandle& handle) { x4_ = handle; } +void CMidiManager::CMidiWrapper::SetMidiHandle(const CSfxHandle& handle) { x4_midiHandle = handle; } -void CMidiManager::CMidiWrapper::SetSongId(const short id) { x8_ = id; } +void CMidiManager::CMidiWrapper::SetSongId(const short id) { x8_songId = id; } CSfxHandle CMidiManager::Play(const CMidiData& data, unsigned short fadeTime, bool stopExisting, short volume) { - bool bVar2 = false; - u32 uVar6 = 0; + bool foundExisting = false; + u32 sysHandle = 0; CSfxHandle handle = LocateHandle(); if (!handle) { return CSfxHandle(); @@ -44,8 +44,8 @@ CSfxHandle CMidiManager::Play(const CMidiData& data, unsigned short fadeTime, bo } if (data.GetSongId() == mMidiWrappers[i].GetSongId()) { - bVar2 = true; - uVar6 = mMidiWrappers[i].GetAudioSysHandle(); + foundExisting = true; + sysHandle = mMidiWrappers[i].GetAudioSysHandle(); mMidiWrappers[i].SetAvailable(true); } else { Stop(mMidiWrappers[i].GetManagerHandle(), fadeTime); @@ -53,16 +53,16 @@ CSfxHandle CMidiManager::Play(const CMidiData& data, unsigned short fadeTime, bo } } - if (bVar2) { - wrapper.SetAudioSysHandle(uVar6); + if (foundExisting) { + wrapper.SetAudioSysHandle(sysHandle); wrapper.SetSongId(data.GetSongId()); } else { - u32 tmp = CAudioSys::SeqPlayEx(data.GetGroupId(), data.GetSongId(), data.GetData(), nullptr, 0); + u32 sysHandle = CAudioSys::SeqPlayEx(data.GetGroupId(), data.GetSongId(), data.GetData(), nullptr, 0); if (fadeTime != 0) { - CAudioSys::SeqVolume(0, 0, tmp, 0); + CAudioSys::SeqVolume(0, 0, sysHandle, 0); } - CAudioSys::SeqVolume(volume, fadeTime, tmp, 0); - wrapper.SetAudioSysHandle(tmp); + CAudioSys::SeqVolume(volume, fadeTime, sysHandle, 0); + wrapper.SetAudioSysHandle(sysHandle); wrapper.SetSongId(data.GetSongId()); }