Merge branch 'master' into sgold/readme/weblink-style
commit
9d3fa41c82
|
@ -1234,7 +1234,10 @@ void IRRImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
||||||
// Parse the XML
|
// Parse the XML
|
||||||
// Find the scene root from document root.
|
// Find the scene root from document root.
|
||||||
const pugi::xml_node &sceneRoot = documentRoot.child("irr_scene");
|
const pugi::xml_node &sceneRoot = documentRoot.child("irr_scene");
|
||||||
if (!sceneRoot) throw new DeadlyImportError("IRR: <irr_scene> not found in file");
|
if (!sceneRoot) {
|
||||||
|
delete root;
|
||||||
|
throw new DeadlyImportError("IRR: <irr_scene> not found in file");
|
||||||
|
}
|
||||||
for (pugi::xml_node &child : sceneRoot.children()) {
|
for (pugi::xml_node &child : sceneRoot.children()) {
|
||||||
// XML elements are either nodes, animators, attributes, or materials
|
// XML elements are either nodes, animators, attributes, or materials
|
||||||
if (!ASSIMP_stricmp(child.name(), "node")) {
|
if (!ASSIMP_stricmp(child.name(), "node")) {
|
||||||
|
|
|
@ -395,7 +395,10 @@ void Q3BSPFileImporter::createTriangleTopology(const Q3BSP::Q3BSPModel *pModel,
|
||||||
m_pCurrentFace->mIndices = new unsigned int[3];
|
m_pCurrentFace->mIndices = new unsigned int[3];
|
||||||
m_pCurrentFace->mIndices[idx] = vertIdx;
|
m_pCurrentFace->mIndices[idx] = vertIdx;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
m_pCurrentFace->mIndices[idx] = vertIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pMesh->mVertices[vertIdx].Set(pVertex->vPosition.x, pVertex->vPosition.y, pVertex->vPosition.z);
|
pMesh->mVertices[vertIdx].Set(pVertex->vPosition.x, pVertex->vPosition.y, pVertex->vPosition.z);
|
||||||
pMesh->mNormals[vertIdx].Set(pVertex->vNormal.x, pVertex->vNormal.y, pVertex->vNormal.z);
|
pMesh->mNormals[vertIdx].Set(pVertex->vNormal.x, pVertex->vNormal.y, pVertex->vNormal.z);
|
||||||
|
|
|
@ -99,12 +99,12 @@ bool DefaultIOSystem::Exists(const char *pFile) const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
FILE *file = ::fopen(pFile, "rb");
|
struct stat statbuf;
|
||||||
if (!file) {
|
stat(pFile, &statbuf);
|
||||||
|
// test for a regular file
|
||||||
|
if (!S_ISREG(statbuf.st_mode)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
::fclose(file);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -116,6 +116,7 @@ IOStream *DefaultIOSystem::Open(const char *strFile, const char *strMode) {
|
||||||
ai_assert(strFile != nullptr);
|
ai_assert(strFile != nullptr);
|
||||||
ai_assert(strMode != nullptr);
|
ai_assert(strMode != nullptr);
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::wstring name = Utf8ToWide(strFile);
|
std::wstring name = Utf8ToWide(strFile);
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
|
@ -126,6 +127,7 @@ IOStream *DefaultIOSystem::Open(const char *strFile, const char *strMode) {
|
||||||
#else
|
#else
|
||||||
file = ::fopen(strFile, strMode);
|
file = ::fopen(strFile, strMode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue