Branimir Karadžić 8 years ago
parent
commit
7a1e4637e3
2 changed files with 19 additions and 5 deletions
  1. 17 3
      examples/common/entry/entry.cpp
  2. 2 2
      tools/texturev/texturev.cpp

+ 17 - 3
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;
 		}
 

+ 2 - 2
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
 				{