X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_sfd.h;h=f765910e56dd71bb7aa89eebd9ef2756d0d6934a;hb=b9dedb4dd2a1e94ae76a3986716ee3c57e568213;hp=05f191d1d9b9cae9cb9b4aff1b0439cca68c6e4d;hpb=c2d67378dd5c82de50b8fbbbe222ec6be2da4eee;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_sfd.h b/world_sfd.h index 05f191d..f765910 100644 --- a/world_sfd.h +++ b/world_sfd.h @@ -72,7 +72,7 @@ static void sfd_new( struct sfd_instance *display, u32 w, u32 h ) { display->w = w; display->h = h; - display->buffer = malloc( w*h*sizeof(float)*2 ); + display->buffer = vg_alloc( w*h*sizeof(float)*2 ); for( int i=0; ibuffer[i] = 0.0f; @@ -153,7 +153,7 @@ static int world_sfd_test( int argc, const char *argv[] ) return 0; } -static int world_sfd_init(void) +static void world_sfd_init(void) { vg_info( "world_sfd_init\n" ); shader_scoretext_register(); @@ -192,33 +192,18 @@ static int world_sfd_init(void) } } - if( vg_acquire_thread_sync(1) ) + vg_acquire_thread_sync(); { vg_tex2d_init( (vg_tex2d *[]){ &tex_scoretext }, 1 ); - if( !scene_upload( &sfd->mesh ) ) - { - vg_release_thread_sync(1); - return 0; - } - - if( !mdl_unpack_submesh( mboard, &sfd->temp, backer ) ) - { - vg_release_thread_sync(1); - return 0; - } - vg_release_thread_sync(1); - } - else - { - free( mboard ); - return 0; + scene_upload( &sfd->mesh ); + mdl_unpack_submesh( mboard, &sfd->temp, backer ); } + vg_release_thread_sync(); scene_free_offline_buffers( &sfd->mesh ); sfd_new( &sfd->tester, 27, 13 ); - free( mboard ); - return 1; + vg_free( mboard ); }