aboutsummaryrefslogtreecommitdiff
path: root/src/map.h
Commit message (Expand)AuthorAge
...
* mapgen stuffPerttu Ahola2011-02-05
* added sand to map generatorPerttu Ahola2011-02-04
* This map generator is starting to look pretty good now... also, disabled load...Perttu Ahola2011-02-01
* partly working chunk-based map generator (doesn't save properly, spawn is pre...Perttu Ahola2011-02-01
* map generation framework under development... not quite operational at this p...Perttu Ahola2011-01-30
* Reworked texture, material, mineral and whatever handlingPerttu Ahola2011-01-26
* Faster lighting at map generation timePerttu Ahola2011-01-24
* minecraft-style water done (but no texture animation or sound)Perttu Ahola2011-01-17
* old water removed, some fixes here and therePerttu Ahola2011-01-17
* fine-tuning of map generator and server and stuff.Perttu Ahola2011-01-17
* Initial commit of mapgen v.2. Lacks configuration and saving to disk.Perttu Ahola2011-01-16
* removing unused code and commentsPerttu Ahola2011-01-07
* drawing range updater update and myrand() (but not usage of it)Perttu Ahola2010-12-26
* new viewing range updater algorithmPerttu Ahola2010-12-26
* better cavesPerttu Ahola2010-12-25
* organizing stuff.Perttu Ahola2010-12-21
* Cracking blocks while diggingPerttu Ahola2010-12-21
* some tinkering with gui. removed updating of configuration file at endPerttu Ahola2010-12-20
* added dedicated server build without irrlichtPerttu Ahola2010-12-19
* day/night working client sidePerttu Ahola2010-12-19
* before daynight mesh cachePerttu Ahola2010-12-18
* tinkering aroundPerttu Ahola2010-12-14
* in before messing with face drawing orientationPerttu Ahola2010-12-14
* starting to separate "material" to "content" and "tile"Perttu Ahola2010-12-12
* commit before some radicallish changes to water behaviorPerttu Ahola2010-12-11
* license stuffPerttu Ahola2010-11-29
* default setting change, random tinkeringPerttu Ahola2010-11-29
* Windows bug fixesPerttu Ahola2010-11-29
* fixed face updating slowness bugPerttu Ahola2010-11-29
* sitä sun tätä tekeillä, toimii kivastiPerttu Ahola2010-11-29
* Working version before block send priorization updatePerttu Ahola2010-11-27
* Initial filesPerttu Ahola2010-11-27
">(IGameDef *gamedef) { TEST(testRLECompression); TEST(testZlibCompression); TEST(testZlibLargeData); } //////////////////////////////////////////////////////////////////////////////// void TestCompression::testRLECompression() { SharedBuffer<u8> fromdata(4); fromdata[0]=1; fromdata[1]=5; fromdata[2]=5; fromdata[3]=1; std::ostringstream os(std::ios_base::binary); compress(fromdata, os, 0); std::string str_out = os.str(); infostream << "str_out.size()="<<str_out.size()<<std::endl; infostream << "TestCompress: 1,5,5,1 -> "; for (char i : str_out) infostream << (u32) i << ","; infostream << std::endl; UASSERT(str_out.size() == 10); UASSERT(str_out[0] == 0); UASSERT(str_out[1] == 0); UASSERT(str_out[2] == 0); UASSERT(str_out[3] == 4); UASSERT(str_out[4] == 0); UASSERT(str_out[5] == 1); UASSERT(str_out[6] == 1); UASSERT(str_out[7] == 5); UASSERT(str_out[8] == 0); UASSERT(str_out[9] == 1); std::istringstream is(str_out, std::ios_base::binary); std::ostringstream os2(std::ios_base::binary); decompress(is, os2, 0); std::string str_out2 = os2.str(); infostream << "decompress: "; for (char i : str_out2) infostream << (u32) i << ","; infostream << std::endl; UASSERTEQ(size_t, str_out2.size(), fromdata.getSize()); for (u32 i = 0; i < str_out2.size(); i++) UASSERT(str_out2[i] == fromdata[i]); } void TestCompression::testZlibCompression() { SharedBuffer<u8> fromdata(4); fromdata[0]=1; fromdata[1]=5; fromdata[2]=5; fromdata[3]=1; std::ostringstream os(std::ios_base::binary); compress(fromdata, os, SER_FMT_VER_HIGHEST_READ); std::string str_out = os.str(); infostream << "str_out.size()=" << str_out.size() <<std::endl; infostream << "TestCompress: 1,5,5,1 -> "; for (char i : str_out) infostream << (u32) i << ","; infostream << std::endl; std::istringstream is(str_out, std::ios_base::binary); std::ostringstream os2(std::ios_base::binary); decompress(is, os2, SER_FMT_VER_HIGHEST_READ); std::string str_out2 = os2.str(); infostream << "decompress: "; for (char i : str_out2) infostream << (u32) i << ","; infostream << std::endl; UASSERTEQ(size_t, str_out2.size(), fromdata.getSize()); for (u32 i = 0; i < str_out2.size(); i++) UASSERT(str_out2[i] == fromdata[i]); } void TestCompression::testZlibLargeData() { infostream << "Test: Testing zlib wrappers with a large amount " "of pseudorandom data" << std::endl; u32 size = 50000; infostream << "Test: Input size of large compressZlib is " << size << std::endl; std::string data_in; data_in.resize(size); PseudoRandom pseudorandom(9420); for (u32 i = 0; i < size; i++) data_in[i] = pseudorandom.range(0, 255); std::ostringstream os_compressed(std::ios::binary); compressZlib(data_in, os_compressed); infostream << "Test: Output size of large compressZlib is " << os_compressed.str().size()<<std::endl; std::istringstream is_compressed(os_compressed.str(), std::ios::binary); std::ostringstream os_decompressed(std::ios::binary); decompressZlib(is_compressed, os_decompressed); infostream << "Test: Output size of large decompressZlib is " << os_decompressed.str().size() << std::endl; std::string str_decompressed = os_decompressed.str(); UASSERTEQ(size_t, str_decompressed.size(), data_in.size()); for (u32 i = 0; i < size && i < str_decompressed.size(); i++) { UTEST(str_decompressed[i] == data_in[i], "index out[%i]=%i differs from in[%i]=%i", i, str_decompressed[i], i, data_in[i]); } }