aboutsummaryrefslogtreecommitdiff
path: root/brlyt.c
diff options
context:
space:
mode:
authormegazig <megazig@hotmail.com>2009-11-05 16:58:00 -0600
committermegazig <megazig@hotmail.com>2009-11-05 16:58:00 -0600
commit3975041cf1c4b46c7284e94e6c9cabb48db51ffb (patch)
treed2e66fba1387933fdcfe98fddee081f9df97c370 /brlyt.c
parent56c06a7eba37d9634d89964d45bb7bd55eb901b2 (diff)
Fixed bug of always dying on first material or texture when writing brlyt.
Diffstat (limited to 'brlyt.c')
-rw-r--r--brlyt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/brlyt.c b/brlyt.c
index 386c5bc..27d1f0b 100644
--- a/brlyt.c
+++ b/brlyt.c
@@ -1543,6 +1543,7 @@ void WriteBRLYTEntry( mxml_node_t * tree , mxml_node_t * node , u8** tagblob , u
char *names;
names = malloc(sizeof(names));
int lengthOfNames = 0;
+ numberOfTextures = 0;
mxml_node_t *subnode = mxmlFindElement(node, node, "entries", NULL, NULL, MXML_DESCEND);
if (subnode != NULL)
{
@@ -1574,6 +1575,7 @@ void WriteBRLYTEntry( mxml_node_t * tree , mxml_node_t * node , u8** tagblob , u
*fileOffset = *fileOffset + sizeof(chunk2);
numEntries++;
+ numberOfTextures++;
baseOffset += (strlen(tempSub) + 1);
@@ -1691,6 +1693,7 @@ void WriteBRLYTEntry( mxml_node_t * tree , mxml_node_t * node , u8** tagblob , u
}
if ( memcmp(temp, mat1, sizeof(mat1)) == 0)
{
+ numberOfMaterials = 0;
int numberOfEntries = 0;
int actualNumber = 0;
brlyt_numoffs_chunk numchunk;
@@ -1719,6 +1722,7 @@ void WriteBRLYTEntry( mxml_node_t * tree , mxml_node_t * node , u8** tagblob , u
for(subnode=mxmlFindElement(node,node,"entries",NULL,NULL,MXML_DESCEND);subnode!=NULL;subnode=mxmlFindElement(subnode,node,"entries",NULL,NULL,MXML_DESCEND))
{
numberOfEntries += 1;
+ numberOfMaterials++;
char temp[256];
if(mxmlElementGetAttr(subnode, "name") != NULL)
strcpy(temp, mxmlElementGetAttr(subnode, "name"));