#include "itemdef.h"
-#include "gamedef.h"
#include "nodedef.h"
#include "tool.h"
#include "inventory.h"
#include "mesh.h"
#include "wieldmesh.h"
#include "client/tile.h"
+#include "client.h"
#endif
#include "log.h"
#include "settings.h"
#ifndef SERVER
public:
ClientCached* createClientCachedDirect(const std::string &name,
- IGameDef *gamedef) const
+ Client *client) const
{
infostream<<"Lazily creating item texture and mesh for \""
<<name<<"\""<<std::endl;
if(cc)
return cc;
- ITextureSource *tsrc = gamedef->getTextureSource();
+ ITextureSource *tsrc = client->getTextureSource();
const ItemDefinition &def = get(name);
// Create new ClientCached
ItemStack item = ItemStack();
item.name = def.name;
- scene::IMesh *mesh = getItemMesh(gamedef, item);
+ scene::IMesh *mesh = getItemMesh(client, item);
cc->wield_mesh = mesh;
// Put in cache
return cc;
}
ClientCached* getClientCached(const std::string &name,
- IGameDef *gamedef) const
+ Client *client) const
{
ClientCached *cc = NULL;
m_clientcached.get(name, &cc);
if(thr_is_current_thread(m_main_thread))
{
- return createClientCachedDirect(name, gamedef);
+ return createClientCachedDirect(name, client);
}
else
{
}
// Get item inventory texture
virtual video::ITexture* getInventoryTexture(const std::string &name,
- IGameDef *gamedef) const
+ Client *client) const
{
- ClientCached *cc = getClientCached(name, gamedef);
+ ClientCached *cc = getClientCached(name, client);
if(!cc)
return NULL;
return cc->inventory_texture;
}
// Get item wield mesh
virtual scene::IMesh* getWieldMesh(const std::string &name,
- IGameDef *gamedef) const
+ Client *client) const
{
- ClientCached *cc = getClientCached(name, gamedef);
+ ClientCached *cc = getClientCached(name, client);
if(!cc)
return NULL;
return cc->wield_mesh;
request = m_get_clientcached_queue.pop();
m_get_clientcached_queue.pushResult(request,
- createClientCachedDirect(request.key, gamedef));
+ createClientCachedDirect(request.key, (Client *)gamedef));
}
#endif
}