1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

small drawItemStack cleanup

-> Replace the three bool params with an enum
-> Add struct for the static content, leads to less repetition
-> cache enable_animations setting
This commit is contained in:
est31 2016-02-07 20:27:50 +01:00
parent 6cd2b3b445
commit 16c7008771
3 changed files with 32 additions and 44 deletions

View file

@ -147,15 +147,20 @@ private:
video::SColor hbar_colors[4];
};
enum ItemRotationKind {
IT_ROT_SELECTED,
IT_ROT_HOVERED,
IT_ROT_DRAGGED,
IT_ROT_NONE, // Must be last, also serves as number
};
void drawItemStack(video::IVideoDriver *driver,
gui::IGUIFont *font,
const ItemStack &item,
const core::rect<s32> &rect,
const core::rect<s32> *clip,
IGameDef *gamedef,
bool selected,
bool hovered,
bool dragged);
ItemRotationKind rotation_kind);
#endif