summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-10-30 23:05:43 +0000
committerJose Fonseca <jfonseca@vmware.com>2015-10-30 23:05:43 +0000
commit7418bc861f6a73faaeb0ca0e78638e633aee607f (patch)
treeee4e3b8d6db7e0e897a7e2749ccaf0c17c165559 /helpers
parent21f7fdaf4ee341022a0416e9186e7b07218cc4b1 (diff)
ddrawtrace: Fix calculation of FVF texture coord size.
Diffstat (limited to 'helpers')
-rw-r--r--helpers/d3d7size.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/helpers/d3d7size.hpp b/helpers/d3d7size.hpp
index 1d96cda6..5d0f6204 100644
--- a/helpers/d3d7size.hpp
+++ b/helpers/d3d7size.hpp
@@ -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);