MaybeSetAdditionalVertexStream

From Multi Theft Auto: Wiki
Revision as of 13:25, 14 May 2017 by Xtravax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This C++ Function is found inside of CAdditionalVertexStreamManager.

It maybe sets an additional vertex stream.

It can be found in Client/Client Core/Sources/CAdditionalVertexStreamManager.cpp in Visual Studio.

Required Arguments

  • PrimitiveType: D3DPRIMITIVETYPE type --.
  • BaseVertexIndex: INT value --.
  • MinVertexIndex: UINT value.
  • NumVertices: UINT value.
  • startIndex: UINT value.
  • primCount: UINT value.

Returns

Returns a boolean representing whether an additional vertex stream was set or not.

Code

bool CAdditionalVertexStreamManager::MaybeSetAdditionalVertexStream ( D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount )
{
    // Cache info
    SCurrentStateInfo state;

    // Save call arguments
    state.args.PrimitiveType = PrimitiveType;
    state.args.BaseVertexIndex = BaseVertexIndex;
    state.args.MinVertexIndex = MinVertexIndex;
    state.args.NumVertices = NumVertices;
    state.args.startIndex = startIndex;
    state.args.primCount = primCount;
  
    // Cache info about state streams etc
    UpdateCurrentStateInfo ( state );

    // For now, this only works if the original has 3 decl elements (0:D, 1:P, 1:T) and stream 1 has a stride of 20
    if ( !CheckCanDoThis ( state ) )
        return false;

    SetAdditionalVertexStream ( state );
    return true;
}

See Also