Fix major overstep with last commit
[carveJwlIkooP6JGAAIwe30JlM.git] / render.h
index 6a5b56d5beffc50b0aec45fbd7b56dfc9f13058d..706cf9b14de229dabdadba2b419e16135c5dd179 100644 (file)
--- a/render.h
+++ b/render.h
@@ -189,8 +189,7 @@ static void fb_use( struct framebuffer *fb )
    }
 }
 
-__attribute__((warn_unused_result))
-static int fb_init( struct framebuffer *fb )
+static void fb_init( struct framebuffer *fb )
 {
    i32 ix = vg_window_x / fb->div,
        iy = vg_window_y / fb->div;
@@ -216,15 +215,8 @@ static int fb_init( struct framebuffer *fb )
          GL_RENDERBUFFER, fb->rb );
    glBindFramebuffer( GL_FRAMEBUFFER, 0 );
 
-   if( VG_CHECK_GL_ERR() )
-   {
-      fb->allocated = 0;
-      vg_error( "Error while creating standard framebuffer\n" );
-      return 0;
-   }
-
+   VG_CHECK_GL_ERR();
    fb->allocated = 1;
-   return 1;
 }
 
 static void fb_free( struct framebuffer *fb )
@@ -268,14 +260,14 @@ static void render_fb_resize(void)
 /*
  * Vg
  */
-static int render_init(void)
+static void render_init(void)
 {
    shader_blit_register();
    shader_standard_register();
    shader_vblend_register();
    shader_unlit_register();
 
-   if( vg_acquire_thread_sync(1) )
+   vg_acquire_thread_sync();
    {
       vg_info( "Allocating framebuffers\n" );
 
@@ -293,12 +285,7 @@ static int render_init(void)
             GL_TEXTURE_2D, 
             gpipeline.rgb_background, 0);
 
-      if( VG_CHECK_GL_ERR() )
-      {
-         vg_error( "Error while creating back buffer\n" );
-         vg_release_thread_sync(1);
-         return 0;
-      }
+      VG_CHECK_GL_ERR();
 
       /* 
        * World depth map, maybe this should be moved to world.h
@@ -319,13 +306,7 @@ static int render_init(void)
             GL_TEXTURE_2D, 
             gpipeline.rgb_depthmap, 0);
 
-      if( VG_CHECK_GL_ERR() )
-      {
-         vg_error( "Error while creating world depth buffer\n" );
-         glBindFramebuffer( GL_FRAMEBUFFER, 0 );
-         vg_release_thread_sync(1);
-         return 0;
-      }
+      VG_CHECK_GL_ERR();
 
       float quad[] = { 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
                        0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f };
@@ -340,13 +321,7 @@ static int render_init(void)
             sizeof(float)*2, (void*)0 );
       glEnableVertexAttribArray( 0 );
 
-      if( VG_CHECK_GL_ERR() )
-      {
-         vg_error( "Error while creating fsquad\n" );
-         glBindFramebuffer( GL_FRAMEBUFFER, 0 );
-         vg_release_thread_sync(1);
-         return 0;
-      }
+      VG_CHECK_GL_ERR();
 
       glGenBuffers( 1, &gpipeline.ubo_world_lighting );
       glBindBuffer( GL_UNIFORM_BUFFER, gpipeline.ubo_world_lighting );
@@ -356,23 +331,15 @@ static int render_init(void)
       render_update_lighting_ub();
       glBindBufferBase( GL_UNIFORM_BUFFER, 0, gpipeline.ubo_world_lighting );
 
-      if( VG_CHECK_GL_ERR() )
-      {
-         vg_error( "Error while creating world uniform buffers\n" );
-         glBindFramebuffer( GL_FRAMEBUFFER, 0 );
-         vg_release_thread_sync(1);
-         return 0;
-      }
+      VG_CHECK_GL_ERR();
 
       glBindFramebuffer( GL_FRAMEBUFFER, 0 );
       vg_success( "Done\n" );
       
       gpipeline.ready = 1;
-      vg_release_thread_sync(1);
-      return 1;
    }
-   else
-      return 0;
+
+   vg_release_thread_sync();
 }
 
 static void render_free(void *_)