This commit is contained in:
@@ -441,7 +441,7 @@ void DrawHotbar() {
|
||||
InventoryItem HotbarGetSelected() {
|
||||
return hotbar[selected];
|
||||
}
|
||||
void DrawSelectedItem() {
|
||||
void DrawSelectedItem(Color tint) {
|
||||
InventoryItem item = hotbar[selected];
|
||||
Vector3 center = {-0.75f, -0.45f, 0.5f};
|
||||
rlPushMatrix();
|
||||
@@ -458,16 +458,16 @@ void DrawSelectedItem() {
|
||||
|
||||
rlRotatef(-45, 1, 0, 0);
|
||||
rlRotatef(25, 0, 0, 1);
|
||||
DrawCubeTexture(playerTex, {0, -12*PIXUNIT/2, 0}, 4*PIXUNIT, 12*PIXUNIT, 4*PIXUNIT, WHITE, 44,20,4,4);
|
||||
DrawCubeTexture(playerTex, {0, -12*PIXUNIT/2, 0}, 4*PIXUNIT, 12*PIXUNIT, 4*PIXUNIT, tint, 44,20,4,4);
|
||||
if(item.item != nullptr) {
|
||||
if(item.item->type == IType_Block) {
|
||||
DrawCubeBlock(terrain, {0, -12*PIXUNIT - 0.25f, 0}, 0.5f, 0.5f, 0.5f, GetBlockDefinition(item.damage));
|
||||
DrawCubeBlock(terrain, {0, -12*PIXUNIT - 0.25f, 0}, 0.5f, 0.5f, 0.5f, GetBlockDefinition(item.damage), tint);
|
||||
}
|
||||
else {
|
||||
UVCorners left = GetUVTex(item.item->texture);
|
||||
rlSetTexture(item_atlas.id);
|
||||
rlBegin(RL_QUADS);
|
||||
rlColor4ub(255, 255, 255, 255);
|
||||
rlColor4ub(tint.r, tint.g, tint.b, 255);
|
||||
rlNormal3f(1.0f, 0.0f, 0.0f);
|
||||
const float size = 0.5f;
|
||||
rlTexCoord2f(left.corner0.x, left.corner0.y); rlVertex3f(0, -12*PIXUNIT - size, 0.25f - size);
|
||||
|
||||
Reference in New Issue
Block a user