diff --git a/source/tools/sced/ui/MainFrm.cpp b/source/tools/sced/ui/MainFrm.cpp index 69b90a202c..1b8d1f20d7 100755 --- a/source/tools/sced/ui/MainFrm.cpp +++ b/source/tools/sced/ui/MainFrm.cpp @@ -46,6 +46,8 @@ #include "SelectObjectTool.h" #include "simulation/Entity.h" +#include "Loader.h" + extern CLightEnv g_LightEnv; ///////////////////////////////////////////////////////////////////////////// @@ -616,9 +618,23 @@ void CMainFrame::OnFileLoadMap() dir=dir.Left(loaddlg.m_ofn.nFileOffset-1); g_UserCfg.SetOptionString(CFG_MAPLOADDIR,(const char*) dir); - CMapReader reader; try { - reader.LoadMap(loadname, g_Game->GetWorld()->GetTerrain(), &g_UnitMan, &g_LightEnv); + + LDR_BeginRegistering(); + CMapReader* reader = new CMapReader(); // freed by the progressive loader + reader->LoadMap(loadname, g_Game->GetWorld()->GetTerrain(), &g_UnitMan, &g_LightEnv); + LDR_EndRegistering(); + + int progress_percent; + wchar_t description[100]; + int ret; + do + { + ret = LDR_ProgressiveLoad(100.f, description, ARRAY_SIZE(description), &progress_percent); + assert(ret == 0 || ret == 1 || ret == ERR_TIMED_OUT); + } + while (ret != 0); + CStr filetitle=loaddlg.m_ofn.lpstrFileTitle; int index=filetitle.ReverseFind(CStr("."));