fix small poroblems
[vg.git] / vg.h
diff --git a/vg.h b/vg.h
index 3ce5a462642ab62d75b89735d330df670239a9c9..aa86ab547a27e3cb84d106b0154c6f36246bdc54 100644 (file)
--- a/vg.h
+++ b/vg.h
@@ -175,6 +175,8 @@ struct vg{
 
    float loader_ring;
    GLuint tex_missing;
+
+   vg_rand rand;
 }
 static vg = { .time_rate = 1.0 };
 const char *vg_get_basepath(void){
@@ -289,12 +291,12 @@ void async_internal_complete( void *payload, u32 size )
    SDL_AtomicUnlock( &vg.sl_status );
 }
 
-static void _vg_load_full( void *data )
-{
+static void _vg_load_full( void *data ){
    vg_preload();
+   vg_tex2d_replace_with_error( &vg.tex_missing );
+   vg_ui.tex_bg = vg.tex_missing;
 
    /* internal */
-   vg_tex2d_replace_with_error( &vg.tex_missing );
    vg_loader_step( vg_input_init, vg_input_free );
    vg_loader_step( vg_lines_init, NULL );
 #ifndef VG_NO_AUDIO
@@ -842,9 +844,8 @@ static void _vg_terminate(void)
    exit(0);
 }
 
-static void vg_enter( int argc, char *argv[], const char *window_name )
-{
-   vg_rand_seed( 461 );
+static void vg_enter( int argc, char *argv[], const char *window_name ){
+   vg_rand_seed( &vg.rand, 461 );
    _vg_process_launch_opts_internal( argc, argv );
 
    /* Systems init */
@@ -903,7 +904,7 @@ static void vg_fatal_error( const char *fmt, ... )
    va_start( args, fmt );
    _vg_logx_va( stderr, NULL, "fatal", KRED, fmt, args );
    va_end( args );
-   exit(0);
+   exit(1);
 }
 
 #endif /* VG_GAME */