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