summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-22 20:56:36 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-22 20:56:36 +0200
commit8687931a97791a67a2f880d51e00febc99958c21 (patch)
tree1a60e1bbc2d476df6d45a77ab8b69ba0984fcf7c /source
parentMoved physics to the cEntity class from the derivative classes (cMonster, cPickup). Added physics override to cPlayer to disable physics calculations. Fixed bug with pitch calculations on mobs. (diff)
downloadcuberite-8687931a97791a67a2f880d51e00febc99958c21.tar
cuberite-8687931a97791a67a2f880d51e00febc99958c21.tar.gz
cuberite-8687931a97791a67a2f880d51e00febc99958c21.tar.bz2
cuberite-8687931a97791a67a2f880d51e00febc99958c21.tar.lz
cuberite-8687931a97791a67a2f880d51e00febc99958c21.tar.xz
cuberite-8687931a97791a67a2f880d51e00febc99958c21.tar.zst
cuberite-8687931a97791a67a2f880d51e00febc99958c21.zip
Diffstat (limited to 'source')
-rw-r--r--source/Generating/ComposableGenerator.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/Generating/ComposableGenerator.cpp b/source/Generating/ComposableGenerator.cpp
index ce1e6ee8d..8219d67c0 100644
--- a/source/Generating/ComposableGenerator.cpp
+++ b/source/Generating/ComposableGenerator.cpp
@@ -226,6 +226,19 @@ void cComposableGenerator::InitHeightGen(cIniFile & a_IniFile)
LOGWARN("Unknown HeightGen \"%s\", using \"Biomal\" instead.", HeightGenName.c_str());
}
m_HeightGen = new cHeiGenBiomal(Seed, *m_BiomeGen);
+
+ /*
+ // Performance-testing:
+ LOGINFO("Measuring performance of cHeiGenBiomal...");
+ clock_t BeginTick = clock();
+ for (int x = 0; x < 500; x++)
+ {
+ cChunkDef::HeightMap Heights;
+ m_HeightGen->GenHeightMap(x * 5, x * 5, Heights);
+ }
+ clock_t Duration = clock() - BeginTick;
+ LOGINFO("HeightGen for 500 chunks took %d ticks (%.02f sec)", Duration, (double)Duration / CLOCKS_PER_SEC);
+ //*/
}
// Add a cache, if requested:
@@ -295,6 +308,21 @@ void cComposableGenerator::InitCompositionGen(cIniFile & a_IniFile)
int SeaLevel = a_IniFile.GetValueSetI("Generator", "BiomalSeaLevel", 62);
int Seed = m_ChunkGenerator.GetSeed();
m_CompositionGen = new cCompoGenBiomal(Seed, SeaLevel);
+
+ /*
+ // Performance-testing:
+ LOGINFO("Measuring performance of cCompoGenBiomal...");
+ clock_t BeginTick = clock();
+ for (int x = 0; x < 500; x++)
+ {
+ cChunkDesc Desc(200 + x * 8, 200 + x * 8);
+ m_BiomeGen->GenBiomes(Desc.GetChunkX(), Desc.GetChunkZ(), Desc.GetBiomeMap());
+ m_HeightGen->GenHeightMap(Desc.GetChunkX(), Desc.GetChunkZ(), Desc.GetHeightMap());
+ m_CompositionGen->ComposeTerrain(Desc);
+ }
+ clock_t Duration = clock() - BeginTick;
+ LOGINFO("CompositionGen for 500 chunks took %d ticks (%.02f sec)", Duration, (double)Duration / CLOCKS_PER_SEC);
+ //*/
}
}