fa6df751c03eea9c5cdec0cdb9d0943dffd6d83b
2 * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
8 #define VG_TIMESTEP_FIXED (1.0/60.0)
10 #define VG_FRAMEBUFFER_RESIZE 1
12 #include "anyascii/anyascii.h"
14 #define RESET_MAX_TIME 45.0
16 typedef struct ray_hit ray_hit
;
24 VG_STATIC
int network_scores_updated
= 0;
26 VG_STATIC u32
utf8_byte0_byte_count( u8 char0
)
28 for( u32 k
=2; k
<4; k
++ )
30 if( !(char0
& (0x80 >> k
)) )
37 VG_STATIC
void str_utf8_collapse( const char *str
, char *buf
, u32 length
)
40 u32 utf32_code
= 0x00000000;
41 u32 i
=0, j
=0, utf32_byte_ct
=0;
53 utf32_code
|= (ustr
[i
] & 0x3F) << (utf32_byte_ct
*6);
58 size_t chars
= anyascii( utf32_code
, &match
);
60 for( u32 k
=0; k
<VG_MIN(chars
, length
-1-j
); k
++ )
62 buf
[ j
++ ] = (u8
)match
[k
];
68 utf32_byte_ct
= utf8_byte0_byte_count( ustr
[i
] )-1;
69 utf32_code
= ustr
[i
] & (0x3F >> utf32_byte_ct
);
70 utf32_code
<<= utf32_byte_ct
*6;