summaryrefslogtreecommitdiffstats
path: root/src/LightingThread.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-01-14syntaxTiger Wang1-1/+1
2022-01-14fixed compile error in jenkins and more warningsx12xx12x1-1/+1
2021-03-28Fix Windows XP to 7 compatibility (#5167)Tiger Wang1-1/+1
* Partially reverts 01a4e696b * Unify thread names - Remove use of GetThreadId API
2021-03-05Prepare ChunkData for BlockState storage (#5105)Tiger Wang1-10/+10
* Rename ChunkData Creatable test * Add missing Y-check in RedstoneWireHandler * Remove ChunkDef.h dependency in Scoreboard * Prepare ChunkData for BlockState storage + Split chunk block, meta, block & sky light storage + Load the height map from disk - Reduce duplicated code in ChunkData - Remove saving MCSBiomes, there aren't any - Remove the allocation pool, ref #4315, #3864 * fixed build * fixed test * fixed the debug compile Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2020-04-16Using Super.Mattes D1-2/+2
2020-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D1-0/+28
The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change) The BlockInfo.h file was removed from Globals.h (main change) The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics) The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor) Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header. That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified. eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values
2019-09-24NBTChunkSerializer: Cleaned up interface.Mattes D1-1/+1
Removed dependency on cChunkDataCallback. Moved all the serializing code into a worker class. Changed the serialization into a single-call action.
2019-09-06Separated chunk generator from world / plugin interfaces.Mattes D1-2/+2
The generator now only takes care of servicing synchronous "GetChunk(X, Y)" and "GetBiomes(X, Y)" requests.
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell101-2/+0
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-22cIsThread: Reset m_ShouldTerminate after the thread has stopped (#4258)peterbell101-1/+1
This allows threads to be restarted after stopping. Fixes #4257
2018-02-21cLightingThread: Faster chunk reading (#4185)peterbell101-12/+23
Profiled at a 10x speedup for cLightingThread::ReadChunks.
2017-10-21cWorld Threads: Seperate initialization and thread start.peterbell101-20/+6
Prevents nullptr dereferences before Start has been called.
2017-09-07Lighting now generally consistent with vanilla (#3988)Alexander Harkness1-1/+2
* Lighting now generally consistent with vanilla Skylight is now dispersed by some blocks, instead of passing through unimpeded. Some blocks which were not marked as transparent are now marked as such. Water and other such blocks now attenuate light with the correct intensity. Generally changes were based on documentation in the Minecraft Wiki: https://minecraft.gamepedia.com/Opacity#On_block_light , however during play-testing on vanilla lava was found not to attenuate sky or block-light so the attenuation was removed. This fixes #3849 * Add API documentation for IsSkylightDispersant * Rename m_SkylightDispersant to m_IsSkylightDispersant * Update comment for m_Transparent property of Blocks
2017-08-02Removed double includes (#3885)Lukas Pioch1-1/+0
2017-06-20Lighting Optimisations (#3785)peterbell101-69/+23
2017-06-09Fixed skylight going down through transparent blocks.Mattes D1-1/+12
2016-02-05Bulk clearing of whitespaceLogicParrot1-30/+30
2015-10-04Fixed a race condition between chunk loader and generator.Mattes D1-3/+3
When using ChunkWorx to generate multiple chunks, the server would sometimes fail an assert because it would generate a chunk even when it was successfully loaded. This was caused by chunks queued in cWorld's m_SetChunkDataQueue and thus being marked as "InQueue" although they were already loaded. Solved by adding a new parameter to chunk coord callbacks specifying whether the operation succeeded or failed, and using that instead of the chunk presence flag to decide whether to generate or not.
2015-07-31Unified the doxy-comment format.Mattes D1-1/+1
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-12/+12
2015-05-30Made cLightingThread own its callbackstycho1-4/+4
2015-05-24Made -Weverything an error.tycho1-3/+3
2015-01-17Fixed CppCheck: (performance) Possible inefficient checking for emptiness.Kirill Kirilenko1-1/+1
2014-12-12LightingThread: Fixed a memory leak.Mattes D1-2/+2
2014-12-10Lighting thread: skip chunks that are already lit.Mattes D1-0/+10
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-4/+4
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-4/+4
2014-08-21Added initializers for class members.Mattes D1-1/+5
As reported by Coverity, these weren't initialized.
2014-07-17Normalized comments.madmaxoft1-2/+2
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-17Fixed basic whitespace problems.madmaxoft1-1/+1
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-06-16Fixed GCC compilation.madmaxoft1-1/+1
2014-05-29Added comments, reformatted code.madmaxoft1-1/+1
2014-05-21Renamed cChunkBuffer to cChunkDataTycho1-1/+1
2014-05-09Lighting thread disabled its chunkstays before deleting them.Mattes D1-0/+2
2014-04-26Implemented Chunk Sparsing with segmentsTycho1-7/+4
2014-04-12ChunkStay must be disabled while being deleted.ProtoProxy_1.7.2_001madmaxoft1-0/+1
Fixes #758.
2014-04-12Fixed member construction order.madmaxoft1-2/+2
2014-04-12Lighting reads blocktypes only for blocks under heightmap.madmaxoft1-14/+78
This should theoretically speed it up, since less data is copied back and forth. Also implemented a possibly more cache-friendly blocklight starter algorithm (PrepareBlockLight2()), is disabled by default, needs perf testing.
2014-03-10Removed Some unnessicary macrosTycho1-6/+0
2014-03-01g_BlockXXX => cBlockInfo::XXXandrew1-2/+2
2014-02-10Rewritten Lua ChunkStay API into a single function, cWorld:ChunkStay().madmaxoft1-1/+13
This fixes problems with indeterminate class object lifespan (Lua-GC) and forgetting to disable it or keep it until ready.
2014-02-08Moved a forgotten comment back to its place.madmaxoft1-2/+2
2014-02-08Fixed lighting thread queueing.madmaxoft1-2/+4
2014-02-08Initial ChunkStay code.madmaxoft1-79/+72
2014-01-07More MSVC warning fixes.madmaxoft1-1/+1
2013-12-31fixed warnings in LightingThread.cppTycho Bickerstaff1-0/+1
2013-12-31take Z axis into account when calculating neighboors in LightingThread::ChunkReadyTycho Bickerstaff1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-05-09Fixed a few out-of-bounds readsmadmaxoft@gmail.com1-3/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1465 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-07Replaced MIN / MAX with std::min and std::maxmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1455 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-05Lighting: Fixed underwater lighting (FS #369)madmaxoft@gmail.com1-37/+60
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1444 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-13Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-25Merged the usable portion of the "gens" branch.madmaxoft@gmail.com1-0/+4
Splitting off the Composable generator and fiddling with LuaChunk / ChunkDesc is good, other generators not good yet. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1171 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-16Fixed crashes caused LightingThread overwriting memory where it shouldn't (yay valgrind!)madmaxoft@gmail.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1046 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-13Fixed a valgrind error in lighting thread (uninitialized var value)madmaxoft1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1039 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-531/+531
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-25/+442
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Fixed *nix threading issue;madmaxoft@gmail.com1-1/+1
Thread objects now use variable names consistent with MCS convention; Fixed a few *nix threading cornercases git-svn-id: http://mc-server.googlecode.com/svn/trunk@392 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-17Added the skeleton of the cLightingThread objectmadmaxoft@gmail.com1-0/+114
git-svn-id: http://mc-server.googlecode.com/svn/trunk@286 0a769ca7-a7f5-676a-18bf-c427514a06d6