#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
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();
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;
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);
}
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"<<std::endl;
infostream<<"- Updating node aliases"<<std::endl;
m_nodedef->updateAliases(m_itemdef);
- // Update node textures
+ // Update node textures and assign shaders to each tile
infostream<<"- Updating node textures"<<std::endl;
- m_nodedef->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"<<std::endl;
wchar_t* text = wgettext("Item textures...");
- draw_load_screen(text,device,font,0,0);
+ draw_load_screen(text, device, guienv, font, 0, 0);
std::set<std::string> names = m_itemdef->getAll();
size_t size = names.size();
size_t count = 0;
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;
}