mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-23 20:09:46 +03:00
* Improve survival mode stuff.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
|
||||
#include <sstream>
|
||||
#include "ItemRenderer.hpp"
|
||||
#include "TileRenderer.hpp"
|
||||
#include "ItemEntity.hpp"
|
||||
@@ -157,6 +158,23 @@ void ItemRenderer::blit(int dx, int dy, int sx, int sy, int tw, int th)
|
||||
t.draw();
|
||||
}
|
||||
|
||||
void ItemRenderer::renderGuiItemOverlay(Font* font, Textures* textures, ItemInstance* instance, int x, int y)
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (instance->m_amount == 1)
|
||||
return;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << instance->m_amount;
|
||||
std::string amtstr = ss.str();
|
||||
|
||||
int width = font->width(amtstr), height = font->height(amtstr) + 8;
|
||||
|
||||
font->drawShadow(amtstr, x + 17 - width, y + 17 - height, 0xFFFFFF);
|
||||
}
|
||||
|
||||
void ItemRenderer::renderGuiItem(Font* font, Textures* textures, ItemInstance* instance, int x, int y, bool b)
|
||||
{
|
||||
// @NOTE: Font unused but would presumably be used to draw the item amount.
|
||||
|
||||
Reference in New Issue
Block a user