#include "cube3d.h" int is_wall(t_game *game, int cell_x, int cell_y) { if (cell_x < 0 || cell_y < 0) return (1); if (cell_x > game->map_size_x || cell_y > game->map_size_y) return (1); if (game->map[cell_y][cell_x] != '0') return (1); return (0); } int plr_out_limits(t_game *game, int x, int y) { int xmax; int ymax; int cell_x; int cell_y; xmax = game->sizel / (game->bpp / 8); ymax = game->win_size_y; cell_x = x / game->cell; cell_y = y / game->cell; if (is_wall(game, cell_x, cell_y)) return (1); if (x < 0 || y < 0 || x > xmax || y > ymax) return (1); return (0); }