mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
minor refactor
This commit is contained in:
parent
95fedfa3a3
commit
3655464b6f
8 changed files with 85 additions and 73 deletions
|
|
@ -52,7 +52,7 @@ glm::vec3 Attribute::asVec3() const {
|
|||
}
|
||||
size_t pos2 = text.find(',', pos1+1);
|
||||
if (pos2 == std::string::npos) {
|
||||
throw std::runtime_error("invalid vec3 value "+escape_string(text));
|
||||
throw std::runtime_error("invalid vec3 value "+util::quote(text));
|
||||
}
|
||||
return glm::vec3(
|
||||
util::parse_double(text, 0, pos1),
|
||||
|
|
@ -69,11 +69,11 @@ glm::vec4 Attribute::asVec4() const {
|
|||
}
|
||||
size_t pos2 = text.find(',', pos1+1);
|
||||
if (pos2 == std::string::npos) {
|
||||
throw std::runtime_error("invalid vec4 value "+escape_string(text));
|
||||
throw std::runtime_error("invalid vec4 value "+util::quote(text));
|
||||
}
|
||||
size_t pos3 = text.find(',', pos2+1);
|
||||
if (pos3 == std::string::npos) {
|
||||
throw std::runtime_error("invalid vec4 value "+escape_string(text));
|
||||
throw std::runtime_error("invalid vec4 value "+util::quote(text));
|
||||
}
|
||||
return glm::vec4(
|
||||
util::parse_double(text, 0, pos1),
|
||||
|
|
@ -382,7 +382,7 @@ static void stringifyElement(
|
|||
auto attr = entry.second;
|
||||
ss << attr.getName();
|
||||
if (!attr.getText().empty()) {
|
||||
ss << "=" << escape_string(attr.getText());
|
||||
ss << "=" << util::escape(attr.getText());
|
||||
}
|
||||
if (count + 1 < int(attrs.size())) {
|
||||
ss << " ";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue