From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.World/TreeTile.cpp | 75 +++++++++----------------------------------- 1 file changed, 14 insertions(+), 61 deletions(-) (limited to 'Minecraft.World/TreeTile.cpp') diff --git a/Minecraft.World/TreeTile.cpp b/Minecraft.World/TreeTile.cpp index 29871625..642d8fbb 100644 --- a/Minecraft.World/TreeTile.cpp +++ b/Minecraft.World/TreeTile.cpp @@ -7,23 +7,18 @@ #include "TreeTile.h" -const unsigned int TreeTile::TREE_NAMES[TREE_NAMES_LENGTH] = { IDS_TILE_LOG_OAK, +const unsigned int TreeTile::TREE_NAMES[ TreeTile::TREE_NAMES_LENGTH] = { IDS_TILE_LOG_OAK, IDS_TILE_LOG_SPRUCE, IDS_TILE_LOG_BIRCH, IDS_TILE_LOG_JUNGLE }; -const wstring TreeTile::TREE_TEXTURES[] = {L"tree_side", L"tree_spruce", L"tree_birch", L"tree_jungle"}; +const wstring TreeTile::TREE_STRING_NAMES[ TreeTile::TREE_NAMES_LENGTH] = {L"oak", L"spruce", L"birch", L"jungle"}; -TreeTile::TreeTile(int id) : Tile(id, Material::wood) -{ - icons = NULL; - iconTop = NULL; -} +const wstring TreeTile::TREE_TEXTURES[] = {L"tree_side", L"tree_spruce", L"tree_birch", L"tree_jungle"}; -int TreeTile::getRenderShape() +TreeTile::TreeTile(int id) : RotatedPillarTile(id, Material::wood) { - return Tile::SHAPE_TREE; } int TreeTile::getResourceCount(Random *random) @@ -53,58 +48,13 @@ void TreeTile::onRemove(Level *level, int x, int y, int z, int id, int data) int currentData = level->getData(x + xo, y + yo, z + zo); if ((currentData & LeafTile::UPDATE_LEAF_BIT) == 0) { - level->setDataNoUpdate(x + xo, y + yo, z + zo, currentData | LeafTile::UPDATE_LEAF_BIT); + level->setData(x + xo, y + yo, z + zo, currentData | LeafTile::UPDATE_LEAF_BIT, Tile::UPDATE_NONE); } } } } } -void TreeTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) -{ - int type = level->getData(x, y, z) & MASK_TYPE; - int dir = PistonBaseTile::getNewFacing(level, x, y, z, dynamic_pointer_cast(by)); - int facing = 0; - - switch (dir) - { - case Facing::NORTH: - case Facing::SOUTH: - facing = FACING_Z; - break; - case Facing::EAST: - case Facing::WEST: - facing = FACING_X; - break; - case Facing::UP: - case Facing::DOWN: - facing = FACING_Y; - break; - } - - level->setData(x, y, z, type | facing); -} - -Icon *TreeTile::getTexture(int face, int data) -{ - int dir = data & MASK_FACING; - int type = data & MASK_TYPE; - - if (dir == FACING_Y && (face == Facing::UP || face == Facing::DOWN)) - { - return iconTop; - } - else if (dir == FACING_X && (face == Facing::EAST || face == Facing::WEST)) - { - return iconTop; - } - else if (dir == FACING_Z && (face == Facing::NORTH || face == Facing::SOUTH)) - { - return iconTop; - } - - return icons[type]; -} unsigned int TreeTile::getDescriptionId(int iData /*= -1*/) { @@ -113,9 +63,14 @@ unsigned int TreeTile::getDescriptionId(int iData /*= -1*/) return TreeTile::TREE_NAMES[type]; } -int TreeTile::getSpawnResourcesAuxValue(int data) +Icon *TreeTile::getTypeTexture(int type) { - return data & MASK_TYPE; + return icons_side[type]; +} + +Icon *TreeTile::getTopTexture(int type) +{ + return icons_top[type]; } int TreeTile::getWoodType(int data) @@ -131,11 +86,9 @@ shared_ptr TreeTile::getSilkTouchItemInstance(int data) void TreeTile::registerIcons(IconRegister *iconRegister) { - iconTop = iconRegister->registerIcon(L"tree_top"); - icons = new Icon*[TREE_NAMES_LENGTH]; - for (int i = 0; i < TREE_NAMES_LENGTH; i++) { - icons[i] = iconRegister->registerIcon(TREE_TEXTURES[i]); + icons_side[i] = iconRegister->registerIcon(getIconName() + L"_" + TREE_STRING_NAMES[i]); + icons_top[i] = iconRegister->registerIcon(getIconName() + L"_" + TREE_STRING_NAMES[i] + L"_top"); } } \ No newline at end of file -- cgit v1.2.3