mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
day-night loop, dynamic skybox, clock on debug panel
This commit is contained in:
parent
4a9a4ddd14
commit
c08c31b0ad
24 changed files with 599 additions and 48 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "../typedefs.h"
|
||||
#include "../content/Content.h"
|
||||
#include "../util/stringutil.h"
|
||||
#include "../util/timeutil.h"
|
||||
#include "../assets/Assets.h"
|
||||
#include "../graphics/Shader.h"
|
||||
#include "../graphics/Batch2D.h"
|
||||
|
|
@ -128,13 +129,22 @@ HudRenderer::HudRenderer(Engine* engine,
|
|||
sub->add(box);
|
||||
panel->add(sub);
|
||||
}
|
||||
panel->add(shared_ptr<Label>(create_label([this](){
|
||||
int hour, minute, second;
|
||||
timeutil::from_value(this->level->world->daytime, hour, minute, second);
|
||||
|
||||
std::wstring timeString =
|
||||
util::lfill(std::to_wstring(hour), 2, L'0') + L":" +
|
||||
util::lfill(std::to_wstring(minute), 2, L'0');
|
||||
return L"time: "+timeString;
|
||||
})));
|
||||
{
|
||||
TrackBar* bar = new TrackBar(0.0f, 1.0f, 1.0f, 0.02f, 2);
|
||||
TrackBar* bar = new TrackBar(0.0f, 1.0f, 1.0f, 0.005f, 8);
|
||||
bar->supplier([=]() {
|
||||
return renderer->skyLightMutliplier;
|
||||
return level->world->daytime;
|
||||
});
|
||||
bar->consumer([=](double val) {
|
||||
renderer->skyLightMutliplier = val;
|
||||
level->world->daytime = val;
|
||||
});
|
||||
panel->add(bar);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue