fix critical bugs !

This commit is contained in:
yann MAGNIN 2019-07-10 12:46:35 +02:00
parent 1cb59a9828
commit cabca91344
8 changed files with 8 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
my_runner
*.cfg
build
*.[ao]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -24,6 +24,8 @@ static void check_id(sfml_t *sfml, int x, int y, int i)
{
uint8_t id;
if (i >= sfml->scene->level->width * sfml->scene->level->height)
return;
id = sfml->scene->level->map[i];
if (id == ID_GROUND || id == ID_FAKE_GROUND)
draw_ground(sfml, x, y,

View File

@ -53,7 +53,7 @@ uint32_t color_alpha, uint8_t action)
{
uint32_t *option;
option = (uint32_t*)malloc(4);
option = (uint32_t*)malloc(4 * sizeof(uint32_t));
option[0] = (uint32_t)size;
option[1] = color_char;
option[2] = color_alpha;

View File

@ -8,12 +8,13 @@
void my_print_nbr(sfml_t *sfml, int nb, uint32_t *option, int pos[2])
{
uint8_t buffer;
char buffer[2];
if (!nb)
return;
my_print_nbr(sfml, nb / 10, option, pos);
buffer = '0' + nb % 10;
my_print(sfml, pos, (const char*)&buffer, option);
buffer[0] = '0' + nb % 10;
buffer[1] = '\0';
my_print(sfml, pos, buffer, option);
pos[0] += ASCII_DEFAULT_WIDTH << option[0];
}