X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=main.c;h=119be9e0f5f62219e4f347a075ef3dd8a5d95e53;hb=bdac014448b6ec968fe645f1581f321144f07dba;hp=9bfa794c51a1e0b1ad55668aa8ca29b1877fc366;hpb=47941822dae18a018c985847b052e70214a3ccc6;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/main.c b/main.c index 9bfa794..119be9e 100644 --- a/main.c +++ b/main.c @@ -19,7 +19,8 @@ */ #define VG_3D -#define VG_STATIC static +//#define VG_STATIC static +#define VG_STATIC //#define VG_MINIMAL_TEST #ifndef VG_MINIMAL_TEST @@ -39,6 +40,25 @@ static int cl_ui = 1; int main( int argc, char *argv[] ) { + vg_mem.use_libc_malloc = 1; +#if 0 + vg_prealloc_quota( 128*1024*1024 ); + void *test_allocator = vg_create_linear_allocator( NULL, 2048 ); + + for( int i=0; i<8; i++ ) + { + u64 *items = vg_linear_alloc( test_allocator, sizeof(u64) ); + items = vg_linear_extend( test_allocator, items, sizeof(u64)); + items[0] = 43; + items[1] = 12445; + + vg_info( "%lu %lu\n", items[0], items[1] ); + } + + vg_linear_clear( test_allocator ); + return 0; +#endif + vg_prealloc_quota( 128*1024*1024 ); vg_enter( argc, argv, "Voyager Game Engine" ); } @@ -50,6 +70,7 @@ VG_STATIC void highscores_save_at_exit(void*_) VG_STATIC void vg_preload(void) { + vg_convar_push( (struct vg_convar){ .name = "cl_ui", .data = &cl_ui, @@ -72,7 +93,7 @@ vg_info(" ' ' '--' [] '----- '----- ' ' '---' " vg_loader_highwater( NULL, highscores_save_at_exit, NULL ); - vg_sleep_ms(200); + //vg_sleep_ms(200); steam_init(); vg_loader_highwater( NULL, steam_end, NULL ); @@ -90,7 +111,8 @@ VG_STATIC void vg_load(void) vg_loader_highwater( audio_init, audio_free, NULL ); /* 'systems' are completely loaded now */ - world_load( "models/mp_dev.mdl" ); + strcpy( world.world_name, "models/mp_test.mdl" ); + world_load(); vg_console_load_autos(); }