MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ProcessMapEntity

Function ProcessMapEntity

neo/tools/compilers/dmap/map.cpp:405–430  ·  view source on GitHub ↗

================ ProcessMapEntity ================ */

Source from the content-addressed store, hash-verified

403================
404*/
405static bool ProcessMapEntity( idMapEntity *mapEnt ) {
406 idMapPrimitive *prim;
407
408 uEntity = &dmapGlobals.uEntities[dmapGlobals.num_entities];
409 memset( uEntity, 0, sizeof(*uEntity) );
410 uEntity->mapEntity = mapEnt;
411 dmapGlobals.num_entities++;
412
413 for ( entityPrimitive = 0; entityPrimitive < mapEnt->GetNumPrimitives(); entityPrimitive++ ) {
414 prim = mapEnt->GetPrimitive(entityPrimitive);
415
416 if ( prim->GetType() == idMapPrimitive::TYPE_BRUSH ) {
417 ParseBrush( static_cast<idMapBrush*>(prim), entityPrimitive );
418 }
419 else if ( prim->GetType() == idMapPrimitive::TYPE_PATCH ) {
420 ParsePatch( static_cast<idMapPatch*>(prim), entityPrimitive );
421 }
422 }
423
424 // never put an origin on the world, even if the editor left one there
425 if ( dmapGlobals.num_entities != 1 ) {
426 uEntity->mapEntity->epairs.GetVector( "origin", "", uEntity->origin );
427 }
428
429 return true;
430}
431
432//===================================================================
433

Callers 1

LoadDMapFileFunction · 0.85

Calls 6

ParseBrushFunction · 0.85
ParsePatchFunction · 0.85
GetNumPrimitivesMethod · 0.80
GetPrimitiveMethod · 0.80
GetVectorMethod · 0.60
GetTypeMethod · 0.45

Tested by

no test coverage detected