mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
style: use constants for window width and height
This commit is contained in:
parent
6aecc3ba6e
commit
7449450c52
1 changed files with 4 additions and 4 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
|
||||
/* Updated: 2025/07/21 11:50:30 by kcolin ### ########.fr */
|
||||
/* Updated: 2025/07/22 12:50:14 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ int game_loop(t_cub3d_data *data)
|
|||
data->player.x += data->player.movement.x;
|
||||
data->player.y += data->player.movement.y;
|
||||
mlx_destroy_image(data->mlx, data->img_data->img);
|
||||
data->img_data->img = mlx_new_image(data->mlx, 800, 600);
|
||||
data->img_data->img = mlx_new_image(data->mlx, WIDTH, HEIGHT);
|
||||
draw_map(data->map, &data->player, data->img_data);
|
||||
mlx_put_image_to_window(data->mlx, data->mlx_win,
|
||||
data->img_data->img, 0, 0);
|
||||
|
|
@ -57,9 +57,9 @@ int main(int argc, char **argv)
|
|||
if (data.mlx == NULL)
|
||||
return (ft_printf("Error: Failed to initalize mlx\n"),
|
||||
free_map(data.map), 1);
|
||||
data.mlx_win = mlx_new_window(data.mlx, 800, 600, "Cub3d");
|
||||
data.mlx_win = mlx_new_window(data.mlx, WIDTH, HEIGHT, "Cub3d");
|
||||
data.img_data = ft_calloc(sizeof(t_img_data), 1);
|
||||
data.img_data->img = mlx_new_image(data.mlx, 800, 600);
|
||||
data.img_data->img = mlx_new_image(data.mlx, WIDTH, HEIGHT);
|
||||
data.img_data->addr = mlx_get_data_addr(data.img_data->img,
|
||||
&data.img_data->bits_per_pixel, &data.img_data->line_length,
|
||||
&data.img_data->endian);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue