@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
29
29
#include " mapblock.h"
30
30
#include " settings.h"
31
31
#include " profiler.h"
32
+ #include " gettext.h"
32
33
#include " log.h"
33
34
#include " nodemetadata.h"
34
35
#include " nodedef.h"
@@ -2804,7 +2805,10 @@ ClientEvent Client::getClientEvent()
2804
2805
return m_client_event_queue.pop_front ();
2805
2806
}
2806
2807
2807
- void Client::afterContentReceived ()
2808
+ void draw_load_screen (const std::wstring &text,
2809
+ IrrlichtDevice* device, gui::IGUIFont* font,
2810
+ float dtime=0 ,int percent=0 , bool clouds=true );
2811
+ void Client::afterContentReceived (IrrlichtDevice *device, gui::IGUIFont* font)
2808
2812
{
2809
2813
infostream<<" Client::afterContentReceived() started" <<std::endl;
2810
2814
assert (m_itemdef_received);
@@ -2839,13 +2843,23 @@ void Client::afterContentReceived()
2839
2843
if (g_settings->getBool (" preload_item_visuals" ))
2840
2844
{
2841
2845
verbosestream<<" Updating item textures and meshes" <<std::endl;
2846
+ wchar_t * text = wgettext (" Item textures..." );
2847
+ draw_load_screen (text,device,font,0 ,0 );
2842
2848
std::set<std::string> names = m_itemdef->getAll ();
2849
+ size_t size = names.size ();
2850
+ size_t count = 0 ;
2851
+ int percent = 0 ;
2843
2852
for (std::set<std::string>::const_iterator
2844
2853
i = names.begin (); i != names.end (); ++i){
2845
2854
// Asking for these caches the result
2846
2855
m_itemdef->getInventoryTexture (*i, this );
2847
2856
m_itemdef->getWieldMesh (*i, this );
2857
+ count++;
2858
+ percent = count*100 /size;
2859
+ if (count%50 == 0 ) // only update every 50 item
2860
+ draw_load_screen (text,device,font,0 ,percent);
2848
2861
}
2862
+ delete[] text;
2849
2863
}
2850
2864
2851
2865
// Start mesh update thread after setting up content definitions
0 commit comments