Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

  1. //===== Copyright � 2005-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: A higher level link library for general use in the game and tools.
  4. //
  5. //===========================================================================//
  6. #include <tier0/platform.h>
  7. #include <tier2/tier2.h>
  8. #include <filesystem_init.h>
  9. // NOTE: This has to be the last file included!
  10. #include "tier0/memdbgon.h"
  11. static CSysModule *g_pFullFileSystemModule = NULL;
  12. void* DefaultCreateInterfaceFn(const char *pName, int *pReturnCode)
  13. {
  14. if ( pReturnCode )
  15. {
  16. *pReturnCode = 0;
  17. }
  18. return NULL;
  19. }
  20. void InitDefaultFileSystem( void )
  21. {
  22. AssertMsg( !g_pFullFileSystem, "Already set up the file system" );
  23. if ( !Sys_LoadInterface( "filesystem_stdio", FILESYSTEM_INTERFACE_VERSION,
  24. &g_pFullFileSystemModule, (void**)&g_pFullFileSystem ) )
  25. {
  26. exit(0);
  27. }
  28. if ( !g_pFullFileSystem->Connect( DefaultCreateInterfaceFn ) )
  29. {
  30. exit(0);
  31. }
  32. if ( g_pFullFileSystem->Init() != INIT_OK )
  33. {
  34. exit(0);
  35. }
  36. g_pFullFileSystem->RemoveAllSearchPaths();
  37. g_pFullFileSystem->AddSearchPath( "", "LOCAL", PATH_ADD_TO_HEAD );
  38. g_pFullFileSystem->AddSearchPath( "", "DEFAULT_WRITE_PATH", PATH_ADD_TO_HEAD );
  39. }
  40. void ShutdownDefaultFileSystem(void)
  41. {
  42. AssertMsg( g_pFullFileSystem, "File system not set up" );
  43. g_pFullFileSystem->Shutdown();
  44. g_pFullFileSystem->Disconnect();
  45. Sys_UnloadModule( g_pFullFileSystemModule );
  46. }