orton_runner/src/text/print_nbr.c

21 lines
385 B
C
Raw Normal View History

2019-01-20 11:55:38 +01:00
/*
** EPITECH PROJECT, 2018
** task01
** File description:
** I do task
*/
#include "game/ascii.h"
void my_print_nbr(sfml_t *sfml, int nb, uint32_t *option, int pos[2])
{
2019-07-10 12:46:35 +02:00
char buffer[2];
2019-01-20 11:55:38 +01:00
if (!nb)
return;
my_print_nbr(sfml, nb / 10, option, pos);
2019-07-10 12:46:35 +02:00
buffer[0] = '0' + nb % 10;
buffer[1] = '\0';
my_print(sfml, pos, buffer, option);
2019-01-20 11:55:38 +01:00
pos[0] += ASCII_DEFAULT_WIDTH << option[0];
}