+// This software is not affiliated with Valve Corporation
+// We are not affiliated, associated, authorized, endorsed by, or in any way officially
+// connected with Valve Corporation, or any of its subsidiaries or its affiliates.
+//
+// All trademarks are property of their respective owners
+
// Abstract Valve file system
//=======================================================================================================================
+// Initialize game directories / pakfile
+void fs_set_gameinfo( const char *path );
+void fs_exit(void);
+
+// Read asset as binary in full. Will search VPK, then searchpaths, or return NULL if not found
+char *valve_fs_get( const char *path );
+
+// Implementation
+//=======================================================================================================================
+
+#ifdef VALVE_IMPLEMENTATION
+
struct valve_filesystem
{
char gamedir[ 512 ];
if( !fs->vpk )
{
- fprintf( stderr, "Could not locate pak01_dir.vpk in %i searchpaths. Stock models will not load!", csr_sb_count( fs->searchpaths ) );
+ log_error( "Could not locate pak01_dir.vpk in %i searchpaths. Stock models will not load!", csr_sb_count( fs->searchpaths ) );
}
- printf( "fs_info:\n\
- gamedir: %s\n\
- exedir: %s\n\
- bin: %s\n\
- pack: %s\n\
- searchpaths:\n", fs->gamedir, fs->exedir, fs->bindir, pack_path );
+ log_info( "fs_info:\n" );
+ log_info( " gamedir: %s\n", fs->gamedir );
+ log_info( " exedir: %s\n", fs->exedir );
+ log_info( " bin: %s\n", fs->bindir );
+ log_info( " pack: %s\n", pack_path );
+ log_info( " searchpaths:\n" );
for( int i = 0; i < csr_sb_count( fs->searchpaths ); i ++ )
{
- printf( " %s\n", fs->searchpaths[i] );
+ log_info( " '%s'\n", fs->searchpaths[i] );
}
}
if( !fs->current_archive )
{
- fprintf( stderr, "Could not locate %s\n", pak );
+ log_error( "Could not locate %s\n", pak );
return NULL;
}
}
return NULL;
}
+
+#endif