From 174806854dada4aa2d9c9e1fc7d8c802f8973a31 Mon Sep 17 00:00:00 2001 From: gered Date: Tue, 7 Jun 2011 10:53:08 -0400 Subject: [PATCH] fixed exception's so that it's gcc compatible. fixed aiString usage error for gcc --- src/convert/skeletalanimated.cpp | 4 ++-- src/convert/static.cpp | 4 ++-- src/main.cpp | 2 +- src/nodetree/nodetree.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/convert/skeletalanimated.cpp b/src/convert/skeletalanimated.cpp index 1321173..a51a4ec 100644 --- a/src/convert/skeletalanimated.cpp +++ b/src/convert/skeletalanimated.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include "mesh.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"); if (fp == NULL) - throw std::exception("Error creating output file."); + throw std::runtime_error("Error creating output file."); WriteMeshHeader(fp); diff --git a/src/convert/static.cpp b/src/convert/static.cpp index c218828..567ddc5 100644 --- a/src/convert/static.cpp +++ b/src/convert/static.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include "mesh.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"); if (fp == NULL) - throw std::exception("Error creating output file."); + throw std::runtime_error("Error creating output file."); WriteMeshHeader(fp); diff --git a/src/main.cpp b/src/main.cpp index 86ab7a3..1722cb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/src/nodetree/nodetree.cpp b/src/nodetree/nodetree.cpp index 3965849..67764be 100644 --- a/src/nodetree/nodetree.cpp +++ b/src/nodetree/nodetree.cpp @@ -2,6 +2,7 @@ #include #include +#include void WalkNode(const aiNode *node); 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"); 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, "HasAnimations: %s\n", scene->HasAnimations() ? "yes" : "no"); @@ -149,7 +150,7 @@ void ShowMeshInfo(const aiMesh *mesh, const aiScene *scene) aiVector3D position; bone->mOffsetMatrix.Decompose(scaling, rotation, position); - aiString parentName = "[null]"; + aiString parentName = aiString("[null]"); aiNode *boneNode = scene->mRootNode->FindNode(bone->mName); if (boneNode != NULL) {