1
0
forked from 0ad/0ad

Updated ScEd binary. Fixed problem with loading maps.

This was SVN commit r2046.
This commit is contained in:
Ykkrosh 2005-03-24 20:57:42 +00:00
parent af7fa2fc6c
commit c2b7df72ce

View File

@ -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("."));