1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Replace object visual by enum (#15681)

This commit is contained in:
cx384 2025-03-06 21:02:11 +01:00 committed by GitHub
parent 63701de45f
commit 18ac8b20fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 86 additions and 29 deletions

View file

@ -12,6 +12,22 @@
#include "util/pointabilities.h"
#include "mapnode.h"
struct EnumString;
enum ObjectVisual : u8 {
OBJECTVISUAL_UNKNOWN,
OBJECTVISUAL_SPRITE,
OBJECTVISUAL_UPRIGHT_SPRITE,
OBJECTVISUAL_CUBE,
OBJECTVISUAL_MESH,
OBJECTVISUAL_ITEM,
OBJECTVISUAL_WIELDITEM,
OBJECTVISUAL_NODE,
};
extern const EnumString es_ObjectVisual[];
struct ObjectProperties
{
/* member variables ordered roughly by size */
@ -22,7 +38,7 @@ struct ObjectProperties
aabb3f collisionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
// Values are BS=1
aabb3f selectionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
std::string visual = "sprite";
ObjectVisual visual = OBJECTVISUAL_SPRITE;
std::string mesh;
std::string damage_texture_modifier = "^[brighten";
std::string nametag;