diff --git a/minetest.vcproj b/minetest.vcproj index 45d6027..c244b43 100644 --- a/minetest.vcproj +++ b/minetest.vcproj @@ -119,6 +119,7 @@ WholeProgramOptimization="true" AdditionalIncludeDirectories=""C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"..\jthread\jthread-1.2.1\src";"..\irrlicht\irrlicht-1.7.1\include";"..\zlib\zlib-1.2.5"" PreprocessorDefinitions="WIN32;_HAS_ITERATOR_DEBUGGING=0,UNITTEST_DISABLE,_CRT_SECURE_NO_DEPRECATE" + ExceptionHandling="2" BufferSecurityCheck="false" EnableEnhancedInstructionSet="1" FloatingPointModel="2" diff --git a/src/client.cpp b/src/client.cpp index af2b375..4792490 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -31,34 +31,22 @@ void * ClientUpdateThread::Thread() ThreadStarted(); DSTACK(__FUNCTION_NAME); - -#if CATCH_UNHANDLED_EXCEPTIONS - try + + BEGIN_DEBUG_EXCEPTION_HANDLER + + while(getRun()) { -#endif - while(getRun()) - { - m_client->asyncStep(); + m_client->asyncStep(); - //m_client->updateSomeExpiredMeshes(); + //m_client->updateSomeExpiredMeshes(); - bool was = m_client->AsyncProcessData(); + bool was = m_client->AsyncProcessData(); - if(was == false) - sleep_ms(10); - } -#if CATCH_UNHANDLED_EXCEPTIONS + if(was == false) + sleep_ms(10); } - /* - This is what has to be done in threads to get suitable debug info - */ - catch(std::exception &e) - { - dstream<ExceptionRecord; + dstream<<"Access violation at "<ExceptionAddress + <<" write?="<ExceptionInformation[0] + <<" address="<ExceptionInformation[1] + < + #include +#else +#endif /* Debug output @@ -215,6 +224,60 @@ private: core::map m_packets; }; +/* + These should be put into every thread +*/ + +#if CATCH_UNHANDLED_EXCEPTIONS == 1 + #define BEGIN_PORTABLE_DEBUG_EXCEPTION_HANDLER try{ + #define END_PORTABLE_DEBUG_EXCEPTION_HANDLER\ + }catch(std::exception &e){\ + dstream<setMinHardwareBufferVertexCount(1); + //driver->setMinHardwareBufferVertexCount(50); scene::ISceneManager* smgr = device->getSceneManager(); @@ -2606,18 +2604,9 @@ int main(int argc, char *argv[]) menu->drop(); }*/ } -#if CATCH_UNHANDLED_EXCEPTIONS - /* - This is what has to be done in every thread to get suitable debug info - */ - catch(std::exception &e) - { - dstream<setHardwareMappingHint(scene::EHM_STATIC); /*std::cout<<"MapBlock has "<getSize()<<" faces " diff --git a/src/materials.h b/src/materials.h index ae2deac..4221497 100644 --- a/src/materials.h +++ b/src/materials.h @@ -54,7 +54,6 @@ class MaterialProperties public: MaterialProperties() { - dstream<<__FUNCTION_NAME<