42_cub3d/src/utils_timedloop_nobonus.c
mcolonna 424b9aa7b2 fixings and improvements
dev:
- add documentation
- main() is more readable

fix:
- unmanaged errors:
  - map parsing: error if color value is >255
  - map parsing: load_textures(): check return value of xml_xpm_file_to_image()
  - main.c: draw_screen(): check return value of mlx_new_image()

other details:
- dev: color_from_rgb(): change signature
- fix: nullize map in map_destroy
- change: change error message for read_all_text() errors
- change: change rotation speed
- change: add and use contant NOOBONUS_SPEED
2024-11-21 15:25:36 +01:00

24 lines
1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils_timedloop_nobonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/19 15:05:10 by mcolonna #+# #+# */
/* Updated: 2024/11/19 15:36:17 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#include "utils.h"
#include "const.h"
void timedloop(void (*f)(void))
{
static int ticks;
if (ticks % NOBONUS_SPEED == 0)
f();
ticks++;
}