diff options
| author | Dominik Kaiser | 2024-05-15 17:02:29 +0200 |
|---|---|---|
| committer | GitHub | 2024-05-15 17:02:29 +0200 |
| commit | cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7 (patch) | |
| tree | 150075893065fd1e41c8b3a8272e0faee421848e /src/draw.c | |
| parent | e6edad24c9fa56538d66067dcff6bde39f746239 (diff) | |
| parent | 33a54536567a8b93cd0320814eba4ff515d5277b (diff) | |
| download | so_long-cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7.tar.gz so_long-cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7.zip | |
Merge refactoring into master
Refactoring
Diffstat (limited to 'src/draw.c')
| -rw-r--r-- | src/draw.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -6,7 +6,7 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/09 17:58:23 by dkaiser #+# #+# */ -/* Updated: 2024/05/11 16:00:17 by dkaiser ### ########.fr */ +/* Updated: 2024/05/15 16:41:15 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,12 +14,12 @@ #include "libft.h" #include "so_long.h" -int draw_map(t_game *game) +int draw_walls(t_game *game) { - int x; - int y; - mlx_texture_t *wall_texture; - mlx_image_t *wall_image; + int x; + int y; + mlx_texture_t *wall_texture; + mlx_image_t *wall_image; wall_texture = mlx_load_png("textures/wall.png"); wall_image = mlx_texture_to_image(game->mlx, wall_texture); @@ -33,7 +33,8 @@ int draw_map(t_game *game) while (y < game->map.grid_size.y) { if (game->map.tiles[y * game->map.grid_size.x + x] == WALL) - mlx_image_to_window(game->mlx, wall_image, x * game->map.tile_size.x, y * game->map.tile_size.y); + mlx_image_to_window(game->mlx, wall_image, x + * game->map.tile_size.x, y * game->map.tile_size.y); y++; } x++; |
