aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp')
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp83
1 files changed, 83 insertions, 0 deletions
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;
+}