diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-12 19:11:40 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-12 19:11:40 +0200 |
| commit | 723c4602c6ec9b74e841501754e651ef359f6385 (patch) | |
| tree | d6dd27c251871fb61e3fc99fe7a0a96438096f1d /src/parse.c | |
| parent | 7b214503608550dc2853b9e01526723f8c65baf3 (diff) | |
| download | scop-723c4602c6ec9b74e841501754e651ef359f6385.tar.gz scop-723c4602c6ec9b74e841501754e651ef359f6385.tar.bz2 scop-723c4602c6ec9b74e841501754e651ef359f6385.zip | |
Added perspective matrix
Diffstat (limited to 'src/parse.c')
| -rw-r--r-- | src/parse.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/parse.c b/src/parse.c index 6290b1a..6f632d6 100644 --- a/src/parse.c +++ b/src/parse.c @@ -6,7 +6,7 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/05/09 11:02:00 by charles #+# #+# */ -/* Updated: 2020/05/11 15:55:44 by charles ### ########.fr */ +/* Updated: 2020/05/12 18:38:56 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,6 +14,15 @@ #define SCOP_VEC_DEFAULT_SIZE 64 +static void *st_iter_func_decrement_uint(void *void_uint) +{ + unsigned int uint; + + uint = *(unsigned int*)&void_uint; + uint--; + return (*(void**)&uint); +} + static int st_parse_face(char **indexes_strs, t_ftvec *indices) { size_t i; @@ -79,11 +88,14 @@ static int st_parse_file(int fd, t_ftvec *vertices, t_ftvec *indices) while ((ret = ft_getline(fd, &line)) == FT_LINE) { + printf("[%s]\n", line); ret = st_parse_line(line, vertices, indices); free(line); if (ret == -1) break ; } + printf(">>%d\n", ret); + printf("[%s]\n", line); if (ret == FT_ERROR) return (-1); if (*line != '\0') @@ -109,6 +121,7 @@ int parse(char *filepath, t_object *object) if ((indices = ft_vecnew(SCOP_VEC_DEFAULT_SIZE)) == NULL) return (-1); st_parse_file(fd, vertices, indices); + ft_veciter_ret(indices, st_iter_func_decrement_uint); object->vertices = (float*)ft_vectobuf32(vertices); object->indices = (unsigned int*)ft_vectobuf32(indices); object->vertices_len = vertices->size; |
