mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
fix assets.parse_model with 'xml' format
This commit is contained in:
parent
da41de263d
commit
ec94abccbc
6 changed files with 12 additions and 8 deletions
|
|
@ -163,11 +163,11 @@ static std::unique_ptr<model::Model> load_model(const xmlelement& root) {
|
|||
}
|
||||
|
||||
std::unique_ptr<model::Model> vcm::parse(
|
||||
std::string_view file, std::string_view src
|
||||
std::string_view file, std::string_view src, bool usexml
|
||||
) {
|
||||
try {
|
||||
auto doc = io::path(std::string(file)).extension() == ".xml"
|
||||
? xml::parse(file, src) : xml::parse_vcm(file, src, "model");
|
||||
auto doc =
|
||||
usexml ? xml::parse(file, src) : xml::parse_vcm(file, src, "model");
|
||||
const auto& root = *doc->getRoot();
|
||||
if (root.getTag() != "model") {
|
||||
throw std::runtime_error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue