Skip to content

Commit

Permalink
fix mini_map WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsunghao-C committed Sep 3, 2024
1 parent c973e06 commit 6a88d2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions minilibx-linux
Submodule minilibx-linux added at 7dc53a
9 changes: 5 additions & 4 deletions srcs/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: tsuchen <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/15 12:13:17 by tsuchen #+# #+# */
/* Updated: 2024/09/03 18:29:30 by tsuchen ### ########.fr */
/* Updated: 2024/09/03 19:05:33 by tsuchen ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -26,10 +26,11 @@ void put_mini_map(t_data *data)
while (x < MINI_MAP_W)
{
map_y = y * (data->map_bound) / MINI_MAP_H;
map_x = x * (ft_strlen(data->map[map_y]) - 1) / MINI_MAP_W;
if (data->map[map_y][map_x] == '1')
map_x = x * (data->map_width - 1) / MINI_MAP_W;
// map_x = x * (ft_strlen(data->map[map_y]) - 1) / MINI_MAP_W;
if ((map_x < ft_strlen(data->map[map_y]) - 1) && data->map[map_y][map_x] == '1')
rc_mlx_pixel_put(&data->mini_map, x, y, 0x212529);
else if (data->map[map_y][map_x] == 'D')
else if ((map_x < ft_strlen(data->map[map_y]) - 1) && data->map[map_y][map_x] == 'D')
rc_mlx_pixel_put(&data->mini_map, x, y, 0xFFC300);
else
rc_mlx_pixel_put(&data->mini_map, x, y, 0xE9ECEF);
Expand Down

0 comments on commit 6a88d2f

Please sign in to comment.