From 7a1e4637e376acc6f81bc7bb72f67cebeda55d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 27 Nov 2017 23:10:34 -0800 Subject: [PATCH] Cleanup. --- examples/common/entry/entry.cpp | 20 +++++++++++++++++--- tools/texturev/texturev.cpp | 4 ++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index 500f6fc2a..08978e762 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -240,7 +240,11 @@ BX_PRAGMA_DIAGNOSTIC_POP(); if (_argc > arg) { _flags &= ~_bit; - _flags |= bx::toBool(_argv[arg]) ? _bit : 0; + + bool set = false; + bx::fromString(&set, _argv[arg]); + + _flags |= set ? _bit : 0; } else { @@ -255,9 +259,19 @@ BX_PRAGMA_DIAGNOSTIC_POP(); int cmdMouseLock(CmdContext* /*_context*/, void* /*_userData*/, int _argc, char const* const* _argv) { - if (_argc > 1) + if (1 < _argc) { - inputSetMouseLock(_argc > 1 ? bx::toBool(_argv[1]) : !inputIsMouseLocked() ); + bool set = false; + if (2 < _argc) + { + bx::fromString(&set, _argv[1]); + inputSetMouseLock(set); + } + else + { + inputSetMouseLock(!inputIsMouseLocked() ); + } + return bx::kExitSuccess; } diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 97fded6e5..dfa4370ac 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -483,7 +483,7 @@ struct View { if (_argc >= 3) { - m_filter = bx::toBool(_argv[2]); + bx::fromString(&m_filter, _argv[2]); } else { @@ -494,7 +494,7 @@ struct View { if (_argc >= 3) { - m_fit = bx::toBool(_argv[2]); + bx::fromString(&m_fit, _argv[2]); } else {