diff --git a/src/frontend/debug_panel.cpp b/src/frontend/debug_panel.cpp index 106f8322..b854fce4 100644 --- a/src/frontend/debug_panel.cpp +++ b/src/frontend/debug_panel.cpp @@ -74,21 +74,25 @@ std::shared_ptr create_debug_panel( })); panel->add(create_label([=](){ auto* indices = level->content->getIndices(); - auto def = indices->getBlockDef(player->selectedVoxel.id); std::wstringstream stream; stream << "r:" << player->selectedVoxel.state.rotation << " s:" << player->selectedVoxel.state.segment << " u:" << std::bitset<8>(player->selectedVoxel.state.userbits); - if (def) { - stream << L" (" << util::str2wstr_utf8(def->name) << L")"; - } if (player->selectedVoxel.id == BLOCK_VOID) { - return std::wstring {L"block: none"}; + return std::wstring {L"block: -"}; } else { return L"block: "+std::to_wstring(player->selectedVoxel.id)+ L" "+stream.str(); } })); + panel->add(create_label([=](){ + auto* indices = level->content->getIndices(); + if (auto def = indices->getBlockDef(player->selectedVoxel.id)) { + return L"name: " + util::str2wstr_utf8(def->name); + } else { + return std::wstring {L"name: void"}; + } + })); panel->add(create_label([=](){ return L"seed: "+std::to_wstring(level->getWorld()->getSeed()); })); diff --git a/src/voxels/voxel.hpp b/src/voxels/voxel.hpp index d7062b36..9cfaf698 100644 --- a/src/voxels/voxel.hpp +++ b/src/voxels/voxel.hpp @@ -12,7 +12,7 @@ inline constexpr int BLOCK_DIR_DOWN = 0x5; struct blockstate { uint8_t rotation : 3; - uint8_t segment : 2; + uint8_t segment : 2; // planned to 0.22 uint8_t reserved : 3; uint8_t userbits : 8; }; @@ -38,5 +38,6 @@ struct voxel { blockid_t id; blockstate state; }; +static_assert(sizeof(voxel) == 4); #endif // VOXELS_VOXEL_HPP_