Couple oversights master
authorhgn <hgodden00@gmail.com>
Thu, 3 Jul 2025 14:52:14 +0000 (15:52 +0100)
committerhgn <hgodden00@gmail.com>
Thu, 3 Jul 2025 14:52:14 +0000 (15:52 +0100)
src/array_file.c
src/metascene.c
src/model.c
src/player_render.c
src/skaterift.c
src/steam.c
src/steam.h

index a90aff28e9da6fddc3148bbe56a224bbc9ce2426..f97988e55123fa3f18113b31536919d478d48d3a 100644 (file)
@@ -36,7 +36,7 @@ static void af_load_array_file_buffer( array_file_context *ctx, array_file_meta
          {
             vg_file_error_info( ctx->fp );
             fclose( ctx->fp );
-            vg_fatal_exit();
+            vg_fatal_error( "AF file buffer error\n" );
          }
       }
       else 
@@ -59,7 +59,7 @@ static void af_load_array_file_buffer( array_file_context *ctx, array_file_meta
             {
                vg_file_error_info( ctx->fp );
                fclose( ctx->fp );
-               vg_fatal_exit();
+               vg_fatal_error( "AF read arror\n" );
             }
          }
       }
@@ -132,11 +132,7 @@ void af_open( array_file_context *ctx, const char *path, u32 min_version, u32 ma
 {
    ctx->fp = fopen( path, "rb" );
    if( !ctx->fp )
-   {
-      vg_fatal_condition();
-      vg_info( "open('%s'): %s\n", path, strerror(errno) );
-      vg_fatal_exit();
-   }
+      vg_fatal_error( "open('%s'): %s\n", path, strerror(errno) );
 
    u64 l = fread( &ctx->header, sizeof(array_file_header), 1, ctx->fp );
    if( l != 1 )
@@ -147,13 +143,12 @@ void af_open( array_file_context *ctx, const char *path, u32 min_version, u32 ma
 
    if( ctx->header.version < min_version || ctx->header.version > max_version )
    {
-      vg_fatal_condition();
       vg_info( "Legacy model version incompatable" );
       vg_info( "For model: %s\n", path );
       vg_info( "  version: %u (min: %u, max: %u)\n", 
                ctx->header.version, min_version, max_version );
       fclose( ctx->fp );
-      vg_fatal_exit();
+      vg_fatal_error( "Legacy\n" );
    }
 
    af_load_array_file( ctx, &ctx->index, &ctx->header.index, stack, sizeof(array_file_meta) );
index 7c75699de621babaf0d640a89a649d387b0b7dc9..dc46ed69eddd75a9f00767c3fa4f9a7121529511 100644 (file)
@@ -107,11 +107,9 @@ static void _cutscene_override_asoc( u32 instance_id, u32 override_index, struct
 
 NOT_IMPLEMENTED:
 
-   vg_fatal_condition();
-   vg_warn( "The data association was not found.\n"
-            "  Entity Type: %u\n"
-            "  Entity name: %s\n", override->entity_type, name );
-   vg_fatal_exit();
+   vg_fatal_error( "The data association was not found.\n"
+                   "  Entity Type: %u\n"
+                   "  Entity name: %s\n", override->entity_type, name );
 }
 
 static void _cutscene_get_strip_asoc( ms_strip *strip, struct cs_asoc *out_asoc )
index 2425b302525d8f23305af2854b3da265711a3c70..6345cd28f29f27663e7ab7a4e85d7b1babcc3b7a 100644 (file)
@@ -27,10 +27,9 @@ void mdl_fread_pack_file( mdl_context *mdl, mdl_file *info, void *dst )
 {
    if( !info->pack_size )
    {
-      vg_fatal_condition();
       vg_info( "Packed file is only a header; it is not packed" );
       vg_info( "path: %s\n", af_str( &mdl->af, info->pstr_path ) );
-      vg_fatal_exit();
+      vg_fatal_error( "" );
    }
 
    fseek( mdl->af.fp, mdl->pack_base_offset + info->pack_offset, SEEK_SET );
@@ -210,7 +209,7 @@ void mdl_load_materials( mdl_context *mdl, vg_stack_allocator *stack )
       else
 #endif
       {
-         vg_msg_init( &msg, data.data + mat->props.kvs.offset, mat->props.kvs.size );
+         vg_msg_init( &msg, data.data? (data.data + mat->props.kvs.offset): NULL, mat->props.kvs.size );
       }
 
       if( mat->shader == k_shader_standard || 
@@ -473,11 +472,7 @@ void mdl_async_load_glmesh( mdl_context *mdl, glmesh *mesh, u32 *fixup_table )
       vg_async_task_dispatch( task, _sync_mdl_load_glmesh );
    }
    else
-   {
-      vg_fatal_condition();
-      vg_info( "No vertex/indice data in model file\n" );
-      vg_fatal_exit();
-   }
+      vg_fatal_error( "No vertex/indice data in model file\n" );
 }
 
 /* uploads the glmesh, and textures. everything is saved into the mdl_context */
index 82dccde3403385a5666eab50a64c97de56af2b7e..62d2cfd70f332d587efa6fbb1d037557a13b744d 100644 (file)
@@ -41,10 +41,7 @@ void player_get_anim( skeleton_anim *out_anim, const char *name )
          return;
       }
    }
-
-   vg_fatal_condition();
-   vg_info( "Failed to find animation '%s' in metascene.\n", name );
-   vg_fatal_exit();
+   vg_fatal_error( "Failed to find animation '%s' in metascene.\n", name );
 }
 
 void player_load_animation_reference( const char *path )
index 85c6b07be1d78927846ac619129aa50ac8ddc2ed..885756404526e1121cc6826075781c24bea2f9ca 100644 (file)
@@ -99,10 +99,12 @@ static void game_load_co( vg_coroutine *co )
    {
       if( !g_client.nosteam )
       {
-         steam_init();
-         steam_register_callback( k_iSteamNetConnectionStatusChangedCallBack, on_server_connect_status );
-         steam_register_callback( k_iPersonaStateChange, on_persona_state_change );
-         request_auth_ticket();
+         if( steam_init() )
+         {
+            steam_register_callback( k_iSteamNetConnectionStatusChangedCallBack, on_server_connect_status );
+            steam_register_callback( k_iPersonaStateChange, on_persona_state_change );
+            request_auth_ticket();
+         }
       }
    }
 
index a5db0f66e2f34448ed03b7483026baf765a568e3..f85349b05145a60b50903c3a9d499fcd296ec827 100644 (file)
@@ -228,7 +228,7 @@ void steam_register(void)
    vg_console_reg_cmd( "ach", steam_achievement_ccmd, NULL );
 }
 
-int steam_init(void)
+bool steam_init(void)
 {
    const char *username = "offline player";
 
@@ -238,7 +238,7 @@ int steam_init(void)
    {
       printf("\n");
       vg_error( "Steamworks failed to initialize\n" );
-      return 1;
+      return 0;
    }
 
    steam_ready = 1;
index c9ecf2b7e15be451e2fc877b24cbe8deab5e34a7..ad4fd8ec6fcadbbc3f0ac693cbd7feaa944edacf 100644 (file)
@@ -9,7 +9,7 @@ extern void *hSteamNetworkingSockets, *hSteamUser, *hSteamUserStats;
 extern char steam_username_at_startup[128];
 
 void steam_register(void);
-int steam_init(void);
+bool steam_init(void);
 void steam_update(void);
 void steam_end(void);
 u32 str_utf8_collapse( const char *str, char *buf, u32 length );