X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world.c;h=14200d91bdfb1746b5b9fd8622336a0408d8b7f1;hb=df9f72d2912a5424d37dfdb02f76aba8f1ed4df1;hp=0183acbbd12997d4e3be23296e601bdad6b2c07d;hpb=c2ee05fe23699fd1de7e1d8259b9bc272b232058;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world.c b/world.c index 0183acb..14200d9 100644 --- a/world.c +++ b/world.c @@ -9,7 +9,7 @@ #include "network.h" static world_instance *world_current_instance(void){ - return &world_static.worlds[ world_static.active_world ]; + return &world_static.instances[ world_static.active_instance ]; } static void world_init(void) @@ -26,6 +26,30 @@ static void world_init(void) VG_MEMORY_SYSTEM ); } +static void world_set_active_instance( u32 index ){ + world_static.challenge_target = NULL; + world_static.challenge_timer = 0.0f; + world_static.focused_entity = 0; + world_static.focus_strength = 0.0f; + world_static.active_trigger_volume_count = 0; + world_static.active_instance = index; +} + +static void skaterift_world_get_save_path( enum world_purpose which, + char buf[128] ){ + addon_reg *reg; + + if( which == k_world_purpose_hub ) reg = world_static.addon_hub; + else reg = world_static.addon_client; + + assert( reg ); + + char id[76]; + addon_alias_uid( ®->alias, id ); + snprintf( buf, 128, "savedata/%s.bkv", id ); +} + + #include "world_entity.c" #include "world_gate.c" #include "world_gen.c" @@ -39,7 +63,7 @@ static void world_init(void) #include "world_routes.c" #include "world_traffic.c" -VG_STATIC void world_update( world_instance *world, v3f pos ) +static void world_update( world_instance *world, v3f pos ) { world_render.sky_time += world_render.sky_rate * vg.time_delta; world_render.sky_rate = vg_lerp( world_render.sky_rate,