Browse Source

Sync AssetImporter documentation with the program's actual command line options. Simplify D3D9 uninitialization code with SAFE_RELEASE. Minor code convention edit.

Lasse Öörni 10 years ago
parent
commit
b218aececc

+ 4 - 3
Docs/Reference.dox

@@ -2868,21 +2868,22 @@ lod         Combine several Urho3D models as LOD levels of the output model
 
 Options:
 -b          Save scene in binary format, default format is XML
--h          Generate hard instead of smooth normals if input file has no normals
+-j          Save scene in JSON format, default format is XML
+-h          Generate hard instead of smooth normals if input has no normals
 -i          Use local ID's for scene nodes
 -l          Output a material list file for models
 -na         Do not output animations
 -nm         Do not output materials
 -nt         Do not output material textures
 -nc         Do not use material diffuse color value, instead output white
--nh         Do not save full node hierarchy (scene mode only)\n"
+-nh         Do not save full node hierarchy (scene mode only)
 -ns         Do not create subdirectories for resources
 -nz         Do not create a zone and a directional light (scene mode only)
 -nf         Do not fix infacing normals
 -ne         Do not save empty nodes (scene mode only)
 -mb <x>     Maximum number of bones per submesh. Default 64
 -p <path>   Set path for scene resources. Default is output file path
--r <name>   Use the named scene node as root node\n"
+-r <name>   Use the named scene node as root node
 -f <freq>   Animation tick frequency to use if unspecified. Default 4800
 -o          Optimize redundant submeshes. Loses scene hierarchy and animations
 -s <filter> Include non-skinning bones in the model's skeleton. Can be given a

+ 9 - 9
Source/Tools/AssetImporter/AssetImporter.cpp

@@ -206,17 +206,17 @@ void Run(const Vector<String>& arguments)
             "Usage: AssetImporter <command> <input file> <output file> [options]\n"
             "See http://assimp.sourceforge.net/main_features_formats.html for input formats\n\n"
             "Commands:\n"
-            "model      Output a model\n"
-            "scene      Output a scene\n"
-            "node       Output a node and its children (prefab)\n"
-            "dump       Dump scene node structure. No output file is generated\n"
-            "lod        Combine several Urho3D models as LOD levels of the output model\n"
-            "           Syntax: lod <dist0> <mdl0> <dist1 <mdl1> ... <output file>\n"
+            "model       Output a model\n"
+            "scene       Output a scene\n"
+            "node        Output a node and its children (prefab)\n"
+            "dump        Dump scene node structure. No output file is generated\n"
+            "lod         Combine several Urho3D models as LOD levels of the output model\n"
+            "            Syntax: lod <dist0> <mdl0> <dist1 <mdl1> ... <output file>\n"
             "\n"
             "Options:\n"
             "-b          Save scene in binary format, default format is XML\n"
             "-j          Save scene in JSON format, default format is XML\n"
-            "-h          Generate hard instead of smooth normals if input file has no normals\n"
+            "-h          Generate hard instead of smooth normals if input has no normals\n"
             "-i          Use local ID's for scene nodes\n"
             "-l          Output a material list file for models\n"
             "-na         Do not output animations\n"
@@ -1531,7 +1531,7 @@ void BuildAndSaveScene(OutScene& scene, bool asPrefab)
     {
         if (saveBinary_)
             outScene->Save(file);
-        else if(saveJson_)
+        else if (saveJson_)
             outScene->SaveJSON(file);
         else
             outScene->SaveXML(file);
@@ -1540,7 +1540,7 @@ void BuildAndSaveScene(OutScene& scene, bool asPrefab)
     {
         if (saveBinary_)
             outRootNode->Save(file);
-        else if(saveJson_)
+        else if (saveJson_)
             outRootNode->SaveJSON(file);
         else
             outRootNode->SaveXML(file);

+ 6 - 25
Source/Urho3D/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -310,31 +310,12 @@ Graphics::~Graphics()
 
     vertexDeclarations_.Clear();
 
-    if (impl_->defaultColorSurface_)
-    {
-        impl_->defaultColorSurface_->Release();
-        impl_->defaultColorSurface_ = 0;
-    }
-    if (impl_->defaultDepthStencilSurface_)
-    {
-        impl_->defaultDepthStencilSurface_->Release();
-        impl_->defaultDepthStencilSurface_ = 0;
-    }
-    if (impl_->frameQuery_)
-    {
-        impl_->frameQuery_->Release();
-        impl_->frameQuery_ = 0;
-    }
-    if (impl_->device_)
-    {
-        impl_->device_->Release();
-        impl_->device_ = 0;
-    }
-    if (impl_->interface_)
-    {
-        impl_->interface_->Release();
-        impl_->interface_ = 0;
-    }
+    URHO3D_SAFE_RELEASE(impl_->defaultColorSurface_);
+    URHO3D_SAFE_RELEASE(impl_->defaultDepthStencilSurface_);
+    URHO3D_SAFE_RELEASE(impl_->frameQuery_);
+    URHO3D_SAFE_RELEASE(impl_->device_);
+    URHO3D_SAFE_RELEASE(impl_->interface_);
+
     if (impl_->window_)
     {
         SDL_ShowCursor(SDL_TRUE);