From 882d483e45a1b293891da7b2285192967b5a4be8 Mon Sep 17 00:00:00 2001 From: gered Date: Mon, 1 Oct 2012 18:53:46 -0400 Subject: [PATCH] fix bug causing repeated vertex 0 data to be written out for all frames could have been avoided if I had actually properly tested converted models! --- src/chunks/chunks.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chunks/chunks.cpp b/src/chunks/chunks.cpp index 309e1bf..2d7e181 100644 --- a/src/chunks/chunks.cpp +++ b/src/chunks/chunks.cpp @@ -43,16 +43,16 @@ void WriteChunk(KeyFramesChunk *chunk, FILE *fp) for (uint32_t j = 0; j < chunk->numVertices; ++j) { - fwrite(&f->vertices->x, sizeof(float), 1, fp); - fwrite(&f->vertices->y, sizeof(float), 1, fp); - fwrite(&f->vertices->z, sizeof(float), 1, fp); + fwrite(&f->vertices[j].x, sizeof(float), 1, fp); + fwrite(&f->vertices[j].y, sizeof(float), 1, fp); + fwrite(&f->vertices[j].z, sizeof(float), 1, fp); } for (uint32_t j = 0; j < chunk->numVertices; ++j) { - fwrite(&f->normals->x, sizeof(float), 1, fp); - fwrite(&f->normals->y, sizeof(float), 1, fp); - fwrite(&f->normals->z, sizeof(float), 1, fp); + fwrite(&f->normals[j].x, sizeof(float), 1, fp); + fwrite(&f->normals[j].y, sizeof(float), 1, fp); + fwrite(&f->normals[j].z, sizeof(float), 1, fp); } } }