2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 ----------------------------------------------------------------------------------
23 This code has been altered significantly from its original form, to support
24 several games based on the Quake III Arena engine, in the form of "Q3Map2."
26 ------------------------------------------------------------------------------- */
40 /* -------------------------------------------------------------------------------
44 ------------------------------------------------------------------------------- */
48 ProcessAdvertisements()
49 copies advertisement info into the BSP structures
52 static void ProcessAdvertisements( void ) {
54 const char* className;
58 bspDrawSurface_t* adSurface;
60 Sys_FPrintf( SYS_VRB, "--- ProcessAdvertisements ---\n" );
62 for( i = 0; i < numEntities; i++ ) {
64 /* is an advertisement? */
65 className = ValueForKey( &entities[ i ], "classname" );
67 if( !Q_stricmp( "advertisement", className ) ) {
69 modelKey = ValueForKey( &entities[ i ], "model" );
71 if( strlen( modelKey ) > MAX_QPATH - 1 ) {
72 Error( "Model Key for entity exceeds ad struct string length." );
74 if( numBSPAds < MAX_MAP_ADVERTISEMENTS ) {
75 bspAds[numBSPAds].cellId = IntForKey( &entities[ i ], "cellId" );
76 strncpy( bspAds[numBSPAds].model, modelKey, sizeof( bspAds[numBSPAds].model ) );
79 modelNum = atoi( modelKey );
80 adModel = &bspModels[modelNum];
82 if( adModel->numBSPSurfaces != 1 ) {
83 Error( "Ad cell id %d has more than one surface.", bspAds[numBSPAds].cellId );
86 adSurface = &bspDrawSurfaces[adModel->firstBSPSurface];
88 // store the normal for use at run time.. all ad verts are assumed to
89 // have identical normals (because they should be a simple rectangle)
90 // so just use the first vert's normal
91 VectorCopy( bspDrawVerts[adSurface->firstVert].normal, bspAds[numBSPAds].normal );
93 // store the ad quad for quick use at run time
94 if( adSurface->surfaceType == MST_PATCH ) {
95 int v0 = adSurface->firstVert + adSurface->patchHeight - 1;
96 int v1 = adSurface->firstVert + adSurface->numVerts - 1;
97 int v2 = adSurface->firstVert + adSurface->numVerts - adSurface->patchWidth;
98 int v3 = adSurface->firstVert;
99 VectorCopy( bspDrawVerts[v0].xyz, bspAds[numBSPAds].rect[0] );
100 VectorCopy( bspDrawVerts[v1].xyz, bspAds[numBSPAds].rect[1] );
101 VectorCopy( bspDrawVerts[v2].xyz, bspAds[numBSPAds].rect[2] );
102 VectorCopy( bspDrawVerts[v3].xyz, bspAds[numBSPAds].rect[3] );
104 Error( "Ad cell %d has an unsupported Ad Surface type.", bspAds[numBSPAds].cellId );
109 Error( "Maximum number of map advertisements exceeded." );
115 Sys_FPrintf( SYS_VRB, "%9d in-game advertisements\n", numBSPAds );
119 SetCloneModelNumbers() - ydnar
120 sets the model numbers for brush entities
123 static void SetCloneModelNumbers( void )
127 char modelValue[ 10 ];
128 const char *value, *value2, *value3;
131 /* start with 1 (worldspawn is model 0) */
133 for( i = 1; i < numEntities; i++ )
135 /* only entities with brushes or patches get a model number */
136 if( entities[ i ].brushes == NULL && entities[ i ].patches == NULL )
139 /* is this a clone? */
140 value = ValueForKey( &entities[ i ], "_clone" );
141 if( value[ 0 ] != '\0' )
144 /* add the model key */
145 sprintf( modelValue, "*%d", models );
146 SetKeyValue( &entities[ i ], "model", modelValue );
148 /* increment model count */
153 for( i = 1; i < numEntities; i++ )
155 /* only entities with brushes or patches get a model number */
156 if( entities[ i ].brushes == NULL && entities[ i ].patches == NULL )
159 /* is this a clone? */
160 value = ValueForKey( &entities[ i ], "_ins" );
161 if( value[ 0 ] == '\0' )
162 value = ValueForKey( &entities[ i ], "_instance" );
163 if( value[ 0 ] == '\0' )
164 value = ValueForKey( &entities[ i ], "_clone" );
165 if( value[ 0 ] == '\0' )
168 /* find an entity with matching clone name */
169 for( j = 0; j < numEntities; j++ )
171 /* is this a clone parent? */
172 value2 = ValueForKey( &entities[ j ], "_clonename" );
173 if( value2[ 0 ] == '\0' )
177 if( strcmp( value, value2 ) == 0 )
179 /* get the model num */
180 value3 = ValueForKey( &entities[ j ], "model" );
181 if( value3[ 0 ] == '\0' )
183 Sys_Printf( "WARNING: Cloned entity %s referenced entity without model\n", value2 );
186 models = atoi( &value2[ 1 ] );
188 /* add the model key */
189 sprintf( modelValue, "*%d", models );
190 SetKeyValue( &entities[ i ], "model", modelValue );
192 /* nuke the brushes/patches for this entity (fixme: leak!) */
193 entities[ i ].brushes = NULL;
194 entities[ i ].patches = NULL;
203 FixBrushSides() - ydnar
204 matches brushsides back to their appropriate drawsurface and shader
207 static void FixBrushSides( entity_t *e )
210 mapDrawSurface_t *ds;
212 bspBrushSide_t *side;
216 Sys_FPrintf( SYS_VRB, "--- FixBrushSides ---\n" );
218 /* walk list of drawsurfaces */
219 for( i = e->firstDrawSurf; i < numMapDrawSurfs; i++ )
221 /* get surface and try to early out */
222 ds = &mapDrawSurfs[ i ];
223 if( ds->outputNum < 0 )
226 /* walk sideref list */
227 for( sideRef = ds->sideRef; sideRef != NULL; sideRef = sideRef->next )
229 /* get bsp brush side */
230 if( sideRef->side == NULL || sideRef->side->outputNum < 0 )
232 side = &bspBrushSides[ sideRef->side->outputNum ];
234 /* set drawsurface */
235 side->surfaceNum = ds->outputNum;
236 //% Sys_FPrintf( SYS_VRB, "DS: %7d Side: %7d ", ds->outputNum, sideRef->side->outputNum );
239 if( strcmp( bspShaders[ side->shaderNum ].shader, ds->shaderInfo->shader ) )
241 //% Sys_FPrintf( SYS_VRB, "Remapping %s to %s\n", bspShaders[ side->shaderNum ].shader, ds->shaderInfo->shader );
242 side->shaderNum = EmitShader( ds->shaderInfo->shader, &ds->shaderInfo->contentFlags, &ds->shaderInfo->surfaceFlags );
252 creates a full bsp + surfaces for the worldspawn entity
255 void ProcessWorldModel( void )
261 qboolean ignoreLeaks, leaked;
262 xmlNodePtr polyline, leaknode;
263 char level[ 2 ], shader[ 1024 ];
267 /* sets integer blockSize from worldspawn "_blocksize" key if it exists */
268 value = ValueForKey( &entities[ 0 ], "_blocksize" );
269 if( value[ 0 ] == '\0' )
270 value = ValueForKey( &entities[ 0 ], "blocksize" );
271 if( value[ 0 ] == '\0' )
272 value = ValueForKey( &entities[ 0 ], "chopsize" ); /* sof2 */
273 if( value[ 0 ] != '\0' )
276 s = sscanf( value, "%d %d %d", &blockSize[ 0 ], &blockSize[ 1 ], &blockSize[ 2 ] );
278 /* handle legacy case */
281 blockSize[ 1 ] = blockSize[ 0 ];
282 blockSize[ 2 ] = blockSize[ 0 ];
285 Sys_Printf( "block size = { %d %d %d }\n", blockSize[ 0 ], blockSize[ 1 ], blockSize[ 2 ] );
287 /* sof2: ignore leaks? */
288 value = ValueForKey( &entities[ 0 ], "_ignoreleaks" ); /* ydnar */
289 if( value[ 0 ] == '\0' )
290 value = ValueForKey( &entities[ 0 ], "ignoreleaks" );
291 if( value[ 0 ] == '1' )
294 ignoreLeaks = qfalse;
296 /* begin worldspawn model */
299 e->firstDrawSurf = 0;
302 ClearMetaTriangles();
304 /* check for patches with adjacent edges that need to lod together */
305 PatchMapDrawSurfs( e );
307 /* build an initial bsp tree using all of the sides of all of the structural brushes */
308 faces = MakeStructuralBSPFaceList( entities[ 0 ].brushes );
309 tree = FaceBSP( faces );
310 MakeTreePortals( tree );
311 FilterStructuralBrushesIntoTree( e, tree );
313 /* see if the bsp is completely enclosed */
314 if( FloodEntities( tree ) || ignoreLeaks )
316 /* rebuild a better bsp tree using only the sides that are visible from the inside */
317 FillOutside( tree->headnode );
319 /* chop the sides to the convex hull of their visible fragments, giving us the smallest polygons */
320 ClipSidesIntoTree( e, tree );
322 /* build a visible face tree */
323 faces = MakeVisibleBSPFaceList( entities[ 0 ].brushes );
325 tree = FaceBSP( faces );
326 MakeTreePortals( tree );
327 FilterStructuralBrushesIntoTree( e, tree );
330 /* ydnar: flood again for skybox */
332 FloodEntities( tree );
336 Sys_FPrintf( SYS_NOXML, "**********************\n" );
337 Sys_FPrintf( SYS_NOXML, "******* leaked *******\n" );
338 Sys_FPrintf( SYS_NOXML, "**********************\n" );
339 polyline = LeakFile( tree );
340 leaknode = xmlNewNode( NULL, "message" );
341 xmlNodeSetContent( leaknode, "MAP LEAKED\n" );
342 xmlAddChild( leaknode, polyline );
343 level[0] = (int) '0' + SYS_ERR;
345 xmlSetProp( leaknode, "level", (char*) &level );
346 xml_SendNode( leaknode );
349 Sys_Printf ("--- MAP LEAKED, ABORTING LEAKTEST ---\n");
354 /* chop the sides to the convex hull of their visible fragments, giving us the smallest polygons */
355 ClipSidesIntoTree( e, tree );
358 /* save out information for visibility processing */
359 NumberClusters( tree );
361 WritePortalFile( tree );
363 /* flood from entities */
366 /* create drawsurfs for triangle models */
367 AddTriangleModels( e );
369 /* create drawsurfs for surface models */
370 AddEntitySurfaceModels( e );
372 /* generate bsp brushes from map brushes */
373 EmitBrushes( e->brushes, &e->firstBrush, &e->numBrushes );
375 /* add references to the detail brushes */
376 FilterDetailBrushesIntoTree( e, tree );
378 /* drawsurfs that cross fog boundaries will need to be split along the fog boundary */
380 FogDrawSurfaces( e );
382 /* subdivide each drawsurf as required by shader tesselation */
384 SubdivideFaceSurfaces( e, tree );
386 /* add in any vertexes required to fix t-junctions */
390 /* ydnar: classify the surfaces */
391 ClassifyEntitySurfaces( e );
393 /* ydnar: project decals */
394 MakeEntityDecals( e );
396 /* ydnar: meta surfaces */
397 MakeEntityMetaTriangles( e );
398 SmoothMetaTriangles();
400 MergeMetaTriangles();
402 /* ydnar: debug portals */
404 MakeDebugPortalSurfs( tree );
406 /* ydnar: fog hull */
407 value = ValueForKey( &entities[ 0 ], "_foghull" );
408 if( value[ 0 ] != '\0' )
410 sprintf( shader, "textures/%s", value );
411 MakeFogHullSurfs( e, tree, shader );
414 /* ydnar: bug 645: do flares for lights */
415 for( i = 0; i < numEntities && emitFlares; i++ )
417 entity_t *light, *target;
418 const char *value, *flareShader;
419 vec3_t origin, targetOrigin, normal, color;
424 light = &entities[ i ];
425 value = ValueForKey( light, "classname" );
426 if( !strcmp( value, "light" ) )
428 /* get flare shader */
429 flareShader = ValueForKey( light, "_flareshader" );
430 value = ValueForKey( light, "_flare" );
431 if( flareShader[ 0 ] != '\0' || value[ 0 ] != '\0' )
434 GetVectorForKey( light, "origin", origin );
435 GetVectorForKey( light, "_color", color );
436 lightStyle = IntForKey( light, "_style" );
437 if( lightStyle == 0 )
438 lightStyle = IntForKey( light, "style" );
440 /* handle directional spotlights */
441 value = ValueForKey( light, "target" );
442 if( value[ 0 ] != '\0' )
444 /* get target light */
445 target = FindTargetEntity( value );
448 GetVectorForKey( target, "origin", targetOrigin );
449 VectorSubtract( targetOrigin, origin, normal );
450 VectorNormalize( normal, normal );
454 //% VectorClear( normal );
455 VectorSet( normal, 0, 0, -1 );
457 /* create the flare surface (note shader defaults automatically) */
458 DrawSurfaceForFlare( mapEntityNum, origin, normal, color, (char*) flareShader, lightStyle );
463 /* add references to the final drawsurfs in the apropriate clusters */
464 FilterDrawsurfsIntoTree( e, tree );
466 /* match drawsurfaces back to original brushsides (sof2) */
470 EndModel( e, tree->headnode );
478 creates bsp + surfaces for other brush models
481 void ProcessSubModel( void )
489 /* start a brush model */
491 e = &entities[ mapEntityNum ];
492 e->firstDrawSurf = numMapDrawSurfs;
495 ClearMetaTriangles();
497 /* check for patches with adjacent edges that need to lod together */
498 PatchMapDrawSurfs( e );
500 /* allocate a tree */
502 node->planenum = PLANENUM_LEAF;
504 tree->headnode = node;
506 /* add the sides to the tree */
507 ClipSidesIntoTree( e, tree );
509 /* ydnar: create drawsurfs for triangle models */
510 AddTriangleModels( e );
512 /* create drawsurfs for surface models */
513 AddEntitySurfaceModels( e );
515 /* generate bsp brushes from map brushes */
516 EmitBrushes( e->brushes, &e->firstBrush, &e->numBrushes );
518 /* just put all the brushes in headnode */
519 for( b = e->brushes; b; b = b->next )
522 bc->next = node->brushlist;
523 node->brushlist = bc;
526 /* subdivide each drawsurf as required by shader tesselation */
528 SubdivideFaceSurfaces( e, tree );
530 /* add in any vertexes required to fix t-junctions */
534 /* ydnar: classify the surfaces and project lightmaps */
535 ClassifyEntitySurfaces( e );
537 /* ydnar: project decals */
538 MakeEntityDecals( e );
540 /* ydnar: meta surfaces */
541 MakeEntityMetaTriangles( e );
542 SmoothMetaTriangles();
544 MergeMetaTriangles();
546 /* add references to the final drawsurfs in the apropriate clusters */
547 FilterDrawsurfsIntoTree( e, tree );
549 /* match drawsurfaces back to original brushsides (sof2) */
561 process world + other models into the bsp
564 void ProcessModels( void )
570 /* preserve -v setting */
571 oldVerbose = verbose;
573 /* start a new bsp */
576 /* create map fogs */
579 /* walk entity list */
580 for( mapEntityNum = 0; mapEntityNum < numEntities; mapEntityNum++ )
583 entity = &entities[ mapEntityNum ];
584 if( entity->brushes == NULL && entity->patches == NULL )
587 /* process the model */
588 Sys_FPrintf( SYS_VRB, "############### model %i ###############\n", numBSPModels );
589 if( mapEntityNum == 0 )
594 /* potentially turn off the deluge of text */
595 verbose = verboseEntities;
598 /* restore -v setting */
599 verbose = oldVerbose;
609 this is probably broken unless teamed with a radiant version that preserves entity order
612 void OnlyEnts( void )
618 Sys_Printf( "--- OnlyEnts ---\n" );
620 sprintf( out, "%s.bsp", source );
625 LoadMapFile( name, qfalse );
629 numBSPEntities = numEntities;
639 handles creation of a bsp from a map file
642 int BSPMain( int argc, char **argv )
645 char path[ 1024 ], tempSource[ 1024 ];
646 qboolean onlyents = qfalse;
650 Sys_Printf( "--- BSP ---\n" );
652 SetDrawSurfacesBuffer();
653 mapDrawSurfs = safe_malloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
654 memset( mapDrawSurfs, 0, sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
657 tempSource[ 0 ] = '\0';
659 /* set flares flag */
660 emitFlares = game->emitFlares;
662 /* process arguments */
663 for( i = 1; i < (argc - 1); i++ )
665 if( !strcmp( argv[ i ], "-onlyents" ) )
667 Sys_Printf( "Running entity-only compile\n" );
670 else if( !strcmp( argv[ i ], "-tempname" ) )
671 strcpy( tempSource, argv[ ++i ] );
672 else if( !strcmp( argv[ i ], "-tmpout" ) )
673 strcpy( outbase, "/tmp" );
674 else if( !strcmp( argv[ i ], "-nowater" ) )
676 Sys_Printf( "Disabling water\n" );
679 else if( !strcmp( argv[ i ], "-nodetail" ) )
681 Sys_Printf( "Ignoring detail brushes\n") ;
684 else if( !strcmp( argv[ i ], "-fulldetail" ) )
686 Sys_Printf( "Turning detail brushes into structural brushes\n" );
689 else if( !strcmp( argv[ i ], "-nofog" ) )
691 Sys_Printf( "Fog volumes disabled\n" );
694 else if( !strcmp( argv[ i ], "-nosubdivide" ) )
696 Sys_Printf( "Disabling brush face subdivision\n" );
699 else if( !strcmp( argv[ i ], "-leaktest" ) )
701 Sys_Printf( "Leaktest enabled\n" );
704 else if( !strcmp( argv[ i ], "-verboseentities" ) )
706 Sys_Printf( "Verbose entities enabled\n" );
707 verboseEntities = qtrue;
709 else if( !strcmp( argv[ i ], "-nocurves" ) )
711 Sys_Printf( "Ignoring curved surfaces (patches)\n" );
712 noCurveBrushes = qtrue;
714 else if( !strcmp( argv[ i ], "-notjunc" ) )
716 Sys_Printf( "T-junction fixing disabled\n" );
719 else if( !strcmp( argv[ i ], "-fakemap" ) )
721 Sys_Printf( "Generating fakemap.map\n" );
724 else if( !strcmp( argv[ i ], "-samplesize" ) )
726 sampleSize = atoi( argv[ i + 1 ] );
730 Sys_Printf( "Lightmap sample size set to %dx%d units\n", sampleSize, sampleSize );
732 else if( !strcmp( argv[ i ], "-custinfoparms") )
734 Sys_Printf( "Custom info parms enabled\n" );
735 useCustomInfoParms = qtrue;
739 else if( !strcmp( argv[ i ], "-rename" ) )
741 Sys_Printf( "Appending _bsp suffix to misc_model shaders (SOF2)\n" );
742 renameModelShaders = qtrue;
746 else if( !strcmp( argv[ i ], "-ne" ) )
748 normalEpsilon = atof( argv[ i + 1 ] );
750 Sys_Printf( "Normal epsilon set to %f\n", normalEpsilon );
752 else if( !strcmp( argv[ i ], "-de" ) )
754 distanceEpsilon = atof( argv[ i + 1 ] );
756 Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon );
758 else if( !strcmp( argv[ i ], "-mv" ) )
760 maxSurfaceVerts = atoi( argv[ i + 1 ] );
761 if( maxSurfaceVerts < 3 )
764 Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts );
766 else if( !strcmp( argv[ i ], "-mi" ) )
768 maxSurfaceIndexes = atoi( argv[ i + 1 ] );
769 if( maxSurfaceIndexes < 3 )
770 maxSurfaceIndexes = 3;
772 Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
774 else if( !strcmp( argv[ i ], "-np" ) )
776 npDegrees = atof( argv[ i + 1 ] );
777 if( npDegrees < 0.0f )
778 shadeAngleDegrees = 0.0f;
779 else if( npDegrees > 0.0f )
780 Sys_Printf( "Forcing nonplanar surfaces with a breaking angle of %f degrees\n", npDegrees );
783 else if( !strcmp( argv[ i ], "-snap" ) )
785 bevelSnap = atoi( argv[ i + 1 ]);
790 Sys_Printf( "Snapping brush bevel planes to %d units\n", bevelSnap );
792 else if( !strcmp( argv[ i ], "-texrange" ) )
794 texRange = atoi( argv[ i + 1 ]);
798 Sys_Printf( "Limiting per-surface texture range to %d texels\n", texRange );
800 else if( !strcmp( argv[ i ], "-nohint" ) )
802 Sys_Printf( "Hint brushes disabled\n" );
805 else if( !strcmp( argv[ i ], "-flat" ) )
807 Sys_Printf( "Flatshading enabled\n" );
810 else if( !strcmp( argv[ i ], "-meta" ) )
812 Sys_Printf( "Creating meta surfaces from brush faces\n" );
815 else if( !strcmp( argv[ i ], "-patchmeta" ) )
817 Sys_Printf( "Creating meta surfaces from patches\n" );
820 else if( !strcmp( argv[ i ], "-flares" ) )
822 Sys_Printf( "Flare surfaces enabled\n" );
825 else if( !strcmp( argv[ i ], "-noflares" ) )
827 Sys_Printf( "Flare surfaces disabled\n" );
830 else if( !strcmp( argv[ i ], "-skyfix" ) )
832 Sys_Printf( "GL_CLAMP sky fix/hack/workaround enabled\n" );
835 else if( !strcmp( argv[ i ], "-debugsurfaces" ) )
837 Sys_Printf( "emitting debug surfaces\n" );
838 debugSurfaces = qtrue;
840 else if( !strcmp( argv[ i ], "-debuginset" ) )
842 Sys_Printf( "Debug surface triangle insetting enabled\n" );
845 else if( !strcmp( argv[ i ], "-debugportals" ) )
847 Sys_Printf( "Debug portal surfaces enabled\n" );
848 debugPortals = qtrue;
850 else if( !strcmp( argv[ i ], "-bsp" ) )
851 Sys_Printf( "-bsp argument unnecessary\n" );
853 Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] );
856 /* fixme: print more useful usage here */
857 if( i != (argc - 1) )
858 Error( "usage: q3map [options] mapfile" );
860 /* copy source name */
861 strcpy( source, ExpandArg( argv[ i ] ) );
862 StripExtension( source );
864 /* ydnar: set default sample size */
865 SetDefaultSampleSize( sampleSize );
867 /* delete portal, line and surface files */
868 sprintf( path, "%s.prt", source );
870 sprintf( path, "%s.lin", source );
872 //% sprintf( path, "%s.srf", source ); /* ydnar */
876 strcpy( name, ExpandArg( argv[ i ] ) );
877 if( strcmp( name + strlen( name ) - 4, ".reg" ) )
879 /* if we are doing a full map, delete the last saved region map */
880 sprintf( path, "%s.reg", source );
882 DefaultExtension( name, ".map" ); /* might be .reg */
885 /* if onlyents, just grab the entites and resave */
895 /* load original file from temp spot in case it was renamed by the editor on the way in */
896 if( strlen( tempSource ) > 0 )
897 LoadMapFile( tempSource, qfalse );
899 LoadMapFile( name, qfalse );
901 /* ydnar: decal setup */
904 /* ydnar: cloned brush model entities */
905 SetCloneModelNumbers();
907 /* process world and submodels */
910 /* set light styles from targetted light entities */
913 /* process in game advertisements */
914 ProcessAdvertisements();
916 /* finish and write bsp */
919 /* remove temp map source file if appropriate */
920 if( strlen( tempSource ) > 0)
921 remove( tempSource );
923 /* return to sender */