<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/SetAdditionalVertexStream?action=history&amp;feed=atom</id>
	<title>SetAdditionalVertexStream - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/SetAdditionalVertexStream?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAdditionalVertexStream&amp;action=history"/>
	<updated>2026-04-22T13:05:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAdditionalVertexStream&amp;diff=50993&amp;oldid=prev</id>
		<title>Xtravax at 13:24, 14 May 2017</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAdditionalVertexStream&amp;diff=50993&amp;oldid=prev"/>
		<updated>2017-05-14T13:24:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:24, 14 May 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Code==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Code==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&quot;c++&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;void CAdditionalVertexStreamManager::SetAdditionalVertexStream ( SCurrentStateInfo&amp;amp; state )&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;void CAdditionalVertexStreamManager::SetAdditionalVertexStream ( SCurrentStateInfo&amp;amp; state )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-50992:rev-50993 --&gt;
&lt;/table&gt;</summary>
		<author><name>Xtravax</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAdditionalVertexStream&amp;diff=50992&amp;oldid=prev</id>
		<title>Xtravax: Created page with &quot;&lt;pageclass subcaption=&quot;C++ Function&quot;&gt;&lt;/pageclass&gt;  This C++ Function is found inside of CAdditionalVertexStreamManager.  It sets an additional vertex stream.  It can be fo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAdditionalVertexStream&amp;diff=50992&amp;oldid=prev"/>
		<updated>2017-05-14T13:24:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pageclass subcaption=&amp;quot;C++ Function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;  This C++ Function is found inside of &lt;a href=&quot;/wiki/CAdditionalVertexStreamManager&quot; title=&quot;CAdditionalVertexStreamManager&quot;&gt;CAdditionalVertexStreamManager&lt;/a&gt;.  It sets an additional vertex stream.  It can be fo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pageclass subcaption=&amp;quot;C++ Function&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This C++ Function is found inside of [[CAdditionalVertexStreamManager]].&lt;br /&gt;
&lt;br /&gt;
It sets an additional vertex stream.&lt;br /&gt;
&lt;br /&gt;
It can be found in '''Client/Client Core/Sources/CAdditionalVertexStreamManager.cpp''' in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''state:''' To be defined.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
void CAdditionalVertexStreamManager::SetAdditionalVertexStream ( SCurrentStateInfo&amp;amp; state )&lt;br /&gt;
{&lt;br /&gt;
    HRESULT hr;&lt;br /&gt;
&lt;br /&gt;
    // Get matching custom N vbuffer for std PT vbuffer&lt;br /&gt;
    SAdditionalStreamInfo* pAdditionalInfo = GetAdditionalStreamInfo ( state.stream1.pStreamData );&lt;br /&gt;
    if ( !pAdditionalInfo )&lt;br /&gt;
        pAdditionalInfo = CreateAdditionalStreamInfo ( state );&lt;br /&gt;
&lt;br /&gt;
    uint StridePT = 20;&lt;br /&gt;
    uint StrideN = 12;&lt;br /&gt;
&lt;br /&gt;
    // Calc area we are going to use&lt;br /&gt;
    uint viMinBased = state.args.MinVertexIndex + state.args.BaseVertexIndex;&lt;br /&gt;
    uint viMaxBased = state.args.MinVertexIndex + state.args.NumVertices + state.args.BaseVertexIndex;&lt;br /&gt;
&lt;br /&gt;
    uint ReadOffsetStart = viMinBased * StridePT + state.stream1.OffsetInBytes;&lt;br /&gt;
    uint ReadOffsetSize = ( viMaxBased - viMinBased ) * StridePT;&lt;br /&gt;
&lt;br /&gt;
    uint OffsetInBytesN = ConvertPTSize ( state.stream1.OffsetInBytes );&lt;br /&gt;
    uint WriteOffsetStart = viMinBased * StrideN + OffsetInBytesN;&lt;br /&gt;
    uint WriteOffsetSize = ( viMaxBased - viMinBased ) * StrideN;&lt;br /&gt;
&lt;br /&gt;
    assert ( WriteOffsetStart == ConvertPTSize ( ReadOffsetStart ) );&lt;br /&gt;
    assert ( WriteOffsetSize == ConvertPTSize ( ReadOffsetSize ) );&lt;br /&gt;
&lt;br /&gt;
    // See if area VB area needs updating&lt;br /&gt;
    if ( !pAdditionalInfo-&amp;gt;ConvertedRanges.IsRangeSet ( WriteOffsetStart, WriteOffsetSize ) )&lt;br /&gt;
    {&lt;br /&gt;
        // Update VB area&lt;br /&gt;
        UpdateAdditionalStreamContent ( state, pAdditionalInfo, ReadOffsetStart, ReadOffsetSize, WriteOffsetStart, WriteOffsetSize );&lt;br /&gt;
        pAdditionalInfo-&amp;gt;ConvertedRanges.SetRange ( WriteOffsetStart, WriteOffsetSize );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Save old declaration&lt;br /&gt;
    hr = m_pDevice-&amp;gt;GetVertexDeclaration ( &amp;amp;m_pOldVertexDeclaration );&lt;br /&gt;
&lt;br /&gt;
    // Set declaration&lt;br /&gt;
    hr = g_pProxyDevice-&amp;gt;SetVertexDeclaration ( pAdditionalInfo-&amp;gt;pVertexDeclaration );&lt;br /&gt;
&lt;br /&gt;
    // Set additional stream&lt;br /&gt;
    uint OffsetInBytes = ConvertPTSize ( state.stream1.OffsetInBytes );&lt;br /&gt;
    hr = m_pDevice-&amp;gt;SetStreamSource ( 2, pAdditionalInfo-&amp;gt;pStreamData, OffsetInBytes, pAdditionalInfo-&amp;gt;Stride );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[[CAdditionalVertexStreamManager]]&lt;/div&gt;</summary>
		<author><name>Xtravax</name></author>
	</entry>
</feed>