mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add temporary test block
This commit is contained in:
parent
c2aa4e3c26
commit
ee47213dbb
8 changed files with 45 additions and 4 deletions
|
|
@ -31,6 +31,13 @@ static std::shared_ptr<Label> create_label(wstringsupplier supplier) {
|
|||
return label;
|
||||
}
|
||||
|
||||
template <size_t T>
|
||||
inline std::wstring to_string(std::bitset<T> bs) {
|
||||
std::wstringstream ss;
|
||||
ss << bs;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
std::shared_ptr<UINode> create_debug_panel(
|
||||
Engine* engine,
|
||||
Level* level,
|
||||
|
|
@ -94,6 +101,18 @@ std::shared_ptr<UINode> create_debug_panel(
|
|||
return std::wstring {L"name: void"};
|
||||
}
|
||||
}));
|
||||
panel->add(create_label([=](){
|
||||
auto* indices = level->content->getIndices();
|
||||
if (auto def = indices->getBlockDef(player->selectedVoxel.id)) {
|
||||
return L"light: " + to_string(std::bitset<16>(level->chunks->getLight(
|
||||
player->actualSelectedBlockPosition.x,
|
||||
player->actualSelectedBlockPosition.y,
|
||||
player->actualSelectedBlockPosition.z
|
||||
)));
|
||||
} else {
|
||||
return std::wstring {L"no light: -"};
|
||||
}
|
||||
}));
|
||||
panel->add(create_label([=](){
|
||||
return L"seed: "+std::to_wstring(level->getWorld()->getSeed());
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue