mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix models load functions
This commit is contained in:
parent
53237dd102
commit
395dc15fb6
1 changed files with 3 additions and 0 deletions
|
|
@ -348,6 +348,7 @@ static assetload::postfunc load_vec3_model(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::shared_ptr<ModelCfg>& config
|
const std::shared_ptr<ModelCfg>& config
|
||||||
) {
|
) {
|
||||||
|
loader.attachToFile(file, {name, AssetType::MODEL});
|
||||||
auto bytes = io::read_bytes_buffer(file);
|
auto bytes = io::read_bytes_buffer(file);
|
||||||
auto modelVEC3 = std::make_shared<vec3::File>(vec3::load(file.string(), bytes));
|
auto modelVEC3 = std::make_shared<vec3::File>(vec3::load(file.string(), bytes));
|
||||||
return [&loader, name, file, config, modelVEC3 = std::move(modelVEC3)](
|
return [&loader, name, file, config, modelVEC3 = std::move(modelVEC3)](
|
||||||
|
|
@ -392,6 +393,7 @@ static assetload::postfunc load_obj_model(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::shared_ptr<ModelCfg>&
|
const std::shared_ptr<ModelCfg>&
|
||||||
) {
|
) {
|
||||||
|
loader.attachToFile(file, {name, AssetType::MODEL});
|
||||||
auto text = io::read_string(file);
|
auto text = io::read_string(file);
|
||||||
try {
|
try {
|
||||||
auto model = obj::parse(file.string(), text).release();
|
auto model = obj::parse(file.string(), text).release();
|
||||||
|
|
@ -411,6 +413,7 @@ static assetload::postfunc load_vcm_model(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::shared_ptr<ModelCfg>& cfg
|
const std::shared_ptr<ModelCfg>& cfg
|
||||||
) {
|
) {
|
||||||
|
loader.attachToFile(file, {name, AssetType::MODEL});
|
||||||
auto text = io::read_string(file);
|
auto text = io::read_string(file);
|
||||||
try {
|
try {
|
||||||
auto vcmModel = vcm::parse(file.string(), text, file.extension() == ".xml");
|
auto vcmModel = vcm::parse(file.string(), text, file.extension() == ".xml");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue