From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- .../SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp (limited to 'Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp') diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp new file mode 100644 index 00000000..20393f6e --- /dev/null +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp @@ -0,0 +1,83 @@ +#include "stdafx.h" +#include "ThinFenceTile_SPU.h" +#include "ChunkRebuildData.h" + +bool ThinFenceTile_SPU::isSolidRender(bool isServerLevel) +{ + return false; +} + +int ThinFenceTile_SPU::getRenderShape() +{ + return Tile_SPU::SHAPE_IRON_FENCE; +} + +bool ThinFenceTile_SPU::shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face) +{ + int id = level->getTile(x, y, z); + if (id == this->id) return false; + return Tile_SPU::shouldRenderFace(level, x, y, z, face); +} + +void ThinFenceTile_SPU::updateDefaultShape() +{ + setShape(0, 0, 0, 1, 1, 1); +} + +void ThinFenceTile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData, TileEntity* forceEntity) // 4J added forceData, forceEntity param +{ + float minX = 7.0f / 16.0f; + float maxX = 9.0f / 16.0f; + float minZ = 7.0f / 16.0f; + float maxZ = 9.0f / 16.0f; + + bool n = attachsTo(level->getTile(x, y, z - 1)); + bool s = attachsTo(level->getTile(x, y, z + 1)); + bool w = attachsTo(level->getTile(x - 1, y, z)); + bool e = attachsTo(level->getTile(x + 1, y, z)); + + if ((w && e) || (!w && !e && !n && !s)) + { + minX = 0; + maxX = 1; + } + else if (w && !e) + { + minX = 0; + } + else if (!w && e) + { + maxX = 1; + } + if ((n && s) || (!w && !e && !n && !s)) + { + minZ = 0; + maxZ = 1; + } + else if (n && !s) + { + minZ = 0; + } + else if (!n && s) + { + maxZ = 1; + } + setShape(minX, 0, minZ, maxX, 1, maxZ); +} + +Icon_SPU *ThinFenceTile_SPU::getEdgeTexture() +{ + if(id == Tile_SPU::ironFence_Id) + return &ms_pTileData->ironFence_EdgeTexture; + if(id == Tile_SPU::thinGlass_Id) + return &ms_pTileData->thinGlass_EdgeTexture; +#ifndef SN_TARGET_PS3_SPU + assert(0); +#endif + return NULL; +} + +bool ThinFenceTile_SPU::attachsTo(int tile) +{ + return ms_pTileData->solid[tile] || tile == id || tile == Tile_SPU::glass_Id; +} -- cgit v1.2.3