+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
#ifndef WORLD_RENDER_H
#define WORLD_RENDER_H
vg_tex2d tex_graffiti = { .path = "textures/graffitibox.qoi",
.flags = VG_TEXTURE_NEAREST };
-static int world_render_init(void)
+static void world_render_init(void)
{
vg_info( "Loading default world textures\n" );
- if( vg_acquire_thread_sync(1) )
+ vg_acquire_thread_sync();
{
vg_tex2d_init( (vg_tex2d *[]){ &tex_terrain_colours,
&tex_terrain_noise,
&tex_alphatest,
&tex_graffiti }, 4 );
-
- vg_release_thread_sync(1);
- return 1;
}
-
- return 0;
+ vg_release_thread_sync();
}
static void world_render_free(void*_)
shader_sky_uMdl(identity_matrix);
shader_sky_uPv(full);
shader_sky_uTexGarbage(0);
- shader_sky_uTime( vg_time );
+ shader_sky_uTime( world.sky_time );
vg_tex2d_bind( &tex_terrain_noise, 0 );
float closest = INFINITY;
int id = 0;
- for( int i=0; i<world.routes.gate_count; i++ )
+ for( int i=0; i<world_routes.gate_count; i++ )
{
- struct route_gate *rg = &world.routes.gates[i];
+ struct route_gate *rg = &world_routes.gates[i];
float dist = v3_dist2( rg->gate.co[0], camera[3] );
if( dist < closest )
}
}
- render_gate( &world.routes.gates[id].gate, playerco, camera );
+ render_gate( &world_routes.gates[id].gate, playerco, camera );
v3_lerp( world.render_gate_pos,
- world.routes.gates[id].gate.co[0],
+ world_routes.gates[id].gate.co[0],
1.0f,
world.render_gate_pos );
}
int closest = 0;
float min_dist = INFINITY;
- for( int i=0; i<world.routes.route_count; i++ )
+ for( int i=0; i<world_routes.route_count; i++ )
{
- float dist = v3_dist2( world.routes.routes[i].scoreboard_transform[3],
+ float dist = v3_dist2( world_routes.routes[i].scoreboard_transform[3],
camera[3] );
if( dist < min_dist )
}
sfd_render( &world.sfd.tester, projection, camera[3],
- world.routes.routes[closest].scoreboard_transform );
+ world_routes.routes[closest].scoreboard_transform );
}
static void render_world_depth( m4x4f projection, m4x3f camera )