trace_plugin/engine_api_post.h
author darope
Wed Dec 21 18:40:50 2005 +0000 (2005-12-21)
changeset 249 0e54d20d8f28
parent 236 2c14a498e4a7
child 274 194308bba518
permissions -rw-r--r--
Merged working branch to maintrunk for release 1.18.1
darope@0
     1
// vi: set ts=4 sw=4 :
darope@0
     2
// vim: set tw=75 :
darope@0
     3
darope@0
     4
// engine_post.h - prototypes and typedefs for "post" versions of HL engine 
darope@0
     5
//                 functions
darope@0
     6
darope@0
     7
/*
darope@0
     8
 * Copyright (c) 2001-2003 Will Day <[email protected]>
darope@0
     9
 *
darope@0
    10
 *    This file is part of Metamod.
darope@0
    11
 *
darope@0
    12
 *    Metamod is free software; you can redistribute it and/or modify it
darope@0
    13
 *    under the terms of the GNU General Public License as published by the
darope@0
    14
 *    Free Software Foundation; either version 2 of the License, or (at
darope@0
    15
 *    your option) any later version.
darope@0
    16
 *
darope@0
    17
 *    Metamod is distributed in the hope that it will be useful, but
darope@0
    18
 *    WITHOUT ANY WARRANTY; without even the implied warranty of
darope@0
    19
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
darope@0
    20
 *    General Public License for more details.
darope@0
    21
 *
darope@0
    22
 *    You should have received a copy of the GNU General Public License
darope@0
    23
 *    along with Metamod; if not, write to the Free Software Foundation,
darope@0
    24
 *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
darope@0
    25
 *
darope@0
    26
 *    In addition, as a special exception, the author gives permission to
darope@0
    27
 *    link the code of this program with the Half-Life Game Engine ("HL
darope@0
    28
 *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
darope@0
    29
 *    L.L.C ("Valve").  You must obey the GNU General Public License in all
darope@0
    30
 *    respects for all of the code used other than the HL Engine and MODs
darope@0
    31
 *    from Valve.  If you modify this file, you may extend this exception
darope@0
    32
 *    to your version of the file, but you are not obligated to do so.  If
darope@0
    33
 *    you do not wish to do so, delete this exception statement from your
darope@0
    34
 *    version.
darope@0
    35
 *
darope@0
    36
 */
darope@0
    37
darope@0
    38
#ifndef ENGINE_API_POST_H
darope@0
    39
#define ENGINE_API_POST_H
darope@0
    40
darope@0
    41
extern enginefuncs_t meta_engfuncs_post;
darope@0
    42
darope@0
    43
// from SDK engine/eiface.h:
darope@0
    44
extern int PrecacheModel_Post(char *s);
darope@0
    45
extern int PrecacheSound_Post(char *s);
darope@0
    46
extern void SetModel_Post(edict_t *e, const char *m);
darope@0
    47
extern int ModelIndex_Post(const char *m);
darope@0
    48
extern int ModelFrames_Post(int modelIndex);
darope@0
    49
darope@0
    50
extern void SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax);
darope@0
    51
extern void ChangeLevel_Post(char *s1, char *s2);
darope@0
    52
extern void GetSpawnParms_Post(edict_t *ent);
darope@0
    53
extern void SaveSpawnParms_Post(edict_t *ent);
darope@0
    54
darope@0
    55
extern float VecToYaw_Post(const float *rgflVector);
darope@0
    56
extern void VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut);
darope@0
    57
extern void MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType);
darope@0
    58
extern void ChangeYaw_Post(edict_t *ent);
darope@0
    59
extern void ChangePitch_Post(edict_t *ent);
darope@0
    60
darope@0
    61
extern edict_t *FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
darope@0
    62
extern int GetEntityIllum_Post(edict_t *pEnt);
darope@0
    63
extern edict_t *FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad);
darope@0
    64
extern edict_t *FindClientInPVS_Post(edict_t *pEdict);
darope@0
    65
extern edict_t *EntitiesInPVS_Post(edict_t *pplayer);
darope@0
    66
darope@0
    67
extern void MakeVectors_Post(const float *rgflVector);
darope@0
    68
extern void AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up);
darope@0
    69
darope@0
    70
extern edict_t *CreateEntity_Post(void);
darope@0
    71
extern void RemoveEntity_Post(edict_t *e);
darope@0
    72
extern edict_t *CreateNamedEntity_Post(int className);
darope@0
    73
darope@0
    74
extern void MakeStatic_Post(edict_t *ent);
darope@0
    75
extern int EntIsOnFloor_Post(edict_t *e);
darope@0
    76
extern int DropToFloor_Post(edict_t *e);
darope@0
    77
darope@0
    78
extern int WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode);
darope@0
    79
extern void SetOrigin_Post(edict_t *e, const float *rgflOrigin);
darope@0
    80
darope@0
    81
extern void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
darope@0
    82
extern void EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
darope@0
    83
darope@0
    84
extern void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
darope@0
    85
extern void TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr);
darope@0
    86
extern int TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
darope@0
    87
extern void TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
darope@0
    88
extern void TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
darope@0
    89
extern const char *TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 );
darope@0
    90
extern void TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
darope@0
    91
extern void GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn);
darope@0
    92
darope@0
    93
extern void ServerCommand_Post(char *str);
darope@0
    94
extern void ServerExecute_Post(void);
darope@0
    95
extern void ClientCommand_Post(edict_t *pEdict, char *szFmt, ...);
darope@0
    96
darope@0
    97
extern void ParticleEffect_Post(const float *org, const float *dir, float color, float count);
darope@0
    98
extern void LightStyle_Post(int style, char *val);
darope@0
    99
extern int DecalIndex_Post(const char *name);
darope@0
   100
extern int PointContents_Post(const float *rgflVector);
darope@0
   101
darope@0
   102
extern void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
darope@0
   103
extern void MessageEnd_Post(void);
darope@0
   104
darope@0
   105
extern void WriteByte_Post(int iValue);
darope@0
   106
extern void WriteChar_Post(int iValue);
darope@0
   107
extern void WriteShort_Post(int iValue);
darope@0
   108
extern void WriteLong_Post(int iValue);
darope@0
   109
extern void WriteAngle_Post(float flValue);
darope@0
   110
extern void WriteCoord_Post(float flValue);
darope@0
   111
extern void WriteString_Post(const char *sz);
darope@0
   112
extern void WriteEntity_Post(int iValue);
darope@0
   113
darope@0
   114
extern void CVarRegister_Post(cvar_t *pCvar);
darope@0
   115
extern float CVarGetFloat_Post(const char *szVarName);
darope@0
   116
extern const char* CVarGetString_Post(const char *szVarName);
darope@0
   117
extern void CVarSetFloat_Post(const char *szVarName, float flValue);
darope@0
   118
extern void CVarSetString_Post(const char *szVarName, const char *szValue);
darope@0
   119
darope@0
   120
extern void AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...);
darope@236
   121
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   122
extern void EngineFprintf_Post(FILE *pfile, char *szFmt, ...);
darope@236
   123
#else
darope@236
   124
extern void EngineFprintf_Post(void *pfile, char *szFmt, ...);
darope@236
   125
#endif
darope@0
   126
darope@236
   127
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   128
extern void *PvAllocEntPrivateData_Post(edict_t *pEdict, long cb);
darope@236
   129
#else
darope@236
   130
extern void *PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb);
darope@236
   131
#endif
darope@0
   132
extern void *PvEntPrivateData_Post(edict_t *pEdict);
darope@0
   133
extern void FreeEntPrivateData_Post(edict_t *pEdict);
darope@0
   134
darope@0
   135
extern const char *SzFromIndex_Post(int iString);
darope@0
   136
extern int AllocString_Post(const char *szValue);
darope@0
   137
darope@0
   138
extern struct entvars_s *GetVarsOfEnt_Post(edict_t *pEdict);
darope@0
   139
extern edict_t *PEntityOfEntOffset_Post(int iEntOffset);
darope@0
   140
extern int EntOffsetOfPEntity_Post(const edict_t *pEdict);
darope@0
   141
extern int IndexOfEdict_Post(const edict_t *pEdict);
darope@0
   142
extern edict_t *PEntityOfEntIndex_Post(int iEntIndex);
darope@0
   143
extern edict_t *FindEntityByVars_Post(struct entvars_s *pvars);
darope@0
   144
extern void *GetModelPtr_Post(edict_t *pEdict);
darope@0
   145
darope@0
   146
extern int RegUserMsg_Post(const char *pszName, int iSize);
darope@0
   147
darope@0
   148
extern void AnimationAutomove_Post(const edict_t *pEdict, float flTime);
darope@0
   149
extern void GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles );
darope@0
   150
darope@236
   151
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   152
extern unsigned long FunctionFromName_Post( const char *pName );
darope@0
   153
extern const char *NameForFunction_Post( unsigned long function );
darope@236
   154
#else
darope@236
   155
extern uint32 FunctionFromName_Post( const char *pName );
darope@236
   156
extern const char *NameForFunction_Post( uint32 function );
darope@236
   157
#endif
darope@0
   158
darope@0
   159
extern void ClientPrintf_Post( edict_t *pEdict, PRINT_TYPE ptype, const char *szMsg ); //! JOHN: engine callbacks so game DLL can print messages to individual clients
darope@0
   160
extern void ServerPrint_Post( const char *szMsg );
darope@0
   161
darope@0
   162
extern const char *Cmd_Args_Post( void ); //! these 3 added 
darope@0
   163
extern const char *Cmd_Argv_Post( int argc ); //! so game DLL can easily 
darope@0
   164
extern int Cmd_Argc_Post( void ); //! access client 'cmd' strings
darope@0
   165
darope@0
   166
extern void GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles );
darope@0
   167
darope@0
   168
extern void CRC32_Init_Post(CRC32_t *pulCRC);
darope@0
   169
extern void CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len);
darope@0
   170
extern void CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch);
darope@0
   171
extern CRC32_t CRC32_Final_Post(CRC32_t pulCRC);
darope@0
   172
darope@236
   173
#ifdef HLSDK_3_2_OLD_EIFACE
darope@0
   174
extern long RandomLong_Post(long lLow, long lHigh);
darope@236
   175
#else
darope@236
   176
extern int32 RandomLong_Post(int32 lLow, int32 lHigh);
darope@236
   177
#endif
darope@0
   178
extern float RandomFloat_Post(float flLow, float flHigh);
darope@0
   179
darope@0
   180
extern void SetView_Post(const edict_t *pClient, const edict_t *pViewent );
darope@0
   181
extern float Time_Post( void );
darope@0
   182
extern void CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw);
darope@0
   183
darope@0
   184
extern byte * LoadFileForMe_Post(char *filename, int *pLength);
darope@0
   185
extern void FreeFile_Post(void *buffer);
darope@0
   186
darope@0
   187
extern void EndSection_Post(const char *pszSectionName); //! trigger_endsection
darope@0
   188
extern int CompareFileTime_Post(char *filename1, char *filename2, int *iCompare);
darope@0
   189
extern void GetGameDir_Post(char *szGetGameDir);
darope@0
   190
extern void Cvar_RegisterVariable_Post(cvar_t *variable);
darope@0
   191
extern void FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);
darope@0
   192
extern void SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed);
darope@0
   193
extern edict_t * CreateFakeClient_Post(const char *netname); //! returns NULL if fake client can't be created
darope@0
   194
extern void RunPlayerMove_Post(edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
darope@0
   195
extern int NumberOfEntities_Post(void);
darope@0
   196
darope@0
   197
extern char *GetInfoKeyBuffer_Post(edict_t *e); //! passing in NULL gets the serverinfo
darope@0
   198
extern char *InfoKeyValue_Post(char *infobuffer, char *key);
darope@0
   199
extern void SetKeyValue_Post(char *infobuffer, char *key, char *value);
darope@0
   200
extern void SetClientKeyValue_Post(int clientIndex, char *infobuffer, char *key, char *value);
darope@0
   201
darope@0
   202
extern int IsMapValid_Post(char *filename);
darope@0
   203
extern void StaticDecal_Post( const float *origin, int decalIndex, int entityIndex, int modelIndex );
darope@0
   204
extern int PrecacheGeneric_Post(char *s);
darope@0
   205
extern int GetPlayerUserId_Post(edict_t *e ); //! returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
darope@0
   206
extern void BuildSoundMsg_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
darope@0
   207
extern int IsDedicatedServer_Post(void);//! is this a dedicated server?
darope@0
   208
extern cvar_t *CVarGetPointer_Post(const char *szVarName);
darope@0
   209
extern unsigned int GetPlayerWONId_Post(edict_t *e); //! returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
darope@0
   210
darope@0
   211
//! YWB 8/1/99 TFF Physics additions
darope@0
   212
extern void Info_RemoveKey_Post( char *s, const char *key );
darope@0
   213
extern const char *GetPhysicsKeyValue_Post( const edict_t *pClient, const char *key );
darope@0
   214
extern void SetPhysicsKeyValue_Post( const edict_t *pClient, const char *key, const char *value );
darope@0
   215
extern const char *GetPhysicsInfoString_Post( const edict_t *pClient );
darope@0
   216
extern unsigned short PrecacheEvent_Post( int type, const char *psz );
darope@0
   217
extern void PlaybackEvent_Post( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
darope@0
   218
darope@0
   219
extern unsigned char *SetFatPVS_Post( float *org );
darope@0
   220
extern unsigned char *SetFatPAS_Post( float *org );
darope@0
   221
darope@0
   222
extern int CheckVisibility_Post( const edict_t *entity, unsigned char *pset );
darope@0
   223
darope@0
   224
extern void DeltaSetField_Post( struct delta_s *pFields, const char *fieldname );
darope@0
   225
extern void DeltaUnsetField_Post( struct delta_s *pFields, const char *fieldname );
darope@0
   226
extern void DeltaAddEncoder_Post( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) );
darope@0
   227
extern int GetCurrentPlayer_Post( void );
darope@0
   228
extern int CanSkipPlayer_Post( const edict_t *player );
darope@0
   229
extern int DeltaFindField_Post( struct delta_s *pFields, const char *fieldname );
darope@0
   230
extern void DeltaSetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber );
darope@0
   231
extern void DeltaUnsetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber );
darope@0
   232
darope@0
   233
extern void SetGroupMask_Post( int mask, int op );
darope@0
   234
darope@0
   235
extern int CreateInstancedBaseline_Post( int classname, struct entity_state_s *baseline );
darope@0
   236
extern void Cvar_DirectSet_Post( struct cvar_s *var, char *value );
darope@0
   237
darope@0
   238
//! Forces the client and server to be running with the same version of the specified file
darope@0
   239
//!_Post( e.g., a player model ).
darope@0
   240
//! Calling this has no effect in single player
darope@0
   241
extern void ForceUnmodified_Post( FORCE_TYPE type, float *mins, float *maxs, const char *filename );
darope@0
   242
darope@0
   243
extern void GetPlayerStats_Post( const edict_t *pClient, int *ping, int *packet_loss );
darope@0
   244
darope@0
   245
extern void AddServerCommand_Post( char *cmd_name, void (*function) (void) );
darope@0
   246
// Added in SDK 2.2:
darope@0
   247
extern qboolean Voice_GetClientListening_Post(int iReceiver, int iSender);
darope@0
   248
extern qboolean Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen);
darope@0
   249
darope@0
   250
// Added for HL 1109 (no SDK update):
darope@249
   251
extern const char *GetPlayerAuthId_Post(edict_t *e);
darope@0
   252
darope@249
   253
// Added 2003-11-10 (no SDK update):
darope@249
   254
extern sequenceEntry_s *SequenceGet_Post(const char* fileName, const char* entryName);
darope@249
   255
extern sentenceEntry_s *SequencePickSentence_Post(const char* groupName, int pickMethod, int *picked);
darope@249
   256
extern int GetFileSize_Post(char *filename);
darope@249
   257
extern unsigned int GetApproxWavePlayLen_Post(const char *filepath);
darope@249
   258
extern int IsCareerMatch_Post(void);
darope@249
   259
extern int GetLocalizedStringLength_Post(const char *label);
darope@249
   260
extern void RegisterTutorMessageShown_Post(int mid);
darope@249
   261
extern int GetTimesTutorMessageShown_Post(int mid);
darope@249
   262
extern void ProcessTutorMessageDecayBuffer_Post(int *buffer, int bufferLength);
darope@249
   263
extern void ConstructTutorMessageDecayBuffer_Post(int *buffer, int bufferLength);
darope@249
   264
extern void ResetTutorMessageDecayData_Post(void);
darope@249
   265
darope@249
   266
darope@249
   267
// Added 2005-08-11 (no SDK update):
darope@249
   268
void QueryClientCvarValue_Post(const edict_t *pEdict, const char *cvar);
darope@249
   269
darope@249
   270
// Added 2005-11-22 (no SDK update):
darope@249
   271
void QueryClientCvarValue2_Post(const edict_t *pEdict, const char *cvar, int requestID);
darope@0
   272
darope@0
   273
#endif /* ENGINE_API_POST_H */