mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
feat: rendering pages on demand
This commit is contained in:
parent
381cb77d08
commit
47809b4024
9 changed files with 106 additions and 39 deletions
|
|
@ -276,13 +276,13 @@ void SlotView::draw(const DrawContext& pctx, const Assets& assets) {
|
|||
drawItemIcon(batch, stack, item, assets, tint, pos);
|
||||
|
||||
if (stack.getCount() > 1 || stack.getFields() != nullptr) {
|
||||
const auto& font = assets.require<Font>(FONT_DEFAULT);
|
||||
auto& font = assets.require<Font>(FONT_DEFAULT);
|
||||
drawItemInfo(batch, stack, item, font, pos);
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_shaded_text(
|
||||
Batch2D& batch, const Font& font, const std::wstring& text, int x, int y
|
||||
Batch2D& batch, Font& font, const std::wstring& text, int x, int y
|
||||
) {
|
||||
batch.setColor({0, 0, 0, 1.0f});
|
||||
font.draw(batch, text, x + 1, y + 1, nullptr, 0);
|
||||
|
|
@ -294,7 +294,7 @@ void SlotView::drawItemInfo(
|
|||
Batch2D& batch,
|
||||
const ItemStack& stack,
|
||||
const ItemDef& item,
|
||||
const Font& font,
|
||||
Font& font,
|
||||
const glm::vec2& pos
|
||||
) {
|
||||
const int SLOT_SIZE = InventoryView::SLOT_SIZE;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace gui {
|
|||
Batch2D& batch,
|
||||
const ItemStack& stack,
|
||||
const ItemDef& item,
|
||||
const Font& font,
|
||||
Font& font,
|
||||
const glm::vec2& pos
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue