X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fclient.cpp;h=30280369f81f539c56ae5a56f5b858da0d093819;hb=8852333eb3042580592ade478e5def20f8ed5d4c;hp=6b5072267ed1221ca0db60a45e89f9a6c7ee67f7;hpb=167df02e3d69dd0e8c8915944e6bab00417b15d5;p=oweals%2Fminetest.git diff --git a/src/client.cpp b/src/client.cpp index 6b5072267..30280369f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -47,10 +47,12 @@ 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" +#include "drawscene.h" + +extern gui::IGUIEnvironment* guienv; /* QueuedMeshUpdate @@ -2194,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(); @@ -2473,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; @@ -2545,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); } @@ -2648,10 +2660,6 @@ float Client::mediaReceiveProgress() return 1.0; // downloader only exists when not yet done } -void draw_load_screen(const std::wstring &text, - IrrlichtDevice* device, gui::IGUIFont* font, - float dtime=0 ,int percent=0, bool clouds=true); - void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font) { infostream<<"Client::afterContentReceived() started"<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")) { verbosestream<<"Updating item textures and meshes"< names = m_itemdef->getAll(); size_t size = names.size(); size_t count = 0; @@ -2693,7 +2701,7 @@ void Client::afterContentReceived(IrrlichtDevice *device, gui::IGUIFont* font) count++; percent = count*100/size; if (count%50 == 0) // only update every 50 item - draw_load_screen(text,device,font,0,percent); + draw_load_screen(text, device, guienv, font, 0, percent); } delete[] text; }