Fixes issue with ACE displaying only banks (#1427)
Updates to some AzCore functions a while ago made some path functions strip off a trailing slash, which caused bad paths to be used when loading middleware data. Updated the code to use better path APIs.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
#include <ACETypes.h>
|
||||
#include <AudioSystemControl_wwise.h>
|
||||
@@ -540,11 +541,10 @@ namespace AudioControls
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
AZStd::string CAudioSystemEditor_wwise::GetDataPath() const
|
||||
AZ::IO::FixedMaxPath CAudioSystemEditor_wwise::GetDataPath() const
|
||||
{
|
||||
AZStd::string path(Path::GetEditingGameDataFolder());
|
||||
AZ::StringFunc::Path::Join(path.c_str(), "sounds/wwise_project/", path);
|
||||
return path;
|
||||
auto projectPath = AZ::IO::FixedMaxPath{ AZ::Utils::GetProjectPath() };
|
||||
return (projectPath / "sounds" / "wwise_project");
|
||||
}
|
||||
|
||||
} // namespace AudioControls
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace AudioControls
|
||||
const AZStd::string_view GetTypeIcon(TImplControlType type) const override;
|
||||
const AZStd::string_view GetTypeIconSelected(TImplControlType type) const override;
|
||||
AZStd::string GetName() const override;
|
||||
AZStd::string GetDataPath() const;
|
||||
AZ::IO::FixedMaxPath GetDataPath() const override;
|
||||
void DataSaved() override {}
|
||||
void ConnectionRemoved(IAudioSystemControl* control) override;
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
@@ -54,12 +54,12 @@ namespace AudioControls
|
||||
void CAudioWwiseLoader::Load(CAudioSystemEditor_wwise* audioSystemImpl)
|
||||
{
|
||||
m_audioSystemImpl = audioSystemImpl;
|
||||
const AZStd::string wwiseProjectFullPath(m_audioSystemImpl->GetDataPath());
|
||||
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::GameParametersFolder);
|
||||
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::GameStatesFolder);
|
||||
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::SwitchesFolder);
|
||||
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::EventsFolder);
|
||||
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::EnvironmentsFolder);
|
||||
const AZ::IO::FixedMaxPath wwiseProjectFullPath{ m_audioSystemImpl->GetDataPath() };
|
||||
LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::GameParametersFolder }.Native());
|
||||
LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::GameStatesFolder }.Native());
|
||||
LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::SwitchesFolder }.Native());
|
||||
LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::EventsFolder }.Native());
|
||||
LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::EnvironmentsFolder }.Native());
|
||||
LoadSoundBanks(Audio::Wwise::GetBanksRootPath(), "", false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user