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_invalid
= -1,
22 k_world_purpose_hub
= 0,
23 k_world_purpose_client
= 1,
27 struct leaderboard_cache
{
28 enum request_status status
;
34 typedef struct world_instance world_instance
;
36 static void skaterift_world_get_save_path( enum world_purpose which
,
39 /* submodule headers */
40 #include "world_entity.h"
41 #include "world_gate.h"
42 #include "world_gen.h"
43 #include "world_info.h"
44 #include "world_load.h"
45 #include "world_physics.h"
46 #include "world_render.h"
47 #include "world_sfd.h"
48 #include "world_volumes.h"
49 #include "world_water.h"
50 #include "world_audio.h"
51 #include "world_routes.h"
52 #include "world_routes_ui.h"
54 /* console variables */
56 static f32 k_day_length
= 30.0f
; /* minutes */
57 static i32 k_debug_light_indices
= 0,
58 k_debug_light_complexity
= 0,
61 #define WORLD_SURFACE_HAS_TRAFFIC 0x1
62 #define WORLD_SURFACE_HAS_PROPS 0x2
64 struct world_instance
{
66 * -------------------------------------------------------
73 k_world_status_unloaded
= 0,
74 k_world_status_loading
= 1,
75 k_world_status_loaded
= 2,
76 k_world_status_unloading
= 3 /* dont spawn sounds and stuff */
94 struct ub_world_lighting
{
102 v4f g_nightsky_colour
;
104 v4f g_ambient_colour
;
105 v4f g_sunset_ambient
;
114 float g_shadow_length
;
115 float g_shadow_spread
;
119 float g_sunset_phase
;
122 int g_shadow_samples
;
125 int g_debug_complexity
;
131 GLuint tbo_light_entities
,
135 float probabilities
[3];
138 struct framebuffer heightmap
;
141 * Dynamically allocated when world_load is called.
143 * the following arrays index somewhere into this linear
145 * --------------------------------------------------------------------------
156 struct world_surface
{
166 mdl_array_ptr ent_spawn
,
197 ent_gate
*rendering_gate
;
200 * ----------------------------------------------------
204 scene_context scene_geo
,
208 /* spacial mappings */
214 glmesh mesh_route_lines
;
218 u32 cubemap_cooldown
, cubemap_side
;
221 struct leaderboard_cache
*leaderboard_cache
;
224 struct route_ui
*routes_ui
;
227 struct world_static
{
229 * Allocated as system memory
230 * --------------------------------------------------------------------------
234 u32 current_run_version
;
235 double time
, rewind_from
, rewind_to
, last_use
;
237 u32 active_trigger_volumes
[8];
238 u32 active_trigger_volume_count
;
240 addon_reg
*instance_addons
[ k_world_max
];
241 world_instance instances
[ k_world_max
];
243 enum world_purpose active_instance
;
244 u32 focused_entity
; /* like skateshop, challenge.. */
249 ent_objective
*challenge_target
;
252 enum world_loader_state
{
254 k_world_loader_preload
,
261 static void world_init(void);
262 static world_instance
*world_current_instance(void);
263 static void world_switch_instance( u32 index
);