From 14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 22 Jan 2013 06:49:14 +0000 Subject: Added new statistics module to AnvilStats - cHeightMap. This paints the heightmap of each region file into a separate BMP file. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1163 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- AnvilStats/Processor.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'AnvilStats/Processor.cpp') diff --git a/AnvilStats/Processor.cpp b/AnvilStats/Processor.cpp index 2f6f2d860..02070a8fc 100644 --- a/AnvilStats/Processor.cpp +++ b/AnvilStats/Processor.cpp @@ -326,10 +326,18 @@ bool cProcessor::cThread::ProcessChunkSections(int a_ChunkX, int a_ChunkZ, cPars { if (!SectionProcessed[y]) { - m_Callback.OnEmptySection(y); + if (m_Callback.OnEmptySection(y)) + { + return true; + } } } + if (m_Callback.OnSectionsFinished()) + { + return true; + } + return false; } @@ -498,6 +506,14 @@ void cProcessor::ProcessWorld(const AString & a_WorldFolder, cCallbackFactory & // Start as many threads as there are cores, plus one: // (One more thread can be in the file-read IO block while all other threads crunch the numbers) int NumThreads = GetNumCores() + 1; + + /* + // Limit the number of threads in DEBUG mode to 1 for easier debugging + #ifdef _DEBUG + NumThreads = 1; + #endif // _DEBUG + */ + for (int i = 0; i < NumThreads; i++) { cCallback * Callback = a_CallbackFactory.GetNewCallback(); -- cgit v1.2.3