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.

111 lines
3.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Expose functions from sys_dll.cpp.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef SYS_DLL_H
  8. #define SYS_DLL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class IHammer;
  17. class IDataCache;
  18. class IPhysics;
  19. class IMDLCache;
  20. class IMatSystemSurface;
  21. class IVideoServices;
  22. class IVideoRecorder;
  23. class IInputSystem;
  24. class IDedicatedExports;
  25. class ISoundEmitterSystemBase;
  26. typedef unsigned short AVIHandle_t;
  27. //-----------------------------------------------------------------------------
  28. // Class factories
  29. //-----------------------------------------------------------------------------
  30. // This factory gets to many of the major app-single systems,
  31. // including the material system, vgui, vgui surface, the file system.
  32. extern CreateInterfaceFn g_AppSystemFactory;
  33. // this factory connect the AppSystemFactory + client.dll + gameui.dll
  34. extern CreateInterfaceFn g_GameSystemFactory;
  35. //-----------------------------------------------------------------------------
  36. // Singleton interfaces
  37. //-----------------------------------------------------------------------------
  38. extern IHammer *g_pHammer;
  39. extern IDataCache *g_pDataCache;
  40. extern IPhysics *g_pPhysics;
  41. extern IMDLCache *g_pMDLCache;
  42. extern IMatSystemSurface *g_pMatSystemSurface;
  43. extern IInputSystem *g_pInputSystem;
  44. extern IVideoServices *g_pVideo;
  45. extern IDedicatedExports *dedicated;
  46. //-----------------------------------------------------------------------------
  47. // Other singletons
  48. //-----------------------------------------------------------------------------
  49. extern IVideoRecorder *g_pVideoRecorder;
  50. inline bool InEditMode()
  51. {
  52. return g_pHammer != NULL;
  53. }
  54. struct modinfo_t
  55. {
  56. char szInfo[ 256 ];
  57. char szDL [ 256 ];
  58. char szHLVersion[ 32 ];
  59. int version;
  60. int size;
  61. bool svonly;
  62. bool cldll;
  63. };
  64. extern modinfo_t gmodinfo;
  65. void LoadEntityDLLs( const char *szBaseDir, bool bIsServerOnly );
  66. void UnloadEntityDLLs( void );
  67. // This returns true if someone called Error() or Sys_Error() and we're exiting.
  68. // Since we call exit() from inside those, some destructors need to be safe and not crash.
  69. bool IsInErrorExit();
  70. // error message
  71. bool Sys_MessageBox(const char *title, const char *info, bool bShowOkAndCancel);
  72. bool ServerDLL_Load( bool bIsServerOnly );
  73. void ServerDLL_Unload();
  74. typedef uint32 AppId_t;
  75. // steam.inf information.
  76. struct SteamInfVersionInfo_t
  77. {
  78. int32 ClientVersion; // PatchVersion
  79. int32 ServerVersion; // ServerVersion
  80. char szVersionString[ 32 ]; // PatchVersion string
  81. char szProductString[ 32 ]; // ProductName string
  82. AppId_t AppID; // Steam AppID. Read from steam.inf(AppID) or gameinfo.txt(SteamAppId)
  83. AppId_t ServerAppID; // ServerAppID. Used for dedicated server crash reporting.
  84. };
  85. const SteamInfVersionInfo_t& GetSteamInfIDVersionInfo();
  86. extern CreateInterfaceFn g_ServerFactory;
  87. #endif