audio_unlock();
- vg_convar_push( (struct vg_convar){
+ vg_var_push( (struct vg_var){
.name = "aud_debug_soundscape",
.data = &k_audio_debug_soundscape,
- .data_type = k_convar_dtype_i32,
+ .data_type = k_var_dtype_i32,
.opt_i32 = { .min=0, .max=1, .clamp=0 },
.persistent = 1
});
- vg_convar_push( (struct vg_convar){
+ vg_var_push( (struct vg_var){
.name = "aud_occlusion_rate",
.data = &k_audio_occlusion_rate,
- .data_type = k_convar_dtype_f32,
+ .data_type = k_var_dtype_f32,
.opt_f32 = { .clamp = 0 },
.persistent = 1
});
v3f last;
v3_zero(last);
+ world_instance *world = get_active_world();
+
for( int i=0; i<sample_count; i++ )
{
v3f dir;
ray_hit contact;
contact.dist = 15.0f;
- if( ray_world( origin, dir, &contact ) )
+ if( ray_world( world, origin, dir, &contact ) )
{
d += contact.dist;
ray_hit contact;
contact.dist = vg_minf( 16.0f, pos[1] );
+ world_instance *world = get_active_world();
- if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) )
+ if( ray_world( world, pos, (v3f){0.0f,-1.0f,0.0f}, &contact ) )
{
- struct world_material *mat = ray_hit_material( &contact );
+ struct world_material *mat = ray_hit_material( world, &contact );
if( mat->info.surface_prop == k_surface_prop_grass)
{
output[1] = 0.0f;
output[2] = pos[2];
- if( world.water.enabled )
+ if( world->water.enabled )
return k_audio_sprite_type_water;
else
return k_audio_sprite_type_none;