From 27e8cb7ba5f334b63aee7a1d5b52aaef58906917 Mon Sep 17 00:00:00 2001 From: megazig Date: Fri, 15 May 2009 10:35:54 -0500 Subject: added findings from tests --- brlyt.c | 94 +++++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 40 deletions(-) (limited to 'brlyt.c') diff --git a/brlyt.c b/brlyt.c index b6343b6..5c1eb48 100644 --- a/brlyt.c +++ b/brlyt.c @@ -209,7 +209,7 @@ void PrintBRLYTEntry_lyt1(brlyt_entry entry, u8* brlyt_file, mxml_node_t *tag) BRLYT_fileoffset = entry.data_location; BRLYT_ReadDataFromMemory(&data, brlyt_file, sizeof(brlyt_lytheader_chunk)); mxmlElementSetAttrf(tag, "type", "%c%c%c%c", entry.magic[0], entry.magic[1], entry.magic[2], entry.magic[3]); - a = mxmlNewElement(tag, "a"); mxmlNewTextf(a, 0, "%08x", data.a); + a = mxmlNewElement(tag, "a"); mxmlNewTextf(a, 0, "%02x", data.a); size = mxmlNewElement(tag, "size"); width = mxmlNewElement(size, "width"); mxmlNewTextf(width, 0, "%f", float_swap_bytes(data.width)); height = mxmlNewElement(size, "height"); mxmlNewTextf(height, 0,"%f", float_swap_bytes(data.height)); @@ -486,8 +486,8 @@ void PrintBRLYTEntry_pic1(brlyt_entry entry, u8* brlyt_file, mxml_node_t *tag) size = mxmlNewElement(tag, "size"); width = mxmlNewElement(size, "width"); mxmlNewTextf(width, 0, "%f", float_swap_bytes(data.width)); height = mxmlNewElement(size, "height"); mxmlNewTextf(height, 0, "%f", float_swap_bytes(data.height)); - mxml_node_t *tpl, *color, *vtx, *coordinates, *set, *coord; - tpl = mxmlNewElement(tag, "tpl"); mxmlElementSetAttrf(tpl, "name", "%s", getMaterial(short_swap_bytes(data2.mat_off))); + mxml_node_t *material, *color, *vtx, *coordinates, *set, *coord; + material = mxmlNewElement(tag, "material"); mxmlElementSetAttrf(material, "name", "%s", getMaterial(short_swap_bytes(data2.mat_off))); color = mxmlNewElement(tag, "colors"); int n; for (n=0;n<4;n++) { @@ -555,7 +555,7 @@ void PrintBRLYTEntry_txt1(brlyt_entry entry, u8* brlyt_file, mxml_node_t *tag) void PrintBRLYTEntry_mat1(brlyt_entry entry, u8* brlyt_file, mxml_node_t *tag) { - mxml_node_t *entries, *colors, *black_color, *white_color, *unk2, *tev_k, *flags; + mxml_node_t *entries, *colors, *forecolor, *backcolor, *unk2, *tev_k, *flags; brlyt_numoffs_chunk data; BRLYT_fileoffset = entry.data_location; BRLYT_ReadDataFromMemory(&data, brlyt_file, sizeof(brlyt_numoffs_chunk)); @@ -575,13 +575,13 @@ void PrintBRLYTEntry_mat1(brlyt_entry entry, u8* brlyt_file, mxml_node_t *tag) colors = mxmlNewElement(entries, "colors"); int i; for (i=0;i<4;i++) { - black_color = mxmlNewElement(colors, "black_color"); - mxmlNewTextf(black_color, 0, "%d", short_swap_bytes(data3.black_color[i])); + forecolor = mxmlNewElement(colors, "forecolor"); + mxmlNewTextf(forecolor, 0, "%d", short_swap_bytes(data3.forecolor[i])); } for (i=0;i<4;i++) { - white_color = mxmlNewElement(colors, "white_color"); - mxmlNewTextf(white_color, 0, "%d", short_swap_bytes(data3.white_color[i])); + backcolor = mxmlNewElement(colors, "backcolor"); + mxmlNewTextf(backcolor, 0, "%d", short_swap_bytes(data3.backcolor[i])); } for (i=0;i<4;i++) { @@ -602,30 +602,31 @@ void PrintBRLYTEntry_mat1(brlyt_entry entry, u8* brlyt_file, mxml_node_t *tag) memcpy(materials+lengthOfMaterials, data3.name, 1+strlen(data3.name)); lengthOfMaterials = newSize; - mxml_node_t *material, *wrap_t, *wrap_s; + mxml_node_t *texture, *wrap_t, *wrap_s; int n = 0; for (n;n