16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 02:09:17 +02:00

semaphores controllable on minimap

This commit is contained in:
milek7
2019-03-02 14:32:39 +01:00
parent 2d66192c9a
commit 1f0d8c4dc8
26 changed files with 678 additions and 315 deletions

View File

@@ -91,6 +91,30 @@ TSubModel::SetDiffuseOverride( glm::vec3 const &Color, bool const Includechildre
}
}
std::optional<glm::vec3>
TSubModel::GetDiffuse(float Includesiblings) {
if (eType == TP_FREESPOTLIGHT) {
if (DiffuseOverride.x >= 0.0f)
return DiffuseOverride;
else
return glm::vec3(f4Diffuse);
}
if (Includesiblings) {
auto sibling = this;
while ((sibling = sibling->Next)) {
auto result = sibling->GetDiffuse(true);
if (result)
return result;
}
}
if (Child)
return Child->GetDiffuse(true);
return std::nullopt;
}
// sets visibility level (alpha component) to specified value
void
TSubModel::SetVisibilityLevel( float const Level, bool const Includechildren, bool const Includesiblings ) {