mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Improved lighting
This commit rewrites the procedure that is responsible for light updating. this commit -provides iterative solutions for unlighting and light spreading -introduces a new priority queue-like container for the iteration -creates per-node MapBlock caching to reduce retrieving MapBlocks from the map -calculates with map block positions and in-block relative node coordinates -skips light updating if it is not necessary since the node's new light will be the same as its old light was
This commit is contained in:
16
src/map.h
16
src/map.h
@@ -211,24 +211,10 @@ public:
|
||||
std::set<v3s16> & light_sources,
|
||||
std::map<v3s16, MapBlock*> & modified_blocks);
|
||||
|
||||
void unLightNeighbors(enum LightBank bank,
|
||||
v3s16 pos, u8 lightwas,
|
||||
std::set<v3s16> & light_sources,
|
||||
std::map<v3s16, MapBlock*> & modified_blocks);
|
||||
|
||||
void spreadLight(enum LightBank bank,
|
||||
std::set<v3s16> & from_nodes,
|
||||
std::map<v3s16, MapBlock*> & modified_blocks);
|
||||
|
||||
void lightNeighbors(enum LightBank bank,
|
||||
v3s16 pos,
|
||||
std::map<v3s16, MapBlock*> & modified_blocks);
|
||||
|
||||
v3s16 getBrightestNeighbour(enum LightBank bank, v3s16 p);
|
||||
|
||||
s16 propagateSunlight(v3s16 start,
|
||||
std::map<v3s16, MapBlock*> & modified_blocks);
|
||||
|
||||
|
||||
void updateLighting(enum LightBank bank,
|
||||
std::map<v3s16, MapBlock*> & a_blocks,
|
||||
std::map<v3s16, MapBlock*> & modified_blocks);
|
||||
|
Reference in New Issue
Block a user