From 282c071163a009003c12cf202e07ca876dd18ad1 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 30 Jan 2024 01:54:37 -0500 Subject: [PATCH] Finished off some loose ends for hot-reload --- code/api.odin | 6 ++---- code/memory.odin | 4 ++-- ols.json | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/code/api.odin b/code/api.odin index 7b0414d..d077836 100644 --- a/code/api.odin +++ b/code/api.odin @@ -65,8 +65,8 @@ startup :: proc( live_mem, snapshot_mem : ^ virtual.Arena ) transient = tracked_allocator_init_vmem( transient_slice, internals_size ) temp = tracked_allocator_init_vmem( temp_slice , internals_size ) - // context.allocator = tracked_allocator( transient ) - // context.temp_allocator = tracked_allocator( temp ) + context.allocator = tracked_allocator( transient ) + context.temp_allocator = tracked_allocator( temp ) } state := new( State, tracked_allocator( memory.persistent ) ) using state @@ -164,8 +164,6 @@ render :: proc() draw_debug_text_y += 16 } - // draw_text( "Hot-Reload Count : %v", -1 ) - draw_text( "Screen Width : %v", rl.GetScreenWidth() ) draw_text( "Screen Height: %v", rl.GetScreenHeight() ) diff --git a/code/memory.odin b/code/memory.odin index 7f59714..01b84b4 100644 --- a/code/memory.odin +++ b/code/memory.odin @@ -54,7 +54,7 @@ tracked_allocator :: proc ( self : ^ TrackedAllocator ) -> mem.Allocator { return mem.tracking_allocator( & self.tracker ) } -tracked_allocator_init :: proc( size, internals_size : int ) -> TrackedAllocator +tracked_allocator_init :: proc( size, internals_size : int, allocator := context.allocator ) -> TrackedAllocator { result : TrackedAllocator @@ -69,7 +69,7 @@ tracked_allocator_init :: proc( size, internals_size : int ) -> TrackedAllocator internals_size := internals_size + arena_size raw_size := backing_size + internals_size - raw_mem, raw_mem_code := mem.alloc( raw_size ) + raw_mem, raw_mem_code := mem.alloc( raw_size, mem.DEFAULT_ALIGNMENT, allocator ) if ( raw_mem_code != mem.Allocator_Error.None ) { // TODO(Ed) : Setup a proper logging interface diff --git a/ols.json b/ols.json index c4a6ca3..367da58 100644 --- a/ols.json +++ b/ols.json @@ -14,7 +14,6 @@ "path": "C:/projects/SectrPrototype/code" } ], - "enable_format": false, "enable_document_symbols": true, "enable_semantic_tokens": false, "enable_hover": true,