Add True and False tests for bitwise enums

This commit is contained in:
Jack Andersen 2019-04-02 18:29:04 -10:00
parent 6816fea5b8
commit 2ab5c1436b
4 changed files with 7 additions and 7 deletions

2
hecl/extern/athena vendored

@ -1 +1 @@
Subproject commit 0b3fd2b5afae72938c72a7256d9b47eca1de9d5d
Subproject commit b40d3b17e5f20e102aa00845a9d548120eddea2d

2
hecl/extern/boo vendored

@ -1 +1 @@
Subproject commit af4b1a4521a2e500088b1f358a474556493e2352
Subproject commit c1d3d040bf5fcc3ec536d3b266bd5ca0ddded7d7

View File

@ -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++;

View File

@ -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);