2 * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
9 #include "network_msg.h"
15 k_world_geo_type_solid
= 0,
16 k_world_geo_type_nonsolid
= 1,
17 k_world_geo_type_water
= 2
21 k_world_purpose_hub
= 0,
22 k_world_purpose_client
= 1,
26 struct leaderboard_cache
{
27 enum request_status status
;
33 typedef struct world_instance world_instance
;
35 static void skaterift_world_get_save_path( enum world_purpose which
,
38 /* submodule headers */
39 #include "world_entity.h"
40 #include "world_gate.h"
41 #include "world_gen.h"
42 #include "world_info.h"
43 #include "world_load.h"
44 #include "world_physics.h"
45 #include "world_render.h"
46 #include "world_sfd.h"
47 #include "world_volumes.h"
48 #include "world_water.h"
49 #include "world_audio.h"
50 #include "world_routes.h"
52 /* console variables */
54 static f32 k_day_length
= 30.0f
; /* minutes */
55 static i32 k_debug_light_indices
= 0,
56 k_debug_light_complexity
= 0,
60 struct world_instance
{
62 * -------------------------------------------------------
67 k_world_status_unloaded
= 0,
68 k_world_status_loading
= 1,
69 k_world_status_loaded
= 2,
70 k_world_status_unloading
= 3 /* dont spawn sounds and stuff */
87 struct ub_world_lighting
{
95 v4f g_nightsky_colour
;
107 float g_shadow_length
;
108 float g_shadow_spread
;
112 float g_sunset_phase
;
115 int g_shadow_samples
;
118 int g_debug_complexity
;
124 GLuint tbo_light_entities
,
128 float probabilities
[3];
131 struct framebuffer heightmap
;
134 * Dynamically allocated when world_load is called.
136 * the following arrays index somewhere into this linear
138 * --------------------------------------------------------------------------
149 struct world_surface
{
158 mdl_array_ptr ent_spawn
,
181 ent_gate
*rendering_gate
;
184 * ----------------------------------------------------
188 scene_context scene_geo
,
192 /* spacial mappings */
198 glmesh mesh_route_lines
;
202 u32 cubemap_cooldown
, cubemap_side
;
207 struct leaderboard_cache
*leaderboard_cache
;
210 struct world_static
{
212 * Allocated as system memory
213 * --------------------------------------------------------------------------
217 u32 current_run_version
;
218 double time
, rewind_from
, rewind_to
, last_use
;
220 u32 active_trigger_volumes
[8];
221 u32 active_trigger_volume_count
;
223 addon_reg
*instance_addons
[ k_world_max
];
224 world_instance instances
[ k_world_max
];
226 enum world_purpose active_instance
;
227 u32 focused_entity
; /* like skateshop, challenge.. */
232 ent_objective
*challenge_target
;
235 enum world_loader_state
{
237 k_world_loader_preload
,
244 static void world_init(void);
245 static world_instance
*world_current_instance(void);
246 static void world_set_active_instance( u32 index
);