Fix hot-reload

This commit is contained in:
Edward R. Gonzalez 2024-06-24 23:38:53 -04:00
parent 08932c8c99
commit 894c3fee97
3 changed files with 9 additions and 3 deletions

View File

@ -374,7 +374,8 @@ hot_reload :: proc( ctx : ^Context, allocator : Allocator )
entries.backing = allocator
temp_path.backing = allocator
hmap_zpl_reload( & temp_codepoint_seen, allocator )
hmap_zpl_reload( & ctx.temp_codepoint_seen, allocator )
draw_list.vertices.backing = allocator
draw_list.indices.backing = allocator
draw_list.calls.backing = allocator
@ -400,6 +401,9 @@ hot_reload :: proc( ctx : ^Context, allocator : Allocator )
atlas.clear_draw_list.calls.backing = allocator
atlas.clear_draw_list.indices.backing = allocator
atlas.clear_draw_list.vertices.backing = allocator
shape_cache.storage.backing = allocator
LRU_reload( & shape_cache.state, allocator )
}
// ve_foncache_shutdown
@ -736,6 +740,8 @@ measure_text_size :: proc( ctx : ^Context, font : FontID, text_utf8 : string ) -
assert( ctx != nil )
assert( font >= 0 && font < FontID(ctx.entries.num) )
context.allocator = ctx.backing
atlas := ctx.atlas
shaped := shape_text_cached( ctx, font, text_utf8 )

View File

@ -152,7 +152,7 @@ hmap_chained_get :: proc( using self : HMapChained($Type), key : u64) -> ^Type
hmap_chained_reload :: proc( self : HMapChained($Type), allocator : Allocator )
{
// pool_reload(self.pool, allocator)
pool_reload(self.pool, allocator)
}
// Returns true if an slot was actually found and marked as vacant

View File

@ -262,7 +262,7 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem
font_rec_mono_semicasual_reg = font_load( path_rec_mono_semicasual_reg, 16.0, "RecMonoSemiCasual_Regular" )
path_squidgy_slimes := strings.concatenate( { Path_Assets, "Squidgy Slimes.ttf" } )
font_squidgy_slimes = font_load( path_squidgy_slimes, 16.0, "Squidgy_Slime" )
font_squidgy_slimes = font_load( path_squidgy_slimes, 32.0, "Squidgy_Slime" )
path_firacode := strings.concatenate( { Path_Assets, "FiraCode-Regular.ttf" } )
font_firacode = font_load( path_firacode, 16.0, "FiraCode" )