+ int switching_to_new_world;
+
+ world_instance worlds[4];
+ u32 world_count;
+ u32 active_world;
+}
+world_global;
+
+VG_STATIC world_instance *get_active_world( void )
+{
+ return &world_global.worlds[ world_global.active_world ];
+}
+
+/*
+ * API
+ */
+
+VG_STATIC
+int ray_hit_is_ramp( world_instance *world, ray_hit *hit );
+
+VG_STATIC
+struct world_material *ray_hit_material( world_instance *world, ray_hit *hit );
+
+VG_STATIC
+void ray_world_get_tri( world_instance *world, ray_hit *hit, v3f tri[3] );
+
+VG_STATIC
+int ray_world( world_instance *world, v3f pos, v3f dir, ray_hit *hit );
+
+/*
+ * Submodules
+ */
+
+#include "world_routes.h"
+#include "world_sfd.h"
+#include "world_render.h"
+#include "world_water.h"
+#include "world_volumes.h"
+#include "world_gen.h"
+#include "world_gate.h"
+
+/*
+ * -----------------------------------------------------------------------------
+ * Events
+ * -----------------------------------------------------------------------------
+ */
+
+VG_STATIC int world_stop_sound( int argc, const char *argv[] )
+{
+ world_instance *world = get_active_world();
+ return 0;
+}
+
+VG_STATIC void world_init(void)
+{
+ world_global.sky_rate = 1.0;
+ world_global.sky_target_rate = 1.0;
+
+ shader_scene_standard_register();
+ shader_scene_standard_alphatest_register();
+ shader_scene_vertex_blend_register();
+ shader_scene_terrain_register();
+ shader_scene_depth_register();
+ shader_scene_position_register();
+
+ shader_model_sky_register();
+
+ vg_info( "Loading world resources\n" );