1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Implemented terrain serialisation

* with test
This commit is contained in:
AlexVinS
2015-08-18 01:56:16 +03:00
committed by AlexVinS
parent 3d63a97cf9
commit 3af255d1b9
5 changed files with 321 additions and 41 deletions

View File

@ -35,9 +35,9 @@ public:
{
CMapGenOptions opt;
opt.setHeight(72);
opt.setWidth(72);
opt.setHasTwoLevels(false);
opt.setHeight(CMapHeader::MAP_SIZE_SMALL);
opt.setWidth(CMapHeader::MAP_SIZE_SMALL);
opt.setHasTwoLevels(true);
opt.setPlayerCount(2);
CMapGenerator gen;
@ -66,7 +66,8 @@ BOOST_AUTO_TEST_CASE(CMapFormatVCMI_Simple)
{
auto path = VCMIDirs::get().userDataPath()/"temp.zip";
boost::filesystem::remove(path);
boost::filesystem::ofstream tmp(path);
boost::filesystem::ofstream tmp(path, boost::filesystem::ofstream::binary);
tmp.write((const char *)serializeBuffer.getBuffer().data(),serializeBuffer.getSize());
tmp.flush();
tmp.close();