3 Copyright (C) 2020 Hugues Ross <hugues.ross@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "irrlichttypes.h"
26 //! Bitmask enum specifying what a texture override should apply to
27 enum class OverrideTarget : u8
39 SIDES = LEFT | RIGHT | FRONT | BACK,
40 ALL_FACES = TOP | BOTTOM | SIDES,
41 ITEM_TARGETS = INVENTORY | WIELD,
44 struct TextureOverride
50 // Helper function for checking if an OverrideTarget is found in
51 // a TextureOverride without casting
52 inline bool hasTarget(OverrideTarget overrideTarget) const
54 return (target & static_cast<u8>(overrideTarget)) != 0;
58 //! Class that provides texture override information from a texture pack
59 class TextureOverrideSource
62 TextureOverrideSource(std::string filepath);
64 //! Get all overrides that apply to item definitions
65 std::vector<TextureOverride> getItemTextureOverrides();
67 //! Get all overrides that apply to node definitions
68 std::vector<TextureOverride> getNodeTileOverrides();
71 std::vector<TextureOverride> m_overrides;