More bug fixing, All latin characters don't look corrupt anymore

HMapChained causes memory corruption in VEFontCache (not sure why yet), so I switched temporarily over to HMapZPL.

Fixed bug with parser_get_glyph_shape from me tracking vertices as u16s instead of i16s.

Currently a bug with the frametime example:
text_test_str := str_fmt("frametime: %0.2f", frametime_avg_ms)

It doesn't handle per-frame updates properly compared to C++ source
This commit is contained in:
2024-06-15 14:53:26 -04:00
parent 13f24b4ae9
commit 65be3eae03
14 changed files with 107 additions and 64 deletions

View File

@ -237,7 +237,9 @@ State :: struct {
// fonts : FontData,
font_provider_data : FontProviderData,
font_arial_unicode_ms : FontID,
font_firacode : FontID,
font_noto_sans : FontID,
font_open_sans : FontID,
font_squidgy_slimes : FontID,
font_rec_mono_semicasual_reg : FontID,

View File

@ -284,9 +284,16 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem
// path_firacode := strings.concatenate( { Path_Assets, "FiraCode-Regular.ttf" } )
// font_firacode = font_load( path_firacode, 24.0, "FiraCode" )
path_open_sans := strings.concatenate( { Path_Assets, "OpenSans-Regular.ttf" } )
font_open_sans = font_load( path_open_sans, 24.0, "OpenSans" )
default_font = font_open_sans
// path_open_sans := strings.concatenate( { Path_Assets, "OpenSans-Regular.ttf" } )
// font_open_sans = font_load( path_open_sans, 24.0, "OpenSans" )
path_noto_sans := strings.concatenate( { Path_Assets, "NotoSans-Regular.ttf" } )
font_noto_sans = font_load( path_noto_sans, 24.0, "NotoSans" )
path_arial_unicode_ms := strings.concatenate( { Path_Assets, "Arial Unicode MS.ttf" } )
font_arial_unicode_ms = font_load( path_arial_unicode_ms, 24.0, "Arial_Unicode_MS" )
default_font = font_arial_unicode_ms
log( "Default font loaded" )
}

View File

@ -79,9 +79,10 @@ render :: proc()
// "Draw text" using immediate mode api
{
// text_test_str := str_fmt("frametime: %v", frametime_avg_ms)
// text_test_str := str_fmt("HELLO VE FONT CACHE!!!!!")
text_test_str := str_fmt("C")
text_test_str := str_fmt("frametime: %0.2f", frametime_avg_ms)
// log(text_test_str)
// text_test_str := str_fmt("HELLO VE FONT CACHE!")
// text_test_str := str_fmt("C")
// font_provider := & state.font_provider_data
fdef := hmap_chained_get( font_cache, default_font.key )