mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
feat: allow specifying direct file path in audio.play_stream
This commit is contained in:
parent
a0b0c0a9f0
commit
b009826d33
1 changed files with 8 additions and 2 deletions
|
|
@ -66,9 +66,15 @@ inline audio::speakerid_t play_stream(
|
||||||
if (channel == -1) {
|
if (channel == -1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto paths = scripting::engine->getResPaths();
|
io::path file;
|
||||||
|
if (std::strchr(filename, ':')) {
|
||||||
|
file = std::string(filename);
|
||||||
|
} else {
|
||||||
|
auto paths = scripting::engine->getResPaths();
|
||||||
|
file = paths->find(filename);
|
||||||
|
}
|
||||||
return audio::play_stream(
|
return audio::play_stream(
|
||||||
paths->find(filename),
|
file,
|
||||||
glm::vec3(
|
glm::vec3(
|
||||||
static_cast<float>(x), static_cast<float>(y), static_cast<float>(z)
|
static_cast<float>(x), static_cast<float>(y), static_cast<float>(z)
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue