#include "md4.h"
#include <stdlib.h>
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
/* -------------------------------------------------------------------------------
#define C_ANTIPORTAL 0x00004000 /* like hint, but doesn't generate portals */
#define C_SKIP 0x00008000 /* like hint, but skips this face (doesn't split bsp) */
#define C_NOMARKS 0x00010000 /* no decals */
+#define C_OB 0x00020000 /* skip -noob for this */
#define C_DETAIL 0x08000000 /* THIS MUST BE THE SAME AS IN RADIANT! */
/* ok to increase these at the expense of more memory */
#define MAX_MAP_AREAS 0x100 /* MAX_MAP_AREA_BYTES in q_shared must match! */
-#define MAX_MAP_FOGS 30 //& 0x100 /* RBSP (32 - world fog - goggles) */
+#define MAX_MAP_FOGS 0x100 //& 0x100 /* RBSP (32 - world fog - goggles) */
#define MAX_MAP_LEAFS 0x20000
#define MAX_MAP_PORTALS 0x20000
#define MAX_MAP_LIGHTING 0x800000
#define MAX_MAP_VISCLUSTERS 0x4000 // <= MAX_MAP_LEAFS
#define MAX_MAP_VISIBILITY ( VIS_HEADER_SIZE + MAX_MAP_VISCLUSTERS * ( ( ( MAX_MAP_VISCLUSTERS + 63 ) & ~63 ) >> 3 ) )
-#define MAX_MAP_DRAW_SURFS 0x20000
+#define MAX_MAP_DRAW_SURFS 0x20000
#define MAX_MAP_ADVERTISEMENTS 30
bspShader_t;
-/* planes x^1 is allways the opposite of plane x */
+/* planes x^1 is always the opposite of plane x */
typedef struct
{
{
int planeNum;
int children[ 2 ]; /* negative numbers are -(leafs+1), not nodes */
- int mins[ 3 ]; /* for frustom culling */
+ int mins[ 3 ]; /* for frustum culling */
int maxs[ 3 ];
}
bspNode_t;
sun_t *sun; /* ydnar */
vec3_t color; /* normalized color */
- vec3_t averageColor;
+ vec4_t averageColor;
byte lightStyle;
/* vortex: per-surface floodlight */
{
int num;
qboolean hint; /* true if this portal was created from a hint splitter */
+ qboolean sky; /* true if this portal belongs to a sky leaf */
qboolean removed;
visPlane_t plane; /* normal pointing into neighbor */
int leaf; /* neighbor */
char *Q_strncat( char *dst, size_t dlen, const char *src, size_t slen );
int BSPInfo( int count, char **fileNames );
int ScaleBSPMain( int argc, char **argv );
+int ShiftBSPMain( int argc, char **argv );
int ConvertMain( int argc, char **argv );
+/* help.c */
+void HelpMain(const char* arg);
/* path_init.c */
game_t *GetGame( char *arg );
/* map.c */
void LoadMapFile( char *filename, qboolean onlyLights, qboolean noCollapseGroups );
int FindFloatPlane( vec3_t normal, vec_t dist, int numPoints, vec3_t *points );
+qboolean PlaneEqual( plane_t *p, vec3_t normal, vec_t dist );
int PlaneTypeForNormal( vec3_t normal );
void AddBrushBevels( void );
brush_t *FinishBrush( qboolean noCollapseGroups );
void PicoLoadFileFunc( const char *name, byte **buffer, int *bufSize );
picoModel_t *FindModel( const char *name, int frame );
picoModel_t *LoadModel( const char *name, int frame );
-void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle );
+void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle, float clipDepth );
void AddTriangleModels( entity_t *e );
void SetupSurfaceLightmaps( void );
void StitchSurfaceLightmaps( void );
-void StoreSurfaceLightmaps( void );
+void StoreSurfaceLightmaps( qboolean fastAllocate );
+
+
+/* exportents.c */
+void ExportEntities( void );
+int ExportEntitiesMain( int argc, char **argv );
/* image.c */
void AddLump( FILE *file, bspHeader_t *header, int lumpNum, const void *data, int length );
void LoadBSPFile( const char *filename );
+void PartialLoadBSPFile( const char *filename );
void WriteBSPFile( const char *filename );
void PrintBSPFileSizes( void );
/* bspfile_ibsp.c */
void LoadIBSPFile( const char *filename );
void WriteIBSPFile( const char *filename );
+void PartialLoadIBSPFile( const char *filename );
+
/* bspfile_rbsp.c */
#include "game_xonotic.h" /* most be after game_quake3.h as they share defines! */
,
#include "game_tremulous.h" /*LinuxManMikeC: must be after game_quake3.h, depends on #define's set in it */
+ ,
+ #include "game_unvanquished.h"
,
#include "game_tenebrae.h"
,
/* ydnar: sinusoid samples */
Q_EXTERN float jitters[ MAX_JITTERS ];
+/* can't code */
+Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse );
/* commandline arguments */
Q_EXTERN qboolean verbose;
Q_EXTERN qboolean bspAlternateSplitWeights Q_ASSIGN( qfalse ); /* 27 */
Q_EXTERN qboolean deepBSP Q_ASSIGN( qfalse ); /* div0 */
Q_EXTERN qboolean maxAreaFaceSurface Q_ASSIGN( qfalse ); /* divVerent */
+Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse );
Q_EXTERN int patchSubdivisions Q_ASSIGN( 8 ); /* ydnar: -patchmeta subdivisions */
Q_EXTERN qboolean debugSurfaces Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugInset Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugPortals Q_ASSIGN( qfalse );
+Q_EXTERN qboolean debugClip Q_ASSIGN( qfalse ); /* debug model autoclipping */
+Q_EXTERN float clipDepthGlobal Q_ASSIGN( 2.0f );
Q_EXTERN qboolean lightmapTriangleCheck Q_ASSIGN( qfalse );
Q_EXTERN qboolean lightmapExtraVisClusterNudge Q_ASSIGN( qfalse );
Q_EXTERN qboolean lightmapFill Q_ASSIGN( qfalse );
Q_EXTERN int metaAdequateScore Q_ASSIGN( -1 );
Q_EXTERN int metaGoodScore Q_ASSIGN( -1 );
Q_EXTERN float metaMaxBBoxDistance Q_ASSIGN( -1 );
+Q_EXTERN qboolean noob Q_ASSIGN( qfalse );
#if Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX
// Increasing the normalEpsilon to compensate for new logic in SnapNormal(), where
= { 1024, 1024, 1024 };
#endif
+Q_EXTERN char EnginePath[ 1024 ];
+
Q_EXTERN char name[ 1024 ];
Q_EXTERN char source[ 1024 ];
Q_EXTERN char outbase[ 32 ];
Q_EXTERN char globalCelShader[ MAX_QPATH ];
Q_EXTERN float farPlaneDist; /* rr2do2, rf, mre, ydnar all contributed to this one... */
+Q_EXTERN int farPlaneDistMode;
Q_EXTERN int numportals;
Q_EXTERN int portalclusters;
Q_EXTERN int sampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_SAMPLE_SIZE );
Q_EXTERN int minSampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_MIN_SAMPLE_SIZE );
-Q_EXTERN qboolean noVertexLighting Q_ASSIGN( qfalse );
+Q_EXTERN float noVertexLighting Q_ASSIGN( 0.0f );
+Q_EXTERN qboolean nolm Q_ASSIGN( qfalse );
Q_EXTERN qboolean noGridLighting Q_ASSIGN( qfalse );
Q_EXTERN qboolean noTrace Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugCluster Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugOrigin Q_ASSIGN( qfalse );
Q_EXTERN qboolean lightmapBorder Q_ASSIGN( qfalse );
+//1=warn; 0=warn if lmsize>128
+Q_EXTERN int debugSampleSize Q_ASSIGN( 0 );
/* longest distance across the map */
Q_EXTERN float maxMapDistance Q_ASSIGN( 0 );
Q_EXTERN float areaScale Q_ASSIGN( 0.25f );
Q_EXTERN float skyScale Q_ASSIGN( 1.0f );
Q_EXTERN float bounceScale Q_ASSIGN( 0.25f );
+Q_EXTERN float bounceColorRatio Q_ASSIGN( 1.0f );
+Q_EXTERN float vertexglobalscale Q_ASSIGN( 1.0f );
+Q_EXTERN float g_backsplashFractionScale Q_ASSIGN( 1.0f );
+Q_EXTERN float g_backsplashDistance Q_ASSIGN( -999.0f );
/* jal: alternative angle attenuation curve */
Q_EXTERN qboolean lightAngleHL Q_ASSIGN( qfalse );
Q_EXTERN float colorsRGB Q_ASSIGN( qfalse );
Q_EXTERN float lightmapExposure Q_ASSIGN( 0.0f );
Q_EXTERN float lightmapCompensate Q_ASSIGN( 1.0f );
+Q_EXTERN float lightmapBrightness Q_ASSIGN( 1.0f );
+Q_EXTERN float lightmapContrast Q_ASSIGN( 1.0f );
/* ydnar: for runtime tweaking of falloff tolerance */
Q_EXTERN float falloffTolerance Q_ASSIGN( 1.0f );