GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
font.c
1#include "font.h"
2
3#include "util.h"
4
5#include <stdlib.h>
6
7static const char* FONT_POINT_LOOKUP[] = {
8 FP0_STR,
9 FP1_STR,
10 FP2_STR,
11 FP3_STR,
12 FP4_STR,
13 FP5_STR,
14 FP6_STR,
15 FP7_STR,
16 FP8_STR,
17 FP9_STR,
18};
19
20const char* get_font_point_str(int val)
21{
22 val = abs(val) % 10;
23 return FONT_POINT_LOOKUP[val];
24}
25
26char digit_char_to_font_point(char digit_char)
27{
28 return get_font_point_str(digit_char - '0')[0];
29}
Utility file to interact with custom font.
const char * get_font_point_str(int val)
Get the decimal point string equivalent of 0-9 from integer param.
Definition font.c:20
char digit_char_to_font_point(char digit_char)
Get the decimal point char equivalent of 0-9 from char param.
Definition font.c:26
Utilities relating around number string representation and protected arithmatic helper functions.