2 * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
14 k_world_geo_type_solid
= 0,
15 k_world_geo_type_nonsolid
= 1,
16 k_world_geo_type_water
= 2
19 typedef struct world_instance world_instance
;
21 /* submodule headers */
22 #include "world_entity.h"
23 #include "world_gate.h"
24 #include "world_gen.h"
25 #include "world_info.h"
26 #include "world_load.h"
27 #include "world_physics.h"
28 #include "world_render.h"
29 #include "world_sfd.h"
30 #include "world_volumes.h"
31 #include "world_water.h"
32 #include "world_audio.h"
33 #include "world_routes.h"
35 /* console variables */
37 static f32 k_day_length
= 30.0f
; /* minutes */
38 static i32 k_debug_light_indices
= 0,
39 k_debug_light_complexity
= 0,
43 struct world_instance
{
45 * -------------------------------------------------------
50 k_world_status_unloaded
= 0,
51 k_world_status_loading
= 1,
52 k_world_status_loaded
= 2,
53 k_world_status_unloading
= 3 /* dont spawn sounds and stuff */
70 struct ub_world_lighting
{
78 v4f g_nightsky_colour
;
90 float g_shadow_length
;
91 float g_shadow_spread
;
101 int g_debug_complexity
;
107 GLuint tbo_light_entities
,
111 float probabilities
[3];
114 struct framebuffer heightmap
;
117 * Dynamically allocated when world_load is called.
119 * the following arrays index somewhere into this linear
121 * --------------------------------------------------------------------------
132 struct world_surface
{
141 mdl_array_ptr ent_spawn
,
160 ent_gate
*rendering_gate
;
163 * ----------------------------------------------------
167 scene_context scene_geo
,
171 /* spacial mappings */
177 glmesh mesh_route_lines
;
185 struct world_static
{
187 * Allocated as system memory
188 * --------------------------------------------------------------------------
192 u32 current_run_version
;
193 double time
, rewind_from
, rewind_to
, last_use
;
195 u32 active_trigger_volumes
[8];
196 u32 active_trigger_volume_count
;
198 world_instance worlds
[4];
203 static void world_init(void);
204 static world_instance
*world_current_instance(void);