diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-14 00:19:48 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:41 +0200 |
commit | abceeee92f99b84ebb79968269835a4f509bfb90 (patch) | |
tree | 669edeca68fae4eb086ac4e4c1846b55d3aa779d /src/guiInventoryMenu.cpp | |
parent | 5fc791ac9a15ea6f234ca2d23041c83679255746 (diff) | |
download | hax-minetest-server-abceeee92f99b84ebb79968269835a4f509bfb90.tar.gz hax-minetest-server-abceeee92f99b84ebb79968269835a4f509bfb90.zip |
Create framework for getting rid of global definitions of node/tool/item/whatever types
Diffstat (limited to 'src/guiInventoryMenu.cpp')
-rw-r--r-- | src/guiInventoryMenu.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/guiInventoryMenu.cpp b/src/guiInventoryMenu.cpp index 7d49acaa2..4ed9c857c 100644 --- a/src/guiInventoryMenu.cpp +++ b/src/guiInventoryMenu.cpp @@ -32,13 +32,14 @@ with this program; if not, write to the Free Software Foundation, Inc., void drawInventoryItem(video::IVideoDriver *driver, gui::IGUIFont *font, InventoryItem *item, core::rect<s32> rect, - const core::rect<s32> *clip) + const core::rect<s32> *clip, + ITextureSource *tsrc) { if(item == NULL) return; video::ITexture *texture = NULL; - texture = item->getImage(); + texture = item->getImage(tsrc); if(texture != NULL) { @@ -89,12 +90,14 @@ GUIInventoryMenu::GUIInventoryMenu(gui::IGUIEnvironment* env, IMenuManager *menumgr, v2s16 menu_size, InventoryContext *c, - InventoryManager *invmgr + InventoryManager *invmgr, + ITextureSource *tsrc ): GUIModalMenu(env, parent, id, menumgr), m_menu_size(menu_size), m_c(c), - m_invmgr(invmgr) + m_invmgr(invmgr), + m_tsrc(tsrc) { m_selected_item = NULL; } @@ -218,7 +221,7 @@ GUIInventoryMenu::ItemSpec GUIInventoryMenu::getItemAtPos(v2s32 p) const return ItemSpec("", "", -1); } -void GUIInventoryMenu::drawList(const ListDrawSpec &s) +void GUIInventoryMenu::drawList(const ListDrawSpec &s, ITextureSource *tsrc) { video::IVideoDriver* driver = Environment->getVideoDriver(); @@ -269,7 +272,7 @@ void GUIInventoryMenu::drawList(const ListDrawSpec &s) if(item) { drawInventoryItem(driver, font, item, - rect, &AbsoluteClippingRect); + rect, &AbsoluteClippingRect, tsrc); } } @@ -292,7 +295,7 @@ void GUIInventoryMenu::drawMenu() for(u32 i=0; i<m_draw_spec.size(); i++) { ListDrawSpec &s = m_draw_spec[i]; - drawList(s); + drawList(s, m_tsrc); } /* |