private static int calculateLoadingStages( Stream stream )
{
Quake3Level q3 = new Quake3Level( null );
// Load header only
q3.LoadHeaderFromStream( stream );
// Ok, count up the things that we will report
int stages = 0;
// loadEntities (1 stage)
++stages;
// extractLightmaps (external, 1 stage)
++stages;
// initQuake3Patches
++stages;
// vertex setup
++stages;
// face setup
++stages;
// patch building
++stages;
// material setup
// this is not strictly based on load, since we only know the number
// of faces, not the number of materials
// raise one event for every 50 faces, plus one at the end
//stages += (q3.Faces.Length / NUM_FACES_PER_PROGRESS_REPORT) + 1;
// node setup
//stages += (q3.Nodes.Length / NUM_NODES_PER_PROGRESS_REPORT) + 1;
// brush setup
//stages += (q3.Brushes.Length / NUM_BRUSHES_PER_PROGRESS_REPORT) + 1;
// leaf setup
//stages += (q3.Leaves.Length / NUM_LEAVES_PER_PROGRESS_REPORT) + 1;
// vis
++stages;
return stages;
}
}