skip color hexa when parsing for real this time
This commit is contained in:
Binary file not shown.
BIN
builds/parse.o
BIN
builds/parse.o
Binary file not shown.
@@ -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);
|
int keypress(int keycode, t_fdf *fdf);
|
||||||
void keypress_more(int keycode, t_fdf *fdf);
|
void keypress_more(int keycode, t_fdf *fdf);
|
||||||
void position_state(t_fdf *fdf);
|
void position_state(t_fdf *fdf);
|
||||||
|
int is_color(char *color);
|
||||||
int **parse_map(t_fdf *fdf, int fd);
|
int **parse_map(t_fdf *fdf, int fd);
|
||||||
int *new_coordinates(t_fdf *fdf, int i, int j);
|
int *new_coordinates(t_fdf *fdf, int i, int j);
|
||||||
void draw_lines(t_fdf *fdf, int *start, int *end);
|
void draw_lines(t_fdf *fdf, int *start, int *end);
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
** U -> up wiew
|
** U -> up wiew
|
||||||
** I -> isometric view
|
** I -> isometric original view
|
||||||
|
** O -> increase altitude
|
||||||
|
** P -> decrease altitude
|
||||||
** F -> fit to window
|
** F -> fit to window
|
||||||
** C -> center
|
** C -> center
|
||||||
*/
|
*/
|
||||||
@@ -17,8 +19,18 @@ void keypress_more(int keycode, t_fdf *fdf)
|
|||||||
}
|
}
|
||||||
else if (keycode == I)
|
else if (keycode == I)
|
||||||
{
|
{
|
||||||
fdf->rot_x = -30;
|
fdf->rot_x = -45;
|
||||||
fdf->rot_y = -60;
|
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--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ int **split_to_map(t_fdf *fdf, char *raw)
|
|||||||
while (++i < fdf->map_height)
|
while (++i < fdf->map_height)
|
||||||
{
|
{
|
||||||
map[i] = ft_calloc(fdf->map_width, sizeof(*map));
|
map[i] = ft_calloc(fdf->map_width, sizeof(*map));
|
||||||
if (!map[i])
|
|
||||||
shut_down(fdf);
|
|
||||||
j = -1;
|
j = -1;
|
||||||
while (++j < fdf->map_width)
|
while (++j < fdf->map_width)
|
||||||
{
|
{
|
||||||
@@ -31,6 +29,7 @@ int **split_to_map(t_fdf *fdf, char *raw)
|
|||||||
map[i][j] = ft_atoi(raw);
|
map[i][j] = ft_atoi(raw);
|
||||||
while (ft_isdigit(*raw) || *raw == '-')
|
while (ft_isdigit(*raw) || *raw == '-')
|
||||||
raw++;
|
raw++;
|
||||||
|
raw += is_color(raw);
|
||||||
z_amplitude(fdf, map[i][j]);
|
z_amplitude(fdf, map[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user