From 959831f4ef5a3e797f576c3de08cd65032c997ad Mon Sep 17 00:00:00 2001
From: David Walter Seikel
Date: Sun, 13 Jan 2013 18:54:10 +1000
Subject: Remove damned ancient DOS line endings from Irrlicht. Hopefully I
did not go overboard.
---
.../irrlicht-1.8/tools/MeshConverter/Makefile | 76 ++--
.../tools/MeshConverter/MeshConverter_v9.vcproj | 374 ++++++++++----------
.../tools/MeshConverter/MeshConverter_vc10.vcxproj | 382 ++++++++++----------
.../tools/MeshConverter/MeshConverter_vc11.vcxproj | 390 ++++++++++-----------
.../irrlicht-1.8/tools/MeshConverter/main.cpp | 216 ++++++------
5 files changed, 719 insertions(+), 719 deletions(-)
(limited to 'libraries/irrlicht-1.8/tools/MeshConverter')
diff --git a/libraries/irrlicht-1.8/tools/MeshConverter/Makefile b/libraries/irrlicht-1.8/tools/MeshConverter/Makefile
index 5328223..ac4b78c 100644
--- a/libraries/irrlicht-1.8/tools/MeshConverter/Makefile
+++ b/libraries/irrlicht-1.8/tools/MeshConverter/Makefile
@@ -1,38 +1,38 @@
-# Makefile for Irrlicht Examples
-# It's usually sufficient to change just the target name and source file list
-# and be sure that CXX is set to a valid compiler
-Target = MeshConverter
-Sources = main.cpp
-
-# general compiler settings
-CPPFLAGS = -I../../include -I/usr/X11R6/include
-CXXFLAGS = -O3 -ffast-math -Wall
-#CXXFLAGS = -g -Wall
-
-#default target is Linux
-all: all_linux
-
-ifeq ($(HOSTTYPE), x86_64)
-LIBSELECT=64
-endif
-
-# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
-all_linux clean_linux: SYSTEM=Linux
-all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lglu32 -lm
-all_win32 clean_win32: SYSTEM=Win32-gcc
-all_win32 clean_win32: SUF=.exe
-# name of the binary - only valid for targets which set SYSTEM
-DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
-
-all_linux all_win32:
- $(warning Building...)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
-
-clean: clean_linux clean_win32
- $(warning Cleaning...)
-
-clean_linux clean_win32:
- @$(RM) $(DESTPATH)
-
-.PHONY: all all_win32 clean clean_linux clean_win32
+# Makefile for Irrlicht Examples
+# It's usually sufficient to change just the target name and source file list
+# and be sure that CXX is set to a valid compiler
+Target = MeshConverter
+Sources = main.cpp
+
+# general compiler settings
+CPPFLAGS = -I../../include -I/usr/X11R6/include
+CXXFLAGS = -O3 -ffast-math -Wall
+#CXXFLAGS = -g -Wall
+
+#default target is Linux
+all: all_linux
+
+ifeq ($(HOSTTYPE), x86_64)
+LIBSELECT=64
+endif
+
+# target specific settings
+all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
+all_linux clean_linux: SYSTEM=Linux
+all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lglu32 -lm
+all_win32 clean_win32: SYSTEM=Win32-gcc
+all_win32 clean_win32: SUF=.exe
+# name of the binary - only valid for targets which set SYSTEM
+DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
+
+all_linux all_win32:
+ $(warning Building...)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
+
+clean: clean_linux clean_win32
+ $(warning Cleaning...)
+
+clean_linux clean_win32:
+ @$(RM) $(DESTPATH)
+
+.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_v9.vcproj b/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_v9.vcproj
index 5747218..09fef60 100644
--- a/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_v9.vcproj
+++ b/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_v9.vcproj
@@ -1,187 +1,187 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc10.vcxproj b/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc10.vcxproj
index 1f1ce49..f994800 100644
--- a/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc10.vcxproj
+++ b/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc10.vcxproj
@@ -1,192 +1,192 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- MeshConverter
- {E72B637E-4AA6-46F3-885F-AC67B4B470ED}
- GUI Editor
- Win32Proj
-
-
-
- Application
- MultiByte
-
-
- Application
- MultiByte
-
-
- Application
- MultiByte
-
-
- Application
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- ..\..\bin\Win32-VisualStudio\
- ..\..\bin\Win64-VisualStudio\
- true
- true
- ..\..\bin\Win32-VisualStudio\
- ..\..\bin\Win64-VisualStudio\
- false
- false
- AllRules.ruleset
- AllRules.ruleset
-
-
-
-
- AllRules.ruleset
- AllRules.ruleset
-
-
-
-
-
-
-
- Disabled
- Neither
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
-
- Level3
- EditAndContinue
-
-
- kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
- ../../bin/Win32-visualstudio/MeshConverter.exe
- ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
- true
- $(OutDir)TestProject.pdb
- Console
-
-
-
-
-
-
- Disabled
- Neither
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebug
-
-
- Level3
- ProgramDatabase
-
-
- kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
- ../../bin/Win64-visualstudio/MeshConverter.exe
- ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
- true
- $(OutDir)TestProject.pdb
- Console
-
-
-
-
-
-
- Full
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- MultiThreaded
-
-
- Level3
-
-
- ../../bin/Win32-visualstudio/MeshConverter.exe
- true
- Console
- true
- true
-
-
-
-
-
-
- Full
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- MultiThreaded
-
-
- Level3
-
-
- ../../bin/Win64-visualstudio/MeshConverter.exe
- true
- Console
- true
- true
-
-
-
-
-
-
-
-
-
- {e08e042a-6c45-411b-92be-3cc31331019f}
- false
-
-
-
-
-
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ MeshConverter
+ {E72B637E-4AA6-46F3-885F-AC67B4B470ED}
+ GUI Editor
+ Win32Proj
+
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+ Application
+ MultiByte
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ ..\..\bin\Win32-VisualStudio\
+ ..\..\bin\Win64-VisualStudio\
+ true
+ true
+ ..\..\bin\Win32-VisualStudio\
+ ..\..\bin\Win64-VisualStudio\
+ false
+ false
+ AllRules.ruleset
+ AllRules.ruleset
+
+
+
+
+ AllRules.ruleset
+ AllRules.ruleset
+
+
+
+
+
+
+
+ Disabled
+ Neither
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ Level3
+ EditAndContinue
+
+
+ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
+ ../../bin/Win32-visualstudio/MeshConverter.exe
+ ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
+ true
+ $(OutDir)TestProject.pdb
+ Console
+
+
+
+
+
+
+ Disabled
+ Neither
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ Level3
+ ProgramDatabase
+
+
+ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
+ ../../bin/Win64-visualstudio/MeshConverter.exe
+ ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
+ true
+ $(OutDir)TestProject.pdb
+ Console
+
+
+
+
+
+
+ Full
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ MultiThreaded
+
+
+ Level3
+
+
+ ../../bin/Win32-visualstudio/MeshConverter.exe
+ true
+ Console
+ true
+ true
+
+
+
+
+
+
+ Full
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ MultiThreaded
+
+
+ Level3
+
+
+ ../../bin/Win64-visualstudio/MeshConverter.exe
+ true
+ Console
+ true
+ true
+
+
+
+
+
+
+
+
+
+ {e08e042a-6c45-411b-92be-3cc31331019f}
+ false
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc11.vcxproj b/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc11.vcxproj
index 6493206..ccd4271 100644
--- a/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc11.vcxproj
+++ b/libraries/irrlicht-1.8/tools/MeshConverter/MeshConverter_vc11.vcxproj
@@ -1,196 +1,196 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- MeshConverter
- {E72B637E-4AA6-46F3-885F-AC67B4B470ED}
- GUI Editor
- Win32Proj
-
-
-
- Application
- MultiByte
- v110
-
-
- Application
- MultiByte
- v110
-
-
- Application
- MultiByte
- v110
-
-
- Application
- MultiByte
- v110
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>10.0.30319.1
- ..\..\bin\Win32-VisualStudio\
- ..\..\bin\Win64-VisualStudio\
- true
- true
- ..\..\bin\Win32-VisualStudio\
- ..\..\bin\Win64-VisualStudio\
- false
- false
- AllRules.ruleset
- AllRules.ruleset
-
-
-
-
- AllRules.ruleset
- AllRules.ruleset
-
-
-
-
-
-
-
- Disabled
- Neither
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
-
- Level3
- EditAndContinue
-
-
- kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
- ../../bin/Win32-visualstudio/MeshConverter.exe
- ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
- true
- $(OutDir)TestProject.pdb
- Console
-
-
-
-
-
-
- Disabled
- Neither
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- EnableFastChecks
- MultiThreadedDebug
-
-
- Level3
- ProgramDatabase
-
-
- kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
- ../../bin/Win64-visualstudio/MeshConverter.exe
- ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
- true
- $(OutDir)TestProject.pdb
- Console
-
-
-
-
-
-
- Full
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- MultiThreaded
-
-
- Level3
-
-
- ../../bin/Win32-visualstudio/MeshConverter.exe
- true
- Console
- true
- true
-
-
-
-
-
-
- Full
- false
- ..\..\include;%(AdditionalIncludeDirectories)
- WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- MultiThreaded
-
-
- Level3
-
-
- ../../bin/Win64-visualstudio/MeshConverter.exe
- true
- Console
- true
- true
-
-
-
-
-
-
-
-
-
- {e08e042a-6c45-411b-92be-3cc31331019f}
- false
-
-
-
-
-
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ MeshConverter
+ {E72B637E-4AA6-46F3-885F-AC67B4B470ED}
+ GUI Editor
+ Win32Proj
+
+
+
+ Application
+ MultiByte
+ v110
+
+
+ Application
+ MultiByte
+ v110
+
+
+ Application
+ MultiByte
+ v110
+
+
+ Application
+ MultiByte
+ v110
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ ..\..\bin\Win32-VisualStudio\
+ ..\..\bin\Win64-VisualStudio\
+ true
+ true
+ ..\..\bin\Win32-VisualStudio\
+ ..\..\bin\Win64-VisualStudio\
+ false
+ false
+ AllRules.ruleset
+ AllRules.ruleset
+
+
+
+
+ AllRules.ruleset
+ AllRules.ruleset
+
+
+
+
+
+
+
+ Disabled
+ Neither
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ Level3
+ EditAndContinue
+
+
+ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
+ ../../bin/Win32-visualstudio/MeshConverter.exe
+ ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
+ true
+ $(OutDir)TestProject.pdb
+ Console
+
+
+
+
+
+
+ Disabled
+ Neither
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ Level3
+ ProgramDatabase
+
+
+ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)
+ ../../bin/Win64-visualstudio/MeshConverter.exe
+ ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)
+ true
+ $(OutDir)TestProject.pdb
+ Console
+
+
+
+
+
+
+ Full
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ MultiThreaded
+
+
+ Level3
+
+
+ ../../bin/Win32-visualstudio/MeshConverter.exe
+ true
+ Console
+ true
+ true
+
+
+
+
+
+
+ Full
+ false
+ ..\..\include;%(AdditionalIncludeDirectories)
+ WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ MultiThreaded
+
+
+ Level3
+
+
+ ../../bin/Win64-visualstudio/MeshConverter.exe
+ true
+ Console
+ true
+ true
+
+
+
+
+
+
+
+
+
+ {e08e042a-6c45-411b-92be-3cc31331019f}
+ false
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries/irrlicht-1.8/tools/MeshConverter/main.cpp b/libraries/irrlicht-1.8/tools/MeshConverter/main.cpp
index d6b878f..f05d6fa 100644
--- a/libraries/irrlicht-1.8/tools/MeshConverter/main.cpp
+++ b/libraries/irrlicht-1.8/tools/MeshConverter/main.cpp
@@ -1,108 +1,108 @@
-#include
-#include
-
-using namespace irr;
-
-using namespace core;
-using namespace scene;
-using namespace video;
-using namespace io;
-using namespace gui;
-
-#ifdef _IRR_WINDOWS_
-#pragma comment(lib, "Irrlicht.lib")
-#endif
-
-void usage(const char* name)
-{
- std::cerr << "Usage: " << name << " [options] " << std::endl;
- std::cerr << " where options are" << std::endl;
- std::cerr << " --createTangents: convert to tangents mesh is possible." << std::endl;
- std::cerr << " --format=[irrmesh|collada|stl|obj|ply]: Choose target format" << std::endl;
-}
-
-int main(int argc, char* argv[])
-{
- if ((argc < 3) ||
- ((argc==3) && (argv[1][0]=='-')))
- {
- usage(argv[0]);
- return 1;
- }
-
- IrrlichtDevice *device = createDevice( video::EDT_NULL,
- dimension2d(800, 600), 32, false, false, false, 0);
-
- device->setWindowCaption(L"Mesh Converter");
-
- scene::EMESH_WRITER_TYPE type = EMWT_IRR_MESH;
- u32 i=1;
- bool createTangents=false;
- while (argv[i][0]=='-')
- {
- core::stringc format = argv[i];
- if (format.size() > 3)
- {
- if (format.equalsn("--format=",9))
- {
- format = format.subString(9,format.size());
- if (format=="collada")
- type = EMWT_COLLADA;
- else if (format=="stl")
- type = EMWT_STL;
- else if (format=="obj")
- type = EMWT_OBJ;
- else if (format=="ply")
- type = EMWT_PLY;
- else
- type = EMWT_IRR_MESH;
- }
- else
- if (format =="--createTangents")
- createTangents=true;
- }
- else
- if (format=="--")
- {
- ++i;
- break;
- }
- ++i;
- }
-
- const s32 srcmesh = i;
- const s32 destmesh = i+1;
-
- --argc;
- if ((argcgetSceneManager()->getMesh(argv[srcmesh])->getMesh(0);
- if (!mesh)
- {
- std::cerr << "Could not load " << argv[srcmesh] << std::endl;
- return 1;
- }
- if (createTangents)
- {
- IMesh* tmp = device->getSceneManager()->getMeshManipulator()->createMeshWithTangents(mesh);
- mesh->drop();
- mesh=tmp;
- }
- IMeshWriter* mw = device->getSceneManager()->createMeshWriter(type);
- IWriteFile* file = device->getFileSystem()->createAndWriteFile(argv[destmesh]);
- mw->writeMesh(file, mesh);
-
- file->drop();
- mw->drop();
- device->drop();
-
- return 0;
-}
-
+#include
+#include
+
+using namespace irr;
+
+using namespace core;
+using namespace scene;
+using namespace video;
+using namespace io;
+using namespace gui;
+
+#ifdef _IRR_WINDOWS_
+#pragma comment(lib, "Irrlicht.lib")
+#endif
+
+void usage(const char* name)
+{
+ std::cerr << "Usage: " << name << " [options] " << std::endl;
+ std::cerr << " where options are" << std::endl;
+ std::cerr << " --createTangents: convert to tangents mesh is possible." << std::endl;
+ std::cerr << " --format=[irrmesh|collada|stl|obj|ply]: Choose target format" << std::endl;
+}
+
+int main(int argc, char* argv[])
+{
+ if ((argc < 3) ||
+ ((argc==3) && (argv[1][0]=='-')))
+ {
+ usage(argv[0]);
+ return 1;
+ }
+
+ IrrlichtDevice *device = createDevice( video::EDT_NULL,
+ dimension2d(800, 600), 32, false, false, false, 0);
+
+ device->setWindowCaption(L"Mesh Converter");
+
+ scene::EMESH_WRITER_TYPE type = EMWT_IRR_MESH;
+ u32 i=1;
+ bool createTangents=false;
+ while (argv[i][0]=='-')
+ {
+ core::stringc format = argv[i];
+ if (format.size() > 3)
+ {
+ if (format.equalsn("--format=",9))
+ {
+ format = format.subString(9,format.size());
+ if (format=="collada")
+ type = EMWT_COLLADA;
+ else if (format=="stl")
+ type = EMWT_STL;
+ else if (format=="obj")
+ type = EMWT_OBJ;
+ else if (format=="ply")
+ type = EMWT_PLY;
+ else
+ type = EMWT_IRR_MESH;
+ }
+ else
+ if (format =="--createTangents")
+ createTangents=true;
+ }
+ else
+ if (format=="--")
+ {
+ ++i;
+ break;
+ }
+ ++i;
+ }
+
+ const s32 srcmesh = i;
+ const s32 destmesh = i+1;
+
+ --argc;
+ if ((argcgetSceneManager()->getMesh(argv[srcmesh])->getMesh(0);
+ if (!mesh)
+ {
+ std::cerr << "Could not load " << argv[srcmesh] << std::endl;
+ return 1;
+ }
+ if (createTangents)
+ {
+ IMesh* tmp = device->getSceneManager()->getMeshManipulator()->createMeshWithTangents(mesh);
+ mesh->drop();
+ mesh=tmp;
+ }
+ IMeshWriter* mw = device->getSceneManager()->createMeshWriter(type);
+ IWriteFile* file = device->getFileSystem()->createAndWriteFile(argv[destmesh]);
+ mw->writeMesh(file, mesh);
+
+ file->drop();
+ mw->drop();
+ device->drop();
+
+ return 0;
+}
+
--
cgit v1.1