aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-08 19:08:36 -0400
committerGitHub <noreply@github.com>2026-03-08 18:08:36 -0500
commit28614b922fb77149a54da1a87bebfbc98736f296 (patch)
tree7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate
parent88798b501d0cf6287b6f87acb2592676e3cec58d (diff)
Modernize project codebase (#906)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate')
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp130
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h20
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp44
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp306
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp36
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h6
35 files changed, 304 insertions, 304 deletions
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h
index 8196032e..929cc0d1 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h
@@ -17,10 +17,10 @@ public:
BedTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual int getRenderShape() { return Tile_SPU::SHAPE_BED; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
- virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
setShape();
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h
index f34a5ec9..1009396c 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h
@@ -18,7 +18,7 @@ public:
virtual bool blocksLight() { return false; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
virtual bool isCubeShaped() { return false; }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int data = level->getData(x, y, z);
int dir = data & 7;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h
index 07eb3d86..e617e84c 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h
@@ -5,7 +5,7 @@ class CakeTile_SPU : public Tile_SPU
{
public:
CakeTile_SPU(int id) : Tile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int d = level->getData(x, y, z);
float r = 1 / 16.0f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h
index 2854b48b..199fceb6 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h
@@ -6,7 +6,7 @@ class CauldronTile_SPU : public Tile_SPU
{
public:
CauldronTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
//@Override
// virtual void updateDefaultShape();
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp
index 1cb5e2ee..ac71c572 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp
@@ -241,12 +241,12 @@ void ChunkRebuildData::createTileData()
m_tileData.signalSource.set(i, Tile::tiles[i]->isSignalSource());
m_tileData.cubeShaped.set(i, Tile::tiles[i]->isCubeShaped());
- m_tileData.xx0[i] = (float)Tile::tiles[i]->getShapeX0();
- m_tileData.yy0[i] = (float)Tile::tiles[i]->getShapeY0();
- m_tileData.zz0[i] = (float)Tile::tiles[i]->getShapeZ0();
- m_tileData.xx1[i] = (float)Tile::tiles[i]->getShapeX1();
- m_tileData.yy1[i] = (float)Tile::tiles[i]->getShapeY1();
- m_tileData.zz1[i] = (float)Tile::tiles[i]->getShapeZ1();
+ m_tileData.xx0[i] = static_cast<float>(Tile::tiles[i]->getShapeX0());
+ m_tileData.yy0[i] = static_cast<float>(Tile::tiles[i]->getShapeY0());
+ m_tileData.zz0[i] = static_cast<float>(Tile::tiles[i]->getShapeZ0());
+ m_tileData.xx1[i] = static_cast<float>(Tile::tiles[i]->getShapeX1());
+ m_tileData.yy1[i] = static_cast<float>(Tile::tiles[i]->getShapeY1());
+ m_tileData.zz1[i] = static_cast<float>(Tile::tiles[i]->getShapeZ1());
Icon* pTex = Tile::tiles[i]->icon;
if(pTex)
{
@@ -269,17 +269,17 @@ void ChunkRebuildData::createTileData()
setIconSPUFromIcon(&m_tileData.grass_iconSideOverlay, Tile::grass->iconSideOverlay);
// ThinFence
- setIconSPUFromIcon(&m_tileData.ironFence_EdgeTexture, ((ThinFenceTile*)Tile::ironFence)->getEdgeTexture());
- setIconSPUFromIcon(&m_tileData.thinGlass_EdgeTexture, ((ThinFenceTile*)Tile::thinGlass)->getEdgeTexture());
+ setIconSPUFromIcon(&m_tileData.ironFence_EdgeTexture, static_cast<ThinFenceTile *>(Tile::ironFence)->getEdgeTexture());
+ setIconSPUFromIcon(&m_tileData.thinGlass_EdgeTexture, static_cast<ThinFenceTile *>(Tile::thinGlass)->getEdgeTexture());
//FarmTile
- setIconSPUFromIcon(&m_tileData.farmTile_Dry, ((FarmTile*)Tile::farmland)->iconDry);
- setIconSPUFromIcon(&m_tileData.farmTile_Wet, ((FarmTile*)Tile::farmland)->iconWet);
+ setIconSPUFromIcon(&m_tileData.farmTile_Dry, static_cast<FarmTile *>(Tile::farmland)->iconDry);
+ setIconSPUFromIcon(&m_tileData.farmTile_Wet, static_cast<FarmTile *>(Tile::farmland)->iconWet);
// DoorTile
for(int i=0;i<8; i++)
{
- setIconSPUFromIcon(&m_tileData.doorTile_Icons[i], ((DoorTile*)Tile::door_wood)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.doorTile_Icons[i], static_cast<DoorTile *>(Tile::door_wood)->icons[i]);
// we're not supporting flipped icons, so manually flip here
if(i>=4)
m_tileData.doorTile_Icons[i].flipHorizontal();
@@ -291,20 +291,20 @@ void ChunkRebuildData::createTileData()
// SandStoneTile
for(int i=0;i<3; i++)
- setIconSPUFromIcon(&m_tileData.sandStone_icons[i], ((SandStoneTile*)Tile::sandStone)->icons[i]);
- setIconSPUFromIcon(&m_tileData.sandStone_iconTop, ((SandStoneTile*)Tile::sandStone)->iconTop);
- setIconSPUFromIcon(&m_tileData.sandStone_iconBottom, ((SandStoneTile*)Tile::sandStone)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.sandStone_icons[i], static_cast<SandStoneTile *>(Tile::sandStone)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.sandStone_iconTop, static_cast<SandStoneTile *>(Tile::sandStone)->iconTop);
+ setIconSPUFromIcon(&m_tileData.sandStone_iconBottom, static_cast<SandStoneTile *>(Tile::sandStone)->iconBottom);
// WoodTile
// assert(WoodTile_SPU::WOOD_NAMES_LENGTH == 4);
for(int i=0;i<4; i++)
- setIconSPUFromIcon(&m_tileData.woodTile_icons[i], ((WoodTile*)Tile::wood)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.woodTile_icons[i], static_cast<WoodTile *>(Tile::wood)->icons[i]);
// TreeTile
// assert(TreeTile_SPU::TREE_NAMES_LENGTH == 4);
for(int i=0;i<4; i++)
- setIconSPUFromIcon(&m_tileData.treeTile_icons[i], ((TreeTile*)Tile::treeTrunk)->icons[i]);
- setIconSPUFromIcon(&m_tileData.treeTile_iconTop, ((TreeTile*)Tile::treeTrunk)->iconTop);
+ setIconSPUFromIcon(&m_tileData.treeTile_icons[i], static_cast<TreeTile *>(Tile::treeTrunk)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.treeTile_iconTop, static_cast<TreeTile *>(Tile::treeTrunk)->iconTop);
// LeafTile
for(int i=0;i<2; i++)
@@ -313,12 +313,12 @@ void ChunkRebuildData::createTileData()
// CropTile
for(int i=0;i<8; i++)
- setIconSPUFromIcon(&m_tileData.cropTile_icons[i], ((CropTile*)Tile::crops)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.cropTile_icons[i], static_cast<CropTile *>(Tile::crops)->icons[i]);
// FurnaceTile
- setIconSPUFromIcon(&m_tileData.furnaceTile_iconTop, ((FurnaceTile*)Tile::furnace)->iconTop);
- setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront, ((FurnaceTile*)Tile::furnace)->iconFront);
- setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront_lit, ((FurnaceTile*)Tile::furnace_lit)->iconFront);
+ setIconSPUFromIcon(&m_tileData.furnaceTile_iconTop, static_cast<FurnaceTile *>(Tile::furnace)->iconTop);
+ setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront, static_cast<FurnaceTile *>(Tile::furnace)->iconFront);
+ setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront_lit, static_cast<FurnaceTile *>(Tile::furnace_lit)->iconFront);
//LiquidTile
setIconSPUFromIcon(&m_tileData.liquidTile_iconWaterStill, (Tile::water)->icons[0]);
@@ -332,64 +332,64 @@ void ChunkRebuildData::createTileData()
// Sapling
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.sapling_icons[i], ((Sapling*)Tile::sapling)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.sapling_icons[i], static_cast<Sapling *>(Tile::sapling)->icons[i]);
- m_tileData.glassTile_allowSame = ((GlassTile*)Tile::glass)->allowSame;
- m_tileData.iceTile_allowSame = ((IceTile*)Tile::ice)->allowSame;
+ m_tileData.glassTile_allowSame = static_cast<GlassTile *>(Tile::glass)->allowSame;
+ m_tileData.iceTile_allowSame = static_cast<IceTile *>(Tile::ice)->allowSame;
// DispenserTile
- setIconSPUFromIcon(&m_tileData.dispenserTile_iconTop, ((DispenserTile*)Tile::dispenser)->iconTop);
- setIconSPUFromIcon(&m_tileData.dispenserTile_iconFront, ((DispenserTile*)Tile::dispenser)->iconFront);
- setIconSPUFromIcon(&m_tileData.dispenserTile_iconFrontVertical, ((DispenserTile*)Tile::dispenser)->iconFrontVertical);
+ setIconSPUFromIcon(&m_tileData.dispenserTile_iconTop, static_cast<DispenserTile *>(Tile::dispenser)->iconTop);
+ setIconSPUFromIcon(&m_tileData.dispenserTile_iconFront, static_cast<DispenserTile *>(Tile::dispenser)->iconFront);
+ setIconSPUFromIcon(&m_tileData.dispenserTile_iconFrontVertical, static_cast<DispenserTile *>(Tile::dispenser)->iconFrontVertical);
// RailTile
- setIconSPUFromIcon(&m_tileData.railTile_iconTurn, ((RailTile*)Tile::rail)->iconTurn);
- setIconSPUFromIcon(&m_tileData.railTile_iconTurnGolden, ((RailTile*)Tile::goldenRail)->iconTurn);
+ setIconSPUFromIcon(&m_tileData.railTile_iconTurn, static_cast<RailTile *>(Tile::rail)->iconTurn);
+ setIconSPUFromIcon(&m_tileData.railTile_iconTurnGolden, static_cast<RailTile *>(Tile::goldenRail)->iconTurn);
for(int i=0;i<2;i++)
- setIconSPUFromIcon(&m_tileData.detectorRailTile_icons[i], ((DetectorRailTile*)Tile::detectorRail)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.detectorRailTile_icons[i], static_cast<DetectorRailTile *>(Tile::detectorRail)->icons[i]);
// tntTile
- setIconSPUFromIcon(&m_tileData.tntTile_iconBottom, ((TntTile*)Tile::tnt)->iconBottom);
- setIconSPUFromIcon(&m_tileData.tntTile_iconTop, ((TntTile*)Tile::tnt)->iconTop);
+ setIconSPUFromIcon(&m_tileData.tntTile_iconBottom, static_cast<TntTile *>(Tile::tnt)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.tntTile_iconTop, static_cast<TntTile *>(Tile::tnt)->iconTop);
// workbenchTile
- setIconSPUFromIcon(&m_tileData.workBench_iconFront, ((WorkbenchTile*)Tile::workBench)->iconFront);
- setIconSPUFromIcon(&m_tileData.workBench_iconTop, ((WorkbenchTile*)Tile::workBench)->iconTop);
+ setIconSPUFromIcon(&m_tileData.workBench_iconFront, static_cast<WorkbenchTile *>(Tile::workBench)->iconFront);
+ setIconSPUFromIcon(&m_tileData.workBench_iconTop, static_cast<WorkbenchTile *>(Tile::workBench)->iconTop);
// cactusTile
- setIconSPUFromIcon(&m_tileData.cactusTile_iconTop, ((CactusTile*)Tile::cactus)->iconTop);
- setIconSPUFromIcon(&m_tileData.cactusTile_iconBottom, ((CactusTile*)Tile::cactus)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.cactusTile_iconTop, static_cast<CactusTile *>(Tile::cactus)->iconTop);
+ setIconSPUFromIcon(&m_tileData.cactusTile_iconBottom, static_cast<CactusTile *>(Tile::cactus)->iconBottom);
// recordPlayer
- setIconSPUFromIcon(&m_tileData.recordPlayer_iconTop, ((RecordPlayerTile*)Tile::recordPlayer)->iconTop);
+ setIconSPUFromIcon(&m_tileData.recordPlayer_iconTop, static_cast<RecordPlayerTile *>(Tile::recordPlayer)->iconTop);
// pumpkin
- setIconSPUFromIcon(&m_tileData.pumpkinTile_iconTop, ((PumpkinTile*)Tile::pumpkin)->iconTop);
- setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFace, ((PumpkinTile*)Tile::pumpkin)->iconFace);
- setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFaceLit, ((PumpkinTile*)Tile::litPumpkin)->iconFace);
+ setIconSPUFromIcon(&m_tileData.pumpkinTile_iconTop, static_cast<PumpkinTile *>(Tile::pumpkin)->iconTop);
+ setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFace, static_cast<PumpkinTile *>(Tile::pumpkin)->iconFace);
+ setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFaceLit, static_cast<PumpkinTile *>(Tile::litPumpkin)->iconFace);
// cakeTile
- setIconSPUFromIcon(&m_tileData.cakeTile_iconTop, ((CakeTile*)Tile::cake)->iconTop);
- setIconSPUFromIcon(&m_tileData.cakeTile_iconBottom, ((CakeTile*)Tile::cake)->iconBottom);
- setIconSPUFromIcon(&m_tileData.cakeTile_iconInner, ((CakeTile*)Tile::cake)->iconInner);
+ setIconSPUFromIcon(&m_tileData.cakeTile_iconTop, static_cast<CakeTile *>(Tile::cake)->iconTop);
+ setIconSPUFromIcon(&m_tileData.cakeTile_iconBottom, static_cast<CakeTile *>(Tile::cake)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.cakeTile_iconInner, static_cast<CakeTile *>(Tile::cake)->iconInner);
// SmoothStoneBrickTile
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.smoothStoneBrick_icons[i], ((SmoothStoneBrickTile*)Tile::stoneBrickSmooth)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.smoothStoneBrick_icons[i], static_cast<SmoothStoneBrickTile *>(Tile::stoneBrickSmooth)->icons[i]);
// HugeMushroomTile
for(int i=0;i<2;i++)
- setIconSPUFromIcon(&m_tileData.hugeMushroom_icons[i], ((HugeMushroomTile*)Tile::hugeMushroom1)->icons[i]);
- setIconSPUFromIcon(&m_tileData.hugeMushroom_iconStem, ((HugeMushroomTile*)Tile::hugeMushroom1)->iconStem);
- setIconSPUFromIcon(&m_tileData.hugeMushroom_iconInside, ((HugeMushroomTile*)Tile::hugeMushroom1)->iconInside);
+ setIconSPUFromIcon(&m_tileData.hugeMushroom_icons[i], static_cast<HugeMushroomTile *>(Tile::hugeMushroom1)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.hugeMushroom_iconStem, static_cast<HugeMushroomTile *>(Tile::hugeMushroom1)->iconStem);
+ setIconSPUFromIcon(&m_tileData.hugeMushroom_iconInside, static_cast<HugeMushroomTile *>(Tile::hugeMushroom1)->iconInside);
// MelonTile
- setIconSPUFromIcon(&m_tileData.melonTile_iconTop, ((MelonTile*)Tile::melon)->iconTop);
+ setIconSPUFromIcon(&m_tileData.melonTile_iconTop, static_cast<MelonTile *>(Tile::melon)->iconTop);
// StemTile
- setIconSPUFromIcon(&m_tileData.stemTile_iconAngled, ((StemTile*)Tile::melonStem)->iconAngled);
+ setIconSPUFromIcon(&m_tileData.stemTile_iconAngled, static_cast<StemTile *>(Tile::melonStem)->iconAngled);
// MycelTile
setIconSPUFromIcon(&m_tileData.mycelTile_iconTop, (Tile::mycel)->iconTop);
@@ -397,14 +397,14 @@ void ChunkRebuildData::createTileData()
// NetherStalkTile
for(int i=0;i<3;i++)
- setIconSPUFromIcon(&m_tileData.netherStalk_icons[i], ((NetherStalkTile*)Tile::netherStalk)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.netherStalk_icons[i], static_cast<NetherStalkTile *>(Tile::netherStalk)->icons[i]);
// EnchantmentTableTile
- setIconSPUFromIcon(&m_tileData.enchantmentTable_iconTop, ((EnchantmentTableTile*)Tile::enchantTable)->iconTop);
- setIconSPUFromIcon(&m_tileData.enchantmentTable_iconBottom, ((EnchantmentTableTile*)Tile::enchantTable)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.enchantmentTable_iconTop, static_cast<EnchantmentTableTile *>(Tile::enchantTable)->iconTop);
+ setIconSPUFromIcon(&m_tileData.enchantmentTable_iconBottom, static_cast<EnchantmentTableTile *>(Tile::enchantTable)->iconBottom);
//BrewingStandTile
- setIconSPUFromIcon(&m_tileData.brewingStand_iconBase, ((BrewingStandTile*)Tile::brewingStand)->iconBase);
+ setIconSPUFromIcon(&m_tileData.brewingStand_iconBase, static_cast<BrewingStandTile *>(Tile::brewingStand)->iconBase);
//RedStoneDust
setIconSPUFromIcon(&m_tileData.redStoneDust_iconCross, (Tile::redStoneDust)->iconCross);
@@ -412,32 +412,32 @@ void ChunkRebuildData::createTileData()
setIconSPUFromIcon(&m_tileData.redStoneDust_iconCrossOver, (Tile::redStoneDust)->iconCrossOver);
setIconSPUFromIcon(&m_tileData.redStoneDust_iconLineOver, (Tile::redStoneDust)->iconLineOver);
- setIconSPUFromIcon(&m_tileData.stoneSlab_iconSide, ((StoneSlabTile*)(Tile::stoneSlab))->iconSide);
+ setIconSPUFromIcon(&m_tileData.stoneSlab_iconSide, static_cast<StoneSlabTile *>(Tile::stoneSlab)->iconSide);
for(int i=0;i<16;i++)
- setIconSPUFromIcon(&m_tileData.clothTile_icons[i], ((ClothTile*)Tile::cloth)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.clothTile_icons[i], static_cast<ClothTile *>(Tile::cloth)->icons[i]);
// CarrotTile
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.carrot_icons[i], ((CarrotTile*)Tile::carrots)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.carrot_icons[i], static_cast<CarrotTile *>(Tile::carrots)->icons[i]);
// PotatoTile
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.potato_icons[i], ((PotatoTile*)Tile::potatoes)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.potato_icons[i], static_cast<PotatoTile *>(Tile::potatoes)->icons[i]);
// AnvilTile
for(int i=0;i<3;i++)
- setIconSPUFromIcon(&m_tileData.anvil_icons[i], ((AnvilTile*)Tile::anvil)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.anvil_icons[i], static_cast<AnvilTile *>(Tile::anvil)->icons[i]);
// QuartzBlockTile
for(int i=0;i<5;i++)
- setIconSPUFromIcon(&m_tileData.quartzBlock_icons[i], ((QuartzBlockTile*)Tile::quartzBlock)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_icons[i], static_cast<QuartzBlockTile *>(Tile::quartzBlock)->icons[i]);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconChiseledTop, ((QuartzBlockTile*)Tile::quartzBlock)->iconChiseledTop);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconLinesTop, ((QuartzBlockTile*)Tile::quartzBlock)->iconLinesTop);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconTop, ((QuartzBlockTile*)Tile::quartzBlock)->iconTop);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconBottom, ((QuartzBlockTile*)Tile::quartzBlock)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconChiseledTop, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconChiseledTop);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconLinesTop, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconLinesTop);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconTop, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconTop);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconBottom, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconBottom);
}
// extern int g_lastHitBlockX;
@@ -696,7 +696,7 @@ bool ChunkRebuildData::isEmptyTile(int x, int y, int z)
bool ChunkRebuildData::isSolidRenderTile(int x, int y, int z)
{
TileRef_SPU tile(getTile(x,y,z));
- if (tile.getPtr() == NULL) return false;
+ if (tile.getPtr() == nullptr) return false;
// 4J - addition here to make rendering big blocks of leaves more efficient. Normally leaves never consider themselves as solid, so
@@ -727,7 +727,7 @@ bool ChunkRebuildData::isSolidRenderTile(int x, int y, int z)
bool ChunkRebuildData::isSolidBlockingTile(int x, int y, int z)
{
TileRef_SPU tile(getTile(x, y, z));
- if (tile.getPtr() == NULL) return false;
+ if (tile.getPtr() == nullptr) return false;
bool ret = tile->getMaterial()->blocksMotion() && tile->isCubeShaped();
return ret;
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h
index f6671db4..2fcb1514 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h
@@ -24,7 +24,7 @@ public:
virtual bool blocksLight() { return false; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
virtual int getRenderShape() { return Tile_SPU::SHAPE_DOOR; }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
int getDir(ChunkRebuildData *level, int x, int y, int z);
bool isOpen(ChunkRebuildData *level, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h
index 6e86d1f0..5e99cc32 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h
@@ -12,7 +12,7 @@ public:
Icon_SPU *getTexture(int face, int data) { return TileRef_SPU(wood_Id)->getTexture(face); }
static int getDirection(int data) { return (data & DIRECTION_MASK); }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param // Brought forward from 1.2.3
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param // Brought forward from 1.2.3
{
int data = getDirection(level->getData(x, y, z));
if (data == Direction::NORTH || data == Direction::SOUTH)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp
index fcb3baef..63c206d1 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp
@@ -59,7 +59,7 @@ bool FenceTile_SPU::connectsTo(ChunkRebuildData *level, int x, int y, int z)
return true;
}
TileRef_SPU tileInstance(tile);
- if (tileInstance.getPtr() != NULL)
+ if (tileInstance.getPtr() != nullptr)
{
if (tileInstance->getMaterial()->isSolidBlocking() && tileInstance->isCubeShaped())
{
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h
index 50a775fb..bed2e3b7 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h
@@ -5,7 +5,7 @@ class FenceTile_SPU : public Tile_SPU
{
public:
FenceTile_SPU(int id) : Tile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual bool blocksLight();
virtual bool isSolidRender(bool isServerLevel = false);
virtual int getRenderShape();
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp
index 1cf83821..1dba9757 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp
@@ -3,7 +3,7 @@
#include "Facing_SPU.h"
#include "ChunkRebuildData.h"
-void HalfSlabTile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData /* = -1 */, TileEntity* forceEntity /* = NULL */)
+void HalfSlabTile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData /* = -1 */, TileEntity* forceEntity /* = nullptr */)
{
if (fullSize())
{
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h
index fd525e96..c89581ad 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h
@@ -9,7 +9,7 @@ public:
static const int TOP_SLOT_BIT = 8;
HalfSlabTile_SPU(int id) : Tile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual void updateDefaultShape();
virtual bool isSolidRender(bool isServerLevel);
virtual bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h
index f4ba6ccf..0597c1fc 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h
@@ -24,29 +24,29 @@ public:
void set(int16_t _x, int16_t _y, int16_t _w, int16_t _h, int texWidth, int texHeight)
{
- x0 = (int16_t)(4096 * (float(_x) / texWidth));
- y0 = (int16_t)(4096 * (float(_y) / texHeight));
- x1 = x0 + (int16_t)(4096 * (float(_w) / texWidth));
- y1 = y0 + (int16_t)(4096 * (float(_h) / texHeight));
+ x0 = static_cast<int16_t>(4096 * (float(_x) / texWidth));
+ y0 = static_cast<int16_t>(4096 * (float(_y) / texHeight));
+ x1 = x0 + static_cast<int16_t>(4096 * (float(_w) / texWidth));
+ y1 = y0 + static_cast<int16_t>(4096 * (float(_h) / texHeight));
}
void flipHorizontal() { int16_t temp = x0; x0 = x1; x1 = temp; }
void flipVertical() { int16_t temp = y0; y0 = y1; y1 = temp; }
- float getU0() const { return (float(x0) / 4096) + UVAdjust; }//sc_texWidth) + getUAdjust(); }
- float getU1() const { return (float(x1) / 4096.0f) - UVAdjust; } //sc_texWidth) - getUAdjust(); }
+ float getU0() const { return (static_cast<float>(x0) / 4096) + UVAdjust; }//sc_texWidth) + getUAdjust(); }
+ float getU1() const { return (static_cast<float>(x1) / 4096.0f) - UVAdjust; } //sc_texWidth) - getUAdjust(); }
float getU(double offset) const
{
float diff = getU1() - getU0();
- return getU0() + (diff * ((float) offset / 16));//SharedConstants::WORLD_RESOLUTION));
+ return getU0() + (diff * (static_cast<float>(offset) / 16));//SharedConstants::WORLD_RESOLUTION));
}
- float getV0() const { return (float(y0) / 4096.0f) + UVAdjust; } //sc_texHeight) + getVAdjust(); }
- float getV1() const { return (float(y1) / 4096.0f) - UVAdjust; } //sc_texHeight) - getVAdjust(); }
+ float getV0() const { return (static_cast<float>(y0) / 4096.0f) + UVAdjust; } //sc_texHeight) + getVAdjust(); }
+ float getV1() const { return (static_cast<float>(y1) / 4096.0f) - UVAdjust; } //sc_texHeight) - getVAdjust(); }
float getV(double offset) const
{
float diff = getV1() - getV0();
- return getV0() + (diff * ((float) offset / 16)); //SharedConstants::WORLD_RESOLUTION));
+ return getV0() + (diff * (static_cast<float>(offset) / 16)); //SharedConstants::WORLD_RESOLUTION));
}
// virtual wstring getName() const = 0;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp
index 7f13fd4f..fa075e71 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp
@@ -211,12 +211,12 @@ double LiquidTile_SPU::getSlopeAngle(ChunkRebuildData *level, int x, int y, int
if (m->getID() == Material_SPU::water_Id)
{
TileRef_SPU tRef(Tile_SPU::water_Id);
- flow = ((LiquidTile_SPU*)tRef.getPtr())->getFlow(level, x, y, z);
+ flow = static_cast<LiquidTile_SPU *>(tRef.getPtr())->getFlow(level, x, y, z);
}
if (m->getID() == Material_SPU::lava_Id)
{
TileRef_SPU tRef(Tile_SPU::lava_Id);
- flow = ((LiquidTile_SPU*)tRef.getPtr())->getFlow(level, x, y, z);
+ flow = static_cast<LiquidTile_SPU *>(tRef.getPtr())->getFlow(level, x, y, z);
}
if (flow.x == 0 && flow.z == 0) return -1000;
return atan2(flow.z, flow.x) - MATH_PI / 2;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h
index e8411c88..81ba68c1 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h
@@ -8,7 +8,7 @@ class PistonBaseTile_SPU : public Tile_SPU
public:
PistonBaseTile_SPU(int id) : Tile_SPU(id) {}
// virtual void updateShape(float x0, float y0, float z0, float x1, float y1, float z1);
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual int getRenderShape() { return SHAPE_PISTON_BASE; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h
index d5460492..ee559eff 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h
@@ -6,7 +6,7 @@ class PistonExtensionTile_SPU : public Tile_SPU
public:
PistonExtensionTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual int getRenderShape() { return SHAPE_PISTON_EXTENSION; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); // 4J added forceData, forceEntity param
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h
index 48fc52e9..6ea12648 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h
@@ -10,7 +10,7 @@ public:
virtual int getRenderShape() { return SHAPE_INVISIBLE; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
- virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
// should never get here.
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h
index f01313a1..a5a4652d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h
@@ -5,7 +5,7 @@ class PortalTile_SPU : public HalfTransparentTile_SPU
{
public:
PortalTile_SPU(int id): HalfTransparentTile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
if (level->getTile(x - 1, y, z) == id || level->getTile(x + 1, y, z) == id)
{
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h
index 133ec52e..6742e6f6 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h
@@ -16,6 +16,6 @@ public:
virtual bool isSolidRender(bool isServerLevel = false);
virtual bool blocksLight();
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual void updateDefaultShape();
};
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h
index 615ebec9..2f8639d4 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h
@@ -10,7 +10,7 @@ public:
RailTile_SPU(int id) : Tile_SPU(id) {}
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int data = level->getData(x, y, z);
if (data >= 2 && data <= 5)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h
index 0e461118..218cbd64 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h
@@ -26,7 +26,7 @@ public:
case TEXTURE_CROSS_OVERLAY: return &ms_pTileData->redStoneDust_iconCrossOver;
case TEXTURE_LINE_OVERLAY: return &ms_pTileData->redStoneDust_iconLineOver;
}
- return NULL;
+ return nullptr;
}
static bool shouldConnectTo(ChunkRebuildData *level, int x, int y, int z, int direction)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h
index 7fe54d99..74bdb95d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h
@@ -16,7 +16,7 @@ public:
}
Icon_SPU *getTexture(int face, int data){ return TileRef_SPU(wood_Id)->getTexture(face); }
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
if (onGround()) return;
int face = level->getData(x, y, z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h
index eefa36b2..ca5ba279 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h
@@ -15,7 +15,7 @@ public:
public:
StairTile_SPU(int id) : Tile_SPU(id) {}
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
bool isSolidRender(bool isServerLevel = false);
int getRenderShape();
void setBaseShape(ChunkRebuildData *level, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h
index 89cd3739..4923e862 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h
@@ -35,7 +35,7 @@ public:
this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss);
}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
ms_pTileData->yy1[id] = (level->getData(x, y, z) * 2 + 2) / 16.0f;
float ss = 0.125f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp
index 3d1007af..efcd44f0 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp
@@ -68,7 +68,7 @@ typedef unsigned short hfloat;
hfloat convertFloatToHFloat(float f)
{
unsigned int x = *(unsigned int *)&f;
- unsigned int sign = (unsigned short)(x >> 31);
+ unsigned int sign = static_cast<unsigned short>(x >> 31);
unsigned int mantissa;
unsigned int exp;
hfloat hf;
@@ -90,8 +90,8 @@ hfloat convertFloatToHFloat(float f)
// 16-bit half-float representation stores number as Inf
mantissa = 0;
}
- hf = (((hfloat)sign) << 15) | (hfloat)(HALF_FLOAT_MAX_BIASED_EXP) |
- (hfloat)(mantissa >> 13);
+ hf = (static_cast<hfloat>(sign) << 15) | static_cast<hfloat>(HALF_FLOAT_MAX_BIASED_EXP) |
+ static_cast<hfloat>(mantissa >> 13);
}
// check if exponent is <= -15
else if (exp <= HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP)
@@ -101,13 +101,13 @@ hfloat convertFloatToHFloat(float f)
exp = (HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP - exp) >> 23;
mantissa >>= (14 + exp);
- hf = (((hfloat)sign) << 15) | (hfloat)(mantissa);
+ hf = (static_cast<hfloat>(sign) << 15) | static_cast<hfloat>(mantissa);
}
else
{
- hf = (((hfloat)sign) << 15) |
- (hfloat)((exp - HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP) >> 13) |
- (hfloat)(mantissa >> 13);
+ hf = (static_cast<hfloat>(sign) << 15) |
+ static_cast<hfloat>((exp - HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP) >> 13) |
+ static_cast<hfloat>(mantissa >> 13);
}
return hf;
@@ -115,8 +115,8 @@ hfloat convertFloatToHFloat(float f)
float convertHFloatToFloat(hfloat hf)
{
- unsigned int sign = (unsigned int)(hf >> 15);
- unsigned int mantissa = (unsigned int)(hf & ((1 << 10) - 1));
+ unsigned int sign = static_cast<unsigned int>(hf >> 15);
+ unsigned int mantissa = static_cast<unsigned int>(hf & ((1 << 10) - 1));
unsigned int exp = (unsigned int)(hf & HALF_FLOAT_MAX_BIASED_EXP);
unsigned int f;
@@ -170,7 +170,7 @@ float convertHFloatToFloat(hfloat hf)
//
Tesselator_SPU *Tesselator_SPU::getInstance()
{
- return NULL;
+ return nullptr;
// return (Tesselator_SPU *)TlsGetValue(tlsIdx);
}
@@ -329,12 +329,12 @@ void Tesselator_SPU::tex2(int tex2)
void Tesselator_SPU::color(float r, float g, float b)
{
- color((int) (r * 255), (int) (g * 255), (int) (b * 255));
+ color(static_cast<int>(r * 255), static_cast<int>(g * 255), static_cast<int>(b * 255));
}
void Tesselator_SPU::color(float r, float g, float b, float a)
{
- color((int) (r * 255), (int) (g * 255), (int) (b * 255), (int) (a * 255));
+ color(static_cast<int>(r * 255), static_cast<int>(g * 255), static_cast<int>(b * 255), static_cast<int>(a * 255));
}
void Tesselator_SPU::color(int r, int g, int b)
@@ -539,7 +539,7 @@ void Tesselator_SPU::vertex(float x, float y, float z)
// see comments in packCompactQuad() for exact format
if( useCompactFormat360 )
{
- unsigned int ucol = (unsigned int)col;
+ unsigned int ucol = static_cast<unsigned int>(col);
#ifdef _XBOX
// Pack as 4:4:4 RGB_
@@ -564,7 +564,7 @@ void Tesselator_SPU::vertex(float x, float y, float z)
unsigned short packedcol = ((col & 0xf8000000 ) >> 16 ) |
((col & 0x00fc0000 ) >> 13 ) |
((col & 0x0000f800 ) >> 11 );
- int ipackedcol = ((int)packedcol) & 0xffff; // 0 to 65535 range
+ int ipackedcol = static_cast<int>(packedcol) & 0xffff; // 0 to 65535 range
ipackedcol -= 32768; // -32768 to 32767 range
ipackedcol &= 0xffff;
@@ -597,12 +597,12 @@ void Tesselator_SPU::vertex(float x, float y, float z)
pShortData[7] = ((INT_ROUND(tex2V * (8192.0f/256.0f)))&0xffff);
incData(4);
#else
- pShortData[0] = (((int)((x + xo ) * 1024.0f))&0xffff);
- pShortData[1] = (((int)((y + yo ) * 1024.0f))&0xffff);
- pShortData[2] = (((int)((z + zo ) * 1024.0f))&0xffff);
+ pShortData[0] = (static_cast<int>((x + xo) * 1024.0f)&0xffff);
+ pShortData[1] = (static_cast<int>((y + yo) * 1024.0f)&0xffff);
+ pShortData[2] = (static_cast<int>((z + zo) * 1024.0f)&0xffff);
pShortData[3] = ipackedcol;
- pShortData[4] = (((int)(uu * 8192.0f))&0xffff);
- pShortData[5] = (((int)(v * 8192.0f))&0xffff);
+ pShortData[4] = (static_cast<int>(uu * 8192.0f)&0xffff);
+ pShortData[5] = (static_cast<int>(v * 8192.0f)&0xffff);
pShortData[6] = ((int16_t*)&_tex2)[0];
pShortData[7] = ((int16_t*)&_tex2)[1];
incData(4);
@@ -723,9 +723,9 @@ void Tesselator_SPU::noColor()
void Tesselator_SPU::normal(float x, float y, float z)
{
hasNormal = true;
- byte xx = (byte) (x * 127);
- byte yy = (byte) (y * 127);
- byte zz = (byte) (z * 127);
+ byte xx = static_cast<byte>(x * 127);
+ byte yy = static_cast<byte>(y * 127);
+ byte zz = static_cast<byte>(z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h
index 8aab31a3..87d87bcf 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h
@@ -5,7 +5,7 @@ class TheEndPortalFrameTile_SPU : public Tile_SPU
{
public:
TheEndPortalFrameTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
virtual int getRenderShape() { return SHAPE_PORTAL_FRAME; }
// virtual void updateDefaultShape();
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
index 20393f6e..9e7d30de 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
@@ -74,7 +74,7 @@ Icon_SPU *ThinFenceTile_SPU::getEdgeTexture()
#ifndef SN_TARGET_PS3_SPU
assert(0);
#endif
- return NULL;
+ return nullptr;
}
bool ThinFenceTile_SPU::attachsTo(int tile)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h
index 61c39201..8f7b601b 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h
@@ -11,7 +11,7 @@ public:
virtual int getRenderShape();
virtual bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face);
virtual void updateDefaultShape();
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual Icon_SPU *getEdgeTexture();
bool attachsTo(int tile);
};
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
index ab9b2c94..22c3a26d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
@@ -71,7 +71,7 @@ const float smallUV = ( 1.0f / 16.0f );
void TileRenderer_SPU::_init()
{
- fixedTexture = NULL;
+ fixedTexture = nullptr;
xFlipTexture = false;
noCulling = false;
blsmooth = 1;
@@ -103,7 +103,7 @@ TileRenderer_SPU::TileRenderer_SPU( ChunkRebuildData* level )
TileRenderer_SPU::TileRenderer_SPU()
{
- this->level = NULL;
+ this->level = nullptr;
_init();
}
@@ -122,12 +122,12 @@ void TileRenderer_SPU::setFixedTexture( Icon_SPU *fixedTexture )
void TileRenderer_SPU::clearFixedTexture()
{
- this->fixedTexture = NULL;
+ this->fixedTexture = nullptr;
}
bool TileRenderer_SPU::hasFixedTexture()
{
- return fixedTexture != NULL;
+ return fixedTexture != nullptr;
}
void TileRenderer_SPU::setShape(float x0, float y0, float z0, float x1, float y1, float z1)
@@ -270,7 +270,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateStemInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_LILYPAD:
- retVal = tesselateLilypadInWorld( (WaterlilyTile_SPU*)tt, x, y, z );
+ retVal = tesselateLilypadInWorld( static_cast<WaterlilyTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_ROWS:
retVal = tesselateRowInWorld( tt, x, y, z );
@@ -279,7 +279,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateTorchInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_FIRE:
- retVal = tesselateFireInWorld( (FireTile_SPU *)tt, x, y, z );
+ retVal = tesselateFireInWorld( static_cast<FireTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_RED_DUST:
retVal = tesselateDustInWorld( tt, x, y, z );
@@ -291,19 +291,19 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateDoorInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_RAIL:
- retVal = tesselateRailInWorld( ( RailTile_SPU* )tt, x, y, z );
+ retVal = tesselateRailInWorld( static_cast<RailTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_STAIRS:
- retVal = tesselateStairsInWorld( (StairTile_SPU *)tt, x, y, z );
+ retVal = tesselateStairsInWorld( static_cast<StairTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_EGG:
- retVal = tesselateEggInWorld((EggTile_SPU*) tt, x, y, z);
+ retVal = tesselateEggInWorld(static_cast<EggTile_SPU *>(tt), x, y, z);
break;
case Tile_SPU::SHAPE_FENCE:
- retVal = tesselateFenceInWorld( ( FenceTile_SPU* )tt, x, y, z );
+ retVal = tesselateFenceInWorld( static_cast<FenceTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_WALL:
- retVal = tesselateWallInWorld( (WallTile_SPU *) tt, x, y, z);
+ retVal = tesselateWallInWorld( static_cast<WallTile_SPU *>(tt), x, y, z);
break;
case Tile_SPU::SHAPE_LEVER:
retVal = tesselateLeverInWorld( tt, x, y, z );
@@ -318,7 +318,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateBedInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_DIODE:
- retVal = tesselateDiodeInWorld( (DiodeTile_SPU *)tt, x, y, z );
+ retVal = tesselateDiodeInWorld( static_cast<DiodeTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_PISTON_BASE:
retVal = tesselatePistonBaseInWorld( tt, x, y, z, false, forceData );
@@ -333,7 +333,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateVineInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_FENCE_GATE:
- retVal = tesselateFenceGateInWorld( ( FenceGateTile_SPU* )tt, x, y, z );
+ retVal = tesselateFenceGateInWorld( static_cast<FenceGateTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_CAULDRON:
retVal = tesselateCauldronInWorld((CauldronTile_SPU* ) tt, x, y, z);
@@ -345,7 +345,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateAnvilInWorld((AnvilTile_SPU *) tt, x, y, z);
break;
case Tile_SPU::SHAPE_BREWING_STAND:
- retVal = tesselateBrewingStandInWorld((BrewingStandTile_SPU* ) tt, x, y, z);
+ retVal = tesselateBrewingStandInWorld(static_cast<BrewingStandTile_SPU *>(tt), x, y, z);
break;
case Tile_SPU::SHAPE_PORTAL_FRAME:
retVal = tesselateAirPortalFrameInWorld((TheEndPortalFrameTile *)tt, x, y, z);
@@ -838,7 +838,7 @@ bool TileRenderer_SPU::tesselateFlowerPotInWorld(FlowerPotTile_SPU *tt, int x, i
float xOff = 0;
float yOff = 4;
float zOff = 0;
- Tile *plant = NULL;
+ Tile *plant = nullptr;
switch (type)
{
@@ -858,7 +858,7 @@ bool TileRenderer_SPU::tesselateFlowerPotInWorld(FlowerPotTile_SPU *tt, int x, i
t->addOffset(xOff / 16.0f, yOff / 16.0f, zOff / 16.0f);
- if (plant != NULL)
+ if (plant != nullptr)
{
tesselateInWorld(plant, x, y, z);
}
@@ -1099,23 +1099,23 @@ bool TileRenderer_SPU::tesselateTorchInWorld( Tile_SPU* tt, int x, int y, int z
float h = 0.20f;
if ( dir == 1 )
{
- tesselateTorch( tt, (float)x - r2, (float)y + h, (float)z, -r, 0.0f, 0 );
+ tesselateTorch( tt, static_cast<float>(x) - r2, static_cast<float>(y) + h, static_cast<float>(z), -r, 0.0f, 0 );
}
else if ( dir == 2 )
{
- tesselateTorch( tt, (float)x + r2, (float)y + h, (float)z, +r, 0.0f, 0 );
+ tesselateTorch( tt, static_cast<float>(x) + r2, static_cast<float>(y) + h, static_cast<float>(z), +r, 0.0f, 0 );
}
else if ( dir == 3 )
{
- tesselateTorch( tt, (float)x, (float)y + h, z - r2, 0.0f, -r, 0 );
+ tesselateTorch( tt, static_cast<float>(x), static_cast<float>(y) + h, z - r2, 0.0f, -r, 0 );
}
else if ( dir == 4 )
{
- tesselateTorch( tt, (float)x, (float)y + h, (float)z + r2, 0.0f, +r, 0 );
+ tesselateTorch( tt, static_cast<float>(x), static_cast<float>(y) + h, static_cast<float>(z) + r2, 0.0f, +r, 0 );
}
else
{
- tesselateTorch( tt, (float)x, (float)y, (float)z, 0.0f, 0.0f, 0 );
+ tesselateTorch( tt, static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), 0.0f, 0.0f, 0 );
}
return true;
@@ -1724,7 +1724,7 @@ bool TileRenderer_SPU::tesselateLeverInWorld( Tile_SPU* tt, int x, int y, int z
}
}
- Vec3* c0 = NULL, *c1 = NULL, *c2 = NULL, *c3 = NULL;
+ Vec3* c0 = nullptr, *c1 = nullptr, *c2 = nullptr, *c3 = nullptr;
for ( int i = 0; i < 6; i++ )
{
if ( i == 0 )
@@ -1897,7 +1897,7 @@ bool TileRenderer_SPU::tesselateTripwireSourceInWorld(Tile_SPU *tt, int x, int y
corners[i]->z += z + 0.5;
}
- Vec3 *c0 = NULL, *c1 = NULL, *c2 = NULL, *c3 = NULL;
+ Vec3 *c0 = nullptr, *c1 = nullptr, *c2 = nullptr, *c3 = nullptr;
int stickX0 = 7;
int stickX1 = 9;
int stickY0 = 9;
@@ -2321,15 +2321,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
float z0_ = z + 0.5f - 0.3f;
float z1_ = z + 0.5f + 0.3f;
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v0 ) );
tex = secondTex;
u0 = tex->getU0();
@@ -2337,15 +2337,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
u1 = tex->getU1();
v1 = tex->getV1();
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
x0 = x + 0.5f - 0.5f;
x1 = x + 0.5f + 0.5f;
@@ -2357,15 +2357,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
z0_ = z + 0.5f - 0.4f;
z1_ = z + 0.5f + 0.4f;
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v0 ) );
tex = firstTex;
u0 = tex->getU0();
@@ -2373,15 +2373,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
u1 = tex->getU1();
v1 = tex->getV1();
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
}
else
{
@@ -2425,10 +2425,10 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
{
t->vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z +
0.0f ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z +
- 0.0f ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z +
- 1.0f ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1 - 0), ( float )( y + 0 + yo ), ( float )( z +
+ 0.0f ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1 - 0), ( float )( y + 0 + yo ), ( float )( z +
+ 1.0f ), ( float )( u1 ), ( float )( v1 ) );
t->vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z +
1.0f ), ( float )( u1 ), ( float )( v0 ) );
@@ -2504,14 +2504,14 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
if ( ( ( x + y + z ) & 1 ) == 0 )
{
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z +
- 0 ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z +
- 0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z +
- 1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z +
- 1 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z +
+ 0), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z +
+ 0), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z +
+ 1), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z +
+ 1), ( float )( u0 ), ( float )( v0 ) );
tex = secondTex;
u0 = tex->getU0();
@@ -2523,10 +2523,10 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
1.0f ), ( float )( u1 ), ( float )( v0 ) );
t->vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z +
1.0f ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z +
- 0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z +
- 0 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), static_cast<float>(z +
+ 0), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z +
+ 0), ( float )( u0 ), ( float )( v0 ) );
}
else
{
@@ -2789,15 +2789,15 @@ bool TileRenderer_SPU::tesselateRailInWorld( RailTile_SPU* tt, int x, int y, int
float r = 1 / 16.0f;
- float x0 = ( float )( x + 1 );
- float x1 = ( float )( x + 1 );
- float x2 = ( float )( x + 0 );
- float x3 = ( float )( x + 0 );
+ float x0 = static_cast<float>(x + 1);
+ float x1 = static_cast<float>(x + 1);
+ float x2 = static_cast<float>(x + 0);
+ float x3 = static_cast<float>(x + 0);
- float z0 = ( float )( z + 0 );
- float z1 = ( float )( z + 1 );
- float z2 = ( float )( z + 1 );
- float z3 = ( float )( z + 0 );
+ float z0 = static_cast<float>(z + 0);
+ float z1 = static_cast<float>(z + 1);
+ float z2 = static_cast<float>(z + 1);
+ float z3 = static_cast<float>(z + 0);
float y0 = ( float )( y + r );
float y1 = ( float )( y + r );
@@ -2806,24 +2806,24 @@ bool TileRenderer_SPU::tesselateRailInWorld( RailTile_SPU* tt, int x, int y, int
if ( data == 1 || data == 2 || data == 3 || data == 7 )
{
- x0 = x3 = ( float )( x + 1 );
- x1 = x2 = ( float )( x + 0 );
- z0 = z1 = ( float )( z + 1 );
- z2 = z3 = ( float )( z + 0 );
+ x0 = x3 = static_cast<float>(x + 1);
+ x1 = x2 = static_cast<float>(x + 0);
+ z0 = z1 = static_cast<float>(z + 1);
+ z2 = z3 = static_cast<float>(z + 0);
}
else if ( data == 8 )
{
- x0 = x1 = ( float )( x + 0 );
- x2 = x3 = ( float )( x + 1 );
- z0 = z3 = ( float )( z + 1 );
- z1 = z2 = ( float )( z + 0 );
+ x0 = x1 = static_cast<float>(x + 0);
+ x2 = x3 = static_cast<float>(x + 1);
+ z0 = z3 = static_cast<float>(z + 1);
+ z1 = z2 = static_cast<float>(z + 0);
}
else if ( data == 9 )
{
- x0 = x3 = ( float )( x + 0 );
- x1 = x2 = ( float )( x + 1 );
- z0 = z1 = ( float )( z + 0 );
- z2 = z3 = ( float )( z + 1 );
+ x0 = x3 = static_cast<float>(x + 0);
+ x1 = x2 = static_cast<float>(x + 1);
+ z0 = z1 = static_cast<float>(z + 0);
+ z2 = z3 = static_cast<float>(z + 1);
}
if ( data == 2 || data == 4 )
@@ -3555,9 +3555,9 @@ bool TileRenderer_SPU::tesselateCrossInWorld( Tile_SPU* tt, int x, int y, int z
}
t->color( br * r, br * g, br * b );
- float xt = (float)x;
- float yt = (float)y;
- float zt = (float)z;
+ float xt = static_cast<float>(x);
+ float yt = static_cast<float>(y);
+ float zt = static_cast<float>(z);
if (tt->id == Tile_SPU::tallgrass_Id)
{
@@ -3575,7 +3575,7 @@ bool TileRenderer_SPU::tesselateCrossInWorld( Tile_SPU* tt, int x, int y, int z
bool TileRenderer_SPU::tesselateStemInWorld( Tile_SPU* _tt, int x, int y, int z )
{
- StemTile_SPU* tt = ( StemTile_SPU* )_tt;
+ StemTile_SPU* tt = static_cast<StemTile_SPU *>(_tt);
Tesselator_SPU* t = getTesselator();
float br;
@@ -3805,7 +3805,7 @@ bool TileRenderer_SPU::tesselateLilypadInWorld(WaterlilyTile_SPU *tt, int x, int
int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y);
seed = seed * seed * 42317861 + seed * 11;
- int dir = (int) ((seed >> 16) & 0x3);
+ int dir = static_cast<int>((seed >> 16) & 0x3);
@@ -4017,7 +4017,7 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
{
changed = true;
Icon_SPU *tex = getTexture( tt, 1, data );
- float angle = ( float )LiquidTile_SPU::getSlopeAngle( level, x, y, z, m );
+ float angle = static_cast<float>(LiquidTile_SPU::getSlopeAngle(level, x, y, z, m));
if ( angle > -999 )
{
tex = getTexture( tt, 2, data );
@@ -4112,8 +4112,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
{
hh0 = ( float )( h0 );
hh1 = ( float )( h3 );
- x0 = ( float )( x );
- x1 = ( float )( x + 1 );
+ x0 = static_cast<float>(x);
+ x1 = static_cast<float>(x + 1);
z0 = ( float )( z + offs);
z1 = ( float )( z + offs);
}
@@ -4121,8 +4121,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
{
hh0 = ( float )( h2 );
hh1 = ( float )( h1 );
- x0 = ( float )( x + 1 );
- x1 = ( float )( x );
+ x0 = static_cast<float>(x + 1);
+ x1 = static_cast<float>(x);
z0 = ( float )( z + 1 - offs);
z1 = ( float )( z + 1 - offs);
}
@@ -4132,8 +4132,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
hh1 = ( float )( h0 );
x0 = ( float )( x + offs);
x1 = ( float )( x + offs);
- z0 = ( float )( z + 1 );
- z1 = ( float )( z );
+ z0 = static_cast<float>(z + 1);
+ z1 = static_cast<float>(z);
}
else
{
@@ -4141,8 +4141,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
hh1 = ( float )( h2 );
x0 = ( float )( x + 1 - offs);
x1 = ( float )( x + 1 - offs);
- z0 = ( float )( z );
- z1 = ( float )( z + 1 );
+ z0 = static_cast<float>(z);
+ z1 = static_cast<float>(z + 1);
}
@@ -4172,8 +4172,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
t->color( c11 * br * r, c11 * br * g, c11 * br * b );
t->vertexUV( ( float )( x0 ), ( float )( y + hh0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v01 ) );
t->vertexUV( ( float )( x1 ), ( float )( y + hh1 ), ( float )( z1 ), ( float )( u1 ), ( float )( v02 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
}
@@ -4586,7 +4586,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
else
{
/*#ifdef _DEBUG
- if(dynamic_cast<StairTile *>(tt)!=NULL)
+ if(dynamic_cast<StairTile *>(tt)!=nullptr)
{
// stair tile
faceFlags |= tt->shouldRenderFace( level, pX, pY - 1, pZ, 0 ) ? 0x01 : 0;
@@ -4786,7 +4786,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4g *= ll4;
c4b *= ll4;
- renderFaceDown( tt, ( float )pX, ( float )pY, ( float )pZ, getTexture( tt, level, pX, pY, pZ, 0 ) );
+ renderFaceDown( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), getTexture( tt, level, pX, pY, pZ, 0 ) );
}
if ( faceFlags & 0x02 )
{
@@ -4878,7 +4878,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4b *= ll4;
- renderFaceUp( tt, ( float )pX, ( float )pY, ( float )pZ, getTexture( tt, level, pX, pY, pZ, 1 ) );
+ renderFaceUp( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), getTexture( tt, level, pX, pY, pZ, 1 ) );
}
if ( faceFlags & 0x04 )
{
@@ -4946,14 +4946,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll2 = (ll00z + ll0Yz + llX0z + llXYz) / 4.0f;
float _ll3 = (ll0yz + ll00z + llXyz + llX0z) / 4.0f;
float _ll4 = (llxyz + llx0z + ll0yz + ll00z) / 4.0f;
- ll1 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll4 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX0));
- ll2 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll2 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll4 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX1));
- ll3 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll2 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll4 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX1));
- ll4 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll4 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX0));
+ ll1 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll4 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX0));
+ ll2 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll2 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll4 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX1));
+ ll3 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll2 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll4 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX1));
+ ll4 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll4 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX0));
int _tc1 = blend(ccx0z, ccxYz, cc0Yz, cc00z);
int _tc2 = blend(cc0Yz, ccX0z, ccXYz, cc00z);
@@ -4998,7 +4998,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 2);
- renderNorth( tt, ( float )pX, ( float )pY, ( float )pZ, tex );
+ renderNorth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), tex );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
@@ -5015,7 +5015,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c3b *= pBaseBlue;
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderNorth( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderNorth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -5082,14 +5082,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll4 = (ll00Z + ll0YZ + llX0Z + llXYZ) / 4.0f;
float _ll3 = (ll0yZ + ll00Z + llXyZ + llX0Z) / 4.0f;
float _ll2 = (llxyZ + llx0Z + ll0yZ + ll00Z) / 4.0f;
- ll1 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll4 * tileShapeY1 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll2 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX0));
- ll2 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll4 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll2 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX0));
- ll3 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll4 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll2 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX1));
- ll4 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll4 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll2 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX1));
+ ll1 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll4 * tileShapeY1 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll2 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX0));
+ ll2 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll4 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll2 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX0));
+ ll3 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll4 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll2 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX1));
+ ll4 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll4 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll2 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX1));
int _tc1 = blend(ccx0Z, ccxYZ, cc0YZ, cc00Z);
int _tc4 = blend(cc0YZ, ccX0Z, ccXYZ, cc00Z);
@@ -5134,7 +5134,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4g *= ll4;
c4b *= ll4;
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 3);
- renderSouth( tt, ( float )pX, ( float )pY, ( float )pZ, getTexture(tt, level, pX, pY, pZ, 3 ) );
+ renderSouth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), getTexture(tt, level, pX, pY, pZ, 3 ) );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
@@ -5151,7 +5151,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c3b *= pBaseBlue;
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderSouth( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderSouth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -5217,14 +5217,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll1 = (llx00 + llx0Z + llxY0 + llxYZ) / 4.0f;
float _ll2 = (llx0z + llx00 + llxYz + llxY0) / 4.0f;
float _ll3 = (llxyz + llxy0 + llx0z + llx00) / 4.0f;
- ll1 = (float) (_ll1 * tileShapeY1 * tileShapeZ1 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY1)
- * tileShapeZ1);
- ll2 = (float) (_ll1 * tileShapeY1 * tileShapeZ0 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY1)
- * tileShapeZ0);
- ll3 = (float) (_ll1 * tileShapeY0 * tileShapeZ0 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY0)
- * tileShapeZ0);
- ll4 = (float) (_ll1 * tileShapeY0 * tileShapeZ1 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY0)
- * tileShapeZ1);
+ ll1 = static_cast<float>(_ll1 * tileShapeY1 * tileShapeZ1 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY1)
+ * tileShapeZ1);
+ ll2 = static_cast<float>(_ll1 * tileShapeY1 * tileShapeZ0 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY1)
+ * tileShapeZ0);
+ ll3 = static_cast<float>(_ll1 * tileShapeY0 * tileShapeZ0 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY0)
+ * tileShapeZ0);
+ ll4 = static_cast<float>(_ll1 * tileShapeY0 * tileShapeZ1 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY0)
+ * tileShapeZ1);
int _tc4 = blend(ccxy0, ccxyZ, ccx0Z, ccx00);
int _tc1 = blend(ccx0Z, ccxY0, ccxYZ, ccx00);
@@ -5269,7 +5269,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4g *= ll4;
c4b *= ll4;
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 4);
- renderWest( tt, ( float )pX, ( float )pY, ( float )pZ, tex );
+ renderWest( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), tex );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
@@ -5286,7 +5286,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c3b *= pBaseBlue;
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderWest( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderWest( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -5352,14 +5352,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll2 = (llXyz + llXy0 + llX0z + llX00) / 4.0f;
float _ll3 = (llX0z + llX00 + llXYz + llXY0) / 4.0f;
float _ll4 = (llX00 + llX0Z + llXY0 + llXYZ) / 4.0f;
- ll1 = (float) (_ll1 * (1.0 - tileShapeY0) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY0
- * tileShapeZ1);
- ll2 = (float) (_ll1 * (1.0 - tileShapeY0) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY0
- * tileShapeZ0);
- ll3 = (float) (_ll1 * (1.0 - tileShapeY1) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY1
- * tileShapeZ0);
- ll4 = (float) (_ll1 * (1.0 - tileShapeY1) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY1
- * tileShapeZ1);
+ ll1 = static_cast<float>(_ll1 * (1.0 - tileShapeY0) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY0
+ * tileShapeZ1);
+ ll2 = static_cast<float>(_ll1 * (1.0 - tileShapeY0) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY0
+ * tileShapeZ0);
+ ll3 = static_cast<float>(_ll1 * (1.0 - tileShapeY1) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY1
+ * tileShapeZ0);
+ ll4 = static_cast<float>(_ll1 * (1.0 - tileShapeY1) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY1
+ * tileShapeZ1);
int _tc1 = blend(ccXy0, ccXyZ, ccX0Z, ccX00);
int _tc4 = blend(ccX0Z, ccXY0, ccXYZ, ccX00);
@@ -5405,7 +5405,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4b *= ll4;
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 5);
- renderEast( tt, ( float )pX, ( float )pY, ( float )pZ, tex );
+ renderEast( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), tex );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
c1r *= pBaseRed;
@@ -5422,7 +5422,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderEast( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderEast( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -6005,8 +6005,8 @@ int TileRenderer_SPU::blend( int a, int b, int c, int def )
int TileRenderer_SPU::blend(int a, int b, int c, int d, float fa, float fb, float fc, float fd)
{
- int top = (int) ((float) ((a >> 16) & 0xff) * fa + (float) ((b >> 16) & 0xff) * fb + (float) ((c >> 16) & 0xff) * fc + (float) ((d >> 16) & 0xff) * fd) & 0xff;
- int bottom = (int) ((float) (a & 0xff) * fa + (float) (b & 0xff) * fb + (float) (c & 0xff) * fc + (float) (d & 0xff) * fd) & 0xff;
+ int top = static_cast<int>((float)((a >> 16) & 0xff) * fa + (float)((b >> 16) & 0xff) * fb + (float)((c >> 16) & 0xff) * fc + (float)((d >> 16) & 0xff) * fd) & 0xff;
+ int bottom = static_cast<int>((float)(a & 0xff) * fa + (float)(b & 0xff) * fb + (float)(c & 0xff) * fc + (float)(d & 0xff) * fd) & 0xff;
return (top << 16) | bottom;
}
@@ -7626,7 +7626,7 @@ Icon_SPU *TileRenderer_SPU::getTexture(Tile_SPU *tile)
Icon_SPU *TileRenderer_SPU::getTextureOrMissing(Icon_SPU *Icon_SPU)
{
- if (Icon_SPU == NULL)
+ if (Icon_SPU == nullptr)
{
assert(0);
// return minecraft->textures->getMissingIcon_SPU(Icon_SPU::TYPE_TERRAIN);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h
index 2c484faa..3f34a778 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h
@@ -72,8 +72,8 @@ public:
void tesselateInWorldFixedTexture( Tile_SPU* tile, int x, int y, int z, Icon_SPU *fixedTexture ); // 4J renamed to differentiate from tesselateInWorld
void tesselateInWorldNoCulling( Tile_SPU* tile, int x, int y, int z, int forceData = -1,
- TileEntity* forceEntity = NULL ); // 4J added forceData, forceEntity param
- bool tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL ); // 4J added forceData, forceEntity param
+ TileEntity* forceEntity = nullptr ); // 4J added forceData, forceEntity param
+ bool tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr ); // 4J added forceData, forceEntity param
private:
bool tesselateAirPortalFrameInWorld(TheEndPortalFrameTile *tt, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
index f2dfeaac..c5a9be4d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
@@ -92,7 +92,7 @@
#include <new>
#include "AnvilTile_SPU.h"
-TileData_SPU* Tile_SPU::ms_pTileData = NULL;
+TileData_SPU* Tile_SPU::ms_pTileData = nullptr;
Tile_SPU Tile_SPU::m_tiles[256];
@@ -181,7 +181,7 @@ Icon_SPU *Tile_SPU::getTexture(ChunkRebuildData *level, int x, int y, int z, int
}
- Icon_SPU *icon = NULL;
+ Icon_SPU *icon = nullptr;
if(opaque)
{
LeafTile_SPU::setFancy(false);
@@ -215,13 +215,13 @@ Icon_SPU *Tile_SPU::getTexture(int face)
// void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, Entity *source)
// {
// AABB *aabb = getAABB(level, x, y, z);
-// if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb);
+// if (aabb != nullptr && box->intersects(aabb)) boxes->push_back(aabb);
// }
//
// void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes)
// {
// AABB *aabb = getAABB(level, x, y, z);
-// if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb);
+// if (aabb != nullptr && box->intersects(aabb)) boxes->push_back(aabb);
// }
//
// AABB *Tile_SPU::getAABB(Level *level, int x, int y, int z)
@@ -368,18 +368,18 @@ Icon_SPU *Tile_SPU::getTexture(int face)
// Vec3 *zh0 = a->clipZ(b, zz0);
// Vec3 *zh1 = a->clipZ(b, zz1);
//
-// Vec3 *closest = NULL;
+// Vec3 *closest = nullptr;
//
-// if (containsX(xh0) && (closest == NULL || a->distanceTo(xh0) < a->distanceTo(closest))) closest = xh0;
-// if (containsX(xh1) && (closest == NULL || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1;
-// if (containsY(yh0) && (closest == NULL || a->distanceTo(yh0) < a->distanceTo(closest))) closest = yh0;
-// if (containsY(yh1) && (closest == NULL || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1;
-// if (containsZ(zh0) && (closest == NULL || a->distanceTo(zh0) < a->distanceTo(closest))) closest = zh0;
-// if (containsZ(zh1) && (closest == NULL || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1;
+// if (containsX(xh0) && (closest == nullptr || a->distanceTo(xh0) < a->distanceTo(closest))) closest = xh0;
+// if (containsX(xh1) && (closest == nullptr || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1;
+// if (containsY(yh0) && (closest == nullptr || a->distanceTo(yh0) < a->distanceTo(closest))) closest = yh0;
+// if (containsY(yh1) && (closest == nullptr || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1;
+// if (containsZ(zh0) && (closest == nullptr || a->distanceTo(zh0) < a->distanceTo(closest))) closest = zh0;
+// if (containsZ(zh1) && (closest == nullptr || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1;
//
// LeaveCriticalSection(&m_csShape);
//
-// if (closest == NULL) return NULL;
+// if (closest == nullptr) return nullptr;
//
// int face = -1;
//
@@ -395,19 +395,19 @@ Icon_SPU *Tile_SPU::getTexture(int face)
//
// bool Tile_SPU::containsX(Vec3 *v)
// {
-// if( v == NULL) return false;
+// if( v == nullptr) return false;
// return v->y >= yy0 && v->y <= yy1 && v->z >= zz0 && v->z <= zz1;
// }
//
// bool Tile_SPU::containsY(Vec3 *v)
// {
-// if( v == NULL) return false;
+// if( v == nullptr) return false;
// return v->x >= xx0 && v->x <= xx1 && v->z >= zz0 && v->z <= zz1;
// }
//
// bool Tile_SPU::containsZ(Vec3 *v)
// {
-// if( v == NULL) return false;
+// if( v == nullptr) return false;
// return v->x >= xx0 && v->x <= xx1 && v->y >= yy0 && v->y <= yy1;
// }
//
@@ -516,7 +516,7 @@ void Tile_SPU::updateDefaultShape()
// // 4J Stu - Special case - only record a crop destroy if is fully grown
// if(id==Tile_SPU::crops_Id)
// {
-// if( Tile_SPU::crops->getResource(data, NULL, 0) > 0 )
+// if( Tile_SPU::crops->getResource(data, nullptr, 0) > 0 )
// player->awardStat(Stats::blocksMined[id], 1);
// }
// else
@@ -533,7 +533,7 @@ void Tile_SPU::updateDefaultShape()
// if (isCubeShaped() && !isEntityTile[id] && EnchantmentHelper::hasSilkTouch(player->inventory))
// {
// shared_ptr<ItemInstance> item = getSilkTouchItemInstance(data);
-// if (item != NULL)
+// if (item != nullptr)
// {
// popResource(level, x, y, z, item);
// }
@@ -625,7 +625,7 @@ float Tile_SPU::getShadeBrightness(ChunkRebuildData *level, int x, int y, int z)
Tile_SPU* Tile_SPU::createFromID( int tileID )
{
if(tileID == 0)
- return NULL;
+ return nullptr;
if(m_tiles[tileID].id != -1)
return &m_tiles[tileID];
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h
index 484823ef..e3d11f04 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h
@@ -242,7 +242,7 @@ public:
Icon_SPU *getTexture(int face, int data);
Icon_SPU *getTexture(int face);
public:
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
double getShapeX0();
double getShapeX1();
double getShapeY0();
@@ -465,7 +465,7 @@ public:
double getShapeZ1() { return ms_pTileData->zz1[id]; }
Material_SPU* getMaterial();
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual void updateDefaultShape();
virtual void setShape(float x0, float y0, float z0, float x1, float y1, float z1);
virtual float getBrightness(ChunkRebuildData *level, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h
index 2b5f86a5..43cffbf8 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h
@@ -14,7 +14,7 @@ public:
bool blocksLight() { return false; }
bool isSolidRender(bool isServerLevel = false) { return false; }
bool isCubeShaped() { return false; }
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int height = level->getData(x, y, z) & HEIGHT_MASK;
float o = 2 * (1 + height) / 16.0f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h
index 6f096a17..4f72c543 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h
@@ -21,7 +21,7 @@ public:
bool isSolidRender(bool isServerLevel = false) { return false; }
bool isCubeShaped() { return false; }
int getRenderShape() { return Tile_SPU::SHAPE_BLOCK;}
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
setShape(level->getData(x, y, z));
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h
index e2f4a4ad..7d94e750 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h
@@ -27,7 +27,7 @@ public:
return false;
}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
const float thickness = 1.0f / 16.0f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h
index e298ae2d..7065210f 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h
@@ -172,15 +172,15 @@ public:
// {
// public:
// ZipFile(File *file) {}
-// InputStream *getInputStream(ZipEntry *entry) { return NULL; }
-// ZipEntry *getEntry(const wstring& name) {return NULL;}
+// InputStream *getInputStream(ZipEntry *entry) { return nullptr; }
+// ZipEntry *getEntry(const wstring& name) {return nullptr;}
// void close() {}
// };
//
// class ImageIO
// {
// public:
-// static BufferedImage *read(InputStream *in) { return NULL; }
+// static BufferedImage *read(InputStream *in) { return nullptr; }
// };
//
// class Keyboard