aboutsummaryrefslogtreecommitdiff
path: root/brlyt.c
diff options
context:
space:
mode:
Diffstat (limited to 'brlyt.c')
-rw-r--r--brlyt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/brlyt.c b/brlyt.c
index fb7d52a..627dba4 100644
--- a/brlyt.c
+++ b/brlyt.c
@@ -141,9 +141,11 @@ char* getMaterial(int offset)
if (offset > 1)
{
- int n;
- for (n=0; n<offset-1;n++)
+ int n = 1;
+ for (n; n<offset;n++)
+ {
foo = foo + strlen(foo) + 1;
+ }
}
return foo;
@@ -485,7 +487,8 @@ void PrintBRLYTEntry_mat1(brlyt_entry entry, u8* brlyt_file)
printf(" texoffs: %08x\n", be16(data4.tex_offs));
printf(" wrap_s: %08x\n", data4.wrap_s);
printf(" wrap_t: %08x\n", data4.wrap_t);
- printf(" name: %s\n", getMaterial(be32(data4.tex_offs)));
+ int tplOffset = be16(data4.tex_offs);
+ printf(" name: %s\n", getMaterial(tplOffset));
}
// # 0x14 * flags[24-27], followed by