| 877 | } |
| 878 | |
| 879 | void Tr2EffectStateManager::ApplyVertexDeclaration( uint32_t declaration ) |
| 880 | { |
| 881 | if( m_isManagedRendering && declaration == m_currentValues.m_vertexDeclaration ) |
| 882 | { |
| 883 | return; |
| 884 | } |
| 885 | |
| 886 | |
| 887 | CCP_ASSERT( declaration != UNINITIALIZED_DECLARATION ); |
| 888 | |
| 889 | if( declaration == NULL_DECLARATION ) |
| 890 | { |
| 891 | m_renderContext.SetVertexLayout( Tr2VertexLayoutAL() ); |
| 892 | } |
| 893 | else |
| 894 | { |
| 895 | CCP_ASSERT( declaration < s_vertexLayoutMap.size() ); |
| 896 | |
| 897 | if( declaration < s_vertexLayoutMap.size() ) |
| 898 | { |
| 899 | Tr2VertexLayoutAL& hvl = *s_vertexLayoutMap[declaration].second; |
| 900 | if( !hvl.IsValid() ) |
| 901 | { |
| 902 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 903 | |
| 904 | hvl.Create( s_vertexLayoutMap[declaration].first, renderContext ); |
| 905 | } |
| 906 | m_renderContext.SetVertexLayout( hvl ); |
| 907 | } |
| 908 | } |
| 909 | m_currentValues.m_vertexDeclaration = declaration; |
| 910 | } |
| 911 | |
| 912 | bool Tr2EffectStateManager::GetVertexDeclarationElements( uint32_t declaration, Tr2VertexDefinition& definition ) |
| 913 | { |
no test coverage detected