Browse Source

Avoid some struct declarations inside paramater list, it makes even GCC7 confusing

pull/2/head
Alibek Omarov 7 years ago
parent
commit
36f756feeb
  1. 37
      engine/common/net_encode.h

37
engine/common/net_encode.h

@ -26,6 +26,7 @@ GNU General Public License for more details.
#define DT_STRING BIT( 7 ) // A null terminated string, sent as 8 byte chars #define DT_STRING BIT( 7 ) // A null terminated string, sent as 8 byte chars
#define DT_SIGNED BIT( 8 ) // sign modificator #define DT_SIGNED BIT( 8 ) // sign modificator
#undef offsetof
#define offsetof( s, m ) (size_t)&(((s *)0)->m) #define offsetof( s, m ) (size_t)&(((s *)0)->m)
#define NUM_FIELDS( x ) ((sizeof( x ) / sizeof( x[0] )) - 1) #define NUM_FIELDS( x ) ((sizeof( x ) / sizeof( x[0] )) - 1)
@ -95,8 +96,8 @@ void Delta_AddEncoder( char *name, pfnDeltaEncode encodeFunc );
int Delta_FindField( delta_t *pFields, const char *fieldname ); int Delta_FindField( delta_t *pFields, const char *fieldname );
void Delta_SetField( delta_t *pFields, const char *fieldname ); void Delta_SetField( delta_t *pFields, const char *fieldname );
void Delta_UnsetField( delta_t *pFields, const char *fieldname ); void Delta_UnsetField( delta_t *pFields, const char *fieldname );
void Delta_SetFieldByIndex( struct delta_s *pFields, int fieldNumber ); void Delta_SetFieldByIndex( delta_t *pFields, int fieldNumber );
void Delta_UnsetFieldByIndex( struct delta_s *pFields, int fieldNumber ); void Delta_UnsetFieldByIndex( delta_t *pFields, int fieldNumber );
// send table over network // send table over network
void Delta_WriteTableField( sizebuf_t *msg, int tableIndex, const delta_t *pField ); void Delta_WriteTableField( sizebuf_t *msg, int tableIndex, const delta_t *pField );
@ -104,18 +105,24 @@ void Delta_ParseTableField( sizebuf_t *msg );
// encode routines // encode routines
void MSG_WriteDeltaUsercmd( sizebuf_t *msg, struct usercmd_s *from, struct usercmd_s *to ); typedef struct entity_state_s entity_state_t;
void MSG_ReadDeltaUsercmd( sizebuf_t *msg, struct usercmd_s *from, struct usercmd_s *to ); typedef struct usercmd_s usercmd_t;
void MSG_WriteDeltaEvent( sizebuf_t *msg, struct event_args_s *from, struct event_args_s *to ); typedef struct event_args_s event_args_t;
void MSG_ReadDeltaEvent( sizebuf_t *msg, struct event_args_s *from, struct event_args_s *to ); typedef struct movevars_s movevars_t;
qboolean MSG_WriteDeltaMovevars( sizebuf_t *msg, struct movevars_s *from, struct movevars_s *to ); typedef struct clientdata_s clientdata_t;
void MSG_ReadDeltaMovevars( sizebuf_t *msg, struct movevars_s *from, struct movevars_s *to ); typedef struct weapon_data_s weapon_data_t;
void MSG_WriteClientData( sizebuf_t *msg, struct clientdata_s *from, struct clientdata_s *to, float timebase ); void MSG_WriteDeltaUsercmd( sizebuf_t *msg, usercmd_t *from, usercmd_t *to );
void MSG_ReadClientData( sizebuf_t *msg, struct clientdata_s *from, struct clientdata_s *to, float timebase ); void MSG_ReadDeltaUsercmd( sizebuf_t *msg, usercmd_t *from, usercmd_t *to );
void MSG_WriteWeaponData( sizebuf_t *msg, struct weapon_data_s *from, struct weapon_data_s *to, float timebase, int index ); void MSG_WriteDeltaEvent( sizebuf_t *msg, event_args_t *from, event_args_t *to );
void MSG_ReadWeaponData( sizebuf_t *msg, struct weapon_data_s *from, struct weapon_data_s *to, float timebase ); void MSG_ReadDeltaEvent( sizebuf_t *msg, event_args_t *from, event_args_t *to );
void MSG_WriteDeltaEntity( struct entity_state_s *from, struct entity_state_s *to, sizebuf_t *msg, qboolean force, qboolean pl, float tbase, int bl ); qboolean MSG_WriteDeltaMovevars( sizebuf_t *msg, movevars_t *from, movevars_t *to );
qboolean MSG_ReadDeltaEntity( sizebuf_t *msg, struct entity_state_s *from, struct entity_state_s *to, int num, qboolean player, float timebase ); void MSG_ReadDeltaMovevars( sizebuf_t *msg, movevars_t *from, movevars_t *to );
int Delta_TestBaseline( struct entity_state_s *from, struct entity_state_s *to, qboolean player, float timebase ); void MSG_WriteClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, float timebase );
void MSG_ReadClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, float timebase );
void MSG_WriteWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to, float timebase, int index );
void MSG_ReadWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to, float timebase );
void MSG_WriteDeltaEntity( entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, qboolean pl, float tbase, int bl );
qboolean MSG_ReadDeltaEntity( sizebuf_t *msg, entity_state_t *from, entity_state_t *to, int num, qboolean player, float timebase );
int Delta_TestBaseline( entity_state_t *from, entity_state_t *to, qboolean player, float timebase );
#endif//NET_ENCODE_H #endif//NET_ENCODE_H
Loading…
Cancel
Save