added more framework code, setting up for the appropriate converter (static/animated)

This commit is contained in:
gered 2011-04-27 10:13:16 -04:00
parent 2ac2dd5b61
commit 11939f9033
6 changed files with 66 additions and 1 deletions

View file

@ -81,11 +81,14 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\assimputils\assimpsceneinfo.cpp" />
<ClCompile Include="src\convert\skeletalanimated.cpp" />
<ClCompile Include="src\convert\static.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\utils\fileutils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\assimputils\utils.h" />
<ClInclude Include="src\convert\convert.h" />
<ClInclude Include="src\utils\utils.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View file

@ -24,6 +24,12 @@
<ClCompile Include="src\assimputils\assimpsceneinfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\convert\static.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\convert\skeletalanimated.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\utils\utils.h">
@ -32,5 +38,8 @@
<ClInclude Include="src\assimputils\utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\convert\convert.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -0,0 +1,9 @@
#ifndef __CONVERT_CONVERT_H_INCLUDED__
#define __CONVERT_CONVERT_H_INCLUDED__
#include <aiScene.h>
void ConvertStatic(const aiScene *scene);
void ConvertSkeletalAnimated(const aiScene *scene);
#endif

View file

@ -0,0 +1,5 @@
#include "convert.h"
void ConvertSkeletalAnimated(const aiScene *scene)
{
}

View file

@ -0,0 +1,5 @@
#include "convert.h"
void ConvertStatic(const aiScene *scene)
{
}

View file

@ -8,6 +8,7 @@
#include "utils/utils.h"
#include "assimputils/utils.h"
#include "convert/convert.h"
int main(int argc, char *argv[])
{
@ -48,7 +49,40 @@ int main(int argc, char *argv[])
}
printf("Scene loaded.\n");
printf("Animated? %d\nSkeletal? %d\nStatic? %d\n", IsSceneAnimated(scene), IsSceneSkeletal(scene), IsSceneStatic(scene));
if (IsSceneStatic(scene))
{
printf("Using static converter.\n");
try
{
ConvertStatic(scene);
}
catch (std::exception &ex)
{
printf("Error: %s\n", ex.what());
return 1;
}
printf("Convert complete.\n");
}
else if (IsSceneAnimated(scene) && IsSceneSkeletal(scene))
{
printf("Using skeletal animation converter.\n");
try
{
ConvertSkeletalAnimated(scene);
}
catch (std::exception &ex)
{
printf("Error: %s\n", ex.what());
return 1;
}
printf("Convert complete.\n");
}
else
{
printf("Unknown scene format.\n");
return 1;
}
return 0;
}