mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2025-05-31 14:11:42 +05:30
Deleted scrapped functions.
This commit is contained in:
32
test/main.c
32
test/main.c
@@ -107,38 +107,6 @@ void write(const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
void unpacktextures(const char *filedata,
|
||||
unsigned int filesize,
|
||||
const char *filename) {
|
||||
struct TexturePack *tp = (struct TexturePack*)filedata;
|
||||
struct TextureBatch **batches = NULL;
|
||||
struct TextureBatchDescriptor **descripts = NULL;
|
||||
batches = (struct TextureBatch**)malloc(tp -> batchNumber);
|
||||
descripts = (struct TextureBatchDescriptor**)malloc(tp -> batchNumber);
|
||||
gettbd(descripts, filedata, filesize);
|
||||
// array of pointers - texture data exists in memory in filedata.
|
||||
unsigned int texturecount = gettexturebatch(batches,
|
||||
descripts,
|
||||
filedata,
|
||||
filesize);
|
||||
unsigned int *tloc = (unsigned int*)
|
||||
malloc(sizeof(unsigned int) * texturecount);
|
||||
locatetextures(tloc, tp, descripts);
|
||||
// add 3 to buffer for digits, & 4 for file extension
|
||||
char *fmt = (char*)malloc(strlen(filename) + 3 + 4);
|
||||
unsigned int texsize = 0;
|
||||
unsigned int i;
|
||||
for (i = 0; i < texturecount; i++) {
|
||||
texsize = descripts[i/(tp -> batchNumber)] -> textureSize;
|
||||
sprintf(fmt, "%s_%d.dds", filename, i);
|
||||
write(fmt, filedata + tloc[i], texsize);
|
||||
}
|
||||
free(fmt);
|
||||
free(tloc);
|
||||
free(descripts);
|
||||
free(batches);
|
||||
}
|
||||
|
||||
void exporttextures(const char *filedata,
|
||||
unsigned int filesize,
|
||||
const char *filename) {
|
||||
|
||||
Reference in New Issue
Block a user