Moved loop to its own function - gettextures()

This commit is contained in:
_
2018-04-04 22:14:45 -07:00
parent 91103da410
commit 6f915237b4
3 changed files with 26 additions and 13 deletions

View File

@@ -83,3 +83,22 @@ unsigned int gettexturebatch(
return totaltextures;
}
void gettextures(struct Texture **t,
struct TexturePack *tp,
struct TextureBatch **tb,
struct TextureBatchDescriptor **bds) {
unsigned int i;
unsigned int j;
// k is access to index of textures.
unsigned int k = 0;
unsigned int offset = 0;
for (i = 0; i < tp -> batchNumber; i++) {
for (j = 0; j < bds[i] -> texNumber; j++) {
printf("texture offsets %x\n", offset + tp -> firstBatchOffset);
t[k] = (struct Texture*)tb + offset;
offset += bds[i] -> textureSize;
k++;
}
}
}