mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix clang-check warnings
This commit is contained in:
parent
4c23dc6adf
commit
17dcbe98ab
8 changed files with 8 additions and 12 deletions
|
|
@ -92,11 +92,11 @@ glm::vec4 Attribute::asColor() const {
|
|||
throw std::runtime_error("#RRGGBB or #RRGGBBAA required");
|
||||
}
|
||||
int a = 255;
|
||||
int r = (hexchar2int(text[1]) << 4) | hexchar2int(text[2]);
|
||||
int g = (hexchar2int(text[3]) << 4) | hexchar2int(text[4]);
|
||||
int b = (hexchar2int(text[5]) << 4) | hexchar2int(text[6]);
|
||||
int r = (std::max(0, hexchar2int(text[1])) << 4) | hexchar2int(text[2]);
|
||||
int g = (std::max(0, hexchar2int(text[3])) << 4) | hexchar2int(text[4]);
|
||||
int b = (std::max(0, hexchar2int(text[5])) << 4) | hexchar2int(text[6]);
|
||||
if (text.length() == 9) {
|
||||
a = (hexchar2int(text[7]) << 4) | hexchar2int(text[8]);
|
||||
a = (std::max(0, hexchar2int(text[7])) << 4) | hexchar2int(text[8]);
|
||||
}
|
||||
return glm::vec4(r / 255.f, g / 255.f, b / 255.f, a / 255.f);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue