refactor(src/klein.c): Fix values on klein format
This commit is contained in:
10
src/klein.c
10
src/klein.c
@@ -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;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
error of the shaders.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#define DEBUG
|
||||
#define GLFW_INCLUDE_NONE
|
||||
|
||||
typedef const void *window_t;
|
||||
typedef unsigned int id_t;
|
||||
@@ -40,8 +42,8 @@ struct projection
|
||||
struct surface
|
||||
{
|
||||
float *data, *norm;
|
||||
unsigned long vertex;
|
||||
unsigned char dim;
|
||||
uint64_t vertex;
|
||||
uint8_t dim;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user