mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
migrate from std::filesystem::path to io::path (WIP)
This commit is contained in:
parent
1e22882284
commit
e0314803c0
72 changed files with 1189 additions and 791 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "io/io.hpp"
|
||||
#include "audio/audio.hpp"
|
||||
#include "debug/Logger.hpp"
|
||||
#include "typedefs.hpp"
|
||||
|
|
@ -43,11 +44,11 @@ static inline std::string vorbis_error_message(int code) {
|
|||
}
|
||||
|
||||
std::unique_ptr<audio::PCM> ogg::load_pcm(
|
||||
const fs::path& file, bool headerOnly
|
||||
const io::path& file, bool headerOnly
|
||||
) {
|
||||
OggVorbis_File vf;
|
||||
int code;
|
||||
if ((code = ov_fopen(file.u8string().c_str(), &vf))) {
|
||||
if ((code = ov_fopen(io::resolve(file).u8string().c_str(), &vf))) {
|
||||
throw std::runtime_error("vorbis: " + vorbis_error_message(code));
|
||||
}
|
||||
std::vector<char> data;
|
||||
|
|
@ -166,10 +167,10 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<PCMStream> ogg::create_stream(const fs::path& file) {
|
||||
std::unique_ptr<PCMStream> ogg::create_stream(const io::path& file) {
|
||||
OggVorbis_File vf;
|
||||
int code;
|
||||
if ((code = ov_fopen(file.u8string().c_str(), &vf))) {
|
||||
if ((code = ov_fopen(io::resolve(file).u8string().c_str(), &vf))) {
|
||||
throw std::runtime_error("vorbis: " + vorbis_error_message(code));
|
||||
}
|
||||
return std::make_unique<OggStream>(vf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue