//----------------------------------------------------------------------------- // Torque Game Engine // Copyright (C) GarageGames.com, Inc. //----------------------------------------------------------------------------- #ifdef _MSC_VER #pragma warning(disable : 4786 4018) #endif #include "nvStripWrap.h" #include "nvtristrip/NvTriStrip.h" #include "nvtristrip/NvTriStripObjects.h" namespace DTS { void nvMakeStrips(std::vector & primitives, std::vector & indices, S32 cacheSize, U32 matIndex) { // incoming indices may have some "holes" in them...e.g., may have index 1,2,3,6,7 only // map to 0..N-1 std::vector map; std::vector remap; U16 next=0; S32 i; for (i=0; i=map.size()) map.push_back(-1); if (map[indices[i]]<0) { map[indices[i]]=next++; remap.push_back(indices[i]); } indices[i] = map[indices[i]]; } PrimitiveGroup * primGroups; U16 numGroups; GenerateStrips(&indices[0],indices.size(),&primGroups,&numGroups); for (i=0; i & faces, std::vector & indices, S32 cacheSize) { // set stripper parameters...we'll just set some default ones SetCacheSize(cacheSize); SetStitchStrips(true); // engine can handle this, so let it SetListsOnly(false); // engine can handle this, so let it SetMinStripSize(0); // engine can handle this, so let it // main strip loop... U32 start, end, i; std::vector someStrips; std::vector retStrips; std::vector someIndices; std::vector retIndices; for (start = 0; start