From: Rudolf Polzer Date: Thu, 24 Feb 2011 08:16:47 +0000 (+0100) Subject: IGNORE: whitespace-only changes X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2FdivVerent%2Fzeroradiant-split-up-the-q3map2-commit;p=xonotic%2Fnetradiant.git IGNORE: whitespace-only changes --- diff --git a/tools/quake3/q3map2/brush.c b/tools/quake3/q3map2/brush.c index 1093be3b..b7c50f4c 100644 --- a/tools/quake3/q3map2/brush.c +++ b/tools/quake3/q3map2/brush.c @@ -321,8 +321,6 @@ void SnapWeldVectorAccu(vec3_accu_t a, vec3_accu_t b, vec3_accu_t out) } } - - /* FixWinding() - ydnar removes degenerate edges from a winding diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index 3a16b0c2..f761fbb1 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -44,7 +44,6 @@ functions ------------------------------------------------------------------------------- */ - /* ProcessAdvertisements() copies advertisement info into the BSP structures @@ -268,7 +267,6 @@ void ProcessWorldModel( void ) char level[ 2 ], shader[ 1024 ]; const char *value; - /* sets integer blockSize from worldspawn "_blocksize" key if it exists */ value = ValueForKey( &entities[ 0 ], "_blocksize" ); if( value[ 0 ] == '\0' ) diff --git a/tools/quake3/q3map2/bspfile_abstract.c b/tools/quake3/q3map2/bspfile_abstract.c index 31b6f171..0ce23ed1 100644 --- a/tools/quake3/q3map2/bspfile_abstract.c +++ b/tools/quake3/q3map2/bspfile_abstract.c @@ -604,6 +604,7 @@ void UnparseEntities( void ) buf = bspEntData; end = buf; *end = 0; + /* run through entity list */ for( i = 0; i < numBSPEntities && i < numEntities; i++ ) @@ -821,7 +822,6 @@ void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castS { const char *value; - /* get cast shadows */ if( castShadows != NULL ) { diff --git a/tools/quake3/q3map2/facebsp.c b/tools/quake3/q3map2/facebsp.c index 270eefe2..4ebc00b7 100644 --- a/tools/quake3/q3map2/facebsp.c +++ b/tools/quake3/q3map2/facebsp.c @@ -225,6 +225,7 @@ void BuildFaceTree_r( node_t *node, face_t *list ) plane = &mapplanes[ splitPlaneNum ]; childLists[0] = NULL; childLists[1] = NULL; + for( split = list; split; split = next ) { /* set next */ diff --git a/tools/quake3/q3map2/game_nexuiz.h b/tools/quake3/q3map2/game_nexuiz.h index 0d23766d..9be29e0f 100644 --- a/tools/quake3/q3map2/game_nexuiz.h +++ b/tools/quake3/q3map2/game_nexuiz.h @@ -130,6 +130,7 @@ game_t struct { "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 }, { "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 }, + /* null */ { NULL, 0, 0, 0, 0, 0, 0 } } diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 8520edd7..1d629694 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -392,7 +392,7 @@ void CreateEntityLights( void ) intensity = intensity * pointScale; light->photons = intensity; - + light->type = EMIT_POINT; /* set falloff threshold */ @@ -766,7 +766,6 @@ int LightContributionToSample( trace_t *trace ) float d; vec3_t pushedOrigin; - /* project sample point into light plane */ d = DotProduct( trace->origin, light->normal ) - light->dist; if( d < 3.0f ) @@ -881,8 +880,7 @@ int LightContributionToSample( trace_t *trace ) { float distByNormal, radiusAtDist, sampleRadius; vec3_t pointAtDist, distToSample; - - + /* do cone calculation */ distByNormal = -DotProduct( trace->displacement, light->normal ); if( distByNormal < 0.0f ) @@ -1101,7 +1099,7 @@ int LightContributionToPoint( trace_t *trace ) /* clamp the distance to prevent super hot spots */ if( dist < 16.0f ) dist = 16.0f; - + /* attenuate */ add = light->photons / (dist * dist); } @@ -1264,7 +1262,6 @@ void TraceGrid( int num ) contribution_t contributions[ MAX_CONTRIBUTIONS ]; trace_t trace; - /* get grid points */ gp = &rawGridPoints[ num ]; bgp = &bspGridPoints[ num ]; @@ -1654,10 +1651,6 @@ void LightWorld( void ) if( dirty ) { Sys_Printf( "--- DirtyRawLightmap ---\n" ); - - - - RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap ); } @@ -1889,12 +1882,6 @@ int LightMain( int argc, char **argv ) Sys_Printf( "Dark lightmap seams enabled\n" ); } - - - - - - else if( !strcmp( argv[ i ], "-shadeangle" ) ) { shadeAngleDegrees = atof( argv[ i + 1 ] ); diff --git a/tools/quake3/q3map2/light_trace.c b/tools/quake3/q3map2/light_trace.c index 2a4e7e46..9627b825 100644 --- a/tools/quake3/q3map2/light_trace.c +++ b/tools/quake3/q3map2/light_trace.c @@ -1412,7 +1412,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ) if( ti->castShadows != 1 ) return qfalse; } - + /* receive shadows from same group and worldspawn group */ else if( trace->recvShadows > 1 ) { diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index 44d60d8a..122d6939 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -2109,7 +2109,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) lm->superLuxels[ lightmapNum ] = safe_malloc( size ); memset( lm->superLuxels[ lightmapNum ], 0, size ); } - + /* set style */ if( lightmapNum > 0 ) { @@ -2288,6 +2288,7 @@ void IlluminateRawLightmap( int rawLightmapNum ) if( *cluster < 0 || (lm->splotchFix && (luxel[ 0 ] <= ambientColor[ 0 ] || luxel[ 1 ] <= ambientColor[ 1 ] || luxel[ 2 ] <= ambientColor[ 2 ])) ) filterColor = qtrue; + if( deluxemap && lightmapNum == 0 && (*cluster < 0 || filter) ) filterDir = qtrue; diff --git a/tools/quake3/q3map2/main.c b/tools/quake3/q3map2/main.c index 86d4d498..b914de1f 100644 --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@ -1,4 +1,4 @@ -/* ------------------------------------------------------------------------------- +/* -------------------------------------------------------------------------------; Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. @@ -36,6 +36,8 @@ several games based on the Quake III Arena engine, in the form of "Q3Map2." /* dependencies */ #include "q3map2.h" + + /* Random() returns a pseudorandom number between 0 and 1 @@ -588,7 +590,7 @@ int main( int argc, char **argv ) /* set exit call */ atexit( ExitQ3Map ); - + /* read general options first */ for( i = 1; i < argc; i++ ) { @@ -635,7 +637,7 @@ int main( int argc, char **argv ) argv[ i ] = NULL; } } - + /* init model library */ PicoInit(); PicoSetMallocFunc( safe_malloc ); diff --git a/tools/quake3/q3map2/map.c b/tools/quake3/q3map2/map.c index 4ec5a381..03470f5a 100644 --- a/tools/quake3/q3map2/map.c +++ b/tools/quake3/q3map2/map.c @@ -1280,7 +1280,6 @@ void AdjustBrushesForOrigin( entity_t *ent ) brush_t *b; parseMesh_t *p; - /* walk brush list */ for( b = ent->brushes; b != NULL; b = b->next ) { diff --git a/tools/quake3/q3map2/patch.c b/tools/quake3/q3map2/patch.c index 58b8ea20..9cd707e2 100644 --- a/tools/quake3/q3map2/patch.c +++ b/tools/quake3/q3map2/patch.c @@ -227,7 +227,6 @@ void ParsePatch( qboolean onlyLights ) float longestCurve; int maxIterations; - MatchToken( "{" ); /* get texture */ diff --git a/tools/quake3/q3map2/prtfile.c b/tools/quake3/q3map2/prtfile.c index 6f36f758..eb11d0d9 100644 --- a/tools/quake3/q3map2/prtfile.c +++ b/tools/quake3/q3map2/prtfile.c @@ -102,6 +102,7 @@ void WritePortalFile_r (node_t *node) // plane the same way vis will, and flip the side orders if needed // FIXME: is this still relevent? WindingPlane (w, normal, &dist); + if ( DotProduct (p->plane.normal, normal) < 0.99 ) { // backwards... fprintf (pf,"%i %i %i ",w->numpoints, p->nodes[1]->cluster, p->nodes[0]->cluster); diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 78b2f7c1..2d4004a4 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -1028,7 +1028,7 @@ typedef struct mapDrawSurface_s int maxIterations; int patchWidth, patchHeight; vec3_t bounds[ 2 ]; - + /* ydnar/sd: for foliage */ int numFoliageInstances; @@ -1436,8 +1436,6 @@ typedef struct surfaceInfo_s } surfaceInfo_t; - - /* ------------------------------------------------------------------------------- prototypes diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 321a527b..06e95d34 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -806,8 +806,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ) int i; shaderInfo_t *si; char shader[ MAX_QPATH ]; - - + /* dummy check */ if( shaderName == NULL || shaderName[ 0 ] == '\0' ) { @@ -1337,7 +1336,6 @@ static void ParseShaderFile( const char *filename ) { surfaceModel_t *model; - /* allocate new model and attach it */ model = safe_malloc( sizeof( *model ) ); memset( model, 0, sizeof( *model ) ); diff --git a/tools/quake3/q3map2/surface.c b/tools/quake3/q3map2/surface.c index 5415ae10..a86eb318 100644 --- a/tools/quake3/q3map2/surface.c +++ b/tools/quake3/q3map2/surface.c @@ -2445,8 +2445,6 @@ void EmitFlareSurface( mapDrawSurface_t *ds ) numSurfacesByType[ ds->type ]++; } - - /* EmitPatchSurface() emits a bsp patch drawsurface @@ -2463,7 +2461,6 @@ void EmitPatchSurface( mapDrawSurface_t *ds ) if( ds->backSide || ds->shaderInfo->invert ) { bspDrawVert_t *dv1, *dv2, temp; - /* walk the verts, flip the normal */ for( i = 0; i < ds->numVerts; i++ ) @@ -2485,7 +2482,7 @@ void EmitPatchSurface( mapDrawSurface_t *ds ) /* invert facing */ VectorScale( ds->lightmapVecs[ 2 ], -1.0f, ds->lightmapVecs[ 2 ] ); } - + /* allocate a new surface */ if( numBSPDrawSurfaces == MAX_MAP_DRAW_SURFS ) Error( "MAX_MAP_DRAW_SURFS" ); @@ -2493,7 +2490,7 @@ void EmitPatchSurface( mapDrawSurface_t *ds ) ds->outputNum = numBSPDrawSurfaces; numBSPDrawSurfaces++; memset( out, 0, sizeof( *out ) ); - + /* set it up */ out->surfaceType = MST_PATCH; if( debugSurfaces ) @@ -2548,8 +2545,6 @@ void EmitPatchSurface( mapDrawSurface_t *ds ) numSurfacesByType[ ds->type ]++; } - - /* OptimizeTriangleSurface() - ydnar optimizes the vertex/index data in a triangle surface @@ -2677,8 +2672,7 @@ static void EmitTriangleSurface( mapDrawSurface_t *ds ) { int i, temp; bspDrawSurface_t *out; - - + /* invert the surface if necessary */ if( ds->backSide || ds->shaderInfo->invert ) { @@ -2689,15 +2683,15 @@ static void EmitTriangleSurface( mapDrawSurface_t *ds ) ds->indexes[ i ] = ds->indexes[ i + 1 ]; ds->indexes[ i + 1 ] = temp; } - + /* walk the verts, flip the normal */ for( i = 0; i < ds->numVerts; i++ ) VectorScale( ds->verts[ i ].normal, -1.0f, ds->verts[ i ].normal ); - + /* invert facing */ VectorScale( ds->lightmapVecs[ 2 ], -1.0f, ds->lightmapVecs[ 2 ] ); } - + /* allocate a new surface */ if( numBSPDrawSurfaces == MAX_MAP_DRAW_SURFS ) Error( "MAX_MAP_DRAW_SURFS" ); @@ -2812,7 +2806,6 @@ static void EmitFaceSurface( mapDrawSurface_t *ds ) } - /* MakeDebugPortalSurfs_r() - ydnar generates drawsurfaces for passable portals in the bsp @@ -3424,7 +3417,7 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t *tree ) /* get shader */ si = ds->shaderInfo; - + /* ydnar: skybox surfaces are special */ if( ds->skybox ) { diff --git a/tools/quake3/q3map2/surface_meta.c b/tools/quake3/q3map2/surface_meta.c index 9191ac14..c4f82c55 100644 --- a/tools/quake3/q3map2/surface_meta.c +++ b/tools/quake3/q3map2/surface_meta.c @@ -84,7 +84,7 @@ static int FindMetaVertex( bspDrawVert_t *src ) { int i; bspDrawVert_t *v, *temp; - + /* try to find an existing drawvert */ for( i = firstSearchMetaVert, v = &metaVerts[ i ]; i < numMetaVerts; i++, v++ ) @@ -657,7 +657,7 @@ void MakeEntityMetaTriangles( entity_t *e ) case SURFACE_TRIANGLES: break; - + case SURFACE_FORCED_META: case SURFACE_META: SurfaceToMetaTriangles( ds ); @@ -973,7 +973,6 @@ void SmoothMetaTriangles( void ) int indexes[ MAX_SAMPLES ]; vec3_t votes[ MAX_SAMPLES ]; - /* note it */ Sys_FPrintf( SYS_VRB, "--- SmoothMetaTriangles ---\n" ); @@ -999,6 +998,7 @@ void SmoothMetaTriangles( void ) shadeAngle = DEG2RAD( tri->si->shadeAngleDegrees ); else shadeAngle = defaultShadeAngle; + if( shadeAngle > maxShadeAngle ) maxShadeAngle = shadeAngle; diff --git a/tools/quake3/q3map2/vis.c b/tools/quake3/q3map2/vis.c index 4ee843a0..dc764ba8 100644 --- a/tools/quake3/q3map2/vis.c +++ b/tools/quake3/q3map2/vis.c @@ -1074,7 +1074,9 @@ int VisMain (int argc, char **argv) } else + { Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] ); + } } if( i != argc - 1 )