X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fclient.cpp;h=30280369f81f539c56ae5a56f5b858da0d093819;hb=8852333eb3042580592ade478e5def20f8ed5d4c;hp=5f3c3f590d15fef260ab8c47237c8c661a9fa700;hpb=09970b7b6daa82ba0cb71540ebb70e671637782f;p=oweals%2Fminetest.git diff --git a/src/client.cpp b/src/client.cpp index 5f3c3f590..30280369f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -47,7 +47,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include "util/serialize.h" #include "config.h" -#include "cmake_config_githash.h" #include "util/directiontables.h" #include "util/pointedthing.h" #include "version.h" @@ -2197,8 +2196,8 @@ void Client::sendReady() writeU8(os,VERSION_PATCH_ORIG); writeU8(os,0); - writeU16(os,strlen(CMAKE_VERSION_GITHASH)); - os.write(CMAKE_VERSION_GITHASH,strlen(CMAKE_VERSION_GITHASH)); + writeU16(os,strlen(minetest_version_hash)); + os.write(minetest_version_hash,strlen(minetest_version_hash)); // Make data buffer std::string s = os.str(); @@ -2476,6 +2475,15 @@ int Client::getCrackLevel() return m_crack_level; } +void Client::setHighlighted(v3s16 pos, bool show_hud) +{ + m_show_hud = show_hud; + v3s16 old_highlighted_pos = m_highlighted_pos; + m_highlighted_pos = pos; + addUpdateMeshTaskForNode(old_highlighted_pos, false, true); + addUpdateMeshTaskForNode(m_highlighted_pos, false, true); +} + void Client::setCrack(int level, v3s16 pos) { int old_crack_level = m_crack_level; @@ -2548,22 +2556,23 @@ void Client::addUpdateMeshTask(v3s16 p, bool ack_to_server, bool urgent) MapBlock *b = m_env.getMap().getBlockNoCreateNoEx(p); if(b == NULL) return; - + /* Create a task to update the mesh of the block */ - + MeshMakeData *data = new MeshMakeData(this); - + { //TimeTaker timer("data fill"); // Release: ~0ms // Debug: 1-6ms, avg=2ms data->fill(b); data->setCrack(m_crack_level, m_crack_pos); + data->setHighlighted(m_highlighted_pos, m_show_hud); data->setSmoothLighting(g_settings->getBool("smooth_lighting")); } - + // Add task to queue m_mesh_update_thread.m_queue_in.addBlock(p, data, ack_to_server, urgent); } @@ -2670,9 +2679,9 @@ void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font) infostream<<"- Updating node aliases"<updateAliases(m_itemdef); - // Update node textures + // Update node textures and assign shaders to each tile infostream<<"- Updating node textures"<updateTextures(m_tsrc); + m_nodedef->updateTextures(m_tsrc, m_shsrc); // Preload item textures and meshes if configured to if(g_settings->getBool("preload_item_visuals"))