uint32 size indices and vertexBaseIndex to Forsyth (#1304)

- Forsyth::OptimizeFaces() now has 2 overloads, 1 for uint16_t and one
for uint32_t sized indices. Internally each overload now calls down to
the templated OptimizeFacesImpl() providing the respective index type.

- The new 'vertexBaseIndex' is the starting vertex index
subtracted from each index in indexList to allow safe operation on
multiple objects in a single index buffer.

- Also replaced the interal int typedefs with common types provided by
stdint.h
This commit is contained in:
Kyle Rocha
2017-12-30 20:46:21 -08:00
committed by Branimir Karadžić
parent de9d9671fa
commit 1f3846224b
3 changed files with 85 additions and 70 deletions

View File

@@ -126,7 +126,7 @@ long int fsize(FILE* _file)
void triangleReorder(uint16_t* _indices, uint32_t _numIndices, uint32_t _numVertices, uint16_t _cacheSize)
{
uint16_t* newIndexList = new uint16_t[_numIndices];
Forsyth::OptimizeFaces(_indices, _numIndices, _numVertices, newIndexList, _cacheSize);
Forsyth::OptimizeFaces(_indices, _numIndices, _numVertices, 0, newIndexList, _cacheSize);
bx::memCopy(_indices, newIndexList, _numIndices*2);
delete [] newIndexList;
}