diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-03 12:48:20 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-03 12:48:20 +0300 |
commit | 06eb0ad4d063c696afa53cad75824c7778c5c157 (patch) | |
tree | a3886145f50c860d7dfc85e4dc733a45ce3d221f | |
parent | e4f7f97e6c79cda72dec7cd6fea5b85328b75894 (diff) | |
download | minetest-06eb0ad4d063c696afa53cad75824c7778c5c157.tar.gz minetest-06eb0ad4d063c696afa53cad75824c7778c5c157.tar.bz2 minetest-06eb0ad4d063c696afa53cad75824c7778c5c157.zip |
copied draft of updateNodeMeshes from backup
-rw-r--r-- | src/main.cpp | 14 | ||||
-rw-r--r-- | src/map.cpp | 52 |
2 files changed, 42 insertions, 24 deletions
diff --git a/src/main.cpp b/src/main.cpp index b069ee87f..c9db0bdc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -183,8 +183,6 @@ TODO: Remove IrrlichtWrapper Server:
-------
-TODO: When player dies, throw items on map
-
SUGG: Make an option to the server to disable building and digging near
the starting position
@@ -202,6 +200,8 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop * Make a small history check to transformLiquids to detect and log
continuous oscillations, in such detail that they can be fixed.
+TODO: When player dies, throw items on map
+
Objects:
--------
@@ -215,11 +215,11 @@ Block object server side: - A "near blocks" buffer, in which some nearby blocks are stored.
- For all blocks in the buffer, objects are stepped(). This
means they are active.
- - TODO: A global active buffer is needed for the server
- - TODO: A timestamp to blocks
- - TODO: All blocks going in and out of the buffer are recorded.
- - TODO: For outgoing blocks, timestamp is written.
- - TODO: For incoming blocks, time difference is calculated and
+ - A global active buffer is needed for the server
+ - A timestamp to blocks
+ - All blocks going in and out of the buffer are recorded.
+ - For outgoing blocks, timestamp is written.
+ - For incoming blocks, time difference is calculated and
objects are stepped according to it.
- When an active object goes far from a player, either delete
diff --git a/src/map.cpp b/src/map.cpp index 0ed2d7da2..0a1b65ace 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -5692,26 +5692,44 @@ void ClientMap::updateMeshes(v3s16 blockpos, u32 daynight_ratio) b->updateMesh(daynight_ratio); } catch(InvalidPositionException &e){} - /*// Trailing edge - try{ - v3s16 p = blockpos + v3s16(1,0,0); - MapBlock *b = getBlockNoCreate(p); - b->updateMesh(daynight_ratio); - } - catch(InvalidPositionException &e){} - try{ - v3s16 p = blockpos + v3s16(0,1,0); - MapBlock *b = getBlockNoCreate(p); - b->updateMesh(daynight_ratio); - } - catch(InvalidPositionException &e){} - try{ - v3s16 p = blockpos + v3s16(0,0,1); - MapBlock *b = getBlockNoCreate(p); +} + +#if 0 +/* + Update mesh of block in which the node is, and if the node is at the + leading edge, update the appropriate leading blocks too. +*/ +void ClientMap::updateNodeMeshes(v3s16 nodepos, u32 daynight_ratio) +{ + v3s16 dirs[4] = { + v3s16(0,0,0), + v3s16(-1,0,0), + v3s16(0,-1,0), + v3s16(0,0,-1), + }; + v3s16 blockposes[4]; + for(u32 i=0; i<4; i++) + { + v3s16 np = nodepos + dirs[i]; + blockposes[i] = getNodeBlockPos(np); + // Don't update mesh of block if it has been done already + bool already_updated = false; + for(u32 j=0; j<i; j++) + { + if(blockposes[j] == blockposes[i]) + { + already_updated = true; + break; + } + } + if(already_updated) + continue; + // Update mesh + MapBlock *b = getBlockNoCreate(blockposes[i]); b->updateMesh(daynight_ratio); } - catch(InvalidPositionException &e){}*/ } +#endif void ClientMap::PrintInfo(std::ostream &out) { |