Added day&night cycle. Also fixed world loading
Build / build (push) Has been cancelled

This commit is contained in:
milkwx3
2026-07-07 22:02:10 +03:00
parent 7ab2d5a083
commit 04d1969084
25 changed files with 3018 additions and 888 deletions
+4 -4
View File
@@ -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);