Team Fortress 2 Source Code as on 22/4/2020
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.

59 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef FILESYSTEM_TOOLS_H
  8. #define FILESYSTEM_TOOLS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "filesystem.h"
  13. #include "filesystem_init.h"
  14. // This is the the path of the initial source file
  15. extern char qdir[1024];
  16. // This is the base engine + mod-specific game dir (e.g. "d:\tf2\mytfmod\")
  17. extern char gamedir[1024];
  18. // ---------------------------------------------------------------------------------------- //
  19. // Filesystem initialization.
  20. // ---------------------------------------------------------------------------------------- //
  21. enum FSInitType_t
  22. {
  23. FS_INIT_FULL, // Load gameinfo.txt, maybe use filesystem_steam, and setup search paths.
  24. FS_INIT_COMPATIBILITY_MODE // Load filesystem_stdio and that's it.
  25. };
  26. //
  27. // Initializes qdir, and gamedir. Also initializes the VMPI filesystem if MPI is defined.
  28. //
  29. // pFilename can be NULL if you want to rely on vproject and qproject. If it's specified, FileSystem_Init
  30. // will go up directories from pFilename looking for gameinfo.txt (if vproject isn't specified).
  31. //
  32. // If bOnlyUseFilename is true, then it won't use any alternative methods of finding the vproject dir
  33. // (ie: it won't use -game or -vproject or the vproject env var or qproject).
  34. //
  35. bool FileSystem_Init( const char *pFilename, int maxMemoryUsage=0, FSInitType_t initType=FS_INIT_FULL, bool bOnlyUseFilename=false );
  36. void FileSystem_Term();
  37. // Used to connect app-framework based console apps to the filesystem tools
  38. void FileSystem_SetupStandardDirectories( const char *pFilename, const char *pGameInfoPath );
  39. CreateInterfaceFn FileSystem_GetFactory( void );
  40. extern IBaseFileSystem *g_pFileSystem;
  41. extern IFileSystem *g_pFullFileSystem; // NOTE: this is here when VMPI is being used, but a VMPI app can
  42. // ONLY use LoadModule/UnloadModule.
  43. #endif // FILESYSTEM_TOOLS_H