skip color hexa when parsing for real this time

This commit is contained in:
hugogogo
2021-07-25 13:59:18 +02:00
parent 9cfb43e7da
commit a429813165
6 changed files with 17 additions and 5 deletions

Binary file not shown.

Binary file not shown.

BIN
fdf

Binary file not shown.

View File

@@ -51,6 +51,7 @@ void draw_color_pixel(t_fdf *fdf, int new_x, int new_y, int z);
int keypress(int keycode, t_fdf *fdf);
void keypress_more(int keycode, t_fdf *fdf);
void position_state(t_fdf *fdf);
int is_color(char *color);
int **parse_map(t_fdf *fdf, int fd);
int *new_coordinates(t_fdf *fdf, int i, int j);
void draw_lines(t_fdf *fdf, int *start, int *end);

View File

@@ -2,7 +2,9 @@
/*
** U -> up wiew
** I -> isometric view
** I -> isometric original view
** O -> increase altitude
** P -> decrease altitude
** F -> fit to window
** C -> center
*/
@@ -17,8 +19,18 @@ void keypress_more(int keycode, t_fdf *fdf)
}
else if (keycode == I)
{
fdf->rot_x = -30;
fdf->rot_y = -60;
fdf->rot_x = -45;
fdf->rot_y = -35;
fdf->mov_x = (fdf->win_size_x - fdf->map_size_x) / 2;
fdf->mov_y = (fdf->win_size_y - fdf->map_size_y) / 2;
fdf->zoom = 0;
}
else if (keycode == O)
fdf->altitude++;
else if (keycode == P)
{
if (fdf->altitude > 1)
fdf->altitude--;
}
}

View File

@@ -21,8 +21,6 @@ int **split_to_map(t_fdf *fdf, char *raw)
while (++i < fdf->map_height)
{
map[i] = ft_calloc(fdf->map_width, sizeof(*map));
if (!map[i])
shut_down(fdf);
j = -1;
while (++j < fdf->map_width)
{
@@ -31,6 +29,7 @@ int **split_to_map(t_fdf *fdf, char *raw)
map[i][j] = ft_atoi(raw);
while (ft_isdigit(*raw) || *raw == '-')
raw++;
raw += is_color(raw);
z_amplitude(fdf, map[i][j]);
}
}