Browse Source

engine: support compiling with gcc3

pull/2/head
Alibek Omarov 5 years ago
parent
commit
aa6674b032
  1. 4
      common/com_model.h
  2. 1
      common/const.h
  3. 3
      common/r_efx.h
  4. 2
      common/xash3d_types.h
  5. 3
      engine/client/client.h
  6. 6
      engine/client/vox.h
  7. 12
      engine/common/common.h
  8. 8
      engine/common/filesystem.c
  9. 5
      engine/common/mod_local.h
  10. 4
      engine/common/net_buffer.h
  11. 46
      engine/common/net_encode.h
  12. 4
      engine/common/soundlib/soundlib.h
  13. 5
      engine/platform/platform.h
  14. 2
      ref_gl/gl_local.h

4
common/com_model.h

@ -232,7 +232,7 @@ typedef struct mextrasurf_s
int reserved[32]; // just for future expansions or mod-makers int reserved[32]; // just for future expansions or mod-makers
} mextrasurf_t; } mextrasurf_t;
typedef struct msurface_s struct msurface_s
{ {
int visframe; // should be drawn when node is crossed int visframe; // should be drawn when node is crossed
@ -264,7 +264,7 @@ typedef struct msurface_s
color24 *samples; // note: this is the actual lightmap data for this surface color24 *samples; // note: this is the actual lightmap data for this surface
decal_t *pdecals; decal_t *pdecals;
} msurface_t; };
typedef struct hull_s typedef struct hull_s
{ {

1
common/const.h

@ -729,7 +729,6 @@ enum
typedef int func_t; typedef int func_t;
typedef int string_t; typedef int string_t;
typedef unsigned char byte;
typedef unsigned short word; typedef unsigned short word;
#include "xash3d_types.h" #include "xash3d_types.h"

3
common/r_efx.h

@ -84,7 +84,6 @@ color24 gTracerColors[] =
#define FTENT_CLIENTCUSTOM 0x00080000 // Must specify callback. Callback function is responsible for killing tempent and updating fields ( unless other flags specify how to do things ) #define FTENT_CLIENTCUSTOM 0x00080000 // Must specify callback. Callback function is responsible for killing tempent and updating fields ( unless other flags specify how to do things )
#define FTENT_SCALE 0x00100000 // An experiment #define FTENT_SCALE 0x00100000 // An experiment
typedef struct tempent_s TEMPENTITY;
struct pmtrace_s; struct pmtrace_s;
typedef struct tempent_s typedef struct tempent_s
{ {
@ -99,7 +98,7 @@ typedef struct tempent_s
int hitSound; int hitSound;
void (*hitcallback)( struct tempent_s *ent, struct pmtrace_s *ptr ); void (*hitcallback)( struct tempent_s *ent, struct pmtrace_s *ptr );
void (*callback)( struct tempent_s *ent, float frametime, float currenttime ); void (*callback)( struct tempent_s *ent, float frametime, float currenttime );
TEMPENTITY *next; struct tempent_s *next;
int priority; int priority;
short clientIndex; // if attached, this is the index of the client to stick to short clientIndex; // if attached, this is the index of the client to stick to
// if COLLIDEALL, this is the index of the client to ignore // if COLLIDEALL, this is the index of the client to ignore

2
common/xash3d_types.h

@ -11,9 +11,7 @@
typedef unsigned char byte; typedef unsigned char byte;
typedef int sound_t; typedef int sound_t;
typedef float vec_t; typedef float vec_t;
typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3]; typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
typedef vec_t quat_t[4]; typedef vec_t quat_t[4];
typedef byte rgba_t[4]; // unsigned byte colorpack typedef byte rgba_t[4]; // unsigned byte colorpack
typedef byte rgb_t[3]; // unsigned byte colorpack typedef byte rgb_t[3]; // unsigned byte colorpack

3
engine/client/client.h

@ -16,6 +16,7 @@ GNU General Public License for more details.
#ifndef CLIENT_H #ifndef CLIENT_H
#define CLIENT_H #define CLIENT_H
#include "xash3d_types.h"
#include "mathlib.h" #include "mathlib.h"
#include "cdll_int.h" #include "cdll_int.h"
#include "menu_int.h" #include "menu_int.h"
@ -38,8 +39,6 @@ GNU General Public License for more details.
#define SPR_HUDSPRITE 1 // hud sprite #define SPR_HUDSPRITE 1 // hud sprite
#define SPR_MAPSPRITE 2 // contain overview.bmp that diced into frames 128x128 #define SPR_MAPSPRITE 2 // contain overview.bmp that diced into frames 128x128
typedef int sound_t;
//============================================================================= //=============================================================================
typedef struct netbandwithgraph_s typedef struct netbandwithgraph_s
{ {

6
engine/client/vox.h

@ -41,8 +41,8 @@ typedef struct
float length; float length;
} sentence_t; } sentence_t;
typedef struct channel_s channel_t; struct channel_s;
void VOX_LoadWord( channel_t *pchan ); void VOX_LoadWord( struct channel_s *pchan );
void VOX_FreeWord( channel_t *pchan ); void VOX_FreeWord( struct channel_s *pchan );
#endif #endif

12
engine/common/common.h

@ -829,7 +829,7 @@ void HPAK_FlushHostQueue( void );
// shared calls // shared calls
struct physent_s; struct physent_s;
typedef struct sv_client_s sv_client_t; struct sv_client_s;
typedef struct sizebuf_s sizebuf_t; typedef struct sizebuf_s sizebuf_t;
qboolean CL_IsInGame( void ); qboolean CL_IsInGame( void );
qboolean CL_IsInMenu( void ); qboolean CL_IsInMenu( void );
@ -858,7 +858,7 @@ void SV_CreateDecal( sizebuf_t *msg, const float *origin, int decalIndex, int en
void Log_Printf( const char *fmt, ... ) _format( 1 ); void Log_Printf( const char *fmt, ... ) _format( 1 );
void SV_BroadcastCommand( const char *fmt, ... ) _format( 1 ); void SV_BroadcastCommand( const char *fmt, ... ) _format( 1 );
qboolean SV_RestoreCustomDecal( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent ); qboolean SV_RestoreCustomDecal( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent );
void SV_BroadcastPrintf( sv_client_t *ignore, char *fmt, ... ) _format( 2 ); void SV_BroadcastPrintf( struct sv_client_s *ignore, char *fmt, ... ) _format( 2 );
int R_CreateDecalList( struct decallist_s *pList ); int R_CreateDecalList( struct decallist_s *pList );
void R_ClearAllDecals( void ); void R_ClearAllDecals( void );
void CL_ClearStaticEntities( void ); void CL_ClearStaticEntities( void );
@ -960,14 +960,6 @@ void ID_Init( void );
const char *ID_GetMD5( void ); const char *ID_GetMD5( void );
void GAME_EXPORT ID_SetCustomClientID( const char *id ); void GAME_EXPORT ID_SetCustomClientID( const char *id );
//
// sequence.c
//
typedef struct sequenceEntry_ sequenceEntry_s;
typedef struct sentenceEntry_ sentenceEntry_s;
sequenceEntry_s *Sequence_Get( const char *fileName, const char *entryName );
sentenceEntry_s *Sequence_PickSentence( const char *groupName, int pickMethod, int *picked );
// //
// masterlist.c // masterlist.c
// //

8
engine/common/filesystem.c

@ -74,7 +74,7 @@ typedef struct wadtype_s
signed char type; signed char type;
} wadtype_t; } wadtype_t;
typedef struct file_s struct file_s
{ {
int handle; // file descriptor int handle; // file descriptor
fs_offset_t real_length; // uncompressed file size (for files opened in "read" mode) fs_offset_t real_length; // uncompressed file size (for files opened in "read" mode)
@ -85,9 +85,9 @@ typedef struct file_s
// contents buffer // contents buffer
fs_offset_t buff_ind, buff_len; // buffer current index and length fs_offset_t buff_ind, buff_len; // buffer current index and length
byte buff[FILE_BUFF_SIZE]; // intermediate buffer byte buff[FILE_BUFF_SIZE]; // intermediate buffer
} file_t; };
typedef struct wfile_s struct wfile_s
{ {
string filename; string filename;
int infotableofs; int infotableofs;
@ -96,7 +96,7 @@ typedef struct wfile_s
file_t *handle; file_t *handle;
dlumpinfo_t *lumps; dlumpinfo_t *lumps;
time_t filetime; time_t filetime;
} wfile_t; };
typedef struct pack_s typedef struct pack_s
{ {

5
engine/common/mod_local.h

@ -20,6 +20,7 @@ GNU General Public License for more details.
#include "edict.h" #include "edict.h"
#include "eiface.h" #include "eiface.h"
#include "ref_api.h" #include "ref_api.h"
#include "studio.h"
#define LM_SAMPLE_SIZE 16 #define LM_SAMPLE_SIZE 16
#define LM_SAMPLE_EXTRASIZE 8 #define LM_SAMPLE_EXTRASIZE 8
@ -172,10 +173,6 @@ void Mod_ReleaseHullPolygons( void );
// //
// mod_studio.c // mod_studio.c
// //
typedef struct studiohdr_s studiohdr_t;
typedef struct mstudioseqdesc_s mstudioseqdesc_t;
typedef struct mstudiobone_s mstudiobone_t;
typedef struct mstudioanim_s mstudioanim_t;
void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded ); void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded );
void Mod_UnloadStudioModel( model_t *mod ); void Mod_UnloadStudioModel( model_t *mod );
void Mod_InitStudioAPI( void ); void Mod_InitStudioAPI( void );

4
engine/common/net_buffer.h

@ -35,7 +35,7 @@ _inline int BitByte( int bits )
return PAD_NUMBER( bits, 8 ) >> 3; return PAD_NUMBER( bits, 8 ) >> 3;
} }
typedef struct sizebuf_s struct sizebuf_s
{ {
qboolean bOverflow; // overflow reading or writing qboolean bOverflow; // overflow reading or writing
const char *pDebugName; // buffer name (pointer to const name) const char *pDebugName; // buffer name (pointer to const name)
@ -43,7 +43,7 @@ typedef struct sizebuf_s
byte *pData; byte *pData;
int iCurBit; int iCurBit;
int nDataBits; int nDataBits;
} sizebuf_t; };
#define MSG_StartReading MSG_StartWriting #define MSG_StartReading MSG_StartWriting
#define MSG_GetNumBytesRead MSG_GetNumBytesWritten #define MSG_GetNumBytesRead MSG_GetNumBytesWritten

46
engine/common/net_encode.h

@ -16,6 +16,8 @@ GNU General Public License for more details.
#ifndef NET_ENCODE_H #ifndef NET_ENCODE_H
#define NET_ENCODE_H #define NET_ENCODE_H
#include "eiface.h"
#define DT_BYTE BIT( 0 ) // A byte #define DT_BYTE BIT( 0 ) // A byte
#define DT_SHORT BIT( 1 ) // 2 byte field #define DT_SHORT BIT( 1 ) // 2 byte field
#define DT_FLOAT BIT( 2 ) // A floating point field #define DT_FLOAT BIT( 2 ) // A floating point field
@ -62,7 +64,7 @@ typedef struct
} delta_field_t; } delta_field_t;
// one field // one field
typedef struct delta_s struct delta_s
{ {
const char *name; const char *name;
int offset; // in bytes int offset; // in bytes
@ -72,9 +74,9 @@ typedef struct delta_s
float post_multiplier; // for DEFINE_DELTA_POST float post_multiplier; // for DEFINE_DELTA_POST
int bits; // how many bits we send\receive int bits; // how many bits we send\receive
qboolean bInactive; // unsetted by user request qboolean bInactive; // unsetted by user request
} delta_t; };
typedef void (*pfnDeltaEncode)( delta_t *pFields, const byte *from, const byte *to ); typedef void (*pfnDeltaEncode)( struct delta_s *pFields, const byte *from, const byte *to );
typedef struct typedef struct
{ {
@ -113,24 +115,24 @@ void Delta_ParseTableField( sizebuf_t *msg );
// encode routines // encode routines
typedef struct entity_state_s entity_state_t; struct entity_state_s;
typedef struct usercmd_s usercmd_t; struct usercmd_s;
typedef struct event_args_s event_args_t; struct event_args_s;
typedef struct movevars_s movevars_t; struct movevars_s;
typedef struct clientdata_s clientdata_t; struct clientdata_s;
typedef struct weapon_data_s weapon_data_t; struct weapon_data_s;
void MSG_WriteDeltaUsercmd( sizebuf_t *msg, usercmd_t *from, usercmd_t *to ); void MSG_WriteDeltaUsercmd( sizebuf_t *msg, struct usercmd_s *from, struct usercmd_s *to );
void MSG_ReadDeltaUsercmd( sizebuf_t *msg, usercmd_t *from, usercmd_t *to ); void MSG_ReadDeltaUsercmd( sizebuf_t *msg, struct usercmd_s *from, struct usercmd_s *to );
void MSG_WriteDeltaEvent( sizebuf_t *msg, event_args_t *from, event_args_t *to ); void MSG_WriteDeltaEvent( sizebuf_t *msg, struct event_args_s *from, struct event_args_s *to );
void MSG_ReadDeltaEvent( sizebuf_t *msg, event_args_t *from, event_args_t *to ); void MSG_ReadDeltaEvent( sizebuf_t *msg, struct event_args_s *from, struct event_args_s *to );
qboolean MSG_WriteDeltaMovevars( sizebuf_t *msg, movevars_t *from, movevars_t *to ); qboolean MSG_WriteDeltaMovevars( sizebuf_t *msg, struct movevars_s *from, struct movevars_s *to );
void MSG_ReadDeltaMovevars( sizebuf_t *msg, movevars_t *from, movevars_t *to ); void MSG_ReadDeltaMovevars( sizebuf_t *msg, struct movevars_s *from, struct movevars_s *to );
void MSG_WriteClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, float timebase ); void MSG_WriteClientData( sizebuf_t *msg, struct clientdata_s *from, struct clientdata_s *to, float timebase );
void MSG_ReadClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, float timebase ); void MSG_ReadClientData( sizebuf_t *msg, struct clientdata_s *from, struct clientdata_s *to, float timebase );
void MSG_WriteWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to, float timebase, int index ); void MSG_WriteWeaponData( sizebuf_t *msg, struct weapon_data_s *from, struct weapon_data_s *to, float timebase, int index );
void MSG_ReadWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to, float timebase ); void MSG_ReadWeaponData( sizebuf_t *msg, struct weapon_data_s *from, struct weapon_data_s *to, float timebase );
void MSG_WriteDeltaEntity( entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, int type, float tbase, int ofs ); void MSG_WriteDeltaEntity( struct entity_state_s *from, struct entity_state_s *to, sizebuf_t *msg, qboolean force, int type, float tbase, int ofs );
qboolean MSG_ReadDeltaEntity( sizebuf_t *msg, entity_state_t *from, entity_state_t *to, int num, int type, float timebase ); qboolean MSG_ReadDeltaEntity( sizebuf_t *msg, struct entity_state_s *from, struct entity_state_s *to, int num, int type, float timebase );
int Delta_TestBaseline( entity_state_t *from, entity_state_t *to, qboolean player, float timebase ); int Delta_TestBaseline( struct entity_state_s *from, struct entity_state_s *to, qboolean player, float timebase );
#endif//NET_ENCODE_H #endif//NET_ENCODE_H

4
engine/common/soundlib/soundlib.h

@ -60,7 +60,7 @@ typedef struct sndlib_s
int cmd_flags; int cmd_flags;
} sndlib_t; } sndlib_t;
typedef struct stream_s struct stream_s
{ {
const streamfmt_t *format; // streamformat to operate const streamfmt_t *format; // streamformat to operate
@ -77,7 +77,7 @@ typedef struct stream_s
char temp[OUTBUF_SIZE]; // mpeg decoder stuff char temp[OUTBUF_SIZE]; // mpeg decoder stuff
size_t pos; // actual track position (or actual buffer remains) size_t pos; // actual track position (or actual buffer remains)
int buffsize; // cached buffer size int buffsize; // cached buffer size
} stream_t; };
/* /*
======================================================================== ========================================================================

5
engine/platform/platform.h

@ -103,15 +103,14 @@ typedef enum
rserr_unknown rserr_unknown
} rserr_t; } rserr_t;
typedef struct vidmode_s vidmode_t; struct vidmode_s;
// Window // Window
qboolean R_Init_Video( const int type ); qboolean R_Init_Video( const int type );
void R_Free_Video( void ); void R_Free_Video( void );
qboolean VID_SetMode( void ); qboolean VID_SetMode( void );
rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen ); rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen );
int R_MaxVideoModes( void ); int R_MaxVideoModes( void );
vidmode_t*R_GetVideoMode( int num ); struct vidmode_s *R_GetVideoMode( int num );
void* GL_GetProcAddress( const char *name ); // RenderAPI requirement void* GL_GetProcAddress( const char *name ); // RenderAPI requirement
void GL_UpdateSwapInterval( void ); void GL_UpdateSwapInterval( void );
int GL_SetAttribute( int attr, int val ); int GL_SetAttribute( int attr, int val );

2
ref_gl/gl_local.h

@ -33,6 +33,7 @@ GNU General Public License for more details.
#include "pm_movevars.h" #include "pm_movevars.h"
//#include "cvar.h" //#include "cvar.h"
#include "gl_export.h" #include "gl_export.h"
#include "wadfile.h"
#ifndef offsetof #ifndef offsetof
#define offsetof(s,m) (size_t)&(((s *)0)->m) #define offsetof(s,m) (size_t)&(((s *)0)->m)
@ -480,7 +481,6 @@ void R_AliasInit( void );
// //
// gl_warp.c // gl_warp.c
// //
typedef struct mip_s mip_t;
void R_InitSkyClouds( mip_t *mt, struct texture_s *tx, qboolean custom_palette ); void R_InitSkyClouds( mip_t *mt, struct texture_s *tx, qboolean custom_palette );
void R_AddSkyBoxSurface( msurface_t *fa ); void R_AddSkyBoxSurface( msurface_t *fa );
void R_ClearSkyBox( void ); void R_ClearSkyBox( void );

Loading…
Cancel
Save