@@ -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"
@@ -2555,6 +2556,9 @@ void Client::inventoryAction(InventoryAction *a)
2555
2556
Predict some local inventory changes
2556
2557
*/
2557
2558
a->clientApply (this , this );
2559
+
2560
+ // Remove it
2561
+ delete a;
2558
2562
}
2559
2563
2560
2564
ClientActiveObject * Client::getSelectedActiveObject (
@@ -2801,7 +2805,10 @@ ClientEvent Client::getClientEvent()
2801
2805
return m_client_event_queue.pop_front ();
2802
2806
}
2803
2807
2804
- 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)
2805
2812
{
2806
2813
infostream<<" Client::afterContentReceived() started" <<std::endl;
2807
2814
assert (m_itemdef_received);
@@ -2836,13 +2843,23 @@ void Client::afterContentReceived()
2836
2843
if (g_settings->getBool (" preload_item_visuals" ))
2837
2844
{
2838
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 );
2839
2848
std::set<std::string> names = m_itemdef->getAll ();
2849
+ size_t size = names.size ();
2850
+ size_t count = 0 ;
2851
+ int percent = 0 ;
2840
2852
for (std::set<std::string>::const_iterator
2841
2853
i = names.begin (); i != names.end (); ++i){
2842
2854
// Asking for these caches the result
2843
2855
m_itemdef->getInventoryTexture (*i, this );
2844
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);
2845
2861
}
2862
+ delete[] text;
2846
2863
}
2847
2864
2848
2865
// Start mesh update thread after setting up content definitions
0 commit comments