Browse Source

Reduce engine dependencies. crtlib/mathlib/matrixlib now can be built standalone

pull/2/head
mittorn 5 years ago
parent
commit
4247af8fa8
  1. 4
      common/port.h
  2. 8
      common/xash3d_types.h
  3. 17
      engine/client/client.h
  4. 5
      engine/client/mod_dbghulls.c
  5. 13
      engine/common/common.h
  6. 9
      engine/common/crtlib.c
  7. 3
      engine/common/crtlib.h
  8. 6
      engine/common/mathlib.c
  9. 7
      engine/common/matrixlib.c
  10. 2
      engine/common/mod_bmodel.c
  11. 2
      engine/common/mod_local.h
  12. 2
      engine/common/model.c
  13. 19
      engine/ref_api.h
  14. 2
      ref_gl/gl_alias.c
  15. 1
      ref_gl/gl_backend.c
  16. 1
      ref_gl/gl_decals.c
  17. 2
      ref_gl/gl_image.c
  18. 1
      ref_gl/gl_refrag.c
  19. 1
      ref_gl/gl_rlight.c
  20. 3
      ref_gl/gl_sprite.c
  21. 4
      ref_gl/gl_studio.c
  22. 2
      ref_gl/gl_warp.c

4
common/port.h

@ -162,4 +162,8 @@ GNU General Public License for more details. @@ -162,4 +162,8 @@ GNU General Public License for more details.
#define USHRT_MAX 65535
#endif
#ifdef XASH_SDL
#include <SDL.h>
#endif
#endif // PORT_H

8
common/xash3d_types.h

@ -129,4 +129,12 @@ typedef struct dll_info_s @@ -129,4 +129,12 @@ typedef struct dll_info_s
typedef void (*setpair_t)( const char *key, const char *value, void *buffer, void *numpairs );
// config strings are a general means of communication from
// the server to all connected clients.
// each config string can be at most CS_SIZE characters.
#define MAX_QPATH 64 // max length of a game pathname
#define MAX_OSPATH 260 // max length of a filesystem pathname
#define CS_SIZE 64 // size of one config string
#define CS_TIME 16 // size of time string
#endif // XASH_TYPES_H

17
engine/client/client.h

@ -40,13 +40,6 @@ GNU General Public License for more details. @@ -40,13 +40,6 @@ GNU General Public License for more details.
typedef int sound_t;
typedef enum
{
DEMO_INACTIVE = 0,
DEMO_XASH3D,
DEMO_QUAKE1
} demo_mode;
//=============================================================================
typedef struct netbandwithgraph_s
{
@ -425,16 +418,6 @@ typedef struct @@ -425,16 +418,6 @@ typedef struct
float applied_angle;
} screen_shake_t;
typedef struct remap_info_s
{
unsigned short textures[MAX_SKINS];// alias textures
struct mstudiotex_s *ptexture; // array of textures with local copy of remapped textures
short numtextures; // textures count
short topcolor; // cached value
short bottomcolor; // cached value
model_t *model; // for catch model changes
} remap_info_t;
typedef enum
{
NET_REQUEST_CANCEL = 0, // request was cancelled for some reasons

5
engine/client/mod_dbghulls.c

@ -12,11 +12,12 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,11 +12,12 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "common.h"
#include "client.h"
#include "mod_local.h"
#include "mathlib.h"
#include "world.h"
#include "client.h"
#define MAX_CLIPNODE_DEPTH 256 // should never exceeds

13
engine/common/common.h

@ -145,14 +145,6 @@ typedef enum @@ -145,14 +145,6 @@ typedef enum
#define CIN_MAIN 0
#define CIN_LOGO 1
// config strings are a general means of communication from
// the server to all connected clients.
// each config string can be at most CS_SIZE characters.
#define MAX_QPATH 64 // max length of a game pathname
#define MAX_OSPATH 260 // max length of a filesystem pathname
#define CS_SIZE 64 // size of one config string
#define CS_TIME 16 // size of time string
#define MAX_DECALS 512 // touching TE_DECAL messages, etc
#define MAX_STATIC_ENTITIES 3096 // static entities that moved on the client when level is spawn
@ -566,7 +558,6 @@ void COM_NormalizeAngles( vec3_t angles ); @@ -566,7 +558,6 @@ void COM_NormalizeAngles( vec3_t angles );
int COM_FileSize( const char *filename );
void COM_FixSlashes( char *pname );
void COM_FreeFile( void *buffer );
#define COM_CheckString( string ) ( ( !string || !*string ) ? 0 : 1 )
int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare );
search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly );
file_t *FS_Open( const char *filepath, const char *mode, qboolean gamedironly );
@ -1021,6 +1012,10 @@ void NET_InitMasters( void ); @@ -1021,6 +1012,10 @@ void NET_InitMasters( void );
void NET_SaveMasters( void );
qboolean NET_SendToMasters( netsrc_t sock, size_t len, const void *data );
#ifdef REF_DLL
#error "common.h in ref_dll"
#endif
#ifdef __cplusplus
}
#endif

9
engine/common/crtlib.c

@ -12,12 +12,15 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,12 +12,15 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "port.h"
#include "xash3d_types.h"
#include "const.h"
#include <math.h>
#include <stdarg.h>
#include <ctype.h>
#include "common.h"
#include <time.h>
#include "stdio.h"
#include "crtlib.h"
void Q_strnupr( const char *in, char *out, size_t size_out )
{
if( size_out == 0 ) return;

3
engine/common/crtlib.h

@ -77,5 +77,6 @@ void COM_ReplaceExtension( char *path, const char *extension ); @@ -77,5 +77,6 @@ void COM_ReplaceExtension( char *path, const char *extension );
void COM_ExtractFilePath( const char *path, char *dest );
const char *COM_FileWithoutPath( const char *in );
void COM_StripExtension( char *path );
#define COM_CheckString( string ) ( ( !string || !*string ) ? 0 : 1 )
#endif//STDLIB_H

6
engine/common/mathlib.c

@ -12,9 +12,11 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,9 +12,11 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "port.h"
#include "xash3d_types.h"
#include "const.h"
#include "com_model.h"
#include <math.h>
#include "common.h"
#include "mathlib.h"
#include "eiface.h"

7
engine/common/matrixlib.c

@ -13,7 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -13,7 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "common.h"
#include "port.h"
#include "xash3d_types.h"
#include "const.h"
#include "com_model.h"
#include "mathlib.h"
const matrix3x4 matrix3x4_identity =
@ -845,4 +848,4 @@ qboolean Matrix4x4_Invert_Full( matrix4x4 out, const matrix4x4 in1 ) @@ -845,4 +848,4 @@ qboolean Matrix4x4_Invert_Full( matrix4x4 out, const matrix4x4 in1 )
}
}
return false;
}
}

2
engine/common/mod_bmodel.c

@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "common.h"
#include "mod_local.h"
#include "sprite.h"
#include "mathlib.h"

2
engine/common/mod_local.h

@ -16,7 +16,7 @@ GNU General Public License for more details. @@ -16,7 +16,7 @@ GNU General Public License for more details.
#ifndef MOD_LOCAL_H
#define MOD_LOCAL_H
#include "common.h"
//#include "common.h"
#include "edict.h"
#include "eiface.h"
#include "ref_api.h"

2
engine/common/model.c

@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,7 +12,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "common.h"
#include "mod_local.h"
#include "sprite.h"
#include "mathlib.h"

19
engine/ref_api.h

@ -60,6 +60,13 @@ GNU General Public License for more details. @@ -60,6 +60,13 @@ GNU General Public License for more details.
#define FWORLD_WATERALPHA BIT( 2 )
#define FWORLD_HAS_DELUXEMAP BIT( 3 )
typedef enum
{
DEMO_INACTIVE = 0,
DEMO_XASH3D,
DEMO_QUAKE1
} demo_mode;
typedef struct
{
msurface_t *surf;
@ -211,7 +218,17 @@ enum @@ -211,7 +218,17 @@ enum
struct con_nprint_s;
struct remap_info_s;
struct engine_studio_api_s;
typedef struct remap_info_s
{
unsigned short textures[MAX_SKINS];// alias textures
struct mstudiotex_s *ptexture; // array of textures with local copy of remapped textures
short numtextures; // textures count
short topcolor; // cached value
short bottomcolor; // cached value
model_t *model; // for catch model changes
} remap_info_t;
typedef struct ref_api_s
{

2
ref_gl/gl_alias.c

@ -20,8 +20,6 @@ GNU General Public License for more details. @@ -20,8 +20,6 @@ GNU General Public License for more details.
#include "alias.h"
#include "pm_local.h"
#include "cl_tent.h"
#include "common.h"
#include "client.h"
#include "pmtrace.h"
extern cvar_t r_shadows;

1
ref_gl/gl_backend.c

@ -16,7 +16,6 @@ GNU General Public License for more details. @@ -16,7 +16,6 @@ GNU General Public License for more details.
#include "gl_local.h"
#include "mathlib.h"
#include "common.h"
char r_speeds_msg[MAX_SYSPATH];
ref_speeds_t r_stats; // r_speeds counters

1
ref_gl/gl_decals.c

@ -15,7 +15,6 @@ GNU General Public License for more details. @@ -15,7 +15,6 @@ GNU General Public License for more details.
#include "gl_local.h"
#include "cl_tent.h"
#include "common.h"
#define DECAL_OVERLAP_DISTANCE 2
#define DECAL_DISTANCE 4 // too big values produce more clipped polygons

2
ref_gl/gl_image.c

@ -14,7 +14,7 @@ GNU General Public License for more details. @@ -14,7 +14,7 @@ GNU General Public License for more details.
*/
#include "gl_local.h"
#include "common.h"
#define TEXTURES_HASH_SIZE (MAX_TEXTURES >> 2)

1
ref_gl/gl_refrag.c

@ -16,7 +16,6 @@ GNU General Public License for more details. @@ -16,7 +16,6 @@ GNU General Public License for more details.
#include "gl_local.h"
#include "entity_types.h"
#include "studio.h"
#include "common.h"
#include "world.h" // BOX_ON_PLANE_SIDE
/*

1
ref_gl/gl_rlight.c

@ -16,7 +16,6 @@ GNU General Public License for more details. @@ -16,7 +16,6 @@ GNU General Public License for more details.
#include "gl_local.h"
#include "pm_local.h"
#include "studio.h"
#include "common.h"
#include "mathlib.h"
#include "ref_params.h"

3
ref_gl/gl_sprite.c

@ -19,7 +19,6 @@ GNU General Public License for more details. @@ -19,7 +19,6 @@ GNU General Public License for more details.
#include "studio.h"
#include "entity_types.h"
#include "cl_tent.h"
#include "common.h"
// it's a Valve default value for LoadMapSprite (probably must be power of two)
#define MAPSPRITE_SIZE 128
@ -179,7 +178,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui @@ -179,7 +178,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
break;
case SPR_ALPHTEST:
pal = gEngfuncs.FS_LoadImage( "#masked.pal", src, 768 );
break;
break;
default:
pal = gEngfuncs.FS_LoadImage( "#normal.pal", src, 768 );
break;

4
ref_gl/gl_studio.c

@ -21,8 +21,8 @@ GNU General Public License for more details. @@ -21,8 +21,8 @@ GNU General Public License for more details.
#include "studio.h"
#include "pm_local.h"
#include "cl_tent.h"
#include "common.h"
#include "client.h"
//#include "client.h"
#include "pmtrace.h"
#define EVENT_CLIENT 5000 // less than this value it's a server-side studio events
#define MAX_LOCALLIGHTS 4

2
ref_gl/gl_warp.c

@ -16,8 +16,6 @@ GNU General Public License for more details. @@ -16,8 +16,6 @@ GNU General Public License for more details.
#include "gl_local.h"
#include "wadfile.h"
#include "common.h"
#define SKYCLOUDS_QUALITY 12
#define MAX_CLIP_VERTS 128 // skybox clip vertices
#define TURBSCALE ( 256.0f / ( M_PI2 ))

Loading…
Cancel
Save