darope@0: // vi: set ts=4 sw=4 : darope@0: // vim: set tw=75 : darope@0: darope@0: // engine_post.h - prototypes and typedefs for "post" versions of HL engine darope@0: // functions darope@0: darope@0: /* darope@0: * Copyright (c) 2001-2003 Will Day darope@0: * darope@0: * This file is part of Metamod. darope@0: * darope@0: * Metamod is free software; you can redistribute it and/or modify it darope@0: * under the terms of the GNU General Public License as published by the darope@0: * Free Software Foundation; either version 2 of the License, or (at darope@0: * your option) any later version. darope@0: * darope@0: * Metamod is distributed in the hope that it will be useful, but darope@0: * WITHOUT ANY WARRANTY; without even the implied warranty of darope@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU darope@0: * General Public License for more details. darope@0: * darope@0: * You should have received a copy of the GNU General Public License darope@0: * along with Metamod; if not, write to the Free Software Foundation, darope@0: * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA darope@0: * darope@0: * In addition, as a special exception, the author gives permission to darope@0: * link the code of this program with the Half-Life Game Engine ("HL darope@0: * Engine") and Modified Game Libraries ("MODs") developed by Valve, darope@0: * L.L.C ("Valve"). You must obey the GNU General Public License in all darope@0: * respects for all of the code used other than the HL Engine and MODs darope@0: * from Valve. If you modify this file, you may extend this exception darope@0: * to your version of the file, but you are not obligated to do so. If darope@0: * you do not wish to do so, delete this exception statement from your darope@0: * version. darope@0: * darope@0: */ darope@0: darope@0: #ifndef ENGINE_API_POST_H darope@0: #define ENGINE_API_POST_H darope@0: darope@0: extern enginefuncs_t meta_engfuncs_post; darope@0: darope@0: // from SDK engine/eiface.h: darope@0: extern int PrecacheModel_Post(char *s); darope@0: extern int PrecacheSound_Post(char *s); darope@0: extern void SetModel_Post(edict_t *e, const char *m); darope@0: extern int ModelIndex_Post(const char *m); darope@0: extern int ModelFrames_Post(int modelIndex); darope@0: darope@0: extern void SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax); darope@0: extern void ChangeLevel_Post(char *s1, char *s2); darope@0: extern void GetSpawnParms_Post(edict_t *ent); darope@0: extern void SaveSpawnParms_Post(edict_t *ent); darope@0: darope@0: extern float VecToYaw_Post(const float *rgflVector); darope@0: extern void VecToAngles_Post(const float *rgflVectorIn, float *rgflVectorOut); darope@0: extern void MoveToOrigin_Post(edict_t *ent, const float *pflGoal, float dist, int iMoveType); darope@0: extern void ChangeYaw_Post(edict_t *ent); darope@0: extern void ChangePitch_Post(edict_t *ent); darope@0: darope@0: extern edict_t *FindEntityByString_Post(edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); darope@0: extern int GetEntityIllum_Post(edict_t *pEnt); darope@0: extern edict_t *FindEntityInSphere_Post(edict_t *pEdictStartSearchAfter, const float *org, float rad); darope@0: extern edict_t *FindClientInPVS_Post(edict_t *pEdict); darope@0: extern edict_t *EntitiesInPVS_Post(edict_t *pplayer); darope@0: darope@0: extern void MakeVectors_Post(const float *rgflVector); darope@0: extern void AngleVectors_Post(const float *rgflVector, float *forward, float *right, float *up); darope@0: darope@0: extern edict_t *CreateEntity_Post(void); darope@0: extern void RemoveEntity_Post(edict_t *e); darope@0: extern edict_t *CreateNamedEntity_Post(int className); darope@0: darope@0: extern void MakeStatic_Post(edict_t *ent); darope@0: extern int EntIsOnFloor_Post(edict_t *e); darope@0: extern int DropToFloor_Post(edict_t *e); darope@0: darope@0: extern int WalkMove_Post(edict_t *ent, float yaw, float dist, int iMode); darope@0: extern void SetOrigin_Post(edict_t *e, const float *rgflOrigin); darope@0: darope@0: extern void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); darope@0: extern void EmitAmbientSound_Post(edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); darope@0: darope@0: extern void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); darope@0: extern void TraceToss_Post(edict_t *pent, edict_t *pentToIgnore, TraceResult *ptr); darope@0: extern int TraceMonsterHull_Post(edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); darope@0: extern void TraceHull_Post(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); darope@0: extern void TraceModel_Post(const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); darope@0: extern const char *TraceTexture_Post(edict_t *pTextureEntity, const float *v1, const float *v2 ); darope@0: extern void TraceSphere_Post(const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); darope@0: extern void GetAimVector_Post(edict_t *ent, float speed, float *rgflReturn); darope@0: darope@0: extern void ServerCommand_Post(char *str); darope@0: extern void ServerExecute_Post(void); darope@0: extern void ClientCommand_Post(edict_t *pEdict, char *szFmt, ...); darope@0: darope@0: extern void ParticleEffect_Post(const float *org, const float *dir, float color, float count); darope@0: extern void LightStyle_Post(int style, char *val); darope@0: extern int DecalIndex_Post(const char *name); darope@0: extern int PointContents_Post(const float *rgflVector); darope@0: darope@0: extern void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); darope@0: extern void MessageEnd_Post(void); darope@0: darope@0: extern void WriteByte_Post(int iValue); darope@0: extern void WriteChar_Post(int iValue); darope@0: extern void WriteShort_Post(int iValue); darope@0: extern void WriteLong_Post(int iValue); darope@0: extern void WriteAngle_Post(float flValue); darope@0: extern void WriteCoord_Post(float flValue); darope@0: extern void WriteString_Post(const char *sz); darope@0: extern void WriteEntity_Post(int iValue); darope@0: darope@0: extern void CVarRegister_Post(cvar_t *pCvar); darope@0: extern float CVarGetFloat_Post(const char *szVarName); darope@0: extern const char* CVarGetString_Post(const char *szVarName); darope@0: extern void CVarSetFloat_Post(const char *szVarName, float flValue); darope@0: extern void CVarSetString_Post(const char *szVarName, const char *szValue); darope@0: darope@0: extern void AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...); darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: extern void EngineFprintf_Post(FILE *pfile, char *szFmt, ...); darope@47: #else darope@47: extern void EngineFprintf_Post(void *pfile, char *szFmt, ...); darope@47: #endif darope@0: darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: extern void *PvAllocEntPrivateData_Post(edict_t *pEdict, long cb); darope@47: #else darope@47: extern void *PvAllocEntPrivateData_Post(edict_t *pEdict, int32 cb); darope@47: #endif darope@0: extern void *PvEntPrivateData_Post(edict_t *pEdict); darope@0: extern void FreeEntPrivateData_Post(edict_t *pEdict); darope@0: darope@0: extern const char *SzFromIndex_Post(int iString); darope@0: extern int AllocString_Post(const char *szValue); darope@0: darope@0: extern struct entvars_s *GetVarsOfEnt_Post(edict_t *pEdict); darope@0: extern edict_t *PEntityOfEntOffset_Post(int iEntOffset); darope@0: extern int EntOffsetOfPEntity_Post(const edict_t *pEdict); darope@0: extern int IndexOfEdict_Post(const edict_t *pEdict); darope@0: extern edict_t *PEntityOfEntIndex_Post(int iEntIndex); darope@0: extern edict_t *FindEntityByVars_Post(struct entvars_s *pvars); darope@0: extern void *GetModelPtr_Post(edict_t *pEdict); darope@0: darope@0: extern int RegUserMsg_Post(const char *pszName, int iSize); darope@0: darope@0: extern void AnimationAutomove_Post(const edict_t *pEdict, float flTime); darope@0: extern void GetBonePosition_Post(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles ); darope@0: darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: extern unsigned long FunctionFromName_Post( const char *pName ); darope@0: extern const char *NameForFunction_Post( unsigned long function ); darope@47: #else darope@47: extern uint32 FunctionFromName_Post( const char *pName ); darope@47: extern const char *NameForFunction_Post( uint32 function ); darope@47: #endif darope@0: darope@0: 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: extern void ServerPrint_Post( const char *szMsg ); darope@0: darope@0: extern const char *Cmd_Args_Post( void ); //! these 3 added darope@0: extern const char *Cmd_Argv_Post( int argc ); //! so game DLL can easily darope@0: extern int Cmd_Argc_Post( void ); //! access client 'cmd' strings darope@0: darope@0: extern void GetAttachment_Post(const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); darope@0: darope@0: extern void CRC32_Init_Post(CRC32_t *pulCRC); darope@0: extern void CRC32_ProcessBuffer_Post(CRC32_t *pulCRC, void *p, int len); darope@0: extern void CRC32_ProcessByte_Post(CRC32_t *pulCRC, unsigned char ch); darope@0: extern CRC32_t CRC32_Final_Post(CRC32_t pulCRC); darope@0: darope@47: #ifdef HLSDK_3_2_OLD_EIFACE darope@0: extern long RandomLong_Post(long lLow, long lHigh); darope@47: #else darope@47: extern int32 RandomLong_Post(int32 lLow, int32 lHigh); darope@47: #endif darope@0: extern float RandomFloat_Post(float flLow, float flHigh); darope@0: darope@0: extern void SetView_Post(const edict_t *pClient, const edict_t *pViewent ); darope@0: extern float Time_Post( void ); darope@0: extern void CrosshairAngle_Post(const edict_t *pClient, float pitch, float yaw); darope@0: darope@0: extern byte * LoadFileForMe_Post(char *filename, int *pLength); darope@0: extern void FreeFile_Post(void *buffer); darope@0: darope@0: extern void EndSection_Post(const char *pszSectionName); //! trigger_endsection darope@0: extern int CompareFileTime_Post(char *filename1, char *filename2, int *iCompare); darope@0: extern void GetGameDir_Post(char *szGetGameDir); darope@0: extern void Cvar_RegisterVariable_Post(cvar_t *variable); darope@0: extern void FadeClientVolume_Post(const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); darope@0: extern void SetClientMaxspeed_Post(const edict_t *pEdict, float fNewMaxspeed); darope@0: extern edict_t * CreateFakeClient_Post(const char *netname); //! returns NULL if fake client can't be created darope@0: 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: extern int NumberOfEntities_Post(void); darope@0: darope@0: extern char *GetInfoKeyBuffer_Post(edict_t *e); //! passing in NULL gets the serverinfo darope@0: extern char *InfoKeyValue_Post(char *infobuffer, char *key); darope@0: extern void SetKeyValue_Post(char *infobuffer, char *key, char *value); darope@0: extern void SetClientKeyValue_Post(int clientIndex, char *infobuffer, char *key, char *value); darope@0: darope@0: extern int IsMapValid_Post(char *filename); darope@0: extern void StaticDecal_Post( const float *origin, int decalIndex, int entityIndex, int modelIndex ); darope@0: extern int PrecacheGeneric_Post(char *s); darope@0: 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: 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: extern int IsDedicatedServer_Post(void);//! is this a dedicated server? darope@0: extern cvar_t *CVarGetPointer_Post(const char *szVarName); darope@0: 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: darope@0: //! YWB 8/1/99 TFF Physics additions darope@0: extern void Info_RemoveKey_Post( char *s, const char *key ); darope@0: extern const char *GetPhysicsKeyValue_Post( const edict_t *pClient, const char *key ); darope@0: extern void SetPhysicsKeyValue_Post( const edict_t *pClient, const char *key, const char *value ); darope@0: extern const char *GetPhysicsInfoString_Post( const edict_t *pClient ); darope@0: extern unsigned short PrecacheEvent_Post( int type, const char *psz ); darope@0: 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: darope@0: extern unsigned char *SetFatPVS_Post( float *org ); darope@0: extern unsigned char *SetFatPAS_Post( float *org ); darope@0: darope@0: extern int CheckVisibility_Post( const edict_t *entity, unsigned char *pset ); darope@0: darope@0: extern void DeltaSetField_Post( struct delta_s *pFields, const char *fieldname ); darope@0: extern void DeltaUnsetField_Post( struct delta_s *pFields, const char *fieldname ); darope@0: extern void DeltaAddEncoder_Post( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) ); darope@0: extern int GetCurrentPlayer_Post( void ); darope@0: extern int CanSkipPlayer_Post( const edict_t *player ); darope@0: extern int DeltaFindField_Post( struct delta_s *pFields, const char *fieldname ); darope@0: extern void DeltaSetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber ); darope@0: extern void DeltaUnsetFieldByIndex_Post( struct delta_s *pFields, int fieldNumber ); darope@0: darope@0: extern void SetGroupMask_Post( int mask, int op ); darope@0: darope@0: extern int CreateInstancedBaseline_Post( int classname, struct entity_state_s *baseline ); darope@0: extern void Cvar_DirectSet_Post( struct cvar_s *var, char *value ); darope@0: darope@0: //! Forces the client and server to be running with the same version of the specified file darope@0: //!_Post( e.g., a player model ). darope@0: //! Calling this has no effect in single player darope@0: extern void ForceUnmodified_Post( FORCE_TYPE type, float *mins, float *maxs, const char *filename ); darope@0: darope@0: extern void GetPlayerStats_Post( const edict_t *pClient, int *ping, int *packet_loss ); darope@0: darope@0: extern void AddServerCommand_Post( char *cmd_name, void (*function) (void) ); darope@0: // Added in SDK 2.2: darope@0: extern qboolean Voice_GetClientListening_Post(int iReceiver, int iSender); darope@0: extern qboolean Voice_SetClientListening_Post(int iReceiver, int iSender, qboolean bListen); darope@0: darope@0: // Added for HL 1109 (no SDK update): darope@185: extern const char *GetPlayerAuthId_Post(edict_t *e); darope@0: darope@185: // Added 2003-11-10 (no SDK update): darope@185: extern sequenceEntry_s *SequenceGet_Post(const char* fileName, const char* entryName); darope@185: extern sentenceEntry_s *SequencePickSentence_Post(const char* groupName, int pickMethod, int *picked); darope@185: extern int GetFileSize_Post(char *filename); darope@185: extern unsigned int GetApproxWavePlayLen_Post(const char *filepath); darope@185: extern int IsCareerMatch_Post(void); darope@185: extern int GetLocalizedStringLength_Post(const char *label); darope@185: extern void RegisterTutorMessageShown_Post(int mid); darope@185: extern int GetTimesTutorMessageShown_Post(int mid); darope@185: extern void ProcessTutorMessageDecayBuffer_Post(int *buffer, int bufferLength); darope@185: extern void ConstructTutorMessageDecayBuffer_Post(int *buffer, int bufferLength); darope@185: extern void ResetTutorMessageDecayData_Post(void); darope@185: darope@185: darope@185: // Added 2005-08-11 (no SDK update): darope@185: void QueryClientCvarValue_Post(const edict_t *pEdict, const char *cvar); darope@185: darope@185: // Added 2005-11-22 (no SDK update): darope@185: void QueryClientCvarValue2_Post(const edict_t *pEdict, const char *cvar, int requestID); darope@0: darope@0: #endif /* ENGINE_API_POST_H */