PseudoCompileBSP()
a stripped down ProcessModels
*/
-void PseudoCompileBSP()
+void PseudoCompileBSP(qboolean need_tree)
{
int models;
char modelValue[10];
entity_t *entity;
+ face_t *faces;
tree_t *tree;
node_t *node;
brush_t *brush;
entity->firstDrawSurf = numMapDrawSurfs;
- node = AllocNode();
- node->planenum = PLANENUM_LEAF;
- tree = AllocTree();
- tree->headnode = node;
+ if(mapEntityNum == 0 && need_tree)
+ {
+ faces = MakeStructuralBSPFaceList(entities[0].brushes);
+ tree = FaceBSP(faces);
+ node = tree->headnode;
+ }
+ else
+ {
+ node = AllocNode();
+ node->planenum = PLANENUM_LEAF;
+ tree = AllocTree();
+ tree->headnode = node;
+ }
/* a minimized ClipSidesIntoTree */
for( brush = entity->brushes; brush; brush = brush->next )
side = &brush->sides[ i ];
if( side->winding == NULL )
continue;
+ /* shader? */
+ if( side->shaderInfo == NULL )
+ continue;
/* save this winding as a visible surface */
DrawSurfaceForSide(entity, brush, side, side->winding);
}
}
FilterDrawsurfsIntoTree(entity, tree);
+ FilterStructuralBrushesIntoTree(entity, tree);
+ FilterDetailBrushesIntoTree(entity, tree);
EmitBrushes(entity->brushes, &entity->firstBrush, &entity->numBrushes );
EndModel(entity, node);
else
{
convertGame = GetGame( argv[ i ] );
- map_allowed = qfalse;
+ map_allowed = qtrue;
if( convertGame == NULL )
Sys_Printf( "Unknown conversion format \"%s\". Defaulting to ASE.\n", argv[ i ] );
}
StripExtension(source);
DefaultExtension(source, ".map");
Sys_Printf("Loading %s\n", source);
- LoadMapFile(source, qfalse, qtrue);
- PseudoCompileBSP();
+ LoadMapFile(source, qfalse, convertGame == NULL);
+ PseudoCompileBSP(convertGame != NULL);
}
else
{