X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.h;h=65494a5be204ea8f6e25b6e7adfddadb3f32a4f7;hb=c2d67378dd5c82de50b8fbbbe222ec6be2da4eee;hp=3662bb19f1447f0333ea23e52a1bee56040f7d57;hpb=1740c935bfdacc65c5c7e4bb95fba1ada1f7118a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.h b/world_render.h index 3662bb1..65494a5 100644 --- a/world_render.h +++ b/world_render.h @@ -15,9 +15,27 @@ 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) +static int world_render_init(void) { - vg_tex2d_init( (vg_tex2d *[]){ &tex_terrain_colours, + vg_info( "Loading default world textures\n" ); + + if( vg_acquire_thread_sync(1) ) + { + 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; +} + +static void world_render_free(void*_) +{ + vg_tex2d_free( (vg_tex2d *[]){ &tex_terrain_colours, &tex_terrain_noise, &tex_alphatest, &tex_graffiti }, 4 );