diff --git a/demo/extractmesh.c b/demo/extractmesh.c index 4ee0243..7126d2d 100644 --- a/demo/extractmesh.c +++ b/demo/extractmesh.c @@ -25,22 +25,22 @@ void writemesh(const struct MeshHeader *mh, // batch data the same treatment. struct BatchData * newBatches = malloc(newmh.numBatch * sizeof(struct BatchData)); - uint64_t previousBatch = 0; + uint64_t endOfPrevious = 0; for (int i = 0; i < newmh.numBatch; i++) { newBatches[i] = (m -> b) -> bd[i]; unsigned int nVertices = m -> b -> bd[i].numVertex; - if (previousBatch == 0) { + if (endOfPrevious == 0) { newBatches[i].offsetPositions = newmh.offsetBatches + ( newmh.numBatch * sizeof(struct BatchData)); } else { - newBatches[i].offsetPositions = previousBatch; + newBatches[i].offsetPositions = endOfPrevious; } newBatches[i].offsetNormals = newBatches[i].offsetPositions + (sizeof(struct Coordinate) * nVertices); newBatches[i].offsetUVs = newBatches[i].offsetNormals + (sizeof(struct Coordinate) * nVertices); newBatches[i].offsetBoneIndexes = newBatches[i].offsetUVs + (sizeof(struct UVs) * nVertices); newBatches[i].offsetBoneWeights = newBatches[i].offsetBoneIndexes + (sizeof(struct BoneIndexes) * nVertices); append(fn, (char*)(&newBatches[i]), sizeof(struct BatchData)); - previousBatch = newBatches[i].offsetBoneWeights + (sizeof(struct BoneWeights) * nVertices);; + endOfPrevious = newBatches[i].offsetBoneWeights + (sizeof(struct BoneWeights) * nVertices);; } for (int i = 0; i < newmh.numBatch; i++) {