.PHONY: all
all: \
+ dependencies-check \
binaries \
install-data \
install-dll \
$(WINDRES) $< $@
endif
-%.o: %.cpp dependencies-check $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),)
+%.o: %.cpp $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
$(CXX) $< $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
-%.o: %.c dependencies-check $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),)
+%.o: %.c dependencies-check $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
$(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
determines opaque brushes in the world and find sky shaders for sunlight calculations
*/
-void SetupBrushesFlags( int mask, int test )
+void SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all )
{
- int i, j, b, compileFlags;
+ int i, j, b;
+ unsigned int compileFlags, allCompileFlags;
qboolean inside;
bspBrush_t *brush;
bspBrushSide_t *side;
/* check all sides */
inside = qtrue;
compileFlags = 0;
+ allCompileFlags = ~(0u);
for( j = 0; j < brush->numSides && inside; j++ )
{
/* do bsp shader calculations */
side = &bspBrushSides[ brush->firstSide + j ];
shader = &bspShaders[ side->shaderNum ];
-
+
/* get shader info */
- si = ShaderInfoForShader( shader->shader );
+ si = ShaderInfoForShaderNull( shader->shader );
if( si == NULL )
continue;
/* or together compile flags */
compileFlags |= si->compileFlags;
+ allCompileFlags &= si->compileFlags;
}
/* determine if this brush is opaque to light */
- if( (compileFlags & mask) == test )
+ if( (compileFlags & mask_any) == test_any && (allCompileFlags & mask_all) == test_all )
{
opaqueBrushes[ b >> 3 ] |= (1 << (b & 7));
numOpaqueBrushes++;
}
void SetupBrushes( void )
{
- SetupBrushesFlags(C_TRANSLUCENT, 0);
+ SetupBrushesFlags(C_TRANSLUCENT, 0, 0, 0);
}
void MiniMapSetupBrushes( void )
{
- SetupBrushesFlags(C_SOLID | C_SKY, C_SOLID);
+ SetupBrushesFlags(C_SOLID | C_SKY, C_SOLID, C_NODRAW, 0);
+ // at least one must be solid
+ // none may be sky
+ // not all may be nodraw
}
qboolean MiniMapEvaluateSampleOffsets(int *bestj, int *bestk, float *bestval)
if(v > ma)
ma = v;
}
- s = 1 / (ma - mi);
- o = mi / (ma - mi);
-
- // equations:
- // brightness + contrast * v
- // after autolevel:
- // brightness + contrast * (v * s - o)
- // =
- // (brightness - contrast * o) + (contrast * s) * v
- minimap.brightness = minimap.brightness - minimap.contrast * o;
- minimap.contrast *= s;
-
- Sys_Printf( "Auto level: Brightness changed to %f\n", minimap.brightness );
- Sys_Printf( "Auto level: Contrast changed to %f\n", minimap.contrast );
+ if(ma > mi)
+ {
+ s = 1 / (ma - mi);
+ o = mi / (ma - mi);
+
+ // equations:
+ // brightness + contrast * v
+ // after autolevel:
+ // brightness + contrast * (v * s - o)
+ // =
+ // (brightness - contrast * o) + (contrast * s) * v
+ minimap.brightness = minimap.brightness - minimap.contrast * o;
+ minimap.contrast *= s;
+
+ Sys_Printf( "Auto level: Brightness changed to %f\n", minimap.brightness );
+ Sys_Printf( "Auto level: Contrast changed to %f\n", minimap.contrast );
+ }
+ else
+ Sys_Printf( "Auto level: failed because all pixels are the same value\n" );
}
if(minimap.brightness != 0 || minimap.contrast != 1)
void IlluminateRawLightmap( int num );
void IlluminateVertexes( int num );
-void SetupBrushesFlags( int mask, int test );
+void SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all );
void SetupBrushes( void );
void SetupClusters( void );
qboolean ClusterVisible( int a, int b );
void LoadShaderInfo( void );
shaderInfo_t *ShaderInfoForShader( const char *shader );
+shaderInfo_t *ShaderInfoForShaderNull( const char *shader );
/* bspfile_abstract.c */
#define MAX_SHADER_DEPRECATION_DEPTH 16
+shaderInfo_t *ShaderInfoForShaderNull( const char *shaderName )
+{
+ if(!strcmp(shaderName, "noshader"))
+ return NULL;
+ return ShaderInfoForShader(shaderName);
+}
+
shaderInfo_t *ShaderInfoForShader( const char *shaderName )
{
int i;