X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.h;h=a73998a778888c9a573dedf582f89195783059b2;hb=47941822dae18a018c985847b052e70214a3ccc6;hp=9693e814dc9c0c07347fd03883f07905265bdc09;hpb=4f96bd0040e35ecb21d353ee2b895129682d22c1;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.h b/world_render.h index 9693e81..a73998a 100644 --- a/world_render.h +++ b/world_render.h @@ -19,7 +19,7 @@ vg_tex2d tex_alphatest = { .path = "textures/alphatest.qoi", vg_tex2d tex_graffiti = { .path = "textures/graffitibox.qoi", .flags = VG_TEXTURE_NEAREST }; -static void world_render_init(void) +VG_STATIC void world_render_init(void) { vg_info( "Loading default world textures\n" ); @@ -33,32 +33,19 @@ static void world_render_init(void) vg_release_thread_sync(); } -static void world_render_free(void*_) -{ - vg_tex2d_free( (vg_tex2d *[]){ &tex_terrain_colours, - &tex_terrain_noise, - &tex_alphatest, - &tex_graffiti }, 4 ); -} - - - -static void render_world_depth( m4x4f projection, m4x3f camera ); - - - +VG_STATIC void render_world_depth( m4x4f projection, m4x3f camera ); /* * Rendering */ -static void bind_terrain_textures(void) +VG_STATIC void bind_terrain_textures(void) { vg_tex2d_bind( &tex_terrain_noise, 0 ); vg_tex2d_bind( &tex_terrain_colours, 1 ); } -static void render_world_vb( m4x4f projection, v3f camera ) +VG_STATIC void render_world_vb( m4x4f projection, v3f camera ) { m4x3f identity_matrix; m4x3_identity( identity_matrix ); @@ -73,21 +60,11 @@ static void render_world_vb( m4x4f projection, v3f camera ) shader_vblend_uMdl( identity_matrix ); shader_vblend_uCamera( camera ); - scene_bind( &world.geo ); + mesh_bind( &world.mesh_geo ); mdl_draw_submesh( &world.sm_geo_vb ); - - mesh_bind( &world.cars ); - -#if 0 - for( int i=0; igate.co[0], camera[3] ); if( dist < closest ) @@ -214,14 +191,14 @@ static void render_world_gates( m4x4f projection, v3f playerco, m4x3f camera ) } } - render_gate( &world_routes.gates[id].gate, playerco, camera ); + render_gate( &world.gates[id].gate, playerco, camera ); v3_lerp( world.render_gate_pos, - world_routes.gates[id].gate.co[0], + world.gates[id].gate.co[0], 1.0f, world.render_gate_pos ); } -static void render_world( m4x4f projection, m4x3f camera ) +VG_STATIC void render_world( m4x4f projection, m4x3f camera ) { render_sky( camera ); render_world_routes( projection, camera[3] ); @@ -232,9 +209,9 @@ static void render_world( m4x4f projection, m4x3f camera ) int closest = 0; float min_dist = INFINITY; - for( int i=0; i