mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
dev: improved how sprites are detected in maps
This commit is contained in:
parent
ef7a6c27a4
commit
5c7cc77419
1 changed files with 2 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/07/31 13:43:05 by kcolin #+# #+# */
|
/* Created: 2025/07/31 13:43:05 by kcolin #+# #+# */
|
||||||
/* Updated: 2025/08/14 21:47:17 by tchampio ### ########.fr */
|
/* Updated: 2025/08/18 13:06:13 by tchampio ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -65,8 +65,7 @@ void place_base_sprites(t_cub3d_data *data, char **map)
|
||||||
x = 0;
|
x = 0;
|
||||||
while (x < (int)ft_strlen(map[y]))
|
while (x < (int)ft_strlen(map[y]))
|
||||||
{
|
{
|
||||||
if (map[y][x] == 'M' || map[y][x] == 'Q'
|
if (ft_strchr("MQJD", map[y][x]))
|
||||||
|| map[y][x] == 'J' || map[y][x] == 'D')
|
|
||||||
{
|
{
|
||||||
if (data->sprite_counter < MAX_SPRITES)
|
if (data->sprite_counter < MAX_SPRITES)
|
||||||
data->sprite_list[data->sprite_counter++]
|
data->sprite_list[data->sprite_counter++]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue