diff --git a/README.md b/README.md index c368704..7bfce14 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ MorriCraft is a high-performance voxel engine built with C++ and Raylib. It feat ## Version History -### v2.1.6 - Inventory Insight (Latest) -* **Item Tooltips**: Added mouse-over names for all inventory and hotbar items. -* **UI Polish**: Dynamic tooltip positioning to ensure labels stay on-screen. +### v2.1.7 - Log Realism (Latest) +* **Authentic Oak Logs**: Replaced plank-fallback textures with dedicated bark (side) and ring (top) textures. +* **Multi-Texture Rendering**: Implemented specialized draw calls for logs to support independent side/top textures. -### v2.1.5 - Windows Portability +### v2.1.6 - Inventory Insight ### v2.1.0 - Personalization & Stability * **Integrated Skin Editor**: Personalize your shirt and pants colors directly from the Options menu. diff --git a/assets/oak_log_side.png b/assets/oak_log_side.png new file mode 100644 index 0000000..0b6875f Binary files /dev/null and b/assets/oak_log_side.png differ diff --git a/assets/oak_log_top.png b/assets/oak_log_top.png new file mode 100644 index 0000000..c50dd15 Binary files /dev/null and b/assets/oak_log_top.png differ diff --git a/build-linux/MorriCraft b/build-linux/MorriCraft index 7cf0b5f..b702735 100755 Binary files a/build-linux/MorriCraft and b/build-linux/MorriCraft differ diff --git a/build-linux/assets/oak_log_side.png b/build-linux/assets/oak_log_side.png new file mode 100644 index 0000000..0b6875f Binary files /dev/null and b/build-linux/assets/oak_log_side.png differ diff --git a/build-linux/assets/oak_log_top.png b/build-linux/assets/oak_log_top.png new file mode 100644 index 0000000..c50dd15 Binary files /dev/null and b/build-linux/assets/oak_log_top.png differ diff --git a/build-linux/assets/version.txt b/build-linux/assets/version.txt index 018da23..7d28254 100644 --- a/build-linux/assets/version.txt +++ b/build-linux/assets/version.txt @@ -1 +1 @@ -v2.1.6 +v2.1.7 diff --git a/build-windows/MorriCraft.exe b/build-windows/MorriCraft.exe index 88dcd06..142dd29 100755 Binary files a/build-windows/MorriCraft.exe and b/build-windows/MorriCraft.exe differ diff --git a/build-windows/assets/oak_log_side.png b/build-windows/assets/oak_log_side.png new file mode 100644 index 0000000..0b6875f Binary files /dev/null and b/build-windows/assets/oak_log_side.png differ diff --git a/build-windows/assets/oak_log_top.png b/build-windows/assets/oak_log_top.png new file mode 100644 index 0000000..c50dd15 Binary files /dev/null and b/build-windows/assets/oak_log_top.png differ diff --git a/build-windows/assets/version.txt b/build-windows/assets/version.txt index 018da23..7d28254 100644 --- a/build-windows/assets/version.txt +++ b/build-windows/assets/version.txt @@ -1 +1 @@ -v2.1.6 +v2.1.7 diff --git a/src/main.cpp b/src/main.cpp index 063bf4d..16a7851 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -722,6 +722,24 @@ void DrawCraftingTable(Vector3 position, unsigned int sideTexId, unsigned int to rlEnd(); } +void DrawLog(Vector3 position, unsigned int sideTexId, unsigned int topTexId, Color tint) { + float x = position.x; float y = position.y; float z = position.z; + rlSetTexture(sideTexId); + rlBegin(RL_QUADS); + rlColor4ub(tint.r, tint.g, tint.b, 255); + rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z + 0.5f); + rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z - 0.5f); + rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z + 0.5f); + rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z - 0.5f); + rlEnd(); + rlSetTexture(topTexId); + rlBegin(RL_QUADS); + rlColor4ub(tint.r, tint.g, tint.b, 255); + rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x - 0.5f, y + 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x - 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x + 0.5f, y + 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x + 0.5f, y + 0.5f, z - 0.5f); + rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x - 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x + 0.5f, y - 0.5f, z - 0.5f); rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x + 0.5f, y - 0.5f, z + 0.5f); rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x - 0.5f, y - 0.5f, z + 0.5f); + rlEnd(); +} + // Optimized check to see if a block has any exposed faces. bool IsExposedOptimized(int lx, int ly, int lz, Chunk* chunk, Chunk* nxM, Chunk* nxP, Chunk* nzM, Chunk* nzP) { if (ly > 0) { if (chunk->blocks[lx][ly-1][lz] == AIR) return true; } else return true; @@ -940,10 +958,16 @@ int main(void) Texture2D grassTopTexture = LoadTexture("assets/grass_top.png"); Texture2D craftingSideTexture = LoadTexture("assets/crafting_table_side.png"); Texture2D craftingTopTexture = LoadTexture("assets/crafting_table_top.png"); + Texture2D logSideTexture = LoadTexture("assets/oak_log_side.png"); + Texture2D logTopTexture = LoadTexture("assets/oak_log_top.png"); // Safety Fallback: Use Planks if custom textures failed to load (prevents crash) if (craftingSideTexture.id == 0) craftingSideTexture = blockTextures[PLANK]; if (craftingTopTexture.id == 0) craftingTopTexture = blockTextures[PLANK]; + if (logSideTexture.id == 0) logSideTexture = blockTextures[PLANK]; + if (logTopTexture.id == 0) logTopTexture = blockTextures[PLANK]; + + blockTextures[LOG] = logSideTexture; // For inventory preview blockTextures[CRAFTING_TABLE] = craftingSideTexture; // Preview for inventory blockTextures[STICK] = LoadTexture("assets/stick.png"); @@ -2590,6 +2614,9 @@ int main(void) for (auto& pos : chunk->renderLists[CRAFTING_TABLE]) { DrawCraftingTable(pos, craftingSideTexture.id, craftingTopTexture.id, blockTextures[DIRT].id, blockTint); } + for (auto& pos : chunk->renderLists[LOG]) { + DrawLog(pos, logSideTexture.id, logTopTexture.id, blockTint); + } } } else { rlSetTexture(blockTextures[renderType].id); diff --git a/version.txt b/version.txt index 018da23..7d28254 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.1.6 +v2.1.7