format: reformat project

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-03 19:53:48 +03:00
committed by Pugemon
parent 736cd175d5
commit bbf33e8e4d
202 changed files with 7389 additions and 5609 deletions
+54 -38
View File
@@ -7,12 +7,18 @@
std::string to_string(BlockModel model) {
switch (model) {
case BlockModel::none: return "none";
case BlockModel::block: return "block";
case BlockModel::xsprite: return "X";
case BlockModel::aabb: return "aabb";
case BlockModel::custom: return "custom";
default: return "unknown";
case BlockModel::none:
return "none";
case BlockModel::block:
return "block";
case BlockModel::xsprite:
return "X";
case BlockModel::aabb:
return "aabb";
case BlockModel::custom:
return "custom";
default:
return "unknown";
}
}
@@ -32,8 +38,7 @@ std::optional<BlockModel> BlockModel_from(std::string_view str) {
}
CoordSystem::CoordSystem(glm::ivec3 axisX, glm::ivec3 axisY, glm::ivec3 axisZ)
: axisX(axisX), axisY(axisY), axisZ(axisZ)
{
: axisX(axisX), axisY(axisY), axisZ(axisZ) {
fix = glm::ivec3(0);
if (isVectorHasNegatives(axisX)) fix -= axisX;
if (isVectorHasNegatives(axisY)) fix -= axisY;
@@ -50,39 +55,50 @@ void CoordSystem::transform(AABB& aabb) const {
aabb.b += fix;
}
const BlockRotProfile BlockRotProfile::NONE {"none", {
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // North
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // East
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // South
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // West
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // Up
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // Down
}};
const BlockRotProfile BlockRotProfile::NONE {
"none",
{
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // North
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // East
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // South
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // West
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // Up
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // Down
}};
const BlockRotProfile BlockRotProfile::PIPE {
"pipe",
{
{{1, 0, 0}, {0, 0, 1}, {0, -1, 0}}, // North
{{0, 0, 1}, {-1, 0, 0}, {0, -1, 0}}, // East
{{-1, 0, 0}, {0, 0, -1}, {0, -1, 0}}, // South
{{0, 0, -1}, {1, 0, 0}, {0, -1, 0}}, // West
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // Up
{{1, 0, 0}, {0, -1, 0}, {0, 0, -1}}, // Down
}};
const BlockRotProfile BlockRotProfile::PIPE {"pipe", {
{ { 1, 0, 0 }, { 0, 0, 1 }, { 0, -1, 0 }}, // North
{ { 0, 0, 1 }, {-1, 0, 0 }, { 0, -1, 0 }}, // East
{ {-1, 0, 0 }, { 0, 0,-1 }, { 0, -1, 0 }}, // South
{ { 0, 0,-1 }, { 1, 0, 0 }, { 0, -1, 0 }}, // West
{ { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }}, // Up
{ { 1, 0, 0 }, { 0,-1, 0 }, { 0, 0,-1 }}, // Down
}};
const BlockRotProfile BlockRotProfile::PANE {"pane", {
{ { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }}, // North
{ { 0, 0,-1 }, { 0, 1, 0 }, { 1, 0, 0 }}, // East
{ {-1, 0, 0 }, { 0, 1, 0 }, { 0, 0,-1 }}, // South
{ { 0, 0, 1 }, { 0, 1, 0 }, {-1, 0, 0 }}, // West
}};
const BlockRotProfile BlockRotProfile::PANE {
"pane",
{
{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, // North
{{0, 0, -1}, {0, 1, 0}, {1, 0, 0}}, // East
{{-1, 0, 0}, {0, 1, 0}, {0, 0, -1}}, // South
{{0, 0, 1}, {0, 1, 0}, {-1, 0, 0}}, // West
}};
Block::Block(const std::string& name)
: name(name),
: name(name),
caption(util::id_to_caption(name)),
textureFaces {TEXTURE_NOTFOUND,TEXTURE_NOTFOUND,TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,TEXTURE_NOTFOUND,TEXTURE_NOTFOUND}
{}
textureFaces {
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND,
TEXTURE_NOTFOUND} {
}
Block::Block(std::string name, const std::string& texture) : name(std::move(name)),
textureFaces{texture,texture,texture,texture,texture,texture}
{}
Block::Block(std::string name, const std::string& texture)
: name(std::move(name)),
textureFaces {texture, texture, texture, texture, texture, texture} {
}