Ignore:
Timestamp:
06/28/07 17:34:14 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/pathmap/Mesh.cpp

    r2304 r2469  
    7070        } 
    7171 
     72        //add a texcoord set for prm 
    7273        DWORD fvf = mesh->GetFVF(); 
    7374        fvf |= D3DFVF_NORMAL; 
    7475        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 prm 
    80         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); 
    8182                setVertexFormat(fvf); 
     83        } 
    8284 
    8385        if(generateTBN) 
     
    127129                        mex.explode(); 
    128130 
    129                         //mex.saveFragMeshes(); 
     131//                      mex.saveFragMeshes(); 
    130132 
    131133                        mex.generateAtlas(prmAtlasSize); 
     
    368370        int ATLASSIZE = prmAtlasSize; 
    369371 
    370         std::vector<SubMesh*>::iterator iSubMesh = subMeshes.begin()-1; 
     372        bool firstSub = true; 
     373        std::vector<SubMesh*>::iterator iSubMesh = subMeshes.begin(); 
    371374        DWORD prevAttribute = 0xffffffff; 
    372375 
     
    377380                { 
    378381                        prevAttribute = attributeArray[u]; 
    379                         iSubMesh++; 
     382                        if(firstSub) 
     383                                firstSub = false; 
     384                        else 
     385                                iSubMesh++; 
    380386                        (*iSubMesh)->edgeStartIndex = iEdge; 
    381387                        (*iSubMesh)->edgeCount = 0; 
     
    524530        } 
    525531        delete oldDefaults; 
     532        e.pDefaults = newDefaults; 
    526533 
    527534        newDefaults[e.NumDefaults].Type = D3DXEDT_STRING; 
    528535        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]; 
    530537        strcpy((LPSTR)newDefaults[e.NumDefaults].pValue, value); 
    531538        newDefaults[e.NumDefaults].pParamName = new char[strlen(name)+1]; 
     
    729736                 D3DDECL_END() }; 
    730737 
    731         //mesh->UpdateSemantics(pathMapMeshDecl); 
     738//      mesh->UpdateSemantics(pathMapMeshDecl); 
    732739 
    733740        LPDIRECT3DVERTEXBUFFER9 svertexBuffer; 
Note: See TracChangeset for help on using the changeset viewer.