Browse Source

Minor cleanup to simplify the override condition for sample code.

Yao Wei Tjong 姚伟忠 10 years ago
parent
commit
587344af8a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      Source/Samples/Sample.inl
  2. 1 1
      Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp

+ 1 - 1
Source/Samples/Sample.inl

@@ -63,7 +63,7 @@ void Sample::Setup()
     // Construct a search path to find the resource prefix with two entries:
     // Construct a search path to find the resource prefix with two entries:
     // The first entry is an empty path which will be substituted with program/bin directory -- this entry is for binary when it is still in build tree
     // The first entry is an empty path which will be substituted with program/bin directory -- this entry is for binary when it is still in build tree
     // The second entry is a relative path from the installed program/bin directory to the asset directory -- this entry is for binary when it is in the Urho3D SDK installation location
     // The second entry is a relative path from the installed program/bin directory to the asset directory -- this entry is for binary when it is in the Urho3D SDK installation location
-    if (engineParameters_["ResourcePrefixPaths"].GetString().Empty())
+    if (!engineParameters_.Contains("ResourcePrefixPaths"))
         engineParameters_["ResourcePrefixPaths"] = " ;../share/Urho3D/Resources";
         engineParameters_["ResourcePrefixPaths"] = " ;../share/Urho3D/Resources";
 }
 }
 
 

+ 1 - 1
Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp

@@ -123,7 +123,7 @@ void Urho3DPlayer::Setup()
     // Construct a search path to find the resource prefix with two entries:
     // Construct a search path to find the resource prefix with two entries:
     // The first entry is an empty path which will be substituted with program/bin directory -- this entry is for binary when it is still in build tree
     // The first entry is an empty path which will be substituted with program/bin directory -- this entry is for binary when it is still in build tree
     // The second entry is a relative path from the installed program/bin directory to the asset directory -- this entry is for binary when it is in the Urho3D SDK installation location
     // The second entry is a relative path from the installed program/bin directory to the asset directory -- this entry is for binary when it is in the Urho3D SDK installation location
-    if (engineParameters_["ResourcePrefixPaths"].GetString().Empty())
+    if (!engineParameters_.Contains("ResourcePrefixPaths"))
         engineParameters_["ResourcePrefixPaths"] = " ;../share/Urho3D/Resources";
         engineParameters_["ResourcePrefixPaths"] = " ;../share/Urho3D/Resources";
 }
 }