Revert "WIP: Enable Travis clang build"

This commit is contained in:
Kim Kulling
2017-10-06 15:42:05 +02:00
committed by GitHub
parent 4a9ab98240
commit c1f93a69ae
48 changed files with 1060 additions and 6538 deletions

View File

@@ -686,6 +686,7 @@ std::list<unsigned int> mesh_idx;
tmesh->mNumVertices = static_cast<unsigned int>(vert_arr.size());
tmesh->mVertices = new aiVector3D[tmesh->mNumVertices];
tmesh->mColors[0] = new aiColor4D[tmesh->mNumVertices];
tmesh->mFaces = new aiFace[face_list_cur.size()];
memcpy(tmesh->mVertices, vert_arr.data(), tmesh->mNumVertices * sizeof(aiVector3D));
memcpy(tmesh->mColors[0], col_arr.data(), tmesh->mNumVertices * sizeof(aiColor4D));

View File

@@ -58,14 +58,6 @@ namespace Formatter {
typedef class basic_formatter< char, std::char_traits<char>, std::allocator<char> > format;
}
#ifndef _MSC_VER
// GCC and Clang need to see this explicit declaration to avoid warning
// MSVC complains about redeclaration even though this is just the
// declaration, not the definition
class FBXImporter;
template<> const std::string LogFunctions<FBXImporter>::log_prefix;
#endif // _MSC_VER
// -------------------------------------------------------------------------------------------
/** Load the Autodesk FBX file format.

View File

@@ -60,13 +60,6 @@ namespace Assimp {
class DB;
}
#ifndef _MSC_VER
// GCC and Clang need to see this explicit declaration to avoid warning
// MSVC complains about redeclaration even though this is just the
// declaration, not the definition
class IFCImporter;
template<> const std::string LogFunctions<IFCImporter>::log_prefix;
#endif // _MSC_VER
// -------------------------------------------------------------------------------------------
/** Load the IFC format, which is an open specification to describe building and construction

View File

@@ -307,7 +307,6 @@ void OpenGEXImporter::InternReadFile( const std::string &filename, aiScene *pSce
std::vector<char> buffer;
TextFileToBuffer( file, buffer );
pIOHandler->Close( file );
OpenDDLParser myParser;
myParser.setBuffer( &buffer[ 0 ], buffer.size() );
@@ -322,7 +321,6 @@ void OpenGEXImporter::InternReadFile( const std::string &filename, aiScene *pSce
copyMeshes( pScene );
copyCameras( pScene );
copyLights( pScene );
copyMaterials( pScene );
resolveReferences();
createNodeTree( pScene );
}
@@ -526,7 +524,7 @@ void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene *pScene ) {
m_currentNode->mNumMeshes = static_cast<unsigned int>(objRefNames.size());
m_currentNode->mMeshes = new unsigned int[ objRefNames.size() ];
if ( !objRefNames.empty() ) {
m_unresolvedRefStack.push_back( std::unique_ptr<RefInfo>( new RefInfo( m_currentNode, RefInfo::MeshRef, objRefNames ) ) );
m_unresolvedRefStack.push_back( new RefInfo( m_currentNode, RefInfo::MeshRef, objRefNames ) );
}
} else if ( m_tokenType == Grammar::LightNodeToken ) {
// TODO!
@@ -545,7 +543,7 @@ void OpenGEXImporter::handleMaterialRefNode( ODDLParser::DDLNode *node, aiScene
std::vector<std::string> matRefNames;
getRefNames( node, matRefNames );
if( !matRefNames.empty() ) {
m_unresolvedRefStack.push_back( std::unique_ptr<RefInfo>( new RefInfo( m_currentNode, RefInfo::MaterialRef, matRefNames ) ) );
m_unresolvedRefStack.push_back( new RefInfo( m_currentNode, RefInfo::MaterialRef, matRefNames ) );
}
}
@@ -1159,19 +1157,6 @@ void OpenGEXImporter::copyLights( aiScene *pScene ) {
std::copy( m_lightCache.begin(), m_lightCache.end(), pScene->mLights );
}
//------------------------------------------------------------------------------------------------
void OpenGEXImporter::copyMaterials( aiScene *pScene ) {
ai_assert( nullptr != pScene );
if ( m_materialCache.empty() ) {
return;
}
pScene->mNumMaterials = static_cast<unsigned int>(m_materialCache.size());
pScene->mMaterials = new aiMaterial*[ pScene->mNumMaterials ];
std::copy( m_materialCache.begin(), m_materialCache.end(), pScene->mMaterials );
}
//------------------------------------------------------------------------------------------------
void OpenGEXImporter::resolveReferences() {
if( m_unresolvedRefStack.empty() ) {
@@ -1179,8 +1164,8 @@ void OpenGEXImporter::resolveReferences() {
}
RefInfo *currentRefInfo( nullptr );
for( auto it = m_unresolvedRefStack.begin(); it != m_unresolvedRefStack.end(); ++it ) {
currentRefInfo = it->get();
for( std::vector<RefInfo*>::iterator it = m_unresolvedRefStack.begin(); it != m_unresolvedRefStack.end(); ++it ) {
currentRefInfo = *it;
if( nullptr != currentRefInfo ) {
aiNode *node( currentRefInfo->m_node );
if( RefInfo::MeshRef == currentRefInfo->m_type ) {
@@ -1246,9 +1231,9 @@ void OpenGEXImporter::pushNode( aiNode *node, aiScene *pScene ) {
if( m_nodeChildMap.end() == it ) {
info = new ChildInfo;
m_root = info;
m_nodeChildMap[ node->mParent ] = std::unique_ptr<ChildInfo>(info);
m_nodeChildMap[ node->mParent ] = info;
} else {
info = it->second.get();
info = it->second;
}
info->m_children.push_back( node );
} else {
@@ -1258,9 +1243,9 @@ void OpenGEXImporter::pushNode( aiNode *node, aiScene *pScene ) {
NodeChildMap::iterator it( m_nodeChildMap.find( node->mParent ) );
if( m_nodeChildMap.end() == it ) {
info = new ChildInfo;
m_nodeChildMap[ node->mParent ] = std::unique_ptr<ChildInfo>(info);
m_nodeChildMap[ node->mParent ] = info;
} else {
info = it->second.get();
info = it->second;
}
info->m_children.push_back( node );
}

View File

@@ -49,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <list>
#include <map>
#include <memory>
namespace ODDLParser {
class DDLNode;
@@ -133,7 +132,6 @@ protected:
void copyMeshes( aiScene *pScene );
void copyCameras( aiScene *pScene );
void copyLights( aiScene *pScene );
void copyMaterials( aiScene *pScene );
void resolveReferences();
void pushNode( aiNode *node, aiScene *pScene );
aiNode *popNode();
@@ -181,7 +179,7 @@ private:
std::list<aiNode*> m_children;
};
ChildInfo *m_root;
typedef std::map<aiNode*, std::unique_ptr<ChildInfo> > NodeChildMap;
typedef std::map<aiNode*, ChildInfo*> NodeChildMap;
NodeChildMap m_nodeChildMap;
std::vector<aiMesh*> m_meshCache;
@@ -202,7 +200,7 @@ private:
std::vector<aiCamera*> m_cameraCache;
std::vector<aiLight*> m_lightCache;
std::vector<aiNode*> m_nodeStack;
std::vector<std::unique_ptr<RefInfo> > m_unresolvedRefStack;
std::vector<RefInfo*> m_unresolvedRefStack;
};
} // Namespace OpenGEX

View File

@@ -157,7 +157,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
DefaultLogger::get()->debug("UNREAL: uc file is " + uc_path);
// and open the files ... we can't live without them
std::unique_ptr<IOStream> p(pIOHandler->Open(d_path));
IOStream* p = pIOHandler->Open(d_path);
if (!p)
throw DeadlyImportError("UNREAL: Unable to open _d file");
StreamReaderLE d_reader(pIOHandler->Open(d_path));
@@ -203,7 +203,7 @@ void UnrealImporter::InternReadFile( const std::string& pFile,
d_reader.IncPtr(1);
}
p.reset(pIOHandler->Open(a_path));
p = pIOHandler->Open(a_path);
if (!p)
throw DeadlyImportError("UNREAL: Unable to open _a file");
StreamReaderLE a_reader(pIOHandler->Open(a_path));

View File

@@ -724,7 +724,7 @@ namespace {
SetTextureProperties(r, prop, out);
if (Value* scale = FindNumber(*prop, "scale")) {
out.scale = static_cast<float>(scale->GetDouble());
out.scale = scale->GetDouble();
}
}
}
@@ -735,7 +735,7 @@ namespace {
SetTextureProperties(r, prop, out);
if (Value* strength = FindNumber(*prop, "strength")) {
out.strength = static_cast<float>(strength->GetDouble());
out.strength = strength->GetDouble();
}
}
}

View File

@@ -563,7 +563,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref<Mesh>& meshRef, Ref<Buf
continue;
}
vertexJointData[vertexId][jointsPerVertex[vertexId]] = static_cast<float>(jointNamesIndex);
vertexJointData[vertexId][jointsPerVertex[vertexId]] = jointNamesIndex;
vertexWeightData[vertexId][jointsPerVertex[vertexId]] = vertWeight;
jointsPerVertex[vertexId] += 1;
@@ -872,7 +872,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
size_t frameIndex = i * nodeChannel->mNumPositionKeys / numKeyframes;
// mTime is measured in ticks, but GLTF time is measured in seconds, so convert.
// Check if we have to cast type here. e.g. uint16_t()
timeData[i] = static_cast<float>(nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond);
timeData[i] = nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond;
}
Ref<Accessor> timeAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
@@ -953,7 +953,7 @@ void glTF2Exporter::ExportAnimations()
Ref<Animation> animRef = mAsset->animations.Create(name);
// Parameters
ExtractAnimationData(*mAsset, name, animRef, bufferRef, nodeChannel, static_cast<float>(anim->mTicksPerSecond));
ExtractAnimationData(*mAsset, name, animRef, bufferRef, nodeChannel, anim->mTicksPerSecond);
for (unsigned int j = 0; j < 3; ++j) {
std::string channelType;

View File

@@ -473,7 +473,7 @@ void ExportSkin(Asset& mAsset, const aiMesh* aimesh, Ref<Mesh>& meshRef, Ref<Buf
continue;
}
vertexJointData[vertexId][jointsPerVertex[vertexId]] = static_cast<float>(jointNamesIndex);
vertexJointData[vertexId][jointsPerVertex[vertexId]] = jointNamesIndex;
vertexWeightData[vertexId][jointsPerVertex[vertexId]] = vertWeight;
jointsPerVertex[vertexId] += 1;
@@ -872,7 +872,7 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animati
size_t frameIndex = i * nodeChannel->mNumPositionKeys / numKeyframes;
// mTime is measured in ticks, but GLTF time is measured in seconds, so convert.
// Check if we have to cast type here. e.g. uint16_t()
timeData[i] = static_cast<float>(nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond);
timeData[i] = nodeChannel->mPositionKeys[frameIndex].mTime / ticksPerSecond;
}
Ref<Accessor> timeAccessor = ExportData(mAsset, animId, buffer, static_cast<unsigned int>(numKeyframes), &timeData[0], AttribType::SCALAR, AttribType::SCALAR, ComponentType_FLOAT);
@@ -953,7 +953,7 @@ void glTFExporter::ExportAnimations()
Ref<Animation> animRef = mAsset->animations.Create(name);
/******************* Parameters ********************/
ExtractAnimationData(*mAsset, name, animRef, bufferRef, nodeChannel, static_cast<float>(anim->mTicksPerSecond));
ExtractAnimationData(*mAsset, name, animRef, bufferRef, nodeChannel, anim->mTicksPerSecond);
for (unsigned int j = 0; j < 3; ++j) {
std::string channelType;