Merge branch 'master' into hide_gpg_signature
commit
34e63dbe09
|
@ -332,6 +332,11 @@ void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vec
|
||||||
// collect vertex data for indices of this face
|
// collect vertex data for indices of this face
|
||||||
for( unsigned int d = 0; d < df.mNumIndices; ++d ) {
|
for( unsigned int d = 0; d < df.mNumIndices; ++d ) {
|
||||||
df.mIndices[d] = newIndex;
|
df.mIndices[d] = newIndex;
|
||||||
|
const unsigned int newIdx( pf.mIndices[ d ] );
|
||||||
|
if ( newIdx > sourceMesh->mPositions.size() ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
orgPoints[newIndex] = pf.mIndices[d];
|
orgPoints[newIndex] = pf.mIndices[d];
|
||||||
|
|
||||||
// Position
|
// Position
|
||||||
|
@ -459,7 +464,7 @@ void XFileImporter::CreateAnimations( aiScene* pScene, const XFile::Scene* pData
|
||||||
nbone->mNodeName.Set( bone->mBoneName);
|
nbone->mNodeName.Set( bone->mBoneName);
|
||||||
nanim->mChannels[b] = nbone;
|
nanim->mChannels[b] = nbone;
|
||||||
|
|
||||||
// keyframes are given as combined transformation matrix keys
|
// key-frames are given as combined transformation matrix keys
|
||||||
if( !bone->mTrafoKeys.empty() )
|
if( !bone->mTrafoKeys.empty() )
|
||||||
{
|
{
|
||||||
nbone->mNumPositionKeys = (unsigned int)bone->mTrafoKeys.size();
|
nbone->mNumPositionKeys = (unsigned int)bone->mTrafoKeys.size();
|
||||||
|
|
|
@ -471,7 +471,10 @@ void XFileParser::ParseDataObjectMesh( Mesh* pMesh)
|
||||||
unsigned int numIndices = ReadInt();
|
unsigned int numIndices = ReadInt();
|
||||||
Face& face = pMesh->mPosFaces[a];
|
Face& face = pMesh->mPosFaces[a];
|
||||||
for (unsigned int b = 0; b < numIndices; ++b) {
|
for (unsigned int b = 0; b < numIndices; ++b) {
|
||||||
face.mIndices.push_back( ReadInt() );
|
const int idx( ReadInt() );
|
||||||
|
if ( static_cast<unsigned int>( idx ) <= numVertices ) {
|
||||||
|
face.mIndices.push_back( idx );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TestForSeparator();
|
TestForSeparator();
|
||||||
}
|
}
|
||||||
|
@ -1293,7 +1296,7 @@ unsigned int XFileParser::ReadBinDWord() {
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
unsigned int XFileParser::ReadInt()
|
unsigned int XFileParser::ReadInt()
|
||||||
{
|
{
|
||||||
if( mIsBinaryFormat)
|
if( mIsBinaryFormat)
|
||||||
{
|
{
|
||||||
if( mBinaryNumCount == 0 && mEnd - mP >= 2)
|
if( mBinaryNumCount == 0 && mEnd - mP >= 2)
|
||||||
{
|
{
|
||||||
|
@ -1305,7 +1308,8 @@ unsigned int XFileParser::ReadInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
--mBinaryNumCount;
|
--mBinaryNumCount;
|
||||||
if ( mEnd - mP >= 4) {
|
const size_t len( mEnd - mP );
|
||||||
|
if ( len >= 4) {
|
||||||
return ReadBinDWord();
|
return ReadBinDWord();
|
||||||
} else {
|
} else {
|
||||||
mP = mEnd;
|
mP = mEnd;
|
||||||
|
@ -1340,6 +1344,7 @@ unsigned int XFileParser::ReadInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckForSeparator();
|
CheckForSeparator();
|
||||||
|
|
||||||
return isNegative ? ((unsigned int) -int( number)) : number;
|
return isNegative ? ((unsigned int) -int( number)) : number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -363,9 +363,7 @@ int CDisplay::ReplaceCurrentTexture(const char* szPath)
|
||||||
*tex = piTexture;
|
*tex = piTexture;
|
||||||
m_pcCurrentTexture->piTexture = tex;
|
m_pcCurrentTexture->piTexture = tex;
|
||||||
|
|
||||||
//if (!pcMesh->bSharedFX){
|
pcMesh->piEffect->SetTexture(tex_string,piTexture);
|
||||||
pcMesh->piEffect->SetTexture(tex_string,piTexture);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,7 +561,6 @@ int CDisplay::AddMaterialToDisplayList(HTREEITEM hRoot,
|
||||||
tvi.iImage = m_aiImageList[AI_VIEW_IMGLIST_MATERIAL];
|
tvi.iImage = m_aiImageList[AI_VIEW_IMGLIST_MATERIAL];
|
||||||
tvi.iSelectedImage = m_aiImageList[AI_VIEW_IMGLIST_MATERIAL];
|
tvi.iSelectedImage = m_aiImageList[AI_VIEW_IMGLIST_MATERIAL];
|
||||||
tvi.lParam = (LPARAM)10;
|
tvi.lParam = (LPARAM)10;
|
||||||
//tvi.state = TVIS_EXPANDED | TVIS_EXPANDEDONCE ;
|
|
||||||
|
|
||||||
sNew.itemex = tvi;
|
sNew.itemex = tvi;
|
||||||
sNew.hInsertAfter = TVI_LAST;
|
sNew.hInsertAfter = TVI_LAST;
|
||||||
|
@ -630,7 +627,7 @@ int CDisplay::AddMaterialToDisplayList(HTREEITEM hRoot,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
// Expand all elements in the treeview
|
// Expand all elements in the tree-view
|
||||||
int CDisplay::ExpandTree()
|
int CDisplay::ExpandTree()
|
||||||
{
|
{
|
||||||
// expand all materials
|
// expand all materials
|
||||||
|
@ -780,7 +777,7 @@ int CDisplay::OnRender()
|
||||||
// Now render the log display in the upper right corner of the window
|
// Now render the log display in the upper right corner of the window
|
||||||
CLogDisplay::Instance().OnRender();
|
CLogDisplay::Instance().OnRender();
|
||||||
|
|
||||||
// present the backbuffer
|
// present the back-buffer
|
||||||
g_piDevice->EndScene();
|
g_piDevice->EndScene();
|
||||||
g_piDevice->Present(NULL,NULL,NULL,NULL);
|
g_piDevice->Present(NULL,NULL,NULL,NULL);
|
||||||
|
|
||||||
|
@ -1601,7 +1598,7 @@ int CDisplay::HandleInput()
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
// Process input for an empty scen view to allow for skybox rotations
|
// Process input for an empty scene view to allow for sky-box rotations
|
||||||
int CDisplay::HandleInputEmptyScene()
|
int CDisplay::HandleInputEmptyScene()
|
||||||
{
|
{
|
||||||
if(CBackgroundPainter::TEXTURE_CUBE == CBackgroundPainter::Instance().GetMode())
|
if(CBackgroundPainter::TEXTURE_CUBE == CBackgroundPainter::Instance().GetMode())
|
||||||
|
@ -2043,7 +2040,7 @@ int CDisplay::RenderNode (aiNode* piNode,const aiMatrix4x4& piMatrix,
|
||||||
g_piDevice->SetVertexDeclaration( gDefaultVertexDecl);
|
g_piDevice->SetVertexDeclaration( gDefaultVertexDecl);
|
||||||
|
|
||||||
if (g_sOptions.bNoAlphaBlending) {
|
if (g_sOptions.bNoAlphaBlending) {
|
||||||
// manually disable alphablending
|
// manually disable alpha-blending
|
||||||
g_piDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,FALSE);
|
g_piDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2207,9 +2204,6 @@ int CDisplay::RenderTextureView()
|
||||||
// it might be that there is no texture ...
|
// it might be that there is no texture ...
|
||||||
if (!m_pcCurrentTexture->piTexture)
|
if (!m_pcCurrentTexture->piTexture)
|
||||||
{
|
{
|
||||||
// FIX: no such log message. it would be repeated to often
|
|
||||||
//CLogDisplay::Instance().AddEntry("Unable to display texture. Image is unreachable.",
|
|
||||||
// D3DCOLOR_ARGB(0xFF,0xFF,0,0));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2304,5 +2298,6 @@ int CDisplay::RenderTextureView()
|
||||||
// do we need to draw UV coordinates?
|
// do we need to draw UV coordinates?
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,6 @@ DWORD WINAPI LoadThreadProc(LPVOID lpParameter)
|
||||||
// get the end time of zje operation, calculate delta t
|
// get the end time of zje operation, calculate delta t
|
||||||
double fEnd = (double)timeGetTime();
|
double fEnd = (double)timeGetTime();
|
||||||
g_fLoadTime = (float)((fEnd - fCur) / 1000);
|
g_fLoadTime = (float)((fEnd - fCur) / 1000);
|
||||||
// char szTemp[128];
|
|
||||||
g_bLoadingFinished = true;
|
g_bLoadingFinished = true;
|
||||||
|
|
||||||
// check whether the loading process has failed ...
|
// check whether the loading process has failed ...
|
||||||
|
|
Loading…
Reference in New Issue