mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-29 02:02:04 +05:30
Check for texture pack done in memory
This commit is contained in:
parent
e3f942e3d7
commit
a52a9ef0bc
@ -71,13 +71,11 @@ bool unpackpld(const char *filedata,
|
|||||||
fn = (char*)malloc(strlen(filename) + 3 + 4);
|
fn = (char*)malloc(strlen(filename) + 3 + 4);
|
||||||
int size = 0;
|
int size = 0;
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
char filetype[TYPE_ID_LENGTH];
|
char textureid[TYPE_ID_LENGTH] = {'\0', '2', '3', 'T'};
|
||||||
char filetypetexture[TYPE_ID_LENGTH] = {'\0', '2', '3', 'T'};
|
|
||||||
for (i = 0; i < h.numOffset; i++) {
|
for (i = 0; i < h.numOffset; i++) {
|
||||||
const char * currentfile = filedata + h.offsets[i];
|
const char * currentfile = filedata + h.offsets[i];
|
||||||
size = sizeofpldstruct(&h, i, filesize);
|
size = sizeofpldstruct(&h, i, filesize);
|
||||||
memcpy(filetype, currentfile, TYPE_ID_LENGTH);
|
if (strncmp( currentfile, textureid, TYPE_ID_LENGTH ) == 0)
|
||||||
if (strcmp( filetype, filetypetexture ) == 0)
|
|
||||||
sprintf(fn, "%s_%d.txp", filename, i);
|
sprintf(fn, "%s_%d.txp", filename, i);
|
||||||
else
|
else
|
||||||
sprintf(fn, "%s_%d", filename, i);
|
sprintf(fn, "%s_%d", filename, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user