From 237b1d672a077702267b4ceedd0479bdc62ccedc Mon Sep 17 00:00:00 2001 From: hgn Date: Mon, 11 Dec 2023 09:17:13 +0000 Subject: [PATCH] launch option to load world --- skaterift.c | 6 +++++- skaterift.h | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/skaterift.c b/skaterift.c index e488f77..00fb7d5 100644 --- a/skaterift.c +++ b/skaterift.c @@ -85,6 +85,10 @@ static void vg_launch_opt(void){ if( vg_long_opt( "demo" ) ){ skaterift.demo_mode = 1; } + + if( (arg = vg_long_opt_arg( "world" )) ){ + skaterift.hub_world = arg; + } } static void vg_preload(void){ @@ -166,7 +170,7 @@ static addon_reg *skaterift_mount_world_unloadable( const char *path, u32 ext ){ static void skaterift_load_world_content(void){ /* hub world */ - addon_reg *hub = skaterift_mount_world_unloadable( "maps/dev_hub", 0 ); + addon_reg *hub = skaterift_mount_world_unloadable( skaterift.hub_world, 0 ); skaterift_mount_world_unloadable( "maps/mp_spawn", ADDON_REG_CITY|ADDON_REG_PREMIUM ); skaterift_mount_world_unloadable( "maps/mp_mtzero", diff --git a/skaterift.h b/skaterift.h index f96d17c..a21e6ab 100644 --- a/skaterift.h +++ b/skaterift.h @@ -68,9 +68,12 @@ struct{ int demo_mode; audio_channel *aud_air; + const char *hub_world; } static skaterift = { - .op = k_async_op_clientloading, .time_rate = 1.0f, .demo_mode = 1 }; + .op = k_async_op_clientloading, .time_rate = 1.0f, .demo_mode = 1, + .hub_world = "maps/dev_hub" +}; /* Skaterift api */ static void skaterift_change_world_start( addon_reg *reg ); -- 2.25.1