add variants (WIP)

This commit is contained in:
MihailRis
2025-07-13 21:28:57 +03:00
parent 01181b6403
commit 5478d121f0
16 changed files with 275 additions and 177 deletions
+14 -16
View File
@@ -108,34 +108,32 @@ const BlockRotProfile BlockRotProfile::STAIRS {
};
Block::Block(const std::string& name)
: name(name),
caption(util::id_to_caption(name)),
textureFaces {
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND
} {
: name(name), caption(util::id_to_caption(name)) {
for (int i = 0; i < defaults.textureFaces.size(); i++) {
defaults.textureFaces[i] = TEXTURE_NOTFOUND;
}
}
Block::~Block() {}
Block::~Block() = default;
Block::Block(std::string name, const std::string& texture)
: name(std::move(name)),
textureFaces {texture, texture, texture, texture, texture, texture} {
: name(std::move(name)) {
for (int i = 0; i < defaults.textureFaces.size(); i++) {
defaults.textureFaces[i] = TEXTURE_NOTFOUND;
}
}
void Block::cloneTo(Block& dst) {
dst.caption = caption;
for (int i = 0; i < 6; i++) {
dst.textureFaces[i] = textureFaces[i];
dst.defaults = defaults;
}
if (variants) {
dst.variants = std::make_unique<Variants>(*variants);
}
dst.material = material;
std::copy(&emission[0], &emission[3], dst.emission);
dst.size = size;
dst.model = model;
dst.drawGroup = drawGroup;
dst.lightPassing = lightPassing;
dst.skyLightPassing = skyLightPassing;
dst.shadeless = shadeless;