コード例 #1
0
ファイル: MeshDatabase.cpp プロジェクト: Clever-Boy/XLE
 unsigned    MeshDatabase::AddStream(
     std::shared_ptr<IVertexSourceData> dataSource,
     std::vector<unsigned>&& vertexMap,
     const char semantic[], unsigned semanticIndex)
 {
     return InsertStream(~0u, dataSource, std::move(vertexMap), semantic, semanticIndex);
 }
コード例 #2
0
ファイル: OggSplitterDS.cpp プロジェクト: kazutomi/xiphqt
//
// Classify the streams and set the groupID
//
void COggSplitter::SetGroupID()
{
	int i = 0;

	while (i<m_iStreams)
	{
		CMediaType	*pmt = &(m_paStream[i]->m_mt);
		int			iMaxGroupID = -1;
		m_paStream[i]->m_iGroupID = -1;

		for (int j=0; j<i; j++)
		{
			CMediaType	*pmt_cmp = &(m_paStream[j]->m_mt);

			if (m_paStream[j]->m_iGroupID > iMaxGroupID)
				iMaxGroupID = m_paStream[j]->m_iGroupID;

			if (*(pmt->Type())    == *(pmt_cmp->Type()) &&
				*(pmt->Subtype()) == *(pmt_cmp->Subtype()))
			{
				m_paStream[i]->m_iGroupID = m_paStream[j]->m_iGroupID;
				m_paStream[i]->Enable(m_bEnableAll);
			}
		}
		
		if (m_paStream[i]->m_iGroupID == -1)
		{ // This is the first stream of this type
			if (*(m_paStream[i]->m_mt.Type()) == MEDIATYPE_Text && !m_bEnableAll)
			{
				// We must create dummy stream ...
				COggStream* pStream;
				InsertStream(i,&pStream, 65535, true);
				m_paStream[i]->m_iGroupID = iMaxGroupID + 1;
				m_paStream[i]->Enable(true);
				i++;
				m_paStream[i]->m_iGroupID = iMaxGroupID + 1;
				m_paStream[i]->Enable(false);
			}
			else
			{
				m_paStream[i]->m_iGroupID = iMaxGroupID + 1;
				m_paStream[i]->Enable(TRUE);
			}
		}

		i++;
	}
}