|
Lines 23-28
Link Here
|
| 23 |
#include <iostream> |
23 |
#include <iostream> |
| 24 |
#include <string> |
24 |
#include <string> |
| 25 |
#include <cstdlib> |
25 |
#include <cstdlib> |
|
|
26 |
#ifdef CONFIGURE_FHEROES2_DATA |
| 27 |
#include <fstream> //needed for copying config files |
| 28 |
#endif |
| 26 |
|
29 |
|
| 27 |
#include "engine.h" |
30 |
#include "engine.h" |
| 28 |
#include "system.h" |
31 |
#include "system.h" |
|
Lines 290-295
void InitHomeDir(void)
Link Here
|
| 290 |
|
293 |
|
| 291 |
if(System::IsDirectory(home_files, true) && ! System::IsDirectory(home_files_save)) |
294 |
if(System::IsDirectory(home_files, true) && ! System::IsDirectory(home_files_save)) |
| 292 |
System::MakeDirectory(home_files_save); |
295 |
System::MakeDirectory(home_files_save); |
|
|
296 |
#ifdef CONFIGURE_FHEROES2_DATA |
| 297 |
const std::string home_cfg = System::ConcatePath(home, "fheroes2.cfg"); |
| 298 |
const std::string home_key = System::ConcatePath(home, "fheroes2.key"); |
| 299 |
const std::string system_cfg = System::ConcatePath(CONFIGURE_FHEROES2_DATA, "fheroes2.cfg"); |
| 300 |
const std::string system_key = System::ConcatePath(CONFIGURE_FHEROES2_DATA, "fheroes2.key"); |
| 301 |
if(! System::IsFile(home_cfg)) { |
| 302 |
std::ifstream src(system_cfg.c_str(), std::ios::binary); |
| 303 |
std::ofstream dst(home_cfg.c_str(), std::ios::binary); |
| 304 |
dst << src.rdbuf(); |
| 305 |
} |
| 306 |
if(! System::IsFile(home_key)) { |
| 307 |
std::ifstream src(system_key.c_str(), std::ios::binary); |
| 308 |
std::ofstream dst(home_key.c_str(), std::ios::binary); |
| 309 |
dst << src.rdbuf(); |
| 310 |
} |
| 311 |
#endif // CONFIGURE_FHEROES2_DATA |
| 293 |
} |
312 |
} |
| 294 |
} |
313 |
} |
| 295 |
|
314 |
|