]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/q3map2.h
Merge commit 'f73cc19a6166fc04269f953c980175779f81b9b0' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / q3map2.h
index 6d2189ce82299be40de3b9a12662ef9cba1ec4fe..567777ca8517270d37ea4de827aa08919541a32a 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef Q3MAP2_H
 #define Q3MAP2_H
 
-
+#include "globaldefs.h"
 
 /* version */
 #ifndef Q3MAP_VERSION
@@ -50,7 +50,7 @@
    ------------------------------------------------------------------------------- */
 
 /* platform-specific */
-#if defined( __linux__ ) || defined( __APPLE__ )
+#if GDEF_OS_LINUX || GDEF_OS_MACOS
        #define Q_UNIX
 #endif
 
@@ -60,7 +60,7 @@
        #include <limits.h>
 #endif
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
        #include <windows.h>
 #endif
 
@@ -72,6 +72,9 @@
 #include "mathlib.h"
 #include "md5lib.h"
 #include "ddslib.h"
+#ifdef BUILD_CRUNCH
+#include "crn_rgba.h"
+#endif // BUILD_CRUNCH
 
 #include "picomodel.h"
 
    ------------------------------------------------------------------------------- */
 
 #define MAC_STATIC_HACK         0
-#if defined( __APPLE__ ) && MAC_STATIC_HACK
+#if GDEF_OS_MACOS && MAC_STATIC_HACK
        #define MAC_STATIC          static
 #else
        #define MAC_STATIC
 #endif
 
 #if 1
-       #ifdef WIN32
+       #if GDEF_OS_WINDOWS
                #define Q_stricmp           stricmp
                #define Q_strncasecmp       strnicmp
        #else
 
 /* 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                    0x100                   //& 0x100       /* RBSP (32 - world fog - goggles) */
+#define MAX_MAP_FOGS            30          //& 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
 
@@ -959,8 +962,9 @@ typedef struct parseMesh_s
        shaderInfo_t        *shaderInfo;
        shaderInfo_t        *celShader;             /* :) */
 
+       /* jal : entity based _lightmapsamplesize */
+       int lightmapSampleSize;
        /* ydnar: gs mods */
-       int lightmapSampleSize;                     /* jal : entity based _lightmapsamplesize */
        float lightmapScale;
        vec3_t eMins, eMaxs;
        indexMap_t          *im;
@@ -1516,33 +1520,51 @@ vec_t                       Random( void );
 char                        *Q_strncpyz( char *dst, const char *src, size_t len );
 char                        *Q_strcat( char *dst, size_t dlen, const char *src );
 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 );
 void                        InitPaths( int *argc, char **argv );
 
 
+/* fixaas.c */
+int                         FixAASMain( int argc, char **argv );
+
+
 /* bsp.c */
 int                         BSPMain( int argc, char **argv );
 
 
+/* bsp_analyze.c */
+int                         AnalyzeBSPMain( int argc, char **argv );
+
+
+/* bsp_info.c */
+int                         BSPInfoMain( int count, char **fileNames );
+
+/* bsp_scale.c */
+int                         ScaleBSPMain( int argc, char **argv );
+
+/* minimap.c */
+int                         MiniMapBSPMain( int argc, char **argv );
+
+/* convert_bsp.c */
+int                         ConvertBSPMain( int argc, char **argv );
+
+
 /* convert_map.c */
 int                         ConvertBSPToMap( char *bspName );
 int                         ConvertBSPToMap_BP( char *bspName );
 
-
 /* convert_ase.c */
 int                         ConvertBSPToASE( char *bspName );
 
 /* convert_obj.c */
 int                         ConvertBSPToOBJ( char *bspName );
 
-
 /* brush.c */
 sideRef_t                   *AllocSideRef( side_t *side, sideRef_t *next );
 int                         CountBrushList( brush_t *brushes );
@@ -1615,12 +1637,12 @@ void                        MakeTreePortals( tree_t *tree );
 
 
 /* leakfile.c */
-xmlNodePtr                  LeakFile( tree_t *tree );
+xmlNodePtr                  LeakFile( tree_t *tree, const char *lineFilePath );
 
 
 /* prtfile.c */
 void                        NumberClusters( tree_t *tree );
-void                        WritePortalFile( tree_t *tree );
+void                        WritePortalFile( tree_t *tree, const char *portalFilePath );
 
 
 /* writebsp.c */
@@ -1630,7 +1652,7 @@ void                        SetLightStyles( void );
 int                         EmitShader( const char *shader, int *contentFlags, int *surfaceFlags );
 
 void                        BeginBSPFile( void );
-void                        EndBSPFile( qboolean do_write );
+void                        EndBSPFile( qboolean do_write, const char *BSPFilePath, const char *surfaceFilePath );
 void                        EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes );
 void                        EmitFogs( void );
 
@@ -1742,8 +1764,8 @@ int                         GetSurfaceExtraMinSampleSize( int num );
 float                       GetSurfaceExtraLongestCurve( int num );
 void                        GetSurfaceExtraLightmapAxis( int num, vec3_t lightmapAxis );
 
-void                        WriteSurfaceExtraFile( const char *path );
-void                        LoadSurfaceExtraFile( const char *path );
+void                        WriteSurfaceExtraFile( const char *surfaceFilePath );
+void                        LoadSurfaceExtraFile( const char *surfaceFilePath );
 
 
 /* decals.c */
@@ -1814,7 +1836,7 @@ void                        FloodLightRawLightmap( int num );
 void                        IlluminateRawLightmap( int num );
 void                        IlluminateVertexes( int num );
 
-void                        SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all );
+void                        SetupBrushesFlags( unsigned int mask_any, unsigned int test_any, unsigned int mask_all, unsigned int test_all );
 void                        SetupBrushes( void );
 void                        SetupClusters( void );
 qboolean                    ClusterVisible( int a, int b );
@@ -1837,7 +1859,12 @@ int                         ImportLightmapsMain( int argc, char **argv );
 
 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 */
@@ -1897,7 +1924,7 @@ qboolean                    KeyExists( const entity_t *ent, const char *key ); /
 const char                  *ValueForKey( const entity_t *ent, const char *key );
 int                         IntForKey( const entity_t *ent, const char *key );
 vec_t                       FloatForKey( const entity_t *ent, const char *key );
-void                        GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec );
+qboolean                    GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec );
 entity_t                    *FindTargetEntity( const char *target );
 void                        GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castShadows, int *recvShadows );
 void InjectCommandLine( char **argv, int beginArgs, int endArgs );
@@ -1938,19 +1965,21 @@ Q_EXTERN game_t games[]
        {
                                                                #include "game_quake3.h"
        ,
-                                                               #include "game_quakelive.h" /* most be after game_quake3.h as they share defines! */
+                                                               #include "game_quakelive.h" /* must be after game_quake3.h as they share defines! */
        ,
-                                                               #include "game_nexuiz.h" /* most be after game_quake3.h as they share defines! */
+                                                               #include "game_nexuiz.h" /* must be after game_quake3.h as they share defines! */
        ,
-                                                               #include "game_xonotic.h" /* most be after game_quake3.h as they share defines! */
+                                                               #include "game_xonotic.h" /* must 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" /* must be after game_tremulous.h as they share defines! */
        ,
                                                                #include "game_tenebrae.h"
        ,
                                                                #include "game_wolf.h"
        ,
-                                                               #include "game_wolfet.h" /* most be after game_wolf.h as they share defines! */
+                                                               #include "game_wolfet.h" /* must be after game_wolf.h as they share defines! */
        ,
                                                                #include "game_etut.h"
        ,
@@ -1958,9 +1987,9 @@ Q_EXTERN game_t games[]
        ,
                                                                #include "game_sof2.h"
        ,
-                                                               #include "game_jk2.h"   /* most be after game_sof2.h as they share defines! */
+                                                               #include "game_jk2.h"   /* must be after game_sof2.h as they share defines! */
        ,
-                                                               #include "game_ja.h"    /* most be after game_jk2.h as they share defines! */
+                                                               #include "game_ja.h"    /* must be after game_jk2.h as they share defines! */
        ,
                                                                #include "game_qfusion.h"   /* qfusion game */
        ,
@@ -2003,7 +2032,7 @@ Q_EXTERN float jitters[ MAX_JITTERS ];
 Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse );
 
 /* commandline arguments */
-Q_EXTERN qboolean                      nocmdline Q_ASSIGN( qfalse );
+Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse );
 Q_EXTERN qboolean verbose;
 Q_EXTERN qboolean verboseEntities Q_ASSIGN( qfalse );
 Q_EXTERN qboolean force Q_ASSIGN( qfalse );
@@ -2226,7 +2255,7 @@ Q_EXTERN qboolean keepLights Q_ASSIGN( qfalse );
 
 Q_EXTERN int sampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_SAMPLE_SIZE );
 Q_EXTERN int minSampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_MIN_SAMPLE_SIZE );
-Q_EXTERN float noVertexLighting Q_ASSIGN( 0.0f );
+Q_EXTERN qboolean noVertexLighting Q_ASSIGN( qfalse );
 Q_EXTERN qboolean nolm Q_ASSIGN( qfalse );
 Q_EXTERN qboolean noGridLighting Q_ASSIGN( qfalse );