mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
Small optimization
This commit is contained in:
parent
9760cff8f4
commit
61ad839ebf
1 changed files with 3 additions and 12 deletions
|
|
@ -244,8 +244,6 @@ void HudRenderer::update() {
|
||||||
|
|
||||||
void HudRenderer::draw(const GfxContext& ctx){
|
void HudRenderer::draw(const GfxContext& ctx){
|
||||||
auto level = frontend->getLevel();
|
auto level = frontend->getLevel();
|
||||||
const Content* content = level->content;
|
|
||||||
const ContentIndices* contentIds = content->indices;
|
|
||||||
|
|
||||||
const Viewport& viewport = ctx.getViewport();
|
const Viewport& viewport = ctx.getViewport();
|
||||||
const uint width = viewport.getWidth();
|
const uint width = viewport.getWidth();
|
||||||
|
|
@ -273,17 +271,10 @@ void HudRenderer::draw(const GfxContext& ctx){
|
||||||
}
|
}
|
||||||
|
|
||||||
Player* player = level->player;
|
Player* player = level->player;
|
||||||
|
hotbarView->setPosition(width-56, height-56);
|
||||||
|
hotbarView->setItems({player->getChosenItem()});
|
||||||
|
hotbarView->actAndDraw(&ctx);
|
||||||
|
|
||||||
{
|
|
||||||
Window::clearDepth();
|
|
||||||
GfxContext subctx = ctx.sub();
|
|
||||||
subctx.depthTest(true);
|
|
||||||
subctx.cullFace(true);
|
|
||||||
|
|
||||||
hotbarView->setPosition(width-56, height-56);
|
|
||||||
hotbarView->setItems({player->getChosenItem()});
|
|
||||||
hotbarView->actAndDraw(&subctx);
|
|
||||||
}
|
|
||||||
uishader->use();
|
uishader->use();
|
||||||
batch->begin();
|
batch->begin();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue