From 5223ef1fb116780298495a4d2f63e6c2c39fdfbd Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 10 Jul 2014 16:36:00 +0200 Subject: Fixed mission description loading --- src/ui/maindialog.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index ed5edb4..dffa424 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -4852,7 +4852,6 @@ void CMainDialog::UpdateSceneChap(int &chap) void CMainDialog::UpdateSceneList(int chap, int &sel) { - FILE* file = NULL; CWindow* pw; CList* pl; std::string fileName; @@ -4947,6 +4946,7 @@ void CMainDialog::UpdateSceneList(int chap, int &sel) #endif*/ } + /* TODO: ????? BuildSceneName(fileName, m_sceneName, (chap+1)*100+(j+1)); file = fopen(fileName.c_str(), "r"); if ( file == NULL ) @@ -4957,7 +4957,8 @@ void CMainDialog::UpdateSceneList(int chap, int &sel) { m_maxList = j+1; // this is not the last! fclose(file); - } + }*/ + m_maxList = j; if ( sel > j-1 ) sel = j-1; @@ -5008,7 +5009,6 @@ void CMainDialog::ShowSoluceUpdate() void CMainDialog::UpdateSceneResume(int rank) { - FILE* file = NULL; CWindow* pw; CEdit* pe; CCheck* pc; @@ -5048,11 +5048,12 @@ void CMainDialog::UpdateSceneResume(int rank) sprintf(op, "Resume.E"); sprintf(op_i18n, "Resume.%c", m_app->GetLanguageChar()); - file = fopen(fileName.c_str(), "r"); - if ( file == NULL ) return; + CInputStream stream; + stream.open(fileName); + if (!stream.is_open()) return; name[0] = 0; - while ( fgets(line, 500, file) != NULL ) + while ( stream.getline(line, 500) ) { for ( i=0 ; i<500 ; i++ ) { @@ -5077,7 +5078,7 @@ void CMainDialog::UpdateSceneResume(int rank) break; } } - fclose(file); + stream.close(); pe->SetText(name); } -- cgit v1.2.3-1-g7c22