mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 13:53:02 +05:30
writemesh() variable previousBatch renamed to endOfPrevious
This commit is contained in:
parent
889a3e44a6
commit
9b70b10565
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user