medium sized dollop
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.h
index 3662bb19f1447f0333ea23e52a1bee56040f7d57..65494a5be204ea8f6e25b6e7adfddadb3f32a4f7 100644 (file)
@@ -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 );