mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
improved set_textures function
This commit is contained in:
parent
1d16d66d89
commit
d336d7bc15
1 changed files with 6 additions and 2 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
|
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/06/06 17:54:42 by tchampio #+# #+# */
|
/* Created: 2025/06/06 17:54:42 by tchampio #+# #+# */
|
||||||
/* Updated: 2025/06/06 17:55:56 by tchampio ### ########.fr */
|
/* Updated: 2025/06/08 20:28:57 by tchampio ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -64,12 +64,16 @@ bool set_textures(char *line, t_mapdata *map)
|
||||||
bool add_textures(int fd, t_mapdata *map)
|
bool add_textures(int fd, t_mapdata *map)
|
||||||
{
|
{
|
||||||
char *line;
|
char *line;
|
||||||
|
int set_lines;
|
||||||
|
|
||||||
line = get_next_line(fd);
|
line = get_next_line(fd);
|
||||||
while (line)
|
set_lines = 0;
|
||||||
|
while (line && set_lines < 4)
|
||||||
{
|
{
|
||||||
if (!set_textures(line, map))
|
if (!set_textures(line, map))
|
||||||
return (free(line), false);
|
return (free(line), false);
|
||||||
|
else
|
||||||
|
set_lines++;
|
||||||
free(line);
|
free(line);
|
||||||
line = get_next_line(fd);
|
line = get_next_line(fd);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue