{
vg_file_error_info( ctx->fp );
fclose( ctx->fp );
- vg_fatal_exit();
+ vg_fatal_error( "AF file buffer error\n" );
}
}
else
{
vg_file_error_info( ctx->fp );
fclose( ctx->fp );
- vg_fatal_exit();
+ vg_fatal_error( "AF read arror\n" );
}
}
}
{
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 )
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) );
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 )
{
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 );
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 ||
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 */
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 )
{
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();
+ }
}
}
vg_console_reg_cmd( "ach", steam_achievement_ccmd, NULL );
}
-int steam_init(void)
+bool steam_init(void)
{
const char *username = "offline player";
{
printf("\n");
vg_error( "Steamworks failed to initialize\n" );
- return 1;
+ return 0;
}
steam_ready = 1;
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 );