2 * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
11 static world_instance
*world_current_instance(void){
12 return &world_static
.instances
[ world_static
.active_instance
];
15 static void world_init(void)
17 vg_loader_step( world_render_init
, NULL
);
18 vg_loader_step( world_sfd_init
, NULL
);
19 vg_loader_step( world_water_init
, NULL
);
20 vg_loader_step( world_gates_init
, NULL
);
21 vg_loader_step( world_routes_init
, NULL
);
23 /* Allocate dynamic world memory arena */
24 u32 max_size
= 76*1024*1024;
25 world_static
.heap
= vg_create_linear_allocator( vg_mem
.rtmemory
, max_size
,
29 static void skaterift_world_get_save_path( enum world_purpose which
,
33 if( which
== k_world_purpose_hub
) reg
= world_static
.addon_hub
;
34 else reg
= world_static
.addon_client
;
39 addon_alias_uid( ®
->alias
, id
);
40 snprintf( buf
, 128, "savedata/%s.bkv", id
);
44 #include "world_entity.c"
45 #include "world_gate.c"
46 #include "world_gen.c"
47 #include "world_load.c"
48 #include "world_physics.c"
49 #include "world_render.c"
50 #include "world_sfd.c"
51 #include "world_volumes.c"
52 #include "world_water.c"
53 #include "world_audio.c"
54 #include "world_routes.c"
55 #include "world_traffic.c"
57 VG_STATIC
void world_update( world_instance
*world
, v3f pos
)
59 world_render
.sky_time
+= world_render
.sky_rate
* vg
.time_delta
;
60 world_render
.sky_rate
= vg_lerp( world_render
.sky_rate
,
61 world_render
.sky_target_rate
,
62 vg
.time_delta
* 5.0 );
64 world_routes_update_timer_texts( world
);
65 world_routes_update( world
);
66 world_traffic_update( world
, pos
);
67 world_sfd_update( world
, pos
);
68 world_volumes_update( world
, pos
);