]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/client.cpp
Improved Xray and Fullbright
[dragonfireclient.git] / src / client / client.cpp
index f7fc637dbe4918502f226ecfda99b02c53bab9a9..fe77ec7a8f3835fd0eeb6e3fc58957fbf224e68a 100644 (file)
@@ -41,6 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "filesys.h"
 #include "mapblock_mesh.h"
 #include "mapblock.h"
+#include "mapsector.h"
 #include "minimap.h"
 #include "modchannels.h"
 #include "content/mods.h"
@@ -1239,12 +1240,6 @@ void Client::sendChatMessage(const std::wstring &message)
                infostream << "Could not queue chat message because maximum out chat queue size ("
                                << max_queue_size << ") is reached." << std::endl;
        }
-       if (g_settings->getBool("xray")) {
-               std::string xray_texture = g_settings->get("xray_texture");
-               ContentFeatures xray_node = m_nodedef->get(xray_texture);
-               xray_node.drawtype = NDT_AIRLIKE;
-               m_nodedef->set(xray_texture, xray_node);
-       }
 }
 
 void Client::clearOutChatQueue()
@@ -1675,6 +1670,18 @@ void Client::addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server, bool ur
        }
 }
 
+void Client::updateAllMapBlocks()
+{
+       std::map<v2s16, MapSector*> *sectors = m_env.getMap().getSectorsPtr();
+       for (auto &sector_it : *sectors) {
+               MapSector *sector = sector_it.second;
+               MapBlockVect blocks;
+               sector->getBlocks(blocks);
+               for (MapBlock *block : blocks)
+                       addUpdateMeshTask(block->getPos(), false, false);
+       }
+}
+
 ClientEvent *Client::getClientEvent()
 {
        FATAL_ERROR_IF(m_client_event_queue.empty(),