Improve reactivity of the cursor on mutation selection menu

This commit is contained in:
Shadow15510 2021-06-06 17:15:05 +02:00
parent 1b76e69808
commit 64bc16a99d
4 changed files with 8 additions and 7 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@
// Duration for internal clock (ms)
#define ENGINE_TICK 50
#define CURSOR_TICK 150
#define CURSOR_TICK 75
#define DNA_ANIMATION_TICK 150
// Duration for DNA points and infectious model (ms)
@ -82,7 +82,7 @@ struct cursor
// Cursor's coordinates
int x, y;
// If the cursor should be displayed
// If the cursor should be displayed (0: display ; 1: hide)
int display;
};

View File

@ -73,7 +73,7 @@ void display_foreground(const int background, const struct game *current_game, c
// Display if boost is activated
if (current_game->boost) dprint(0, 0, C_BLACK, "+");
break;
case 3:
@ -124,7 +124,9 @@ void display_mutation(const int table[4][8], const struct cursor c, const int mu
if (table[i][j]) dsubimage(j*16, i*16, &img_mutations, 16 * (mutation_menu - 1), 16 * (table[i][j] - 1), 15, 15, DIMAGE_NONE);
}
}
dsubimage((16 * c.x) - 1, (16 * c.y) - 1, &img_cursor, 0, 17 * (c.display), 17, 17, DIMAGE_NONE);
int to_display = 0;
if (c.display > 1) to_display = 1;
dsubimage((16 * c.x) - 1, (16 * c.y) - 1, &img_cursor, 0, 17 * (to_display), 17, 17, DIMAGE_NONE);
dupdate();
}

View File

@ -62,9 +62,8 @@ void mutation_select(struct game *current_game, const int mutation_menu)
{
// Cursor blinking gestion
while (!tick) sleep();
tick = 1;
//c.display = (c.display + 1) % 2;
c.display = 0;
tick = 0;
c.display = (c.display + 1) % 4;
// Get and display the mutation menu
int table[4][8];