Browse Source

Revert 64257ef to not break C++ header compability

pull/2/head
Alibek Omarov 6 years ago
parent
commit
7601a4cd29
  1. 14
      common/net_api.h
  2. 1
      common/port.h
  3. 30
      engine/cdll_exp.h
  4. 1
      engine/cdll_int.h
  5. 11
      engine/client/client.h
  6. 5
      engine/common/common.h
  7. 39
      engine/eiface.h
  8. 2
      engine/menu_int.h

14
common/net_api.h

@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
// kill the request hook after receiving the first response
#define FNETAPI_MULTIPLE_RESPONSE ( 1<<0 )
typedef void (*net_api_response_func_t) ( struct net_response_s *response );
#define NET_SUCCESS ( 0 )
#define NET_ERROR_TIMEOUT ( 1<<0 )
#define NET_ERROR_PROTO_UNSUPPORTED ( 1<<1 )
@ -58,8 +60,6 @@ typedef struct net_response_s @@ -58,8 +60,6 @@ typedef struct net_response_s
void *response;
} net_response_t;
typedef void (*net_api_response_func_t) ( net_response_t *response );
typedef struct net_status_s
{
// Connected to remote server? 1 == yes, 0 otherwise
@ -83,15 +83,15 @@ typedef struct net_api_s @@ -83,15 +83,15 @@ typedef struct net_api_s
// APIs
void (*InitNetworking)( void );
void (*Status )( struct net_status_s *status );
void (*SendRequest)( int context, int request, int flags, double timeout, netadr_t *remote_address, net_api_response_func_t response );
void (*SendRequest)( int context, int request, int flags, double timeout, struct netadr_s *remote_address, net_api_response_func_t response );
void (*CancelRequest)( int context );
void (*CancelAllRequests)( void );
char *(*AdrToString)( netadr_t *a );
int ( *CompareAdr)( netadr_t *a, netadr_t *b );
int ( *StringToAdr)( char *s, netadr_t *a );
char *(*AdrToString)( struct netadr_s *a );
int ( *CompareAdr)( struct netadr_s *a, struct netadr_s *b );
int ( *StringToAdr)( char *s, struct netadr_s *a );
const char *(*ValueForKey)( const char *s, const char *key );
void (*RemoveKey)( char *s, const char *key );
void (*SetValueForKey)( char *s, const char *key, const char *value, int maxsize );
} net_api_t;
#endif//NET_APIH
#endif//NET_APIH

1
common/port.h

@ -76,6 +76,7 @@ GNU General Public License for more details. @@ -76,6 +76,7 @@ GNU General Public License for more details.
// Windows-specific
#define __cdecl
#define __stdcall
#define _inline static inline
#define O_BINARY 0 // O_BINARY is Windows extension
#define O_TEXT 0 // O_TEXT is Windows extension

30
engine/cdll_exp.h

@ -15,18 +15,6 @@ GNU General Public License for more details. @@ -15,18 +15,6 @@ GNU General Public License for more details.
#ifndef CDLL_EXP_H
#define CDLL_EXP_H
typedef struct r_studio_interface_s r_studio_interface_t;
typedef struct engine_studio_api_s engine_studio_api_t;
typedef struct mstudioevent_s mstudioevent_t;
typedef struct local_state_s local_state_t;
typedef struct playermove_s playermove_t;
typedef struct tempent_s tempent_t;
typedef struct physent_s physent_t;
typedef struct pmtrace_s pmtrace_t;
typedef struct usercmd_s usercmd_t;
typedef struct netadr_s netadr_t;
// NOTE: ordering is important!
typedef struct cldll_func_s
{
@ -36,15 +24,15 @@ typedef struct cldll_func_s @@ -36,15 +24,15 @@ typedef struct cldll_func_s
int (*pfnRedraw)( float flTime, int intermission );
int (*pfnUpdateClientData)( client_data_t *cdata, float flTime );
void (*pfnReset)( void );
void (*pfnPlayerMove)( playermove_t *ppmove, int server );
void (*pfnPlayerMoveInit)( playermove_t *ppmove );
void (*pfnPlayerMove)( struct playermove_s *ppmove, int server );
void (*pfnPlayerMoveInit)( struct playermove_s *ppmove );
char (*pfnPlayerMoveTexture)( char *name );
void (*IN_ActivateMouse)( void );
void (*IN_DeactivateMouse)( void );
void (*IN_MouseEvent)( int mstate );
void (*IN_ClearStates)( void );
void (*IN_Accumulate)( void );
void (*CL_CreateMove)( float frametime, usercmd_t *cmd, int active );
void (*CL_CreateMove)( float frametime, struct usercmd_s *cmd, int active );
int (*CL_IsThirdPerson)( void );
void (*CL_CameraOffset)( float *ofs ); // unused
void *(*KB_Find)( const char *name );
@ -54,26 +42,26 @@ typedef struct cldll_func_s @@ -54,26 +42,26 @@ typedef struct cldll_func_s
void (*pfnCreateEntities)( void );
void (*pfnDrawNormalTriangles)( void );
void (*pfnDrawTransparentTriangles)( void );
void (*pfnStudioEvent)( const mstudioevent_t *event, const cl_entity_t *entity );
void (*pfnPostRunCmd)( local_state_t *from, local_state_t *to, usercmd_t *cmd, int runfuncs, double time, unsigned int random_seed );
void (*pfnStudioEvent)( const struct mstudioevent_s *event, const cl_entity_t *entity );
void (*pfnPostRunCmd)( struct local_state_s *from, struct local_state_s *to, usercmd_t *cmd, int runfuncs, double time, unsigned int random_seed );
void (*pfnShutdown)( void );
void (*pfnTxferLocalOverrides)( entity_state_t *state, const clientdata_t *client );
void (*pfnProcessPlayerState)( entity_state_t *dst, const entity_state_t *src );
void (*pfnTxferPredictionData)( entity_state_t *ps, const entity_state_t *pps, clientdata_t *pcd, const clientdata_t *ppcd, weapon_data_t *wd, const weapon_data_t *pwd );
void (*pfnDemo_ReadBuffer)( int size, byte *buffer );
int (*pfnConnectionlessPacket)( const netadr_t *net_from, const char *args, char *buffer, int *size );
int (*pfnConnectionlessPacket)( const struct netadr_s *net_from, const char *args, char *buffer, int *size );
int (*pfnGetHullBounds)( int hullnumber, float *mins, float *maxs );
void (*pfnFrame)( double time );
int (*pfnKey_Event)( int eventcode, int keynum, const char *pszCurrentBinding );
void (*pfnTempEntUpdate)( double frametime, double client_time, double cl_gravity, tempent_t **ppTempEntFree, tempent_t **ppTempEntActive, int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( *Callback_TempEntPlaySound )( tempent_t *pTemp, float damp ));
void (*pfnTempEntUpdate)( double frametime, double client_time, double cl_gravity, struct tempent_s **ppTempEntFree, struct tempent_s **ppTempEntActive, int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( *Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ));
cl_entity_t *(*pfnGetUserEntity)( int index );
void (*pfnVoiceStatus)( int entindex, qboolean bTalking );
void (*pfnDirectorMessage)( int iSize, void *pbuf );
int (*pfnGetStudioModelInterface)( int version, r_studio_interface_t **ppinterface, engine_studio_api_t *pstudio );
int (*pfnGetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio );
void (*pfnChatInputPosition)( int *x, int *y );
// Xash3D extension
int (*pfnGetRenderInterface)( int version, render_api_t *renderfuncs, render_interface_t *callback );
void (*pfnClipMoveToEntity)( physent_t *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, pmtrace_t *tr );
void (*pfnClipMoveToEntity)( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
// Xash3D FWGS extension
int (*pfnTouchEvent)( int type, int fingerID, float x, float y, float dx, float dy );
void (*pfnMoveEvent)( float forwardmove, float sidemove );

1
engine/cdll_int.h

@ -212,6 +212,7 @@ typedef struct cl_enginefuncs_s @@ -212,6 +212,7 @@ typedef struct cl_enginefuncs_s
float (*pfnRandomFloat)( float flLow, float flHigh );
int (*pfnRandomLong)( int lLow, int lHigh );
void (*pfnHookEvent)( const char *name, void ( *pfnEvent )( struct event_args_s *args ));
int (*Con_IsVisible) ();
const char *(*pfnGetGameDirectory)( void );
struct cvar_s *(*pfnGetCvarPointer)( const char *szName );

11
engine/client/client.h

@ -954,13 +954,11 @@ void CL_InitStudioAPI( void ); @@ -954,13 +954,11 @@ void CL_InitStudioAPI( void );
//
// cl_frame.c
//
typedef struct channel_s channel_t;
typedef struct rawchan_s rawchan_t;
int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta );
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType );
void CL_ResetLatchedVars( cl_entity_t *ent, qboolean full_reset );
qboolean CL_GetEntitySpatialization( channel_t *ch );
qboolean CL_GetMovieSpatialization( rawchan_t *ch );
qboolean CL_GetEntitySpatialization( struct channel_s *ch );
qboolean CL_GetMovieSpatialization( struct rawchan_s *ch );
void CL_ComputePlayerOrigin( cl_entity_t *clent );
void CL_ProcessPacket( frame_t *frame );
void CL_MoveThirdpersonCamera( void );
@ -981,7 +979,6 @@ void CL_ClearAllRemaps( void ); @@ -981,7 +979,6 @@ void CL_ClearAllRemaps( void );
//
// cl_tent.c
//
typedef struct particle_s particle_t;
int CL_AddEntity( int entityType, cl_entity_t *pEnt );
void CL_WeaponAnim( int iAnim, int body );
void CL_ClearEffects( void );
@ -991,7 +988,7 @@ void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, f @@ -991,7 +988,7 @@ void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, f
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale );
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags );
void CL_PlayerDecal( int playerIndex, int textureIndex, int entityIndex, float *pos );
void R_FreeDeadParticles( particle_t **ppparticles );
void R_FreeDeadParticles( struct particle_s **ppparticles );
void CL_AddClientResource( const char *filename, int type );
void CL_AddClientResources( void );
int CL_FxBlend( cl_entity_t *e );
@ -1114,6 +1111,4 @@ void SCR_RunCinematic( void ); @@ -1114,6 +1111,4 @@ void SCR_RunCinematic( void );
void SCR_StopCinematic( void );
void CL_PlayVideo_f( void );
extern rgba_t g_color_table[8];
#endif//CLIENT_H

5
engine/common/common.h

@ -981,7 +981,6 @@ void Key_EnableTextInput( qboolean enable, qboolean force ); @@ -981,7 +981,6 @@ void Key_EnableTextInput( qboolean enable, qboolean force );
// shared calls
typedef struct sv_client_s sv_client_t;
typedef struct sizebuf_s sizebuf_t;
typedef struct physent_s physent_t;
qboolean CL_IsInGame( void );
qboolean CL_IsInMenu( void );
qboolean CL_IsInConsole( void );
@ -1036,8 +1035,8 @@ qboolean SV_Initialized( void ); @@ -1036,8 +1035,8 @@ qboolean SV_Initialized( void );
qboolean CL_LoadProgs( const char *name );
int SV_GetSaveComment( const char *savename, char *comment );
qboolean SV_NewGame( const char *mapName, qboolean loadGame );
void SV_ClipPMoveToEntity( physent_t *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void CL_ClipPMoveToEntity( physent_t *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void SV_ClipPMoveToEntity( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void CL_ClipPMoveToEntity( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void CL_Particle( const vec3_t origin, int color, float life, int zpos, int zvel ); // debug thing
void SV_SysError( const char *error_string );
void SV_ShutdownGame( void );

39
engine/eiface.h

@ -234,14 +234,14 @@ typedef struct enginefuncs_s @@ -234,14 +234,14 @@ typedef struct enginefuncs_s
int (*pfnCheckVisibility )( const edict_t *entity, unsigned char *pset );
void (*pfnDeltaSetField) ( delta_t *pFields, const char *fieldname );
void (*pfnDeltaUnsetField)( delta_t *pFields, const char *fieldname );
void (*pfnDeltaAddEncoder)( char *name, void (*conditionalencode)( delta_t *pFields, const unsigned char *from, const unsigned char *to ) );
void (*pfnDeltaSetField) ( struct delta_s *pFields, const char *fieldname );
void (*pfnDeltaUnsetField)( struct delta_s *pFields, const char *fieldname );
void (*pfnDeltaAddEncoder)( char *name, void (*conditionalencode)( struct delta_s *pFields, const unsigned char *from, const unsigned char *to ) );
int (*pfnGetCurrentPlayer)( void );
int (*pfnCanSkipPlayer)( const edict_t *player );
int (*pfnDeltaFindField)( delta_t *pFields, const char *fieldname );
void (*pfnDeltaSetFieldByIndex)( delta_t *pFields, int fieldNumber );
void (*pfnDeltaUnsetFieldByIndex)( delta_t *pFields, int fieldNumber );
int (*pfnDeltaFindField)( struct delta_s *pFields, const char *fieldname );
void (*pfnDeltaSetFieldByIndex)( struct delta_s *pFields, int fieldNumber );
void (*pfnDeltaUnsetFieldByIndex)( struct delta_s *pFields, int fieldNumber );
void (*pfnSetGroupMask)( int mask, int op );
int (*pfnCreateInstancedBaseline)( int classname, struct entity_state_s *baseline );
void (*pfnCvar_DirectSet)( struct cvar_s *var, const char *value );
@ -393,13 +393,6 @@ typedef struct @@ -393,13 +393,6 @@ typedef struct
#undef ARRAYSIZE
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
typedef struct playermove_s playermove_t;
typedef struct clientdata_s clientdata_t;
typedef struct entity_state_s entity_state_t;
typedef struct weapon_data_s weapon_data_t;
typedef struct netadr_t netadr_s;
typedef struct usercmd_s usercmd_t;
typedef struct
{
// Initialize/shutdown the game (one-time call after loading of game .dll )
@ -450,22 +443,22 @@ typedef struct @@ -450,22 +443,22 @@ typedef struct
// Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint.
void (*pfnSys_Error)( const char *error_string );
void (*pfnPM_Move)( playermove_t *ppmove, qboolean server );
void (*pfnPM_Init)( playermove_t *ppmove );
void (*pfnPM_Move)( struct playermove_s *ppmove, qboolean server );
void (*pfnPM_Init)( struct playermove_s *ppmove );
char (*pfnPM_FindTextureType)( char *name );
void (*pfnSetupVisibility)( edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas );
void (*pfnUpdateClientData) ( const edict_t *ent, int sendweapons, clientdata_t *cd );
int (*pfnAddToFullPack)( entity_state_t *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet );
void (*pfnCreateBaseline)( int player, int eindex, entity_state_t *baseline, edict_t *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs );
void (*pfnSetupVisibility)( struct edict_s *pViewEntity, struct edict_s *pClient, unsigned char **pvs, unsigned char **pas );
void (*pfnUpdateClientData) ( const struct edict_s *ent, int sendweapons, struct clientdata_s *cd );
int (*pfnAddToFullPack)( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet );
void (*pfnCreateBaseline)( int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs );
void (*pfnRegisterEncoders)( void );
int (*pfnGetWeaponData)( edict_t *player, weapon_data_t *info );
int (*pfnGetWeaponData)( struct edict_s *player, struct weapon_data_s *info );
void (*pfnCmdStart)( const edict_t *player, const usercmd_t *cmd, unsigned int random_seed );
void (*pfnCmdStart)( const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed );
void (*pfnCmdEnd)( const edict_t *player );
// Return 1 if the packet is valid. Set response_buffer_size if you want to send a response packet. Incoming, it holds the max
// size of the response_buffer, so you must zero it out if you choose not to respond.
int (*pfnConnectionlessPacket )( const netadr_t *net_from, const char *args, char *response_buffer, int *response_buffer_size );
int (*pfnConnectionlessPacket )( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size );
// Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise
int (*pfnGetHullBounds) ( int hullnumber, float *mins, float *maxs );
@ -475,7 +468,7 @@ typedef struct @@ -475,7 +468,7 @@ typedef struct
// One of the pfnForceUnmodified files failed the consistency check for the specified player
// Return 0 to allow the client to continue, 1 to force immediate disconnection ( with an optional disconnect message of up to 256 characters )
int (*pfnInconsistentFile)( const edict_t *player, const char *filename, char *disconnect_message );
int (*pfnInconsistentFile)( const struct edict_s *player, const char *filename, char *disconnect_message );
// The game .dll should return 1 if lag compensation should be allowed ( could also just set
// the sv_unlag cvar.

2
engine/menu_int.h

@ -47,8 +47,6 @@ typedef struct ui_globalvars_s @@ -47,8 +47,6 @@ typedef struct ui_globalvars_s
char maptitle[64]; // title of active map
} ui_globalvars_t;
typedef struct ref_viewpass_s ref_viewpass_t;
typedef struct ui_enginefuncs_s
{
// image handlers

Loading…
Cancel
Save