2 * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
8 #define VG_TIMESTEP_FIXED (1.0/60.0)
11 //#define VG_STATIC static
13 #define VG_FRAMEBUFFER_RESIZE 1
15 #include "submodules/anyascii/impl/c/anyascii.c"
17 #define RESET_MAX_TIME 45.0
19 enum menu_controller_type
21 k_menu_controller_type_keyboard
,
22 k_menu_controller_type_xbox
,
23 k_menu_controller_type_playstation
,
24 k_menu_controller_type_steam
,
25 k_menu_controller_type_steam_deck
28 VG_STATIC
enum menu_controller_type menu_display_controller
;
30 typedef struct ray_hit ray_hit
;
38 VG_STATIC
int network_scores_updated
= 0;
40 VG_STATIC u32
utf8_byte0_byte_count( u8 char0
)
42 for( u32 k
=2; k
<4; k
++ )
44 if( !(char0
& (0x80 >> k
)) )
51 VG_STATIC
void str_utf8_collapse( const char *str
, char *buf
, u32 length
)
54 u32 utf32_code
= 0x00000000;
55 u32 i
=0, j
=0, utf32_byte_ct
=0;
67 utf32_code
|= (ustr
[i
] & 0x3F) << (utf32_byte_ct
*6);
72 size_t chars
= anyascii( utf32_code
, &match
);
74 for( u32 k
=0; k
<VG_MIN(chars
, length
-1-j
); k
++ )
76 buf
[ j
++ ] = (u8
)match
[k
];
82 utf32_byte_ct
= utf8_byte0_byte_count( ustr
[i
] )-1;
83 utf32_code
= ustr
[i
] & (0x3F >> utf32_byte_ct
);
84 utf32_code
<<= utf32_byte_ct
*6;