initial basic MS3D class and support for recognizing and invoking the appropriate converter
This commit is contained in:
parent
04216ee1a0
commit
de7bb4adb5
|
@ -77,6 +77,7 @@
|
||||||
<ClCompile Include="src\assets\material.cpp" />
|
<ClCompile Include="src\assets\material.cpp" />
|
||||||
<ClCompile Include="src\main.cpp" />
|
<ClCompile Include="src\main.cpp" />
|
||||||
<ClCompile Include="src\md2\md2.cpp" />
|
<ClCompile Include="src\md2\md2.cpp" />
|
||||||
|
<ClCompile Include="src\ms3d\ms3d.cpp" />
|
||||||
<ClCompile Include="src\obj\obj.cpp" />
|
<ClCompile Include="src\obj\obj.cpp" />
|
||||||
<ClCompile Include="src\sm\sm.cpp" />
|
<ClCompile Include="src\sm\sm.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -85,6 +86,7 @@
|
||||||
<ClInclude Include="src\geometry\vector2.h" />
|
<ClInclude Include="src\geometry\vector2.h" />
|
||||||
<ClInclude Include="src\geometry\vector3.h" />
|
<ClInclude Include="src\geometry\vector3.h" />
|
||||||
<ClInclude Include="src\md2\md2.h" />
|
<ClInclude Include="src\md2\md2.h" />
|
||||||
|
<ClInclude Include="src\ms3d\ms3d.h" />
|
||||||
<ClInclude Include="src\obj\obj.h" />
|
<ClInclude Include="src\obj\obj.h" />
|
||||||
<ClInclude Include="src\sm\sm.h" />
|
<ClInclude Include="src\sm\sm.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "md2/md2.h"
|
#include "md2/md2.h"
|
||||||
#include "obj/obj.h"
|
#include "obj/obj.h"
|
||||||
#include "sm/sm.h"
|
#include "sm/sm.h"
|
||||||
|
#include "ms3d/ms3d.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +74,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
else if (extension == ".sm")
|
else if (extension == ".sm")
|
||||||
{
|
{
|
||||||
printf("Using SM converer.\n");
|
printf("Using SM converter.\n");
|
||||||
|
|
||||||
StaticModel *sm = new StaticModel();
|
StaticModel *sm = new StaticModel();
|
||||||
if (!sm->Load(file))
|
if (!sm->Load(file))
|
||||||
|
@ -87,6 +88,22 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (extension == ".ms3d")
|
||||||
|
{
|
||||||
|
printf("Using MS3D converter.\n");
|
||||||
|
|
||||||
|
Ms3d *ms3d = new Ms3d();
|
||||||
|
if (!ms3d->Load(file))
|
||||||
|
{
|
||||||
|
printf("Error loading MS3D file.\n\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (!ms3d->ConvertToMesh(meshFile))
|
||||||
|
{
|
||||||
|
printf("Error converting MS3D to MESH.\n\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("Unrecognized file type.\n\n");
|
printf("Unrecognized file type.\n\n");
|
||||||
|
|
21
MeshConverter/src/ms3d/ms3d.cpp
Normal file
21
MeshConverter/src/ms3d/ms3d.cpp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#include "ms3d.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
Ms3d::Ms3d()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Ms3d::Release()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Ms3d::Load(const std::string &file)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Ms3d::ConvertToMesh(const std::string &file)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
18
MeshConverter/src/ms3d/ms3d.h
Normal file
18
MeshConverter/src/ms3d/ms3d.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef __MS3D_H_INCLUDED__
|
||||||
|
#define __MS3D_H_INCLUDED__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Ms3d
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Ms3d();
|
||||||
|
virtual ~Ms3d() { Release(); }
|
||||||
|
|
||||||
|
void Release();
|
||||||
|
bool Load(const std::string &file);
|
||||||
|
bool ConvertToMesh(const std::string &file);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Reference in a new issue