diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-30 15:52:16 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-30 15:52:16 +0100 |
| commit | 57867bbbdc24b734d85f8d3569c7ad27dcd9504d (patch) | |
| tree | 1727dd02444038341746894268ecea62b84aaea1 /src/parse/parse_check.c | |
| parent | 3a164bce55e173d5204c4aaa66dd4eb5bc1762f9 (diff) | |
| download | cub3d-57867bbbdc24b734d85f8d3569c7ad27dcd9504d.tar.gz cub3d-57867bbbdc24b734d85f8d3569c7ad27dcd9504d.tar.bz2 cub3d-57867bbbdc24b734d85f8d3569c7ad27dcd9504d.zip | |
files restructuration
Diffstat (limited to 'src/parse/parse_check.c')
| -rw-r--r-- | src/parse/parse_check.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/parse/parse_check.c b/src/parse/parse_check.c new file mode 100644 index 0000000..a65d74a --- /dev/null +++ b/src/parse/parse_check.c @@ -0,0 +1,46 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* check.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/01/11 10:59:15 by cacharle #+# #+# */ +/* Updated: 2020/01/11 13:03:33 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "cub3d.h" + +t_state *parse_check(t_state *state) +{ + int i; + /* int j; */ + /* int player_count; */ + + i = -1; + while (++i < state->map_width) + if (state->map[0][i] != CELL_WALL + || state->map[state->map_height - 1][i] != CELL_WALL) + return (error_put_return_state_destroy( + "validate map without borders", state)); + i = -1; + while (++i < state->map_height) + if (state->map[i][0] != CELL_WALL + || state->map[i][state->map_width - 1] != CELL_WALL) + return (error_put_return_state_destroy( + "validate map without borders", state)); + // maybe not necessary + /* player_count = 0; */ + /* i = -1; */ + /* while (++i < state->map_height) */ + /* { */ + /* j = -1; */ + /* while (++j < state->map_width) */ + /* if (helper_is_player_cell(state->map[i][j])) */ + /* player_count++; */ + /* } */ + /* if (player_count != 1) */ + /* return (state_destroy(state)); */ + return (state); +} |
