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.

166 lines
5.9 KiB

  1. //===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef ENGINECALLBACK_H
  9. #define ENGINECALLBACK_H
  10. #ifndef EIFACE_H
  11. #include "eiface.h"
  12. #endif
  13. #ifdef POSIX
  14. #define random random_valve// stdlib.h defined random()..., and so does vstdlib/random.h
  15. #endif
  16. #include "tier3/tier3.h"
  17. #include "tier2/tier2_logging.h"
  18. #include "google/protobuf/message.h"
  19. class IFileSystem; // include FileSystem.h
  20. class IUniformRandomStream; // include vstdlib/random.h
  21. class IEngineSound; // include engine/IEngineSound.h
  22. class IVEngineServer;
  23. class IVoiceServer;
  24. class IStaticPropMgrServer;
  25. class ISpatialPartition;
  26. class IVModelInfo;
  27. class IEngineTrace;
  28. class IGameEventManager2;
  29. class IVDebugOverlay;
  30. class IDataCache;
  31. class IMDLCache;
  32. class IServerEngineTools;
  33. class IXboxSystem;
  34. class IScriptManager;
  35. class IServerFoundry;
  36. class CSteamAPIContext;
  37. class CSteamGameServerAPIContext;
  38. extern IVEngineServer *engine;
  39. extern IVoiceServer *g_pVoiceServer;
  40. extern IFileSystem *filesystem;
  41. extern IStaticPropMgrServer *staticpropmgr;
  42. extern ISpatialPartition *partition;
  43. extern IEngineSound *enginesound;
  44. extern IVModelInfo *modelinfo;
  45. extern IEngineTrace *enginetrace;
  46. extern IFileLoggingListener *filelogginglistener;
  47. extern IGameEventManager2 *gameeventmanager;
  48. extern IVDebugOverlay *debugoverlay;
  49. extern IServerEngineTools *serverenginetools;
  50. extern IServerFoundry *serverfoundry;
  51. extern IXboxSystem *xboxsystem; // 360 only
  52. extern IScriptManager *scriptmanager;
  53. #if !defined( NO_STEAM )
  54. extern CSteamAPIContext *steamapicontext; // available on game clients
  55. extern CSteamGameServerAPIContext *steamgameserverapicontext; //available on game servers
  56. #endif
  57. #ifdef INFESTED_DLL
  58. class IASW_Mission_Chooser;
  59. extern IASW_Mission_Chooser *missionchooser;
  60. #endif
  61. //-----------------------------------------------------------------------------
  62. // Precaches a material
  63. //-----------------------------------------------------------------------------
  64. void PrecacheMaterial( const char *pMaterialName );
  65. //-----------------------------------------------------------------------------
  66. // Converts a previously precached material into an index
  67. //-----------------------------------------------------------------------------
  68. int GetMaterialIndex( const char *pMaterialName );
  69. //-----------------------------------------------------------------------------
  70. // Converts a previously precached material index into a string
  71. //-----------------------------------------------------------------------------
  72. const char *GetMaterialNameFromIndex( int nMaterialIndex );
  73. //-----------------------------------------------------------------------------
  74. // Precache-related methods for particle systems
  75. //-----------------------------------------------------------------------------
  76. int PrecacheParticleSystem( const char *pParticleSystemName );
  77. int GetParticleSystemIndex( const char *pParticleSystemName );
  78. const char *GetParticleSystemNameFromIndex( int nIndex );
  79. //-----------------------------------------------------------------------------
  80. // Precache-related methods for movies
  81. //-----------------------------------------------------------------------------
  82. void PrecacheMovie( const char *pMovieName );
  83. int GetMovieIndex( const char *pMovieName );
  84. const char *GetMovieNameFromIndex( int nMovieIndex );
  85. //-----------------------------------------------------------------------------
  86. // Precache-related methods for effects (used by DispatchEffect)
  87. //-----------------------------------------------------------------------------
  88. void PrecacheEffect( const char *pParticleSystemName );
  89. int GetEffectIndex( const char *pParticleSystemName );
  90. const char *GetEffectNameFromIndex( int nIndex );
  91. class IRecipientFilter;
  92. void EntityMessageBegin( CBaseEntity * entity, bool reliable = false );
  93. void MessageEnd( void );
  94. // bytewise
  95. void MessageWriteByte( int iValue);
  96. void MessageWriteChar( int iValue);
  97. void MessageWriteShort( int iValue);
  98. void MessageWriteWord( int iValue );
  99. void MessageWriteLong( int iValue);
  100. void MessageWriteFloat( float flValue);
  101. void MessageWriteAngle( float flValue);
  102. void MessageWriteCoord( float flValue);
  103. void MessageWriteVec3Coord( const Vector& rgflValue);
  104. void MessageWriteVec3Normal( const Vector& rgflValue);
  105. void MessageWriteAngles( const QAngle& rgflValue);
  106. void MessageWriteString( const char *sz );
  107. void MessageWriteEntity( int iValue);
  108. void MessageWriteEHandle( CBaseEntity *pEntity ); //encoded as a long
  109. // bitwise
  110. void MessageWriteBool( bool bValue );
  111. void MessageWriteUBitLong( unsigned int data, int numbits );
  112. void MessageWriteSBitLong( int data, int numbits );
  113. void MessageWriteBits( const void *pIn, int nBits );
  114. void MessageWriteBitVecIntegral( const Vector& vecValue );
  115. // Bytewise
  116. #define WRITE_BYTE (MessageWriteByte)
  117. #define WRITE_CHAR (MessageWriteChar)
  118. #define WRITE_SHORT (MessageWriteShort)
  119. #define WRITE_WORD (MessageWriteWord)
  120. #define WRITE_LONG (MessageWriteLong)
  121. #define WRITE_FLOAT (MessageWriteFloat)
  122. #define WRITE_ANGLE (MessageWriteAngle)
  123. #define WRITE_COORD (MessageWriteCoord)
  124. #define WRITE_VEC3COORD (MessageWriteVec3Coord)
  125. #define WRITE_VEC3NORMAL (MessageWriteVec3Normal)
  126. #define WRITE_ANGLES (MessageWriteAngles)
  127. #define WRITE_STRING (MessageWriteString)
  128. #define WRITE_ENTITY (MessageWriteEntity)
  129. #define WRITE_EHANDLE (MessageWriteEHandle)
  130. // Bitwise
  131. #define WRITE_BOOL (MessageWriteBool)
  132. #define WRITE_UBITLONG (MessageWriteUBitLong)
  133. #define WRITE_SBITLONG (MessageWriteSBitLong)
  134. #define WRITE_BITS (MessageWriteBits)
  135. #define WRITE_VEC3_INTEGRAL (MessageWriteBitVecIntegral)
  136. //-----------------------------------------------------------------------------
  137. // Send a user message
  138. //-----------------------------------------------------------------------------
  139. class IRecipientFilter;
  140. void SendUserMessage( IRecipientFilter& filter, int message, const ::google::protobuf::Message &msg );
  141. #endif //ENGINECALLBACK_H