In CxbxImpl_SetVertexData4f, call CxbxSetVertexAttribute *after* detecting Register X_D3DVSDE_VERTEX, and updating it to X_D3DVSDE_POSITION, to avoid needless "Register < 0" logging, and to have current position values written to the NV2A vertex attribute value buffer.

This commit is contained in:
PatrickvL 2021-05-17 14:51:03 +02:00
parent b0b47ab744
commit 9d601299ad
1 changed files with 3 additions and 3 deletions

View File

@ -749,9 +749,6 @@ void CxbxImpl_SetVertexData4f(int Register, FLOAT a, FLOAT b, FLOAT c, FLOAT d)
HRESULT hRet = D3D_OK;
// Always update our attribute storage with the most recently set register value
CxbxSetVertexAttribute(Register, a, b, c, d);
// Grow g_InlineVertexBuffer_Table to contain at least current, and a potentially next vertex
if (g_InlineVertexBuffer_TableLength <= g_InlineVertexBuffer_TableOffset + 1) {
UINT InlineVertexBuffer_TableLength_Original = g_InlineVertexBuffer_TableLength;
@ -791,6 +788,9 @@ void CxbxImpl_SetVertexData4f(int Register, FLOAT a, FLOAT b, FLOAT c, FLOAT d)
if (Register == X_D3DVSDE_VERTEX)
index = X_D3DVSDE_POSITION;
// Always update our attribute storage with the most recently set register value
CxbxSetVertexAttribute(index, a, b, c, d);
unsigned o = g_InlineVertexBuffer_TableOffset;
g_InlineVertexBuffer_Table[o].Slots[index] = D3DXVECTOR4(a, b, c, d);