From c2b7df72ce3d3a23ecf2283d3adbd88aaec18795 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Thu, 24 Mar 2005 20:57:42 +0000 Subject: [PATCH] Updated ScEd binary. Fixed problem with loading maps. This was SVN commit r2046. --- source/tools/sced/ui/MainFrm.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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("."));