-#include "rigidbody.h"
-#include "bvh.h"
-#include "model.h"
-
-#include "traffic.h" /*TODO: -> world_traffic.h */
-
-#include "shaders/terrain.h"
-#include "shaders/sky.h"
-#include "shaders/planeinf.h"
-#include "shaders/standard.h"
-#include "shaders/vblend.h"
-#include "shaders/gpos.h"
-#include "shaders/fscolour.h"
-#include "shaders/alphatest.h"
-
-enum { k_max_ui_segments = 8 };
-enum { k_max_ui_splits_per_segment = 16 };
-
-enum { k_max_ui_elements = k_max_ui_segments*k_max_ui_splits_per_segment };
-enum { k_max_element_verts = 10 };
-enum { k_max_element_indices = 20 };
-
-enum { k_route_ui_max_verts = k_max_ui_elements*k_max_element_verts };
-enum { k_route_ui_max_indices = k_max_ui_elements*k_max_element_indices };
-
-static struct gworld
-{
- struct subworld_gen
- {
-
- }
- subworld_gen;
-
- /* gameplay */
- struct respawn_point
- {
- v3f co;
- v4f q;
- char name[32];
- }
- spawns[32];
- u32 spawn_count;
-
- struct world_audio_thing
- {
- v3f pos;
- float volume;
- u32 flags;
-
- audio_player player;
- audio_clip temp_embedded_clip;
- }
- * audio_things;
-
- u32 audio_things_count,
- audio_things_cap;
-
- struct achievement_zone
- {
- m4x3f transform, inv_transform;
- char name[32];
- int triggered;
-
- union
- {
- mdl_node *ptarget_delegated;
- struct world_audio_thing *ptarget;
- };
- }
- * achievement_zones;
-
- u32 achievement_zones_count,
- achievement_zones_cap;
-
- struct subworld_routes
- {
- struct route_node
- {
- v3f co, right, up, h;
- u32 next[2];
-
- u32 special_type, special_id, current_refs, ref_count;
- u32 route_ids[4]; /* Gates can be linked into up to four routes */
- }
- *nodes;
-
- u32 node_count,
- node_cap;
-
- struct route
- {
- u32 track_id;
- v4f colour;
-
- u32 start;
- mdl_submesh sm;
-
- int active;
- float factive;
-
- double best_lap, latest_pass; /* Session */
-
- struct
- {
- GLuint vao, vbo, ebo;
-
- u32 indices_head;
- u32 vertex_head;
-
- float last_notch;
-
- struct route_ui_segment
- {
- float length;
- u32 vertex_start, vertex_count,
- index_start, index_count, notches;
- }
- segments[k_max_ui_segments];
-
- u32 segment_start, segment_count, fade_start, fade_count;
- double fade_timer_start;
- float xpos;
- }
- ui;
-
- m4x3f scoreboard_transform;
- }
- *routes;
-
- double time, rewind_from, rewind_to, last_use;
-
- u32 route_count,
- route_cap;
-
- struct route_gate
- {
- struct teleport_gate
- {
- v3f co[2];
- v4f q[2];
- v2f dims;
-
- m4x3f to_world, recv_to_world, transport;
- }
- gate;
-
- u32 node_id;
-
- struct route_timing
- {
- u32 version; /* Incremented on every teleport */
- double time;
- }
- timing;
- }
- *gates;
-
- struct route_collector
- {
- struct route_timing timing;
- }
- *collectors;
-
- u32 gate_count,
- gate_cap,
- collector_count,
- collector_cap;
-
- u32 active_gate,
- current_run_version;
-
- scene scene_lines;
- }
- routes;
-
- struct subworld_sfd
- {
- scene mesh;
- mdl_submesh *sm_module, *sm_card;
- glmesh temp;
-
- struct sfd_instance
- {
- float *buffer;
-
- u32 w,h;
- }
- tester;
- }
- sfd;
-
- /* Paths */
- traffic_node traffic[128];
- u32 traffic_count;
-
-#if 0
- traffic_driver van_man[6];
-#endif
-
- double sky_time, sky_rate, sky_target_rate;
-
- /* Physics */
-
- /* Rendering & geometry */
- scene geo, foliage;
- rigidbody rb_geo;
-
- /* TODO Maybe make this less hardcoded */
- mdl_submesh sm_geo_std_oob, sm_geo_std, sm_geo_vb,
- sm_foliage_main, sm_foliage_alphatest,
- sm_graffiti, sm_subworld, sm_terrain;
-
- glmesh skybox, skydome;
- mdl_submesh dome_upper, dome_lower;
-
- glmesh cars;
- mdl_submesh car_holden;
-
- /* Load time */
-
- struct instance_cache
- {
- mdl_header *mdl;
- u32 pstr_file;
- }
- * instance_cache;
- u32 instance_cache_count,
- instance_cache_cap;
-
- v3f render_gate_pos;
- int active_route_board;
-}
-world ;