fixed exception's so that it's gcc compatible. fixed aiString usage error for gcc

This commit is contained in:
gered 2011-06-07 10:53:08 -04:00
parent ee3975406e
commit 174806854d
4 changed files with 8 additions and 7 deletions

View file

@ -2,7 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <exception> #include <stdexcept>
#include "mesh.h" #include "mesh.h"
#include "../assimputils/utils.h" #include "../assimputils/utils.h"
@ -11,7 +11,7 @@ void ConvertSkeletalAnimated(const std::string &outfile, const aiScene *scene)
{ {
FILE *fp = fopen(outfile.c_str(), "wb"); FILE *fp = fopen(outfile.c_str(), "wb");
if (fp == NULL) if (fp == NULL)
throw std::exception("Error creating output file."); throw std::runtime_error("Error creating output file.");
WriteMeshHeader(fp); WriteMeshHeader(fp);

View file

@ -2,7 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <exception> #include <stdexcept>
#include "mesh.h" #include "mesh.h"
#include "../assimputils/utils.h" #include "../assimputils/utils.h"
@ -11,7 +11,7 @@ void ConvertStatic(const std::string &outfile, const aiScene *scene)
{ {
FILE *fp = fopen(outfile.c_str(), "wb"); FILE *fp = fopen(outfile.c_str(), "wb");
if (fp == NULL) if (fp == NULL)
throw std::exception("Error creating output file."); throw std::runtime_error("Error creating output file.");
WriteMeshHeader(fp); WriteMeshHeader(fp);

View file

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <exception> #include <stdexcept>
#include <assimp/assimp.hpp> #include <assimp/assimp.hpp>
#include <assimp/aiScene.h> #include <assimp/aiScene.h>

View file

@ -2,6 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <stdexcept>
void WalkNode(const aiNode *node); void WalkNode(const aiNode *node);
void ShowMeshInfo(const aiMesh *mesh, const aiScene *scene); void ShowMeshInfo(const aiMesh *mesh, const aiScene *scene);
@ -26,7 +27,7 @@ void Walk(const aiScene *scene, const std::string &filename)
g_fp = fopen(filename.c_str(), "w"); g_fp = fopen(filename.c_str(), "w");
if (g_fp == NULL) if (g_fp == NULL)
throw std::exception("Error creating description output file."); throw std::runtime_error("Error creating description output file.");
fprintf(g_fp, "\n*** GENERAL SCENE INFO ***\n\n"); fprintf(g_fp, "\n*** GENERAL SCENE INFO ***\n\n");
fprintf(g_fp, "HasAnimations: %s\n", scene->HasAnimations() ? "yes" : "no"); fprintf(g_fp, "HasAnimations: %s\n", scene->HasAnimations() ? "yes" : "no");
@ -149,7 +150,7 @@ void ShowMeshInfo(const aiMesh *mesh, const aiScene *scene)
aiVector3D position; aiVector3D position;
bone->mOffsetMatrix.Decompose(scaling, rotation, position); bone->mOffsetMatrix.Decompose(scaling, rotation, position);
aiString parentName = "[null]"; aiString parentName = aiString("[null]");
aiNode *boneNode = scene->mRootNode->FindNode(bone->mName); aiNode *boneNode = scene->mRootNode->FindNode(bone->mName);
if (boneNode != NULL) if (boneNode != NULL)
{ {