refactor(src/klein.c): Fix values on klein format

This commit is contained in:
PedroEdiaz
2025-04-12 11:38:55 -06:00
parent 533109fbcd
commit d2d6794f08
3 changed files with 11 additions and 9 deletions

View File

@@ -7,7 +7,7 @@
5 bytes with KLEIN
1 byte empty for scaling
1 byte with the dimention of the surface
8 bytes interprated as a long with the number of vertex
8 bytes interprated as an int with the number of vertex
n bytes with the vertex data of the surface
n bytes with the normal data of the surface
@@ -35,10 +35,10 @@ int create_surface_klein(unsigned char *path, struct surface *surface)
size = surface->dim * surface->vertex;
surface->data = malloc(16 * size);
fread(surface->data, 16, size, file);
surface->data = malloc(4 * size);
fread(surface->data, 4, size, file);
surface->norm = malloc(16 * size);
fread(surface->norm, 16, size, file);
surface->norm = malloc(4 * size);
fread(surface->norm, 4, size, file);
return 0;
}