2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-05 16:27:27 +00:00

chore: fix loading and writing code for T6

This commit is contained in:
Jan
2024-12-31 12:38:01 +01:00
parent d8bc156ffd
commit 83d13aa166
193 changed files with 4129 additions and 4208 deletions

View File

@@ -61,7 +61,7 @@ class SoundBankWriterImpl : public SoundBankWriter
};
public:
explicit SoundBankWriterImpl(std::string fileName, std::ostream& stream, ISearchPath* assetSearchPath)
explicit SoundBankWriterImpl(std::string fileName, std::ostream& stream, ISearchPath& assetSearchPath)
: m_file_name(std::move(fileName)),
m_stream(stream),
m_asset_search_path(assetSearchPath),
@@ -212,7 +212,7 @@ public:
if (extension.empty())
return false;
const auto file = m_asset_search_path->Open(filePath);
const auto file = m_asset_search_path.Open(filePath);
if (!file.IsOpen())
return false;
@@ -323,7 +323,7 @@ public:
private:
std::string m_file_name;
std::ostream& m_stream;
ISearchPath* m_asset_search_path;
ISearchPath& m_asset_search_path;
std::vector<SoundBankEntryInfo> m_sounds;
int64_t m_current_offset;
@@ -336,7 +336,7 @@ private:
std::filesystem::path SoundBankWriter::OutputPath;
std::unique_ptr<SoundBankWriter> SoundBankWriter::Create(const std::string& fileName, std::ostream& stream, ISearchPath* assetSearchPath)
std::unique_ptr<SoundBankWriter> SoundBankWriter::Create(const std::string& fileName, std::ostream& stream, ISearchPath& assetSearchPath)
{
return std::make_unique<SoundBankWriterImpl>(fileName, stream, assetSearchPath);
}

View File

@@ -19,7 +19,7 @@ public:
virtual void AddSound(const std::string& soundFilePath, unsigned int soundId, bool looping = false, bool streamed = false) = 0;
virtual bool Write(size_t& dataSize) = 0;
static std::unique_ptr<SoundBankWriter> Create(const std::string& fileName, std::ostream& stream, ISearchPath* assetSearchPath);
static std::unique_ptr<SoundBankWriter> Create(const std::string& fileName, std::ostream& stream, ISearchPath& assetSearchPath);
static std::filesystem::path OutputPath;
};