initial basic MS3D class and support for recognizing and invoking the appropriate converter

This commit is contained in:
gered 2011-02-10 21:45:30 -05:00
parent 04216ee1a0
commit de7bb4adb5
4 changed files with 59 additions and 1 deletions

View file

@ -77,6 +77,7 @@
<ClCompile Include="src\assets\material.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\md2\md2.cpp" />
<ClCompile Include="src\ms3d\ms3d.cpp" />
<ClCompile Include="src\obj\obj.cpp" />
<ClCompile Include="src\sm\sm.cpp" />
</ItemGroup>
@ -85,6 +86,7 @@
<ClInclude Include="src\geometry\vector2.h" />
<ClInclude Include="src\geometry\vector3.h" />
<ClInclude Include="src\md2\md2.h" />
<ClInclude Include="src\ms3d\ms3d.h" />
<ClInclude Include="src\obj\obj.h" />
<ClInclude Include="src\sm\sm.h" />
</ItemGroup>

View file

@ -5,6 +5,7 @@
#include "md2/md2.h"
#include "obj/obj.h"
#include "sm/sm.h"
#include "ms3d/ms3d.h"
int main(int argc, char **argv)
{
@ -73,7 +74,7 @@ int main(int argc, char **argv)
}
else if (extension == ".sm")
{
printf("Using SM converer.\n");
printf("Using SM converter.\n");
StaticModel *sm = new StaticModel();
if (!sm->Load(file))
@ -87,6 +88,22 @@ int main(int argc, char **argv)
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
{
printf("Unrecognized file type.\n\n");

View 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;
}

View 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