From 2ab5c1436bdf4a36594347fc48ea894db868d9b3 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 2 Apr 2019 18:29:04 -1000 Subject: [PATCH] Add True and False tests for bitwise enums --- hecl/extern/athena | 2 +- hecl/extern/boo | 2 +- hecl/lib/Console.cpp | 8 ++++---- hecl/shaderc/shaderc.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hecl/extern/athena b/hecl/extern/athena index 0b3fd2b5a..b40d3b17e 160000 --- a/hecl/extern/athena +++ b/hecl/extern/athena @@ -1 +1 @@ -Subproject commit 0b3fd2b5afae72938c72a7256d9b47eca1de9d5d +Subproject commit b40d3b17e5f20e102aa00845a9d548120eddea2d diff --git a/hecl/extern/boo b/hecl/extern/boo index af4b1a452..c1d3d040b 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit af4b1a4521a2e500088b1f358a474556493e2352 +Subproject commit c1d3d040bf5fcc3ec536d3b266bd5ca0ddded7d7 diff --git a/hecl/lib/Console.cpp b/hecl/lib/Console.cpp index 96d51221d..14e58c620 100644 --- a/hecl/lib/Console.cpp +++ b/hecl/lib/Console.cpp @@ -241,7 +241,7 @@ void Console::handleSpecialKeyDown(boo::ESpecialKey sp, boo::EModifierKey mod, b break; case boo::ESpecialKey::Backspace: { if (!m_commandString.empty()) { - if ((mod & boo::EModifierKey::Ctrl) != boo::EModifierKey::None) { + if (True(mod & boo::EModifierKey::Ctrl)) { size_t index = m_commandString.rfind(' ', size_t(m_cursorPosition - 1)); if (index == std::string::npos) { @@ -267,7 +267,7 @@ void Console::handleSpecialKeyDown(boo::ESpecialKey sp, boo::EModifierKey mod, b if ((m_cursorPosition + 1) >= int(m_commandString.size())) break; - if ((mod & boo::EModifierKey::Ctrl) != boo::EModifierKey::None) { + if (True(mod & boo::EModifierKey::Ctrl)) { size_t index = m_commandString.find_first_of(' ', size_t(m_cursorPosition + 1)); if (index != std::string::npos) m_commandString.erase(size_t(m_cursorPosition + 1), index + 1); @@ -303,7 +303,7 @@ void Console::handleSpecialKeyDown(boo::ESpecialKey sp, boo::EModifierKey mod, b if (m_cursorPosition < 0) break; - if ((mod & boo::EModifierKey::Ctrl) != boo::EModifierKey::None) + if (True(mod & boo::EModifierKey::Ctrl)) m_cursorPosition = int(m_commandString.rfind(' ', size_t(m_cursorPosition) - 1)); else m_cursorPosition--; @@ -316,7 +316,7 @@ void Console::handleSpecialKeyDown(boo::ESpecialKey sp, boo::EModifierKey mod, b if (m_cursorPosition >= int(m_commandString.size() - 1)) break; - if ((mod & boo::EModifierKey::Ctrl) != boo::EModifierKey::None) { + if (True(mod & boo::EModifierKey::Ctrl)) { if (m_commandString[size_t(m_cursorPosition)] == ' ') m_cursorPosition++; diff --git a/hecl/shaderc/shaderc.cpp b/hecl/shaderc/shaderc.cpp index 0276a32de..42a08028d 100644 --- a/hecl/shaderc/shaderc.cpp +++ b/hecl/shaderc/shaderc.cpp @@ -555,7 +555,7 @@ bool Compiler::compileFile(SystemStringView file, std::string_view baseName, std break; } out.second += Format(fmt, - (attr.first & boo::VertexSemantic::Instanced) != boo::VertexSemantic::None + True(attr.first & boo::VertexSemantic::Instanced) ? " | boo::VertexSemantic::Instanced" : "", attr.second);