*/
/* world geometry */
- scene *scene_geo,
- *scene_no_collide,
- *scene_lines;
+ scene_context scene_geo,
+ scene_no_collide,
+ scene_lines;
/* spacial mappings */
bh_tree *audio_bh,
glmesh mesh_base, mesh_display;
mdl_submesh sm_base;
u32 active_route_board;
+ scene_context scene;
u32 w, h;
float *buffer;
mdl_context msky;
mdl_open( &msky, "models/rs_skydome.mdl", vg_mem.scratch );
mdl_load_metadata_block( &msky, vg_mem.scratch );
- mdl_load_mesh_block( &msky, vg_mem.scratch );
+ mdl_async_load_glmesh( &msky, &world_global.skydome );
mdl_close( &msky );
- vg_acquire_thread_sync();
- {
- mdl_unpack_glmesh( &msky, &world_global.skydome );
- }
- vg_release_thread_sync();
-
/* Other systems */
vg_info( "Loading other world systems\n" );
v3_copy( audio->transform.co, sound_co );
}
else
- vg_fatal_exit_loop( "ent_audio_call (invalid function id)" );
+ vg_fatal_error( "ent_audio_call (invalid function id)" );
float chance = vg_randf()*100.0f,
bar = 0.0f;
ray_hit *hit, v3f tri[3] )
{
for( int i=0; i<3; i++ )
- v3_copy( world->scene_geo->arrvertices[ hit->tri[i] ].co, tri[i] );
+ v3_copy( world->scene_geo.arrvertices[ hit->tri[i] ].co, tri[i] );
}
VG_STATIC int ray_world( world_instance *world,
v3f pos, v3f dir, ray_hit *hit )
{
- return scene_raycast( world->scene_geo, world->geo_bh, pos, dir, hit );
+ return scene_raycast( &world->scene_geo, world->geo_bh, pos, dir, hit );
}
/*
int idx;
while( bh_next( world->geo_bh, &it, region, &idx ) ){
- u32 *ptri = &world->scene_geo->arrindices[ idx*3 ];
+ u32 *ptri = &world->scene_geo.arrindices[ idx*3 ];
v3f tri[3];
boxf box;
box_init_inf( box );
for( int j=0; j<3; j++ ){
- v3_copy( world->scene_geo->arrvertices[ptri[j]].co, tri[j] );
+ v3_copy( world->scene_geo.arrvertices[ptri[j]].co, tri[j] );
box_addpt( box, tri[j] );
}