Guest User

Untitled

a guest
Nov 24th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.81 KB | None | 0 0
  1. abstract_class IVEngineClient
  2. {
  3. public:
  4. virtual int GetIntersectingSurfaces( const model_t *model, const Vector &vCenter, const float radius, const bool bOnlyVisibleSurfaces, SurfInfo *pInfos, const int nMaxInfos ) = 0;
  5. virtual Vector GetLightForPoint (const Vector &pos, bool bClamp) = 0;
  6. virtual IMaterial *TraceLineMaterialAndLighting( const Vector &start, const Vector &end, Vector &diffuseLightColor, Vector& baseColor ) = 0;
  7. virtual const char *ParseFile( const char *data, char *token, int maxlen ) = 0;
  8. virtual bool CopyFile( const char *source, const char *destination ) = 0;
  9. virtual void GetScreenSize( int& width, int& height ) = 0;
  10. virtual void ServerCmd( const char *szCmdString, bool bReliable = true ) = 0;
  11. virtual void ClientCmd( const char *szCmdString ) = 0;
  12. virtual bool GetPlayerInfo( int ent_num, player_info_t *pinfo ) = 0;
  13. virtual int GetPlayerForUserID( int userID ) = 0;
  14. virtual client_textmessage_t *TextMessageGet( const char *pName ) = 0;
  15. virtual bool Con_IsVisible( void ) = 0;
  16. virtual int GetLocalPlayer( void ) = 0;
  17. virtual const model_t *LoadModel( const char *pName, bool bProp = false ) = 0;
  18. virtual float Time( void ) = 0;
  19. virtual float GetLastTimeStamp( void ) = 0;
  20. virtual CSentence *GetSentence( CAudioSource *pAudioSource ) = 0;
  21. virtual float GetSentenceLength( CAudioSource *pAudioSource ) = 0;
  22. virtual bool IsStreaming( CAudioSource *pAudioSource ) const = 0;
  23. virtual void GetViewAngles( QAngle& va ) = 0;
  24. virtual void SetViewAngles( QAngle& va ) = 0;
  25. virtual int GetMaxClients( void ) = 0;
  26. virtual const char *Key_LookupBinding( const char *pBinding ) = 0;
  27. virtual const char *Key_BindingForKey( ButtonCode_t &code ) = 0;
  28. virtual void StartKeyTrapMode( void ) = 0;
  29. virtual bool CheckDoneKeyTrapping( ButtonCode_t &code ) = 0;
  30. virtual bool IsInGame( void ) = 0;
  31. virtual bool IsConnected( void ) = 0;
  32. virtual bool IsDrawingLoadingImage( void ) = 0;
  33. virtual void Con_NPrintf( int pos, const char *fmt, ... ) = 0;
  34. virtual void Con_NXPrintf( const struct con_nprint_s *info, const char *fmt, ... ) = 0;
  35. virtual int IsBoxVisible( const Vector& mins, const Vector& maxs ) = 0;
  36. virtual int IsBoxInViewCluster( const Vector& mins, const Vector& maxs ) = 0;
  37. virtual bool CullBox( const Vector& mins, const Vector& maxs ) = 0;
  38. virtual void Sound_ExtraUpdate( void ) = 0;
  39. virtual const char *GetGameDirectory( void ) = 0;
  40. virtual const VMatrix& WorldToScreenMatrix() = 0;
  41. virtual const VMatrix& WorldToViewMatrix() = 0;
  42. virtual int GameLumpVersion( int lumpId ) const = 0;
  43. virtual int GameLumpSize( int lumpId ) const = 0;
  44. virtual bool LoadGameLump( int lumpId, void* pBuffer, int size ) = 0;
  45. virtual int LevelLeafCount() const = 0;
  46. virtual ISpatialQuery* GetBSPTreeQuery() = 0;
  47.  
  48. virtual void LinearToGamma( float* linear, float* gamma ) = 0;
  49. virtual float LightStyleValue( int style ) = 0;
  50. virtual void ComputeDynamicLighting( const Vector& pt, const Vector* pNormal, Vector& color ) = 0;
  51. virtual void GetAmbientLightColor( Vector& color ) = 0;
  52. virtual int GetDXSupportLevel() = 0;
  53. virtual bool SupportsHDR() = 0;
  54. virtual void Mat_Stub( IMaterialSystem *pMatSys ) = 0;
  55. virtual void GetChapterName( char *pchBuff, int iMaxLength ) = 0;
  56. virtual char const *GetLevelName( void ) = 0;
  57. virtual int GetLevelVersion ( void ) = 0;
  58. virtual struct IVoiceTweak_s *GetVoiceTweakAPI( void ) = 0;
  59. virtual void EngineStats_BeginFrame( void ) = 0;
  60. virtual void EngineStats_EndFrame( void ) = 0;
  61. virtual void FireEvents() = 0;
  62. virtual int GetLeavesArea( int *pLeaves, int nLeaves ) = 0;
  63. virtual bool DoesBoxTouchAreaFrustum( const Vector &mins, const Vector &maxs, int iArea ) = 0;
  64. virtual void SetAudioState( const AudioState_t& state ) = 0;
  65. virtual int SentenceGroupPick( int groupIndex, char *name, int nameBufLen ) = 0;
  66. virtual int SentenceGroupPickSequential( int groupIndex, char *name, int nameBufLen, int sentenceIndex, int reset ) = 0;
  67. virtual int SentenceIndexFromName( const char *pSentenceName ) = 0;
  68. virtual const char *SentenceNameFromIndex( int sentenceIndex ) = 0;
  69. virtual int SentenceGroupIndexFromName( const char *pGroupName ) = 0;
  70. virtual const char *SentenceGroupNameFromIndex( int groupIndex ) = 0;
  71. virtual float SentenceLength( int sentenceIndex ) = 0;
  72. virtual void ComputeLighting( const Vector& pt, const Vector* pNormal, bool bClamp, Vector& color, Vector *pBoxColors=NULL ) = 0;
  73. virtual void ActivateOccluder( int nOccluderIndex, bool bActive ) = 0;
  74. virtual bool IsOccluded( const Vector &vecAbsMins, const Vector &vecAbsMaxs ) = 0;
  75. virtual void *SaveAllocMemory( size_t num, size_t size ) = 0;
  76. virtual void SaveFreeMemory( void *pSaveMem ) = 0;
  77. virtual INetChannelInfo *GetNetChannelInfo( void ) = 0;
  78. virtual void DebugDrawPhysCollide( const CPhysCollide *pCollide, IMaterial *pMaterial, matrix3x4_t& transform, const color32 &color ) = 0;
  79. virtual void CheckPoint( const char *pName ) = 0;
  80. virtual void DrawPortals() = 0;
  81. virtual bool IsPlayingDemo( void ) = 0;
  82. virtual bool IsRecordingDemo( void ) = 0;
  83. virtual bool IsPlayingTimeDemo( void ) = 0;
  84.  
  85. // UNKNOWN RETURN VALUES - NEW FUNCTIONS
  86. virtual void *GetDemoRecordingTick ( void ) = 0;
  87. virtual void *GetDemoPlaybackTick ( void ) = 0;
  88. virtual void *GetDemoPlaybackStartTick ( void ) = 0;
  89. virtual void *GetDemoPlaybackTimeScale ( void ) = 0;
  90. virtual void *GetDemoPlaybackTotalTicks ( void ) = 0;
  91. // END
  92.  
  93. virtual bool IsPaused( void ) = 0;
  94. virtual bool IsTakingScreenshot( void ) = 0;
  95. virtual bool IsHLTV( void ) = 0;
  96.  
  97. // UNKNOWN RETURN VALUES - NEW FUNCTIONS
  98. //virtual bool IsReplay( void ) = 0;
  99. //virtual void *DownloadReplay ( int unknown1 ) = 0;
  100. //virtual bool IsReplayEnabled ( void ) = 0;
  101. //virtual bool IsReplayRecording ( void ) = 0;
  102. //virtual void *GetReplayRecordingTick ( void ) = 0;
  103. // END
  104.  
  105. virtual bool IsLevelMainMenuBackground( void ) = 0;
  106. virtual void GetMainMenuBackgroundName( char *dest, int destlen ) = 0;
  107. virtual void *GetVideoModes ( int& iUnknown, void *vmode_s ) = 0;
  108. virtual void SetOcclusionParameters( const OcclusionParams_t &params ) = 0;
  109. virtual void GetUILanguage( char *dest, int destlen ) = 0;
  110. virtual SkyboxVisibility_t IsSkyboxVisibleFromPoint( const Vector &vecPoint ) = 0;
  111. virtual const char* GetMapEntitiesString() = 0;
  112. virtual bool IsInEditMode( void ) = 0;
  113. virtual float GetScreenAspectRatio() = 0;
  114. virtual bool REMOVED_SteamRefreshLogin( const char *password, bool isSecure ) = 0;
  115. virtual bool REMOVED_SteamProcessCall( bool & finished ) = 0;
  116.  
  117. virtual unsigned int GetEngineBuildNumber() = 0; // engines build
  118. virtual const char * GetProductVersionString() = 0; // mods version number (steam.inf)
  119. virtual void GrabPreColorCorrectedFrame( int x, int y, int width, int height ) = 0;
  120. virtual bool IsHammerRunning( ) const = 0;
  121. virtual void ExecuteClientCmd( const char *szCmdString ) = 0;
  122. virtual bool MapHasHDRLighting(void) = 0;
  123. virtual int GetAppID() = 0;
  124. virtual Vector GetLightForPointFast(const Vector &pos, bool bClamp) = 0;
  125. virtual void ClientCmd_Unrestricted( const char *szCmdString ) = 0;
  126. virtual void SetRestrictServerCommands( bool bRestrict ) = 0;
  127. virtual void SetRestrictClientCommands( bool bRestrict ) = 0;
  128. virtual void SetOverlayBindProxy( int iOverlayID, void *pBindProxy ) = 0;
  129. virtual bool CopyFrameBufferToMaterial( const char *pMaterialName ) = 0;
  130. virtual void ChangeTeam( const char *pTeamName ) = 0;
  131. virtual void ReadConfiguration( const bool readDefault = false ) = 0;
  132. virtual void SetAchievementMgr( IAchievementMgr *pAchievementMgr ) = 0;
  133. virtual IAchievementMgr *GetAchievementMgr() = 0;
  134. virtual bool MapLoadFailed( void ) = 0;
  135. virtual void SetMapLoadFailed( bool bState ) = 0;
  136. virtual bool IsLowViolence() = 0;
  137. virtual const char *GetMostRecentSaveGame( void ) = 0;
  138. virtual void SetMostRecentSaveGame( const char *lpszFilename ) = 0;
  139. virtual void StartXboxExitingProcess() = 0;
  140. virtual bool IsSaveInProgress() = 0;
  141. virtual uint OnStorageDeviceAttached( void ) = 0;
  142. virtual void OnStorageDeviceDetached( void ) = 0;
  143. virtual void ResetDemoInterpolation( void ) = 0;
  144. virtual void SetGamestatsData( CGamestatsData *pGamestatsData ) = 0;
  145. virtual CGamestatsData *GetGamestatsData() = 0;
  146.  
  147. // New functions
  148. virtual void *GetMouseDelta ( int&, int&, bool ) = 0;
  149. virtual void ServerCmdKeyValues ( void* ) = 0;
  150. virtual bool IsSkippingPlayback ( void ) = 0;
  151. virtual bool IsLoadingDemo ( void ) = 0;
  152. virtual bool IsInCommentaryMode ( void ) = 0;
  153. };
  154. // VEngineClient013
  155.  
  156. abstract_class IBaseClientDLL
  157. {
  158. public:
  159. // Called once when the client DLL is loaded
  160. virtual int Init( CreateInterfaceFn appSystemFactory,
  161. CreateInterfaceFn physicsFactory,
  162. CGlobalVarsBase *pGlobals ) = 0;
  163.  
  164. virtual void PostInit() = 0;
  165.  
  166. // Called once when the client DLL is being unloaded
  167. virtual void Shutdown( void ) = 0;
  168.  
  169. // Called at the start of each level change
  170. virtual void LevelInitPreEntity( char const* pMapName ) = 0;
  171. // Called at the start of a new level, after the entities have been received and created
  172. virtual void LevelInitPostEntity( ) = 0;
  173. // Called at the end of a level
  174. virtual void LevelShutdown( void ) = 0;
  175.  
  176. virtual void Unk1() = 0;
  177. virtual void Unk2() = 0;
  178.  
  179. // Request a pointer to the list of client datatable classes
  180. virtual ClientClass *GetAllClasses( void ) = 0;
  181.  
  182. // Called once per level to re-initialize any hud element drawing stuff
  183. virtual int HudVidInit( void ) = 0;
  184. // Called by the engine when gathering user input
  185. virtual void HudProcessInput( bool bActive ) = 0;
  186. // Called oncer per frame to allow the hud elements to think
  187. virtual void HudUpdate( bool bActive ) = 0;
  188. // Reset the hud elements to their initial states
  189. virtual void HudReset( void ) = 0;
  190. // Display a hud text message
  191. virtual void HudText( const char * message ) = 0;
  192.  
  193. virtual bool ShouldDrawDropdownConsole ( void ) = 0;
  194.  
  195. // Mouse Input Interfaces
  196. // Activate the mouse (hides the cursor and locks it to the center of the screen)
  197. virtual void IN_ActivateMouse( void ) = 0;
  198. // Deactivates the mouse (shows the cursor and unlocks it)
  199. virtual void IN_DeactivateMouse( void ) = 0;
  200. // This is only called during extra sound updates and just accumulates mouse x, y offets and recenters the mouse.
  201. // This call is used to try to prevent the mouse from appearing out of the side of a windowed version of the engine if
  202. // rendering or other processing is taking too long
  203. virtual void IN_Accumulate (void) = 0;
  204. // Reset all key and mouse states to their initial, unpressed state
  205. virtual void IN_ClearStates (void) = 0;
  206. // If key is found by name, returns whether it's being held down in isdown, otherwise function returns false
  207. virtual bool IN_IsKeyDown( const char *name, bool& isdown ) = 0;
  208. // Raw keyboard signal, if the client .dll returns 1, the engine processes the key as usual, otherwise,
  209. // if the client .dll returns 0, the key is swallowed.
  210. virtual int IN_KeyEvent( int eventcode, ButtonCode_t keynum, const char *pszCurrentBinding ) = 0;
  211.  
  212. // This function is called once per tick to create the player CUserCmd (used for prediction/physics simulation of the player)
  213. // Because the mouse can be sampled at greater than the tick interval, there is a separate input_sample_frametime, which
  214. // specifies how much additional mouse / keyboard simulation to perform.
  215. virtual void CreateMove (
  216. int sequence_number, // sequence_number of this cmd
  217. float input_sample_frametime, // Frametime for mouse input sampling
  218. bool active ) = 0; // True if the player is active (not paused)
  219.  
  220. // If the game is running faster than the tick_interval framerate, then we do extra mouse sampling to avoid jittery input
  221. // This code path is much like the normal move creation code, except no move is created
  222. virtual void ExtraMouseSample( float frametime, bool active ) = 0;
  223.  
  224. // Encode the delta (changes) between the CUserCmd in slot from vs the one in slot to. The game code will have
  225. // matching logic to read the delta.
  226. virtual bool WriteUsercmdDeltaToBuffer( bf_write *buf, int from, int to, bool isnewcommand ) = 0;
  227. // Demos need to be able to encode/decode CUserCmds to memory buffers, so these functions wrap that
  228. virtual void EncodeUserCmdToBuffer( bf_write& buf, int slot ) = 0;
  229. virtual void DecodeUserCmdFromBuffer( bf_read& buf, int slot ) = 0;
  230.  
  231. // Set up and render one or more views (e.g., rear view window, etc.). This called into RenderView below
  232. virtual void View_Render( vrect_t *rect ) = 0;
  233.  
  234. // Allow engine to expressly render a view (e.g., during timerefresh)
  235. // See IVRenderView.h, PushViewFlags_t for nFlags values
  236. virtual void RenderView( const CViewSetup &view, int nClearFlags, int whatToDraw ) = 0;
  237.  
  238. // Apply screen fade directly from engine
  239. virtual void View_Fade( ScreenFade_t *pSF ) = 0;
  240.  
  241. // The engine has parsed a crosshair angle message, this function is called to dispatch the new crosshair angle
  242. virtual void SetCrosshairAngle( const QAngle& angle ) = 0;
  243.  
  244. // Sprite (.spr) model handling code
  245. // Load a .spr file by name
  246. virtual void InitSprite( CEngineSprite *pSprite, const char *loadname ) = 0;
  247. // Shutdown a .spr file
  248. virtual void ShutdownSprite( CEngineSprite *pSprite ) = 0;
  249. // Returns sizeof( CEngineSprite ) so the engine can allocate appropriate memory
  250. virtual int GetSpriteSize( void ) const = 0;
  251.  
  252. // Called when a player starts or stops talking.
  253. // entindex is -1 to represent the local client talking (before the data comes back from the server).
  254. // entindex is -2 to represent the local client's voice being acked by the server.
  255. // entindex is GetPlayer() when the server acknowledges that the local client is talking.
  256. virtual void VoiceStatus( int entindex, qboolean bTalking ) = 0;
  257.  
  258. // Networked string table definitions have arrived, allow client .dll to
  259. // hook string changes with a callback function ( see INetworkStringTableClient.h )
  260. virtual void InstallStringTableCallback( char const *tableName ) = 0;
  261.  
  262. // Notification that we're moving into another stage during the frame.
  263. virtual void FrameStageNotify( ClientFrameStage_t curStage ) = 0;
  264.  
  265. // The engine has received the specified user message, this code is used to dispatch the message handler
  266. virtual bool DispatchUserMessage( int msg_type, bf_read &msg_data ) = 0;
  267.  
  268. // Save/restore system hooks
  269. virtual CSaveRestoreData *SaveInit( int size ) = 0;
  270. virtual void SaveWriteFields( CSaveRestoreData *, const char *, void *, datamap_t *, typedescription_t *, int ) = 0;
  271. virtual void SaveReadFields( CSaveRestoreData *, const char *, void *, datamap_t *, typedescription_t *, int ) = 0;
  272. virtual void PreSave( CSaveRestoreData * ) = 0;
  273. virtual void Save( CSaveRestoreData * ) = 0;
  274. virtual void WriteSaveHeaders( CSaveRestoreData * ) = 0;
  275. virtual void ReadRestoreHeaders( CSaveRestoreData * ) = 0;
  276. virtual void Restore( CSaveRestoreData *, bool ) = 0;
  277. virtual void DispatchOnRestore() = 0;
  278.  
  279. // Hand over the StandardRecvProxies in the client DLL's module.
  280. virtual CStandardRecvProxies* GetStandardRecvProxies() = 0;
  281.  
  282. // save game screenshot writing
  283. virtual void WriteSaveGameScreenshot( const char *pFilename ) = 0;
  284.  
  285. // Given a list of "S(wavname) S(wavname2)" tokens, look up the localized text and emit
  286. // the appropriate close caption if running with closecaption = 1
  287. virtual void EmitSentenceCloseCaption( char const *tokenstream ) = 0;
  288. // Emits a regular close caption by token name
  289. virtual void EmitCloseCaption( char const *captionname, float duration ) = 0;
  290.  
  291. // Returns true if the client can start recording a demo now. If the client returns false,
  292. // an error message of up to length bytes should be returned in errorMsg.
  293. virtual bool CanRecordDemo( char *errorMsg, int length ) const = 0;
  294.  
  295. // Added interface
  296.  
  297. // save game screenshot writing
  298. virtual void WriteSaveGameScreenshotOfSize( const char *pFilename, int width, int height ) = 0;
  299.  
  300. // Gets the current view
  301. virtual bool GetPlayerView( CViewSetup &playerView ) = 0;
  302.  
  303. // Matchmaking
  304. virtual void SetupGameProperties( CUtlVector< XUSER_CONTEXT > &contexts, CUtlVector< XUSER_PROPERTY > &properties ) = 0;
  305. virtual uint GetPresenceID( const char *pIDName ) = 0;
  306. virtual const char *GetPropertyIdString( const uint id ) = 0;
  307. virtual void GetPropertyDisplayString( uint id, uint value, char *pOutput, int nBytes ) = 0;
  308. #ifdef _WIN32
  309. virtual void StartStatsReporting( HANDLE handle, bool bArbitrated ) = 0;
  310. #endif
  311.  
  312. virtual void InvalidateMdlCache() = 0;
  313.  
  314. virtual void IN_SetSampleTime( float frametime ) = 0;
  315.  
  316. };
Add Comment
Please, Sign In to add comment