Luanti 5.16.0-dev
Loading...
Searching...
No Matches
texture_override.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2020 Hugues Ross <hugues.ross@gmail.com>
4
5#pragma once
6
7#include "irrlichttypes.h"
8#include <string>
9#include <vector>
10
11typedef u32 override_t;
12
46
48{
49 std::string id;
50 std::string texture;
53
54 // Helper function for checking if an OverrideTarget is found in
55 // a TextureOverride without casting
56 inline bool hasTarget(OverrideTarget overrideTarget) const
57 {
58 return (target & static_cast<override_t>(overrideTarget)) != 0;
59 }
60};
61
64{
65public:
66 TextureOverrideSource(const std::string &filepath);
67
69 std::vector<TextureOverride> getItemTextureOverrides() const;
70
72 std::vector<TextureOverride> getNodeTileOverrides() const;
73
74private:
75 std::vector<TextureOverride> m_overrides;
76};
std::vector< TextureOverride > getItemTextureOverrides() const
Get all overrides that apply to item definitions.
Definition texture_override.cpp:112
TextureOverrideSource(const std::string &filepath)
Definition texture_override.cpp:43
std::vector< TextureOverride > getNodeTileOverrides() const
Get all overrides that apply to node definitions.
Definition texture_override.cpp:125
std::vector< TextureOverride > m_overrides
Definition texture_override.h:75
Definition texture_override.h:48
u8 world_scale
Definition texture_override.h:52
bool hasTarget(OverrideTarget overrideTarget) const
Definition texture_override.h:56
std::string texture
Definition texture_override.h:50
std::string id
Definition texture_override.h:49
override_t target
Definition texture_override.h:51
OverrideTarget
Bitmask enum specifying what a texture override should apply to.
Definition texture_override.h:15
@ SPECIAL_1
Definition texture_override.h:25
@ SIDES
Definition texture_override.h:38
@ OVERLAY_BOTTOM
Definition texture_override.h:32
@ OVERLAY_BACK
Definition texture_override.h:36
@ BACK
Definition texture_override.h:22
@ ALL_FACES
Definition texture_override.h:39
@ BOTTOM
Definition texture_override.h:18
@ RIGHT
Definition texture_override.h:20
@ INVENTORY
Definition texture_override.h:23
@ SPECIAL_6
Definition texture_override.h:30
@ SPECIAL_3
Definition texture_override.h:27
@ OVERLAY_TOP
Definition texture_override.h:31
@ OVERLAY_SIDES
Definition texture_override.h:41
@ TOP
Definition texture_override.h:17
@ OVERLAY_ALL
Definition texture_override.h:42
@ LEFT
Definition texture_override.h:19
@ OVERLAY_LEFT
Definition texture_override.h:34
@ SPECIAL_4
Definition texture_override.h:28
@ ITEM_TARGETS
Definition texture_override.h:44
@ OVERLAY_RIGHT
Definition texture_override.h:33
@ NODE_TARGETS
Definition texture_override.h:43
@ FRONT
Definition texture_override.h:21
@ OVERLAY_FRONT
Definition texture_override.h:35
@ SPECIAL_5
Definition texture_override.h:29
@ INVALID
Definition texture_override.h:16
@ SPECIAL_2
Definition texture_override.h:26
@ WIELD
Definition texture_override.h:24
@ ALL_SPECIAL
Definition texture_override.h:40
u32 override_t
Definition texture_override.h:11