mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 13:53:02 +05:30
Added for loop to accomodate cases with multiple batches
This commit is contained in:
parent
ad357afc36
commit
d38926b86a
@ -42,7 +42,7 @@ struct BoneIndexes {
|
|||||||
struct BoneWeights {
|
struct BoneWeights {
|
||||||
uint16_t weights; // <format=hex>
|
uint16_t weights; // <format=hex>
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
// This is where most of the parsing will be.
|
// This is where most of the parsing will be.
|
||||||
// this struct is in-order of what the file format will have.
|
// this struct is in-order of what the file format will have.
|
||||||
@ -68,6 +68,8 @@ struct Mesh {
|
|||||||
struct Batch b;
|
struct Batch b;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
void printgheader(struct Header*);
|
void printgheader(struct Header*);
|
||||||
|
|
||||||
void printmeshheader(struct MeshHeader*);
|
void printmeshheader(struct MeshHeader*);
|
||||||
|
@ -115,15 +115,18 @@ void extractmeshes(const char *filedata,
|
|||||||
struct MeshHeader *mh = NULL;
|
struct MeshHeader *mh = NULL;
|
||||||
struct Batch *b = NULL;
|
struct Batch *b = NULL;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
unsigned int j;
|
||||||
bool ok;
|
bool ok;
|
||||||
//h -> numMesh
|
//h -> numMesh
|
||||||
for (i = 1; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
ok = getmeshheader(&mh, i, filedata);
|
ok = getmeshheader(&mh, i, filedata);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
for (j = 0; j < mh -> numBatch; j++) {
|
||||||
getmeshbatch(&b, mh, filedata);
|
getmeshbatch(&b, mh, filedata);
|
||||||
printmeshbatch(b);
|
printmeshbatch(b);
|
||||||
}
|
} // end for
|
||||||
}
|
} // end if
|
||||||
|
} // end for
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char ** argv) {
|
int main(int argc, char ** argv) {
|
||||||
|
Loading…
Reference in New Issue
Block a user