- Timestamp:
- 06/28/07 17:34:14 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/pathmap/Mesh.cpp
r2304 r2469 70 70 } 71 71 72 //add a texcoord set for prm 72 73 DWORD fvf = mesh->GetFVF(); 73 74 fvf |= D3DFVF_NORMAL; 74 75 DWORD nTexCoords = fvf & D3DFVF_TEXCOUNT_MASK; 75 nTexCoords += D3DFVF_TEX1;76 fvf &= ~D3DFVF_TEXCOUNT_MASK;77 fvf |= nTexCoords;78 fvf |= D3DFVF_TEXCOORDSIZE2(nTexCoords / D3DFVF_TEX1);79 //add a texcoord set for prm80 if(generateUV)76 if(generateUV || (originalAtlasTexCoordIndex == 0 && nTexCoords == D3DFVF_TEX1)) 77 { 78 nTexCoords += D3DFVF_TEX1; 79 fvf &= ~D3DFVF_TEXCOUNT_MASK; 80 fvf |= nTexCoords; 81 fvf |= D3DFVF_TEXCOORDSIZE2(nTexCoords / D3DFVF_TEX1); 81 82 setVertexFormat(fvf); 83 } 82 84 83 85 if(generateTBN) … … 127 129 mex.explode(); 128 130 129 //mex.saveFragMeshes();131 // mex.saveFragMeshes(); 130 132 131 133 mex.generateAtlas(prmAtlasSize); … … 368 370 int ATLASSIZE = prmAtlasSize; 369 371 370 std::vector<SubMesh*>::iterator iSubMesh = subMeshes.begin()-1; 372 bool firstSub = true; 373 std::vector<SubMesh*>::iterator iSubMesh = subMeshes.begin(); 371 374 DWORD prevAttribute = 0xffffffff; 372 375 … … 377 380 { 378 381 prevAttribute = attributeArray[u]; 379 iSubMesh++; 382 if(firstSub) 383 firstSub = false; 384 else 385 iSubMesh++; 380 386 (*iSubMesh)->edgeStartIndex = iEdge; 381 387 (*iSubMesh)->edgeCount = 0; … … 524 530 } 525 531 delete oldDefaults; 532 e.pDefaults = newDefaults; 526 533 527 534 newDefaults[e.NumDefaults].Type = D3DXEDT_STRING; 528 535 newDefaults[e.NumDefaults].NumBytes = strlen(name) + 1; 529 newDefaults[e.NumDefaults].pValue = new char[e.pDefaults[ i].NumBytes];536 newDefaults[e.NumDefaults].pValue = new char[e.pDefaults[e.NumDefaults].NumBytes]; 530 537 strcpy((LPSTR)newDefaults[e.NumDefaults].pValue, value); 531 538 newDefaults[e.NumDefaults].pParamName = new char[strlen(name)+1]; … … 729 736 D3DDECL_END() }; 730 737 731 //mesh->UpdateSemantics(pathMapMeshDecl);738 // mesh->UpdateSemantics(pathMapMeshDecl); 732 739 733 740 LPDIRECT3DVERTEXBUFFER9 svertexBuffer;
Note: See TracChangeset
for help on using the changeset viewer.