fix critical bugs !
This commit is contained in:
parent
1cb59a9828
commit
cabca91344
|
@ -1,3 +1,4 @@
|
|||
my_runner
|
||||
*.cfg
|
||||
build
|
||||
*.[ao]
|
||||
|
|
BIN
lib/libmycsfml.a
BIN
lib/libmycsfml.a
Binary file not shown.
BIN
lib/libmystdio.a
BIN
lib/libmystdio.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue