initial import, >900commits predate this

This commit is contained in:
2020-09-29 13:47:50 +02:00
commit e74154ccee
352 changed files with 108120 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
#include "./sound_loader_wav.hpp"
#include "./soloud_filesystem_file_impl.hpp"
#include <mm/services/filesystem.hpp>
namespace MM {
std::shared_ptr<::SoLoud::Wav> SoundLoaderWavFile::load(const std::string& path, Engine& engine) const {
auto& fs = engine.getService<Services::FilesystemService>();
if (!fs.isFile(path.c_str()))
return nullptr;
auto h = fs.open(path.c_str());
MM::SoLoud::FilesystemFile sl_f(h, engine);
auto ptr = std::make_shared<::SoLoud::Wav>();
auto r = ptr->loadFile(&sl_f);
if (r != ::SoLoud::SO_NO_ERROR) {
// log error
return nullptr;
}
return ptr;
}
} // MM