Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
ItemVisualsManager Struct Reference

#include <item_visuals_manager.h>

+ Collaboration diagram for ItemVisualsManager:

Classes

struct  ItemVisuals
 

Public Member Functions

 ItemVisualsManager ()
 
 ~ItemVisualsManager ()
 
void clear ()
 Clears the cached visuals.
 
video::ITexture * getInventoryTexture (const ItemStack &item, Client *client) const
 
video::ITexture * getInventoryOverlayTexture (const ItemStack &item, Client *client) const
 
AnimationInfogetInventoryAnimation (const ItemStack &item, Client *client) const
 
AnimationInfogetInventoryOverlayAnimation (const ItemStack &item, Client *client) const
 
ItemMeshgetItemMesh (const ItemStack &item, Client *client) const
 
PalettegetPalette (const ItemStack &item, Client *client) const
 
video::SColor getItemstackColor (const ItemStack &stack, Client *client) const
 

Private Member Functions

ItemVisualscreateItemVisuals (const ItemStack &item, Client *client) const
 

Private Attributes

std::thread::id m_main_thread
 
std::unordered_map< std::string, std::unique_ptr< ItemVisuals > > m_cached_item_visuals
 

Constructor & Destructor Documentation

◆ ItemVisualsManager()

ItemVisualsManager::ItemVisualsManager ( )

References m_main_thread.

◆ ~ItemVisualsManager()

ItemVisualsManager::~ItemVisualsManager ( )

Member Function Documentation

◆ clear()

void ItemVisualsManager::clear ( )

Clears the cached visuals.

References m_cached_item_visuals.

Referenced by Client::~Client().

+ Here is the caller graph for this function:

◆ createItemVisuals()

ItemVisualsManager::ItemVisuals * ItemVisualsManager::createItemVisuals ( const ItemStack & item,
Client * client ) const
private

References ItemImageDef::animation, createAnimationFrames(), createItemMesh(), ItemStack::getDefinition(), ItemStack::getInventoryImage(), ItemStack::getInventoryOverlay(), ITextureSource::getPalette(), infostream, ItemDefinition::inventory_overlay, m_cached_item_visuals, m_main_thread, ItemDefinition::name, ItemImageDef::name, ItemDefinition::palette_image, and sanity_check.

Referenced by getInventoryAnimation(), getInventoryOverlayAnimation(), getInventoryOverlayTexture(), getInventoryTexture(), getItemMesh(), and getPalette().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInventoryAnimation()

AnimationInfo * ItemVisualsManager::getInventoryAnimation ( const ItemStack & item,
Client * client ) const

References createItemVisuals(), AnimationInfo::getFrameCount(), and ItemVisualsManager::ItemVisuals::inventory_normal.

Referenced by WieldMeshSceneNode::setItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInventoryOverlayAnimation()

AnimationInfo * ItemVisualsManager::getInventoryOverlayAnimation ( const ItemStack & item,
Client * client ) const

References createItemVisuals(), AnimationInfo::getFrameCount(), and ItemVisualsManager::ItemVisuals::inventory_overlay.

Referenced by WieldMeshSceneNode::setItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInventoryOverlayTexture()

video::ITexture * ItemVisualsManager::getInventoryOverlayTexture ( const ItemStack & item,
Client * client ) const

References createItemVisuals(), AnimationInfo::getTexture(), and ItemVisualsManager::ItemVisuals::inventory_overlay.

Referenced by drawItemStack(), and WieldMeshSceneNode::setItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInventoryTexture()

video::ITexture * ItemVisualsManager::getInventoryTexture ( const ItemStack & item,
Client * client ) const

References createItemVisuals(), AnimationInfo::getTexture(), and ItemVisualsManager::ItemVisuals::inventory_normal.

Referenced by drawItemStack(), and WieldMeshSceneNode::setItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemMesh()

ItemMesh * ItemVisualsManager::getItemMesh ( const ItemStack & item,
Client * client ) const

References createItemVisuals(), and ItemVisualsManager::ItemVisuals::item_mesh.

Referenced by drawItemStack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemstackColor()

video::SColor ItemVisualsManager::getItemstackColor ( const ItemStack & stack,
Client * client ) const

References getPalette(), SimpleMetadata::getString(), ItemStack::metadata, mystoi(), ItemStack::name, and parseColorString().

Referenced by drawItemStack(), and WieldMeshSceneNode::setItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPalette()

Palette * ItemVisualsManager::getPalette ( const ItemStack & item,
Client * client ) const

References createItemVisuals(), and ItemVisualsManager::ItemVisuals::palette.

Referenced by getItemstackColor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cached_item_visuals

std::unordered_map<std::string, std::unique_ptr<ItemVisuals> > ItemVisualsManager::m_cached_item_visuals
mutableprivate

Referenced by clear(), and createItemVisuals().

◆ m_main_thread

std::thread::id ItemVisualsManager::m_main_thread
private

The documentation for this struct was generated from the following files: