]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/q3map2.h
Increase the influence of directional lights on the deluxemap by a)Ignoring angle...
[xonotic/netradiant.git] / tools / quake3 / q3map2 / q3map2.h
index fe25f5821abf8cb46df8d069ff361295ea79d95a..644a0510ab14a1b4893d3cc3271bd9140d2bb693 100644 (file)
@@ -83,7 +83,7 @@ dependencies
 #include "vfs.h"
 #include "png.h"
 #include "md4.h"
-
+#include "radiant_jpeglib.h"
 #include <stdlib.h>
 
 
@@ -185,7 +185,7 @@ constants
 /* bsp */
 #define        MAX_PATCH_SIZE                  32
 #define        MAX_BRUSH_SIDES                 1024
-#define MAX_BUILD_SIDES                        300
+#define MAX_BUILD_SIDES                        1024
 
 #define        MAX_EXPANDED_AXIS               128
 
@@ -215,7 +215,7 @@ constants
 
 #define        PORTALFILE                              "PRT1"
 
-#define        MAX_PORTALS                             32768
+#define        MAX_PORTALS                             0x20000 /* same as MAX_MAP_PORTALS */
 #define MAX_SEPERATORS                 MAX_POINTS_ON_WINDING
 #define        MAX_POINTS_ON_FIXED_WINDING     24      /* ydnar: increased this from 12 at the expense of more memory */
 #define        MAX_PORTALS_ON_LEAF             1024
@@ -535,6 +535,13 @@ typedef struct surfaceParm_s
 }
 surfaceParm_t;
 
+typedef enum
+{
+       MINIMAP_MODE_GRAY,
+       MINIMAP_MODE_BLACK,
+       MINIMAP_MODE_WHITE
+}
+miniMapMode_t;
 
 typedef struct game_s
 {
@@ -555,12 +562,19 @@ typedef struct game_s
        float                           lightmapCompensate;                             /* default lightmap compensate value */
        float                           gridScale;                                              /* vortex: default lightgrid scale (affects both directional and ambient spectres) */
        float                           gridAmbientScale;                               /* vortex: default lightgrid ambient spectre scale */
+       qboolean                        lightAngleHL;                                   /* jal: use half-lambert curve for light angle attenuation */
        qboolean                        noStyles;                                               /* use lightstyles hack or not */
        qboolean                        keepLights;                                             /* keep light entities on bsp */
        int                                     patchSubdivisions;                              /* default patch subdivisions tolerance */
        qboolean                        patchShadows;                                   /* patch casting enabled */
        qboolean                        deluxeMap;                                              /* compile deluxemaps */
        int                                     deluxeMode;                                             /* deluxemap mode (0 - modelspace, 1 - tangentspace with renormalization, 2 - tangentspace without renormalization) */
+       int                 miniMapSize;                    /* minimap size */
+       float               miniMapSharpen;                 /* minimap sharpening coefficient */
+       float               miniMapBorder;                  /* minimap border amount */
+       qboolean            miniMapKeepAspect;              /* minimap keep aspect ratio by letterboxing */
+       miniMapMode_t       miniMapMode;                    /* minimap mode */
+       char                *miniMapNameFormat;             /* minimap name format */
        char                            *bspIdent;                                              /* 4-letter bsp file prefix */
        int                                     bspVersion;                                             /* bsp version to use */
        qboolean                        lumpSwap;                                               /* cod-style len/ofs order */
@@ -876,7 +890,9 @@ typedef struct brush_s
        shaderInfo_t            *celShader;                     /* :) */
        
        /* ydnar: gs mods */
+       int                                     lightmapSampleSize; /* jal : entity based _lightmapsamplesize */
        float                           lightmapScale;
+       float                           shadeAngleDegrees; /* jal : entity based _shadeangle */
        vec3_t                          eMins, eMaxs;
        indexMap_t                      *im;
 
@@ -927,6 +943,7 @@ typedef struct parseMesh_s
        shaderInfo_t            *celShader;                             /* :) */
        
        /* ydnar: gs mods */
+       int                                     lightmapSampleSize;             /* jal : entity based _lightmapsamplesize */
        float                           lightmapScale;
        vec3_t                          eMins, eMaxs;
        indexMap_t                      *im;
@@ -1024,6 +1041,9 @@ typedef struct mapDrawSurface_s
        
        /* ydnar: per-surface (per-entity, actually) lightmap sample size scaling */
        float                           lightmapScale;
+
+       /* jal: per-surface (per-entity, actually) shadeangle */
+       float                           shadeAngleDegrees;
        
        /* ydnar: surface classification */
        vec3_t                          mins, maxs;
@@ -1067,6 +1087,7 @@ typedef struct metaTriangle_s
        shaderInfo_t            *si;
        side_t                          *side;
        int                                     entityNum, surfaceNum, planeNum, fogNum, sampleSize, castShadows, recvShadows;
+       float                           shadeAngleDegrees;
        vec4_t                          plane;
        vec3_t                          lightmapAxis;
        int                                     indexes[ 3 ];
@@ -1091,7 +1112,6 @@ typedef struct
        int                                     firstBrush, numBrushes;         /* only valid during BSP compile */
        epair_t                         *epairs;
        vec3_t                          originbrush_origin;
-       qboolean                        forceNormalSmoothing; /* vortex: true if entity has _smoothnormals/_sn/_smooth key */
 }
 entity_t;
 
@@ -1284,6 +1304,7 @@ typedef struct light_s
        float                           radiusByDist;   /* for spotlights */
        float                           fade;                   /* ydnar: from wolf, for linear lights */
        float                           angleScale;             /* ydnar: stolen from vlight for K */
+       float                           extraDist;              /* "extra dimension" distance of the light, to kill hot spots */
 
        float                           add;                    /* ydnar: used for area lights */
        float                           envelope;               /* ydnar: units until falloff < tolerance */
@@ -1330,6 +1351,7 @@ typedef struct
        /* input and output */
        vec3_t                          color;                  /* starts out at full color, may be reduced if transparent surfaces are crossed */
        vec3_t                          colorNoShadow;  /* result color with no shadow casting */
+       vec3_t                          directionContribution; /* result contribution to the deluxe map */
 
        /* output */
        vec3_t                          hit;
@@ -1622,7 +1644,7 @@ void                                              PicoPrintFunc( int level, const char *str );
 void                                           PicoLoadFileFunc( char *name, byte **buffer, int *bufSize );
 picoModel_t                                    *FindModel( char *name, int frame );
 picoModel_t                                    *LoadModel( char *name, int frame );
-void                                           InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale );
+void                                           InsertModel( char *name, 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                                           AddTriangleModels( entity_t *e );
 
 
@@ -2082,9 +2104,6 @@ Q_EXTERN qboolean                 hint;   /* ydnar */
 Q_EXTERN char                          inbase[ MAX_QPATH ];
 Q_EXTERN char                          globalCelShader[ MAX_QPATH ];
 
-/* other bits */
-Q_EXTERN int                           totalvis;
-
 Q_EXTERN float                         farPlaneDist;   /* rr2do2, rf, mre, ydnar all contributed to this one... */
 
 Q_EXTERN int                           numportals;
@@ -2124,6 +2143,7 @@ light global variables
 
 /* commandline arguments */
 Q_EXTERN qboolean                      wolfLight Q_ASSIGN( qfalse );
+Q_EXTERN float                         extraDist Q_ASSIGN( 0.0f );
 Q_EXTERN qboolean                      loMem Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      noStyles Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      keepLights Q_ASSIGN( qfalse );
@@ -2163,10 +2183,12 @@ Q_EXTERN qboolean                       dark Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      sunOnly Q_ASSIGN( qfalse );
 Q_EXTERN int                           approximateTolerance Q_ASSIGN( 0 );
 Q_EXTERN qboolean                      noCollapse Q_ASSIGN( qfalse );
+Q_EXTERN int                           lightmapSearchBlockSize Q_ASSIGN( 0 );
 Q_EXTERN qboolean                      exportLightmaps Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      externalLightmaps Q_ASSIGN( qfalse );
 Q_EXTERN int                           lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH );
 Q_EXTERN char *                                lmCustomDir Q_ASSIGN( NULL );
+Q_EXTERN int                           lmLimitSize Q_ASSIGN( 0 );
 
 Q_EXTERN qboolean                      dirty Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      dirtDebug Q_ASSIGN( qfalse );
@@ -2199,10 +2221,16 @@ Q_EXTERN float                          pointScale 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 );
+
+/* jal: alternative angle attenuation curve */
+Q_EXTERN qboolean                      lightAngleHL Q_ASSIGN( qfalse );
  
 /* vortex: gridscale and gridambientscale */
 Q_EXTERN float                         gridScale Q_ASSIGN( 1.0f );
 Q_EXTERN float                         gridAmbientScale Q_ASSIGN( 1.0f );
+Q_EXTERN float                         gridDirectionality Q_ASSIGN( 1.0f );
+Q_EXTERN float                         gridAmbientDirectionality Q_ASSIGN( 0.0f );
+Q_EXTERN qboolean                      inGrid Q_ASSIGN(0);
 
 /* ydnar: lightmap gamma/compensation */
 Q_EXTERN float                         lightmapGamma Q_ASSIGN( 1.0f );
@@ -2367,7 +2395,8 @@ Q_EXTERN int                              allocatedBSPShaders Q_ASSIGN( 0 );
 Q_EXTERN bspShader_t*          bspShaders Q_ASSIGN(0);
 
 Q_EXTERN int                           bspEntDataSize Q_ASSIGN( 0 );
-Q_EXTERN char                          bspEntData[ MAX_MAP_ENTSTRING ];
+Q_EXTERN int                           allocatedBSPEntData Q_ASSIGN( 0 );
+Q_EXTERN char                          *bspEntData Q_ASSIGN(0);
 
 Q_EXTERN int                           numBSPLeafs Q_ASSIGN( 0 );
 Q_EXTERN bspLeaf_t                     bspLeafs[ MAX_MAP_LEAFS ];