Removed magic numbers for card score length and intmax buffer sizes

This commit is contained in:
MeirGavish
2025-08-08 01:59:21 +03:00
parent 2ce3acbe1c
commit fd8e52d48a
5 changed files with 19 additions and 9 deletions
+2
View File
@@ -6,6 +6,8 @@
#define MAX_JOKERS_HELD_SIZE 5 // This doesn't account for negatives right now.
#define MAX_SHOP_JOKERS 2 // TODO: Make this dynamic and allow for other items besides jokers
#define MAX_SELECTION_SIZE 5
#define MAX_CARD_SCORE_DIGITS 2 // Current digit limit for score received from cards including mult etc. from jokers
#define MAX_CARD_SCORE_STR_LEN (MAX_CARD_SCORE_DIGITS + 1) // For the '+' or 'X'
#define FRAMES(x) (((x) + game_speed - 1) / game_speed)
// TODO: Turn into enum?
+3
View File
@@ -43,6 +43,9 @@
// Tile size in pixels, both height and width as tiles are square
#define TILE_SIZE 8
// By default TTE characters occupy a single tile
#define TTE_CHAR_SIZE TILE_SIZE
typedef struct
{
int left;
+2
View File
@@ -37,6 +37,8 @@ static inline int get_digits_even(int n)
#define NUM_ELEM_IN_ARR(arr) (sizeof(arr) / sizeof((arr)[0]))
#define INT_MAX_DIGITS 10 // strlen(str(INT_MAX)) = strlen("2147483647")
int int_arr_max(int int_arr[], int size);
#endif // UTIL_H