2023-10-26 17:40:01 +02:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* :::::::: */
|
|
|
|
/* map.c :+: :+: */
|
|
|
|
/* +:+ */
|
|
|
|
/* By: houtworm <codam@houtworm.net> +#+ */
|
|
|
|
/* +#+ */
|
|
|
|
/* Created: 2023/10/26 17:33:50 by houtworm #+# #+# */
|
2023-10-27 20:07:11 +02:00
|
|
|
/* Updated: 2023/10/27 16:25:33 by djonker ######## odam.nl */
|
2023-10-26 17:40:01 +02:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#include "../cub3d.h"
|
|
|
|
|
|
|
|
char **ft_getmap(void)
|
|
|
|
{
|
|
|
|
int y;
|
|
|
|
int x;
|
|
|
|
char **map;
|
|
|
|
char localmap[24][24] = {
|
|
|
|
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
|
|
|
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,0,1,0,1,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,1,0,1,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
|
|
|
|
{1,0,0,0,0,0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