Granulate file loading too
parent
dfe1f03e5b
commit
dbc553343c
|
@ -642,14 +642,14 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)
|
||||||
|
|
||||||
// Dispatch the reading to the worker class for this format
|
// Dispatch the reading to the worker class for this format
|
||||||
DefaultLogger::get()->info("Found a matching importer for this file format");
|
DefaultLogger::get()->info("Found a matching importer for this file format");
|
||||||
pimpl->mProgressHandler->Update();
|
pimpl->mProgressHandler->UpdateFileRead( 0, 1 );
|
||||||
|
|
||||||
if (profiler) {
|
if (profiler) {
|
||||||
profiler->BeginRegion("import");
|
profiler->BeginRegion("import");
|
||||||
}
|
}
|
||||||
|
|
||||||
pimpl->mScene = imp->ReadFile( this, pFile, pimpl->mIOHandler);
|
pimpl->mScene = imp->ReadFile( this, pFile, pimpl->mIOHandler);
|
||||||
pimpl->mProgressHandler->Update();
|
pimpl->mProgressHandler->UpdateFileRead( 1, 1 );
|
||||||
|
|
||||||
if (profiler) {
|
if (profiler) {
|
||||||
profiler->EndRegion("import");
|
profiler->EndRegion("import");
|
||||||
|
|
|
@ -81,12 +81,25 @@ public:
|
||||||
* all needed cleanup tasks prior to returning control to the
|
* all needed cleanup tasks prior to returning control to the
|
||||||
* caller). If the loading is aborted, #Importer::ReadFile()
|
* caller). If the loading is aborted, #Importer::ReadFile()
|
||||||
* returns always NULL.
|
* returns always NULL.
|
||||||
*
|
|
||||||
* @note Currently, percentage is always -1.f because there is
|
|
||||||
* no reliable way to compute it.
|
|
||||||
* */
|
* */
|
||||||
virtual bool Update(float percentage = -1.f) = 0;
|
virtual bool Update(float percentage = -1.f) = 0;
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
/** @brief Progress callback for file loading steps
|
||||||
|
* @param numberOfSteps The number of total post-processing
|
||||||
|
* steps
|
||||||
|
* @param currentStep The index of the current post-processing
|
||||||
|
* step that will run, or equal to numberOfSteps if all of
|
||||||
|
* them has finished. This number is always strictly monotone
|
||||||
|
* increasing, although not necessarily linearly.
|
||||||
|
*
|
||||||
|
* @note This is currently only used at the start and the end
|
||||||
|
* of the file parsing.
|
||||||
|
* */
|
||||||
|
virtual void UpdateFileRead(int currentStep /*= 0*/, int numberOfSteps /*= 0*/) {
|
||||||
|
float f = currentStep / (float)numberOfSteps;
|
||||||
|
Update( f * 0.5f );
|
||||||
|
};
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** @brief Progress callback for post-processing steps
|
/** @brief Progress callback for post-processing steps
|
||||||
|
|
Loading…
Reference in New Issue