Skip to content

Commit

Permalink
ddrawtrace: Fix calculation of FVF texture coord size.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed Oct 30, 2015
1 parent 21f7fda commit 7418bc8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion helpers/d3d7size.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,20 @@ _getVertexSize(DWORD dwFVF) {
for (DWORD CoordIndex = 0; CoordIndex < dwNumTextures; ++CoordIndex) {
// See D3DFVF_TEXCOORDSIZE*
DWORD dwTexCoordSize = (dwFVF >> (CoordIndex*2 + 16)) & 3;
size += dwTexCoordSize * sizeof(FLOAT);
switch (dwTexCoordSize) {
case D3DFVF_TEXTUREFORMAT2:
size += 2 * sizeof(FLOAT);
break;
case D3DFVF_TEXTUREFORMAT1:
size += 1 * sizeof(FLOAT);
break;
case D3DFVF_TEXTUREFORMAT3:
size += 3 * sizeof(FLOAT);
break;
case D3DFVF_TEXTUREFORMAT4:
size += 4 * sizeof(FLOAT);
break;
}
}

assert((dwFVF & D3DFVF_RESERVED2) == 0);
Expand Down

0 comments on commit 7418bc8

Please sign in to comment.