diff options
| author | megazig <megazig@hotmail.com> | 2009-11-05 16:58:00 -0600 |
|---|---|---|
| committer | megazig <megazig@hotmail.com> | 2009-11-05 16:58:00 -0600 |
| commit | 3975041cf1c4b46c7284e94e6c9cabb48db51ffb (patch) | |
| tree | d2e66fba1387933fdcfe98fddee081f9df97c370 | |
| parent | 56c06a7eba37d9634d89964d45bb7bd55eb901b2 (diff) | |
Fixed bug of always dying on first material or texture when writing brlyt.
| -rw-r--r-- | brlyt.c | 4 | ||||
| -rw-r--r-- | general.h | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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")); @@ -12,7 +12,7 @@ #define BENZIN_VERSION_MAJOR 1 #define BENZIN_VERSION_MINOR 9 -#define BENZIN_VERSION_BUILD 8 +#define BENZIN_VERSION_BUILD 9 #define BENZIN_VERSION_OTHER "BETA" #define INFORMATION_TEXT \ |
