Skip to content

Commit

Permalink
Bugfix: Bugfixes fror VS 2010 with CMake ( thanks to Jonathan Klein ).
Browse files Browse the repository at this point in the history
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1124 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
  • Loading branch information
kimmi committed Jan 25, 2012
1 parent 007dae4 commit 16a5bef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Visual Studio 9 support, bugfixes.
B3D-Loader, Assimp testing

- Jonathan Klein
Ogre Loader
Ogre Loader, VC2010 fixes and CMake fixes.

- Sebastian Hempel,
PyAssimp (first version)
Expand Down
7 changes: 7 additions & 0 deletions code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,13 @@ SET( unzip_SRCS
)
SOURCE_GROUP( unzip FILES ${unzip_SRCS})


# VC2010 fixes
OPTION( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF )
if( VC10_STDINT_FIX )
ADD_DEFINITIONS( -D_STDINT )
endif( VC10_STDINT_FIX )

ADD_DEFINITIONS( -DASSIMP_BUILD_DLL_EXPORT )

if ( MSVC80 OR MSVC90 OR MSVC10 )
Expand Down
8 changes: 6 additions & 2 deletions code/M3Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ M3Importer::M3Importer() :
m_pHead( NULL ),
m_pRefs( NULL )
{

// empty
}

// ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -263,8 +263,11 @@ void M3Importer::convertToAssimp( const std::string& pFile, aiScene* pScene, DIV
pRootNode->mChildren[ i ] = pCurrentNode;

// Loop over the faces of the nodes
// = regions[i].ofsIndices; j < (regions[i].ofsIndices + regions[i].nIndices); j +=3)

unsigned int numFaces = ( pRegions[ i ].ofsIndices + pRegions[ i ].nIndices ) - pRegions[ i ].ofsIndices;
aiMesh *pMesh = new aiMesh;
pMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
MeshArray.push_back( pMesh );

pMesh->mNumFaces = numFaces;
Expand Down Expand Up @@ -316,13 +319,14 @@ void M3Importer::createVertexData( aiMesh *pMesh, const std::vector<aiVector3D>
aiFace *pFace = &( pMesh->mFaces[ currentFace ] );
for ( unsigned int currentIdx=0; currentIdx<pFace->mNumIndices; currentIdx++ )
{
unsigned int idx = pFace->mIndices[ currentIdx ];
const unsigned int idx = pFace->mIndices[ currentIdx ];
if ( vertices.size() > idx )
{
pMesh->mVertices[ pos ] = vertices[ idx ];
pMesh->mNormals[ pos ] = normals[ idx ];

pFace->mIndices[ currentIdx ] = pos;
pFace->mIndices[ pos ];
pos++;
}
}
Expand Down

0 comments on commit 16a5bef

Please sign in to comment.