]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/q3map2.h
_farplanedist now ignores C_SKY leafs
[xonotic/netradiant.git] / tools / quake3 / q3map2 / q3map2.h
index bf30def5291ca467b0a56c11ea7c0e7cb51c43ab..427c0279b95b4b0d808c2f19ab8d74d06ac9af31 100644 (file)
@@ -124,9 +124,9 @@ constants
 
 /* temporary hacks and tests (please keep off in SVN to prevent anyone's legacy map from screwing up) */
 /* 2011-01-10 TTimo says we should turn these on in SVN, so turning on now */
-#define EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES  1
-#define EXPERIMENTAL_SNAP_NORMAL_FIX                   1
-#define EXPERIMENTAL_SNAP_PLANE_FIX                    1
+#define Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES  1
+#define Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX            1
+#define Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX             1
 
 /* general */
 #define MAX_QPATH                              64
@@ -317,9 +317,6 @@ abstracted bsp file
 #define MAX_LIGHTMAP_SHADERS   256
 
 /* ok to increase these at the expense of more memory */
-#define        MAX_MAP_ENTITIES                0x1000          //%     0x800   /* ydnar */
-#define        MAX_MAP_ENTSTRING               0x80000         //%     0x40000 /* ydnar */
-
 #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_LEAFS                   0x20000
@@ -568,6 +565,8 @@ typedef struct game_s
        qboolean                        wolfLight;                                              /* when true, lights work like wolf q3map  */
        int                                     lightmapSize;                                   /* bsp lightmap width/height */
        float                           lightmapGamma;                                  /* default lightmap gamma */
+       qboolean                        lightmapsRGB;                                   /* default lightmap sRGB mode */
+       qboolean                        texturesRGB;                                    /* default texture sRGB mode */
        float                           lightmapExposure;                               /* default lightmap exposure */
        float                           lightmapCompensate;                             /* default lightmap compensate value */
        float                           gridScale;                                              /* vortex: default lightgrid scale (affects both directional and ambient spectres) */
@@ -1237,6 +1236,7 @@ typedef struct
 {
        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 */
@@ -1956,6 +1956,8 @@ Q_EXTERN game_t                           games[]
                                                                ,
                                                                #include "game_qfusion.h"       /* qfusion game */
                                                                ,
+                                                               #include "game_reaction.h" /* must be after game_quake3.h */
+                                                               ,
                                                                #include "game_darkplaces.h"    /* vortex: darkplaces q1 engine */
                                                                ,
                                                                #include "game_dq.h"    /* vortex: deluxe quake game ( darkplaces q1 engine) */
@@ -2032,8 +2034,11 @@ Q_EXTERN qboolean                        debugPortals Q_ASSIGN( qfalse );
 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 );
 
-#if EXPERIMENTAL_SNAP_NORMAL_FIX
+#if Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX
 // Increasing the normalEpsilon to compensate for new logic in SnapNormal(), where
 // this epsilon is now used to compare against 0 components instead of the 1 or -1
 // components.  Unfortunately, normalEpsilon is also used in PlaneEqual().  So changing
@@ -2044,7 +2049,7 @@ Q_EXTERN double                           normalEpsilon Q_ASSIGN(0.00005);
 Q_EXTERN double                                normalEpsilon Q_ASSIGN( 0.00001 );
 #endif
 
-#if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
+#if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES
 // NOTE: This distanceEpsilon is too small if parts of the map are at maximum world
 // extents (in the range of plus or minus 2^16).  The smallest epsilon at values
 // close to 2^16 is about 0.007, which is greater than distanceEpsilon.  Therefore,
@@ -2277,6 +2282,7 @@ Q_EXTERN float                            maxMapDistance Q_ASSIGN( 0 );
 
 /* for run time tweaking of light sources */
 Q_EXTERN float                         pointScale Q_ASSIGN( 7500.0f );
+Q_EXTERN float                         spotScale Q_ASSIGN( 7500.0f );
 Q_EXTERN float                         areaScale Q_ASSIGN( 0.25f );
 Q_EXTERN float                         skyScale Q_ASSIGN( 1.0f );
 Q_EXTERN float                         bounceScale Q_ASSIGN( 0.25f );
@@ -2293,6 +2299,8 @@ Q_EXTERN qboolean                 inGrid Q_ASSIGN(0);
 
 /* ydnar: lightmap gamma/compensation */
 Q_EXTERN float                         lightmapGamma Q_ASSIGN( 1.0f );
+Q_EXTERN float                         lightmapsRGB Q_ASSIGN( qfalse );
+Q_EXTERN float                         texturesRGB Q_ASSIGN( qfalse );
 Q_EXTERN float                         lightmapExposure Q_ASSIGN( 1.0f );
 Q_EXTERN float                         lightmapCompensate Q_ASSIGN( 1.0f );
 
@@ -2444,7 +2452,8 @@ abstracted bsp globals
 
 Q_EXTERN int                           numEntities Q_ASSIGN( 0 );
 Q_EXTERN int                           numBSPEntities Q_ASSIGN( 0 );
-Q_EXTERN entity_t                      entities[ MAX_MAP_ENTITIES ];
+Q_EXTERN int                           allocatedEntities Q_ASSIGN( 0 );
+Q_EXTERN entity_t*                     entities Q_ASSIGN(NULL);
 
 Q_EXTERN int                           numBSPModels Q_ASSIGN( 0 );
 Q_EXTERN int                           allocatedBSPModels Q_ASSIGN( 0 );
@@ -2534,5 +2543,8 @@ Q_EXTERN bspAdvertisement_t       bspAds[ MAX_MAP_ADVERTISEMENTS ];
 
 #define AUTOEXPAND_BY_REALLOC_BSP(suffix, def) AUTOEXPAND_BY_REALLOC(bsp##suffix, numBSP##suffix, allocatedBSP##suffix, def)
 
+#define Image_LinearFloatFromsRGBFloat(c) (((c) <= 0.04045f) ? (c) * (1.0f / 12.92f) : (float)pow(((c) + 0.055f)*(1.0f/1.055f), 2.4f))
+#define Image_sRGBFloatFromLinearFloat(c) (((c) < 0.0031308f) ? (c) * 12.92f : 1.055f * (float)pow((c), 1.0f/2.4f) - 0.055f)
+
 /* end marker */
 #endif