aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World
diff options
context:
space:
mode:
authorvoid_17 <61356189+void2012@users.noreply.github.com>2026-03-07 03:31:30 +0700
committerGitHub <noreply@github.com>2026-03-07 03:31:30 +0700
commit988e3042e00485aa7ed3725fe7bfde1da8cf8519 (patch)
treecf712d80b4d03eec73f935e0cce23020ddb6f5ef /Minecraft.World
parent175fc3824e502ecd701c1da2ecd2061d77495693 (diff)
Remove all MSVC `__int64` (#742)
Diffstat (limited to 'Minecraft.World')
-rw-r--r--Minecraft.World/AddIslandLayer.cpp2
-rw-r--r--Minecraft.World/AddIslandLayer.h2
-rw-r--r--Minecraft.World/AddMushroomIslandLayer.cpp2
-rw-r--r--Minecraft.World/AddMushroomIslandLayer.h2
-rw-r--r--Minecraft.World/AddSnowLayer.cpp2
-rw-r--r--Minecraft.World/AddSnowLayer.h2
-rw-r--r--Minecraft.World/BasicTree.cpp2
-rw-r--r--Minecraft.World/BasicTypeContainers.h6
-rw-r--r--Minecraft.World/BeaconTileEntity.h2
-rw-r--r--Minecraft.World/BiomeCache.cpp10
-rw-r--r--Minecraft.World/BiomeCache.h6
-rw-r--r--Minecraft.World/BiomeInitLayer.cpp2
-rw-r--r--Minecraft.World/BiomeInitLayer.h2
-rw-r--r--Minecraft.World/BiomeSource.cpp26
-rw-r--r--Minecraft.World/BiomeSource.h16
-rw-r--r--Minecraft.World/ByteArrayInputStream.cpp4
-rw-r--r--Minecraft.World/ByteArrayInputStream.h2
-rw-r--r--Minecraft.World/ByteBuffer.cpp30
-rw-r--r--Minecraft.World/ByteBuffer.h4
-rw-r--r--Minecraft.World/C4JThread.h10
-rw-r--r--Minecraft.World/CanyonFeature.cpp2
-rw-r--r--Minecraft.World/CanyonFeature.h2
-rw-r--r--Minecraft.World/CaveFeature.cpp2
-rw-r--r--Minecraft.World/ChunkPos.cpp10
-rw-r--r--Minecraft.World/ChunkPos.h8
-rw-r--r--Minecraft.World/ChunkStorageProfileDecorator.cpp6
-rw-r--r--Minecraft.World/ChunkStorageProfileDecorator.h8
-rw-r--r--Minecraft.World/CompoundTag.h10
-rw-r--r--Minecraft.World/CompressedTileStorage.cpp46
-rw-r--r--Minecraft.World/ConsoleSaveFileInputStream.h2
-rw-r--r--Minecraft.World/ConsoleSaveFileOriginal.cpp14
-rw-r--r--Minecraft.World/CustomLevelSource.cpp10
-rw-r--r--Minecraft.World/CustomLevelSource.h4
-rw-r--r--Minecraft.World/DataInput.h2
-rw-r--r--Minecraft.World/DataInputStream.cpp56
-rw-r--r--Minecraft.World/DataInputStream.h4
-rw-r--r--Minecraft.World/DataOutput.h2
-rw-r--r--Minecraft.World/DataOutputStream.cpp8
-rw-r--r--Minecraft.World/DataOutputStream.h4
-rw-r--r--Minecraft.World/DerivedLevelData.cpp18
-rw-r--r--Minecraft.World/DerivedLevelData.h18
-rw-r--r--Minecraft.World/Dimension.cpp24
-rw-r--r--Minecraft.World/Dimension.h6
-rw-r--r--Minecraft.World/DirectoryLevelStorage.cpp14
-rw-r--r--Minecraft.World/DirectoryLevelStorage.h8
-rw-r--r--Minecraft.World/EmptyLevelChunk.cpp2
-rw-r--r--Minecraft.World/EmptyLevelChunk.h2
-rw-r--r--Minecraft.World/EnchantmentMenu.h2
-rw-r--r--Minecraft.World/FileHeader.h8
-rw-r--r--Minecraft.World/FileInputStream.cpp6
-rw-r--r--Minecraft.World/FileInputStream.h2
-rw-r--r--Minecraft.World/FlatLevelSource.cpp48
-rw-r--r--Minecraft.World/FlatLevelSource.h8
-rw-r--r--Minecraft.World/FuzzyZoomLayer.cpp4
-rw-r--r--Minecraft.World/FuzzyZoomLayer.h4
-rw-r--r--Minecraft.World/GZIPInputStream.h2
-rw-r--r--Minecraft.World/GrowMushroomIslandLayer.cpp6
-rw-r--r--Minecraft.World/GrowMushroomIslandLayer.h2
-rw-r--r--Minecraft.World/HellDimension.cpp4
-rw-r--r--Minecraft.World/HellDimension.h2
-rw-r--r--Minecraft.World/HellFlatLevelSource.cpp16
-rw-r--r--Minecraft.World/HellFlatLevelSource.h2
-rw-r--r--Minecraft.World/HellRandomLevelSource.cpp6
-rw-r--r--Minecraft.World/HellRandomLevelSource.h2
-rw-r--r--Minecraft.World/InputStream.h2
-rw-r--r--Minecraft.World/IslandLayer.cpp2
-rw-r--r--Minecraft.World/IslandLayer.h2
-rw-r--r--Minecraft.World/JavaMath.cpp8
-rw-r--r--Minecraft.World/JavaMath.h2
-rw-r--r--Minecraft.World/LargeCaveFeature.cpp8
-rw-r--r--Minecraft.World/LargeCaveFeature.h4
-rw-r--r--Minecraft.World/LargeFeature.cpp8
-rw-r--r--Minecraft.World/LargeHellCaveFeature.cpp4
-rw-r--r--Minecraft.World/LargeHellCaveFeature.h4
-rw-r--r--Minecraft.World/Layer.cpp16
-rw-r--r--Minecraft.World/Layer.h14
-rw-r--r--Minecraft.World/Level.cpp36
-rw-r--r--Minecraft.World/Level.h24
-rw-r--r--Minecraft.World/LevelChunk.cpp4
-rw-r--r--Minecraft.World/LevelChunk.h14
-rw-r--r--Minecraft.World/LevelData.cpp72
-rw-r--r--Minecraft.World/LevelData.h28
-rw-r--r--Minecraft.World/LevelSettings.cpp14
-rw-r--r--Minecraft.World/LevelSettings.h8
-rw-r--r--Minecraft.World/LevelSummary.cpp14
-rw-r--r--Minecraft.World/LevelSummary.h10
-rw-r--r--Minecraft.World/LightningBolt.h2
-rw-r--r--Minecraft.World/LoginPacket.cpp20
-rw-r--r--Minecraft.World/LoginPacket.h6
-rw-r--r--Minecraft.World/LongTag.h6
-rw-r--r--Minecraft.World/McRegionChunkStorage.cpp8
-rw-r--r--Minecraft.World/McRegionChunkStorage.h2
-rw-r--r--Minecraft.World/Mth.cpp8
-rw-r--r--Minecraft.World/Mth.h10
-rw-r--r--Minecraft.World/NbtSlotFile.cpp2
-rw-r--r--Minecraft.World/NbtSlotFile.h2
-rw-r--r--Minecraft.World/NotGateTile.cpp2
-rw-r--r--Minecraft.World/NotGateTile.h6
-rw-r--r--Minecraft.World/OldChunkStorage.cpp4
-rw-r--r--Minecraft.World/Packet.cpp16
-rw-r--r--Minecraft.World/Packet.h14
-rw-r--r--Minecraft.World/PerlinNoise.cpp4
-rw-r--r--Minecraft.World/PortalForcer.cpp8
-rw-r--r--Minecraft.World/PortalForcer.h10
-rw-r--r--Minecraft.World/Random.cpp18
-rw-r--r--Minecraft.World/Random.h8
-rw-r--r--Minecraft.World/RandomLevelSource.cpp18
-rw-r--r--Minecraft.World/RandomLevelSource.h2
-rw-r--r--Minecraft.World/RegionFile.cpp34
-rw-r--r--Minecraft.World/RegionFile.h6
-rw-r--r--Minecraft.World/RegionHillsLayer.cpp2
-rw-r--r--Minecraft.World/RegionHillsLayer.h2
-rw-r--r--Minecraft.World/RespawnPacket.cpp20
-rw-r--r--Minecraft.World/RespawnPacket.h4
-rw-r--r--Minecraft.World/RiverInitLayer.cpp2
-rw-r--r--Minecraft.World/RiverInitLayer.h2
-rw-r--r--Minecraft.World/RiverLayer.cpp2
-rw-r--r--Minecraft.World/RiverLayer.h2
-rw-r--r--Minecraft.World/RiverMixerLayer.cpp4
-rw-r--r--Minecraft.World/RiverMixerLayer.h4
-rw-r--r--Minecraft.World/SetTimePacket.cpp6
-rw-r--r--Minecraft.World/SetTimePacket.h6
-rw-r--r--Minecraft.World/ShoreLayer.cpp2
-rw-r--r--Minecraft.World/ShoreLayer.h2
-rw-r--r--Minecraft.World/SkyIslandDimension.cpp2
-rw-r--r--Minecraft.World/SmoothLayer.cpp2
-rw-r--r--Minecraft.World/SmoothLayer.h2
-rw-r--r--Minecraft.World/SmoothZoomLayer.cpp4
-rw-r--r--Minecraft.World/SmoothZoomLayer.h4
-rw-r--r--Minecraft.World/Socket.h10
-rw-r--r--Minecraft.World/SparseDataStorage.cpp56
-rw-r--r--Minecraft.World/SparseDataStorage.h8
-rw-r--r--Minecraft.World/SparseLightStorage.cpp54
-rw-r--r--Minecraft.World/SparseLightStorage.h8
-rw-r--r--Minecraft.World/StructureFeature.cpp8
-rw-r--r--Minecraft.World/StructureFeature.h8
-rw-r--r--Minecraft.World/SwampRiversLayer.cpp2
-rw-r--r--Minecraft.World/SwampRiversLayer.h2
-rw-r--r--Minecraft.World/System.h8
-rw-r--r--Minecraft.World/TheEndDimension.cpp2
-rw-r--r--Minecraft.World/TheEndDimension.h2
-rw-r--r--Minecraft.World/TheEndLevelRandomLevelSource.cpp8
-rw-r--r--Minecraft.World/TheEndLevelRandomLevelSource.h4
-rw-r--r--Minecraft.World/TickNextTickData.h10
-rw-r--r--Minecraft.World/Tile.cpp2
-rw-r--r--Minecraft.World/Tile.h10
-rw-r--r--Minecraft.World/VoronoiZoom.cpp2
-rw-r--r--Minecraft.World/VoronoiZoom.h2
-rw-r--r--Minecraft.World/WaterLevelChunk.cpp2
-rw-r--r--Minecraft.World/WaterLevelChunk.h2
-rw-r--r--Minecraft.World/ZoneFile.cpp2
-rw-r--r--Minecraft.World/ZoneFile.h6
-rw-r--r--Minecraft.World/ZoneIo.cpp2
-rw-r--r--Minecraft.World/ZoneIo.h4
-rw-r--r--Minecraft.World/ZonedChunkStorage.cpp10
-rw-r--r--Minecraft.World/ZonedChunkStorage.h12
-rw-r--r--Minecraft.World/ZoomLayer.cpp4
-rw-r--r--Minecraft.World/ZoomLayer.h4
-rw-r--r--Minecraft.World/stdafx.h8
-rw-r--r--Minecraft.World/system.cpp28
160 files changed, 711 insertions, 717 deletions
diff --git a/Minecraft.World/AddIslandLayer.cpp b/Minecraft.World/AddIslandLayer.cpp
index 21e9a96d..a8842936 100644
--- a/Minecraft.World/AddIslandLayer.cpp
+++ b/Minecraft.World/AddIslandLayer.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.newbiome.layer.h"
#include "net.minecraft.world.level.biome.h"
-AddIslandLayer::AddIslandLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+AddIslandLayer::AddIslandLayer(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
diff --git a/Minecraft.World/AddIslandLayer.h b/Minecraft.World/AddIslandLayer.h
index e7c9384b..2446bbf8 100644
--- a/Minecraft.World/AddIslandLayer.h
+++ b/Minecraft.World/AddIslandLayer.h
@@ -5,7 +5,7 @@
class AddIslandLayer : public Layer
{
public:
- AddIslandLayer(__int64 seedMixup, shared_ptr<Layer>parent);
+ AddIslandLayer(int64_t seedMixup, shared_ptr<Layer>parent);
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/AddMushroomIslandLayer.cpp b/Minecraft.World/AddMushroomIslandLayer.cpp
index 022a3b29..324c88ee 100644
--- a/Minecraft.World/AddMushroomIslandLayer.cpp
+++ b/Minecraft.World/AddMushroomIslandLayer.cpp
@@ -3,7 +3,7 @@
#include "net.minecraft.world.level.biome.h"
-AddMushroomIslandLayer::AddMushroomIslandLayer(__int64 seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
+AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
{
this->parent = parent;
}
diff --git a/Minecraft.World/AddMushroomIslandLayer.h b/Minecraft.World/AddMushroomIslandLayer.h
index acda9fa7..f691ebda 100644
--- a/Minecraft.World/AddMushroomIslandLayer.h
+++ b/Minecraft.World/AddMushroomIslandLayer.h
@@ -4,6 +4,6 @@
class AddMushroomIslandLayer : public Layer
{
public:
- AddMushroomIslandLayer(__int64 seedMixup, shared_ptr<Layer> parent);
+ AddMushroomIslandLayer(int64_t seedMixup, shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/AddSnowLayer.cpp b/Minecraft.World/AddSnowLayer.cpp
index d8a33cc9..aa459789 100644
--- a/Minecraft.World/AddSnowLayer.cpp
+++ b/Minecraft.World/AddSnowLayer.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.newbiome.layer.h"
#include "net.minecraft.world.level.biome.h"
-AddSnowLayer::AddSnowLayer(__int64 seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
+AddSnowLayer::AddSnowLayer(int64_t seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
{
this->parent = parent;
}
diff --git a/Minecraft.World/AddSnowLayer.h b/Minecraft.World/AddSnowLayer.h
index ede7a226..0b3702da 100644
--- a/Minecraft.World/AddSnowLayer.h
+++ b/Minecraft.World/AddSnowLayer.h
@@ -4,6 +4,6 @@
class AddSnowLayer : public Layer
{
public:
- AddSnowLayer(__int64 seedMixup, shared_ptr<Layer> parent);
+ AddSnowLayer(int64_t seedMixup, shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/BasicTree.cpp b/Minecraft.World/BasicTree.cpp
index 01f10cb3..c1c92287 100644
--- a/Minecraft.World/BasicTree.cpp
+++ b/Minecraft.World/BasicTree.cpp
@@ -524,7 +524,7 @@ bool BasicTree::place(Level *level, Random *random, int x, int y, int z)
// Initialize the instance fields for the level and the seed.
thisLevel = level;
- __int64 seed = random->nextLong();
+ int64_t seed = random->nextLong();
rnd->setSeed(seed);
// Initialize the origin of the tree trunk
origin[0] = x;
diff --git a/Minecraft.World/BasicTypeContainers.h b/Minecraft.World/BasicTypeContainers.h
index 5f577a97..d2936ebe 100644
--- a/Minecraft.World/BasicTypeContainers.h
+++ b/Minecraft.World/BasicTypeContainers.h
@@ -58,14 +58,14 @@ public:
}
static bool isInfinite( double a ) { return false; /*4J TODO*/ }
- static double longBitsToDouble( __int64 bits )
+ static double longBitsToDouble( int64_t bits )
{
return *(double *)&bits;
}
- static __int64 doubleToLongBits( double d )
+ static int64_t doubleToLongBits( double d )
{
- return *(__int64 *)&d;
+ return *(int64_t *)&d;
}
};
diff --git a/Minecraft.World/BeaconTileEntity.h b/Minecraft.World/BeaconTileEntity.h
index caab25e7..eaf3847e 100644
--- a/Minecraft.World/BeaconTileEntity.h
+++ b/Minecraft.World/BeaconTileEntity.h
@@ -21,7 +21,7 @@ public:
static void staticCtor();
private:
- __int64 clientSideRenderTick;
+ int64_t clientSideRenderTick;
float clientSideRenderScale;
bool isActive;
diff --git a/Minecraft.World/BiomeCache.cpp b/Minecraft.World/BiomeCache.cpp
index b93ce32e..54be445c 100644
--- a/Minecraft.World/BiomeCache.cpp
+++ b/Minecraft.World/BiomeCache.cpp
@@ -85,7 +85,7 @@ BiomeCache::Block *BiomeCache::getBlockAt(int x, int z)
EnterCriticalSection(&m_CS);
x >>= ZONE_SIZE_BITS;
z >>= ZONE_SIZE_BITS;
- __int64 slot = (((__int64) x) & 0xffffffffl) | ((((__int64) z) & 0xffffffffl) << 32l);
+ int64_t slot = (((int64_t) x) & 0xffffffffl) | ((((int64_t) z) & 0xffffffffl) << 32l);
auto it = cached.find(slot);
Block *block = NULL;
if (it == cached.end())
@@ -124,8 +124,8 @@ float BiomeCache::getDownfall(int x, int z)
void BiomeCache::update()
{
EnterCriticalSection(&m_CS);
- __int64 now = app.getAppTime();
- __int64 utime = now - lastUpdateTime;
+ int64_t now = app.getAppTime();
+ int64_t utime = now - lastUpdateTime;
if (utime > DECAY_TIME / 4 || utime < 0)
{
lastUpdateTime = now;
@@ -133,11 +133,11 @@ void BiomeCache::update()
for (auto it = all.begin(); it != all.end();)
{
Block *block = *it;
- __int64 time = now - block->lastUse;
+ int64_t time = now - block->lastUse;
if (time > DECAY_TIME || time < 0)
{
it = all.erase(it);
- __int64 slot = (((__int64) block->x) & 0xffffffffl) | ((((__int64) block->z) & 0xffffffffl) << 32l);
+ int64_t slot = (((int64_t) block->x) & 0xffffffffl) | ((((int64_t) block->z) & 0xffffffffl) << 32l);
cached.erase(slot);
delete block;
}
diff --git a/Minecraft.World/BiomeCache.h b/Minecraft.World/BiomeCache.h
index bf509f54..b2593ce3 100644
--- a/Minecraft.World/BiomeCache.h
+++ b/Minecraft.World/BiomeCache.h
@@ -10,7 +10,7 @@ private:
static const int ZONE_SIZE_MASK = ZONE_SIZE - 1;
const BiomeSource *source;
- __int64 lastUpdateTime;
+ int64_t lastUpdateTime;
public:
class Block
@@ -22,7 +22,7 @@ public:
// BiomeArray biomes;
byteArray biomeIndices;
int x, z;
- __int64 lastUse;
+ int64_t lastUse;
Block(int x, int z, BiomeCache *parent);
~Block();
@@ -32,7 +32,7 @@ public:
};
private:
- unordered_map<__int64,Block *,LongKeyHash,LongKeyEq> cached; // 4J - was LongHashMap
+ unordered_map<int64_t,Block *,LongKeyHash,LongKeyEq> cached; // 4J - was LongHashMap
vector<Block *> all; // was ArrayList<Block>
public:
diff --git a/Minecraft.World/BiomeInitLayer.cpp b/Minecraft.World/BiomeInitLayer.cpp
index ead63eee..6edd18de 100644
--- a/Minecraft.World/BiomeInitLayer.cpp
+++ b/Minecraft.World/BiomeInitLayer.cpp
@@ -4,7 +4,7 @@
#include "net.minecraft.world.level.h"
#include "BiomeInitLayer.h"
-BiomeInitLayer::BiomeInitLayer(__int64 seed, shared_ptr<Layer>parent, LevelType *levelType) : Layer(seed)
+BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr<Layer>parent, LevelType *levelType) : Layer(seed)
{
this->parent = parent;
diff --git a/Minecraft.World/BiomeInitLayer.h b/Minecraft.World/BiomeInitLayer.h
index e645a379..00bf3812 100644
--- a/Minecraft.World/BiomeInitLayer.h
+++ b/Minecraft.World/BiomeInitLayer.h
@@ -10,7 +10,7 @@ private:
BiomeArray startBiomes;
public:
- BiomeInitLayer(__int64 seed, shared_ptr<Layer> parent, LevelType *levelType);
+ BiomeInitLayer(int64_t seed, shared_ptr<Layer> parent, LevelType *levelType);
virtual ~BiomeInitLayer();
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/BiomeSource.cpp b/Minecraft.World/BiomeSource.cpp
index 8e2a5680..2ab6182e 100644
--- a/Minecraft.World/BiomeSource.cpp
+++ b/Minecraft.World/BiomeSource.cpp
@@ -10,7 +10,7 @@
// 4J - removal of separate temperature & downfall layers brought forward from 1.2.3
void BiomeSource::_init()
-{
+{
layer = nullptr;
zoomedLayer = nullptr;
@@ -26,7 +26,7 @@ void BiomeSource::_init()
playerSpawnBiomes.push_back(Biome::jungleHills);
}
-void BiomeSource::_init(__int64 seed, LevelType *generator)
+void BiomeSource::_init(int64_t seed, LevelType *generator)
{
_init();
@@ -43,7 +43,7 @@ BiomeSource::BiomeSource()
}
// 4J added
-BiomeSource::BiomeSource(__int64 seed, LevelType *generator)
+BiomeSource::BiomeSource(int64_t seed, LevelType *generator)
{
_init(seed, generator);
}
@@ -271,7 +271,7 @@ void BiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int
/**
* Checks if an area around a block contains only the specified biomes.
* Useful for placing elements like towns.
-*
+*
* This is a bit of a rough check, to make it as fast as possible. To ensure
* NO other biomes, add a margin of at least four blocks to the radius
*/
@@ -299,7 +299,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, vector<Biome *> allowed)
/**
* Checks if an area around a block contains only the specified biome.
* Useful for placing elements like towns.
-*
+*
* This is a bit of a rough check, to make it as fast as possible. To ensure
* NO other biomes, add a margin of at least four blocks to the radius
*/
@@ -327,7 +327,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, Biome *allowed)
/**
* Finds the specified biome within the radius. This will return a random
* position if several are found. This test is fairly rough.
-*
+*
* Returns null if the biome wasn't found
*/
TilePos *BiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random *random)
@@ -365,7 +365,7 @@ TilePos *BiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random *rand
/**
* Finds one of the specified biomes within the radius. This will return a
* random position if several are found. This test is fairly rough.
-*
+*
* Returns null if the biome wasn't found
*/
TilePos *BiomeSource::findBiome(int x, int z, int r, vector<Biome *> allowed, Random *random)
@@ -411,13 +411,13 @@ void BiomeSource::update()
// 4J added - find a seed for this biomesource that matches certain criteria
#ifdef __PSVITA__
-__int64 BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs
+int64_t BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs
#else
-__int64 BiomeSource::findSeed(LevelType *generator)
+int64_t BiomeSource::findSeed(LevelType *generator)
#endif
{
- __int64 bestSeed = 0;
+ int64_t bestSeed = 0;
ProgressRenderer *mcprogress = Minecraft::GetInstance()->progressRenderer;
mcprogress->progressStage(IDS_PROGRESS_NEW_WORLD_SEED);
@@ -455,7 +455,7 @@ __int64 BiomeSource::findSeed(LevelType *generator)
// Just keeping trying to generate seeds until we find one that matches our criteria
do
{
- __int64 seed = pr->nextLong();
+ int64_t seed = pr->nextLong();
BiomeSource *biomeSource = new BiomeSource(seed,generator);
biomeSource->getRawBiomeIndices(indices, biomeOffset, biomeOffset, biomeWidth, biomeWidth);
@@ -487,7 +487,7 @@ __int64 BiomeSource::findSeed(LevelType *generator)
unsigned int *pixels = new unsigned int[54 * 16 * 54 * 16];
for(int i = 0; i < 54 * 16 * 54 * 16; i++ )
- {
+ {
int id = biomes[i]->id;
// Create following colours:
@@ -563,7 +563,7 @@ void BiomeSource::getFracs(intArray indices, float *fracs)
bool BiomeSource::getIsMatch(float *frac)
{
// A true for a particular biome type here marks it as one that *has* to be present
- static const bool critical[Biome::BIOME_COUNT] = {
+ static const bool critical[Biome::BIOME_COUNT] = {
true, // ocean
true, // plains
true, // desert
diff --git a/Minecraft.World/BiomeSource.h b/Minecraft.World/BiomeSource.h
index bef09db0..a1e8a50b 100644
--- a/Minecraft.World/BiomeSource.h
+++ b/Minecraft.World/BiomeSource.h
@@ -25,20 +25,20 @@ private:
protected:
void _init();
- void _init(__int64 seed, LevelType *generator);
+ void _init(int64_t seed, LevelType *generator);
BiomeSource();
public:
- BiomeSource(__int64 seed, LevelType *generator);
+ BiomeSource(int64_t seed, LevelType *generator);
BiomeSource(Level *level);
private:
static bool getIsMatch(float *frac); // 4J added
static void getFracs(intArray indices, float *fracs); // 4J added
public:
#ifdef __PSVITA__
- static __int64 findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added
+ static int64_t findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added
#else
- static __int64 findSeed(LevelType *generator); // 4J added
+ static int64_t findSeed(LevelType *generator); // 4J added
#endif
~BiomeSource();
@@ -71,7 +71,7 @@ public:
/**
* Checks if an area around a block contains only the specified biomes.
* Useful for placing elements like towns.
- *
+ *
* This is a bit of a rough check, to make it as fast as possible. To ensure
* NO other biomes, add a margin of at least four blocks to the radius
*/
@@ -80,7 +80,7 @@ public:
/**
* Checks if an area around a block contains only the specified biome.
* Useful for placing elements like towns.
- *
+ *
* This is a bit of a rough check, to make it as fast as possible. To ensure
* NO other biomes, add a margin of at least four blocks to the radius
*/
@@ -89,7 +89,7 @@ public:
/**
* Finds the specified biome within the radius. This will return a random
* position if several are found. This test is fairly rough.
- *
+ *
* Returns null if the biome wasn't found
*/
virtual TilePos *findBiome(int x, int z, int r, Biome *toFind, Random *random);
@@ -97,7 +97,7 @@ public:
/**
* Finds one of the specified biomes within the radius. This will return a
* random position if several are found. This test is fairly rough.
- *
+ *
* Returns null if the biome wasn't found
*/
virtual TilePos *findBiome(int x, int z, int r, vector<Biome *> allowed, Random *random);
diff --git a/Minecraft.World/ByteArrayInputStream.cpp b/Minecraft.World/ByteArrayInputStream.cpp
index 394bda14..b0167300 100644
--- a/Minecraft.World/ByteArrayInputStream.cpp
+++ b/Minecraft.World/ByteArrayInputStream.cpp
@@ -51,7 +51,7 @@ int ByteArrayInputStream::read()
//
//The read(b) method for class InputStream has the same effect as:
//
-// read(b, 0, b.length)
+// read(b, 0, b.length)
//Parameters:
//b - the buffer into which the data is read.
//Returns:
@@ -100,7 +100,7 @@ void ByteArrayInputStream::close()
//n - the number of bytes to be skipped.
//Returns:
//the actual number of bytes skipped.
-__int64 ByteArrayInputStream::skip(__int64 n)
+int64_t ByteArrayInputStream::skip(int64_t n)
{
int newPos = pos + n;
diff --git a/Minecraft.World/ByteArrayInputStream.h b/Minecraft.World/ByteArrayInputStream.h
index e74b1cf7..5b2d95cf 100644
--- a/Minecraft.World/ByteArrayInputStream.h
+++ b/Minecraft.World/ByteArrayInputStream.h
@@ -19,7 +19,7 @@ public:
virtual int read(byteArray b);
virtual int read(byteArray b, unsigned int offset, unsigned int length);
virtual void close();
- virtual __int64 skip(__int64 n);
+ virtual int64_t skip(int64_t n);
// 4J Stu Added - Sometimes we don't want to delete the data on destroying this
void reset() { buf = byteArray(); count = 0; mark = 0; pos = 0; }
diff --git a/Minecraft.World/ByteBuffer.cpp b/Minecraft.World/ByteBuffer.cpp
index 66514737..57b30dbd 100644
--- a/Minecraft.World/ByteBuffer.cpp
+++ b/Minecraft.World/ByteBuffer.cpp
@@ -176,20 +176,20 @@ int ByteBuffer::getInt(unsigned int index)
//
//Returns:
//The long value at the buffer's current position
-__int64 ByteBuffer::getLong()
+int64_t ByteBuffer::getLong()
{
assert( m_position+8 < m_limit );
- __int64 value = 0;
+ int64_t value = 0;
- __int64 b1 = buffer[ m_position ];
- __int64 b2 = buffer[ m_position+1 ];
- __int64 b3 = buffer[ m_position+2 ];
- __int64 b4 = buffer[ m_position+3 ];
- __int64 b5 = buffer[ m_position+4 ];
- __int64 b6 = buffer[ m_position+5 ];
- __int64 b7 = buffer[ m_position+6 ];
- __int64 b8 = buffer[ m_position+7 ];
+ int64_t b1 = buffer[ m_position ];
+ int64_t b2 = buffer[ m_position+1 ];
+ int64_t b3 = buffer[ m_position+2 ];
+ int64_t b4 = buffer[ m_position+3 ];
+ int64_t b5 = buffer[ m_position+4 ];
+ int64_t b6 = buffer[ m_position+5 ];
+ int64_t b7 = buffer[ m_position+6 ];
+ int64_t b8 = buffer[ m_position+7 ];
m_position += 8;
@@ -358,7 +358,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s)
// TODO 4J Stu - Should this function be writing from the start of the buffer, or from position?
// And should it update position?
assert( s.length*2 <= m_limit);
-
+
// 4J Stu - Assumes big endian
memcpy( buffer, s.data, s.length*2 );
@@ -373,7 +373,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s)
//value - The long value to be written
//Returns:
//This buffer
-ByteBuffer *ByteBuffer::putLong(__int64 value)
+ByteBuffer *ByteBuffer::putLong(int64_t value)
{
assert( m_position+7 < m_limit );
@@ -407,7 +407,7 @@ ByteBuffer *ByteBuffer::putLong(__int64 value)
//This method transfers the entire content of the given source byte array into this buffer.
//An invocation of this method of the form dst.put(a) behaves in exactly the same way as the invocation
//
-// dst.put(a, 0, a.length)
+// dst.put(a, 0, a.length)
//Returns:
//This buffer
ByteBuffer *ByteBuffer::put(byteArray inputArray)
@@ -436,7 +436,7 @@ byteArray ByteBuffer::array()
//it will be read-only if, and only if, this buffer is read-only.
//
//Returns:
-//A new int buffer
+//A new int buffer
IntBuffer *ByteBuffer::asIntBuffer()
{
// TODO 4J Stu - Is it safe to just cast our byte array pointer to another type?
@@ -463,7 +463,7 @@ FloatBuffer *ByteBuffer::asFloatBuffer()
#ifdef __PS3__
// we're using the RSX now to upload textures to vram, so we need th main ram textures allocated from io space
-ByteBuffer_IO::ByteBuffer_IO( unsigned int capacity )
+ByteBuffer_IO::ByteBuffer_IO( unsigned int capacity )
: ByteBuffer(capacity, (byte*)RenderManager.allocIOMem(capacity, 64))
{
memset( buffer,0,sizeof(byte)*capacity);
diff --git a/Minecraft.World/ByteBuffer.h b/Minecraft.World/ByteBuffer.h
index 2d936374..56ac0b96 100644
--- a/Minecraft.World/ByteBuffer.h
+++ b/Minecraft.World/ByteBuffer.h
@@ -28,7 +28,7 @@ public:
int getInt(unsigned int index);
void get(byteArray) {} // 4J - TODO
byte get(int index);
- __int64 getLong();
+ int64_t getLong();
short getShort();
void getShortArray(shortArray &s);
ByteBuffer *put(int index, byte b);
@@ -36,7 +36,7 @@ public:
ByteBuffer *putInt(unsigned int index, int value);
ByteBuffer *putShort(short value);
ByteBuffer *putShortArray(shortArray &s);
- ByteBuffer *putLong(__int64 value);
+ ByteBuffer *putLong(int64_t value);
ByteBuffer *put(byteArray inputArray);
byteArray array();
IntBuffer *asIntBuffer();
diff --git a/Minecraft.World/C4JThread.h b/Minecraft.World/C4JThread.h
index 3d5f050c..6bf0a0a7 100644
--- a/Minecraft.World/C4JThread.h
+++ b/Minecraft.World/C4JThread.h
@@ -66,7 +66,7 @@ public:
e_modeAutoClear,
e_modeManualClear
};
- Event(EMode mode = e_modeAutoClear);
+ Event(EMode mode = e_modeAutoClear);
~Event();
void Set();
void Clear();
@@ -75,7 +75,7 @@ public:
private:
EMode m_mode;
#ifdef __PS3__
- sys_event_flag_t m_event;
+ sys_event_flag_t m_event;
#elif defined __ORBIS__
SceKernelEventFlag m_event;
#elif defined __PSVITA__
@@ -111,7 +111,7 @@ public:
int m_size;
EMode m_mode;
#ifdef __PS3__
- sys_event_flag_t m_events;
+ sys_event_flag_t m_events;
#elif defined __ORBIS__
SceKernelEventFlag m_events;
#elif defined __PSVITA__
@@ -129,7 +129,7 @@ public:
typedef void (ThreadInitFunc)();
C4JThread* m_thread;
- std::queue<void*> m_queue;
+ std::queue<void*> m_queue;
C4JThread::EventArray* m_startEvent;
C4JThread::Event* m_finishedEvent;
CRITICAL_SECTION m_critSect;
@@ -187,7 +187,7 @@ private:
bool m_isRunning;
bool m_hasStarted;
int m_exitCode;
- __int64 m_lastSleepTime;
+ int64_t m_lastSleepTime;
static std::vector<C4JThread*> ms_threadList;
static CRITICAL_SECTION ms_threadListCS;
diff --git a/Minecraft.World/CanyonFeature.cpp b/Minecraft.World/CanyonFeature.cpp
index 6d1dda64..a375db7d 100644
--- a/Minecraft.World/CanyonFeature.cpp
+++ b/Minecraft.World/CanyonFeature.cpp
@@ -4,7 +4,7 @@
#include "net.minecraft.world.level.tile.h"
#include "net.minecraft.world.level.biome.h"
-void CanyonFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale)
+void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale)
{
MemSect(49);
Random *random = new Random(seed);
diff --git a/Minecraft.World/CanyonFeature.h b/Minecraft.World/CanyonFeature.h
index cf3f7a61..d3edbf1f 100644
--- a/Minecraft.World/CanyonFeature.h
+++ b/Minecraft.World/CanyonFeature.h
@@ -9,6 +9,6 @@ private:
float rs[1024];
protected:
- void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale);
+ void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale);
virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks);
};
diff --git a/Minecraft.World/CaveFeature.cpp b/Minecraft.World/CaveFeature.cpp
index adb5d446..8183fbdf 100644
--- a/Minecraft.World/CaveFeature.cpp
+++ b/Minecraft.World/CaveFeature.cpp
@@ -20,7 +20,7 @@ bool CaveFeature::place(Level *level, Random *random, int x, int y, int z)
double radius = random->nextDouble() * 4 + 2;
double fuss = random->nextDouble() * 0.6;
- __int64 seed = random->nextLong();
+ int64_t seed = random->nextLong();
random->setSeed(seed);
vector<TilePos *> toRemove;
diff --git a/Minecraft.World/ChunkPos.cpp b/Minecraft.World/ChunkPos.cpp
index ff1c34f0..acf885c0 100644
--- a/Minecraft.World/ChunkPos.cpp
+++ b/Minecraft.World/ChunkPos.cpp
@@ -6,16 +6,16 @@ ChunkPos::ChunkPos(int x, int z) : x( x ), z( z )
{
}
-__int64 ChunkPos::hashCode(int x, int z)
+int64_t ChunkPos::hashCode(int x, int z)
{
- __int64 xx = x;
- __int64 zz = z;
+ int64_t xx = x;
+ int64_t zz = z;
return (xx & 0xffffffffl) | ((zz & 0xffffffffl) << 32l);
}
int ChunkPos::hashCode()
{
- __int64 hash = hashCode(x, z);
+ int64_t hash = hashCode(x, z);
int h1 = (int) (hash);
int h2 = (int) (hash >> 32l);
return h1 ^ h2;
@@ -63,7 +63,7 @@ wstring ChunkPos::toString()
return L"[" + std::to_wstring(x) + L", " + std::to_wstring(z) + L"]";
}
-__int64 ChunkPos::hash_fnct(const ChunkPos &k)
+int64_t ChunkPos::hash_fnct(const ChunkPos &k)
{
return k.hashCode(k.x,k.z);
}
diff --git a/Minecraft.World/ChunkPos.h b/Minecraft.World/ChunkPos.h
index 2a3fda02..55bd1ebb 100644
--- a/Minecraft.World/ChunkPos.h
+++ b/Minecraft.World/ChunkPos.h
@@ -10,7 +10,7 @@ public:
ChunkPos(int x, int z);
- static __int64 hashCode(int x, int z);
+ static int64_t hashCode(int x, int z);
int hashCode();
double distanceToSqr(shared_ptr<Entity> e);
@@ -22,7 +22,7 @@ public:
TilePos getMiddleBlockPosition(int y);
wstring toString();
- static __int64 hash_fnct(const ChunkPos &k);
+ static int64_t hash_fnct(const ChunkPos &k);
static bool eq_test(const ChunkPos &x, const ChunkPos &y);
bool operator == (const ChunkPos &k) const { return (this->x == k.x) && ( this->z == k.z); }
ChunkPos & operator= (const ChunkPos & other) { x = other.x; z = other.z; return *this; }
@@ -30,12 +30,12 @@ public:
struct ChunkPosKeyHash
{
- inline __int64 operator()(const ChunkPos &k) const
+ inline int64_t operator()(const ChunkPos &k) const
{ return ChunkPos::hash_fnct(k); }
};
struct ChunkPosKeyEq
{
- inline bool operator()(const ChunkPos &x, const ChunkPos &y) const
+ inline bool operator()(const ChunkPos &x, const ChunkPos &y) const
{ return ChunkPos::eq_test(x, y); }
}; \ No newline at end of file
diff --git a/Minecraft.World/ChunkStorageProfileDecorator.cpp b/Minecraft.World/ChunkStorageProfileDecorator.cpp
index 76ffddbc..5d757811 100644
--- a/Minecraft.World/ChunkStorageProfileDecorator.cpp
+++ b/Minecraft.World/ChunkStorageProfileDecorator.cpp
@@ -10,7 +10,7 @@ ChunkStorageProfilerDecorator::ChunkStorageProfilerDecorator(ChunkStorage *capsu
LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z)
{
- __int64 nanoTime = System::nanoTime();
+ int64_t nanoTime = System::nanoTime();
LevelChunk *chunk = capsulated->load(level, x, z);
timeSpentLoading += System::nanoTime() - nanoTime;
loadCount++;
@@ -20,7 +20,7 @@ LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z)
void ChunkStorageProfilerDecorator::save(Level *level, LevelChunk *levelChunk)
{
- __int64 nanoTime = System::nanoTime();
+ int64_t nanoTime = System::nanoTime();
capsulated->save(level, levelChunk);
timeSpentSaving += System::nanoTime() - nanoTime;
saveCount++;
@@ -59,7 +59,7 @@ void ChunkStorageProfilerDecorator::tick()
sprintf(buf,"Average save time: %f (%I64d)",0.000001 * (double) timeSpentSaving / (double) loadCount, loadCount);
#endif
app.DebugPrintf(buf);
-#endif
+#endif
}
counter = 0;
}
diff --git a/Minecraft.World/ChunkStorageProfileDecorator.h b/Minecraft.World/ChunkStorageProfileDecorator.h
index 67c582da..02ea4dcb 100644
--- a/Minecraft.World/ChunkStorageProfileDecorator.h
+++ b/Minecraft.World/ChunkStorageProfileDecorator.h
@@ -8,10 +8,10 @@ class ChunkStorageProfilerDecorator : public ChunkStorage
private:
ChunkStorage *capsulated;
- __int64 timeSpentLoading;
- __int64 loadCount;
- __int64 timeSpentSaving;
- __int64 saveCount;
+ int64_t timeSpentLoading;
+ int64_t loadCount;
+ int64_t timeSpentSaving;
+ int64_t saveCount;
int counter;
diff --git a/Minecraft.World/CompoundTag.h b/Minecraft.World/CompoundTag.h
index f3a711d2..83a6108f 100644
--- a/Minecraft.World/CompoundTag.h
+++ b/Minecraft.World/CompoundTag.h
@@ -11,7 +11,7 @@
#include "ByteArrayTag.h"
#include "IntArrayTag.h"
-class CompoundTag : public Tag
+class CompoundTag : public Tag
{
private:
unordered_map<wstring, Tag *> tags;
@@ -86,7 +86,7 @@ public:
tags[name] = (new IntTag(name,value));
}
- void putLong(const wstring &name, __int64 value)
+ void putLong(const wstring &name, int64_t value)
{
tags[name] = (new LongTag(name,value));
}
@@ -156,9 +156,9 @@ public:
return ((IntTag *) tags[name])->data;
}
- __int64 getLong(const wstring &name)
+ int64_t getLong(const wstring &name)
{
- if (tags.find(name) == tags.end()) return (__int64)0;
+ if (tags.find(name) == tags.end()) return (int64_t)0;
return ((LongTag *) tags[name])->data;
}
@@ -261,7 +261,7 @@ public:
CompoundTag *tag = new CompoundTag(getName());
for( auto& it : tags )
- {
+ {
tag->put((wchar_t *)it.first.c_str(), it.second->copy());
}
return tag;
diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp
index 12c1ba3b..eb1b784a 100644
--- a/Minecraft.World/CompressedTileStorage.cpp
+++ b/Minecraft.World/CompressedTileStorage.cpp
@@ -143,7 +143,7 @@ CompressedTileStorage::CompressedTileStorage(bool isEmpty)
#endif
}
-bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range)
+bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range)
{
int block;
unsigned short *blockIndices = (unsigned short *)indicesAndData;
@@ -152,7 +152,7 @@ bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (
for( int z = 0; z < 16; z += 4 )
{
getBlock(&block, x, y, z);
- __uint64 *comp = (__uint64 *)&blockIndices[block];
+ uint64_t *comp = (uint64_t *)&blockIndices[block];
// Are the 4 y regions stored here all zero? (INDEX_TYPE_0_OR_8_BIT | INDEX_TYPE_0_BIT_FLAG )
if( ( *comp ) != 0x0007000700070007L ) return false;
}
@@ -170,18 +170,18 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other)
// Attempt to compare as much as we can in 64-byte chunks (8 groups of 8 bytes)
int quickCount = allocatedSize / 64;
- __int64 *pOld = (__int64 *)indicesAndData;
- __int64 *pNew = (__int64 *)other->indicesAndData;
+ int64_t *pOld = (int64_t *)indicesAndData;
+ int64_t *pNew = (int64_t *)other->indicesAndData;
for( int i = 0; i < quickCount; i++ )
{
- __int64 d0 = pOld[0] ^ pNew[0];
- __int64 d1 = pOld[1] ^ pNew[1];
- __int64 d2 = pOld[2] ^ pNew[2];
- __int64 d3 = pOld[3] ^ pNew[3];
- __int64 d4 = pOld[4] ^ pNew[4];
- __int64 d5 = pOld[5] ^ pNew[5];
- __int64 d6 = pOld[6] ^ pNew[6];
- __int64 d7 = pOld[7] ^ pNew[7];
+ int64_t d0 = pOld[0] ^ pNew[0];
+ int64_t d1 = pOld[1] ^ pNew[1];
+ int64_t d2 = pOld[2] ^ pNew[2];
+ int64_t d3 = pOld[3] ^ pNew[3];
+ int64_t d4 = pOld[4] ^ pNew[4];
+ int64_t d5 = pOld[5] ^ pNew[5];
+ int64_t d6 = pOld[6] ^ pNew[6];
+ int64_t d7 = pOld[7] ^ pNew[7];
d0 |= d1;
d2 |= d3;
d4 |= d5;
@@ -195,7 +195,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other)
}
pOld += 8;
pNew += 8;
- }
+ }
// Now test anything remaining just byte at a time
unsigned char *pucOld = (unsigned char *)pOld;
@@ -262,7 +262,7 @@ inline int CompressedTileStorage::getIndex(int block, int tile)
// and z is: ___________zzzz
// and maps to this bit of b ________bb_____
// and this bit of t ___________tt__
-//
+//
inline void CompressedTileStorage::getBlockAndTile(int *block, int *tile, int x, int y, int z)
{
@@ -303,7 +303,7 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset)
int offsets[512];
int memToAlloc = 0;
// static int type0 = 0, type1 = 0, type2 = 0, type4 = 0, type8 = 0, chunkTotal = 0;
-
+
// Loop round all blocks
for( int i = 0; i < 512; i++ )
{
@@ -333,8 +333,8 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset)
}
}
#else
- __uint64 usedFlags[4] = {0,0,0,0};
- __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific
+ uint64_t usedFlags[4] = {0,0,0,0};
+ int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific
for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4 x 4 tiles in the block
{
int tile = data[getIndex(i,j)];
@@ -890,7 +890,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/)
unsigned char *unpacked_data = NULL;
unsigned char *packed_data;
- // First task is to find out what type of storage each block needs. Need to unpack each where required.
+ // First task is to find out what type of storage each block needs. Need to unpack each where required.
// Note that we don't need to fully unpack the data at this stage since we are only interested in working out how many unique types of tiles are in each block, not
// what those actual tile ids are.
if( upgradeBlock == -1 )
@@ -951,8 +951,8 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/)
}
#else
- __uint64 usedFlags[4] = {0,0,0,0};
- __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific
+ uint64_t usedFlags[4] = {0,0,0,0};
+ int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific
for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4x4x4 tiles in the block
{
int tiletype = unpacked_data[j];
@@ -1026,7 +1026,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/)
}
}
switch(_blockIndices[i])
- {
+ {
case INDEX_TYPE_1_BIT:
memToAlloc += 10;
break;
@@ -1097,7 +1097,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/)
else
{
packed_data = data + ( ( blockIndices[i] >> INDEX_OFFSET_SHIFT ) & INDEX_OFFSET_MASK);
-
+
int dataSize = 8 << indexTypeOld; // 8, 16 or 32 bytes of per-tile storage
dataSize += 1 << ( 1 << indexTypeOld ); // 2, 4 or 16 bytes to store each tile type
newIndices[i] |= ( usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT;
@@ -1290,7 +1290,7 @@ int CompressedTileStorage::getHighestNonEmptyY()
if(found) break;
}
-
+
int highestNonEmptyY = -1;
if(found)
{
diff --git a/Minecraft.World/ConsoleSaveFileInputStream.h b/Minecraft.World/ConsoleSaveFileInputStream.h
index 876a9484..7f4a69c4 100644
--- a/Minecraft.World/ConsoleSaveFileInputStream.h
+++ b/Minecraft.World/ConsoleSaveFileInputStream.h
@@ -17,7 +17,7 @@ public:
virtual int read(byteArray b);
virtual int read(byteArray b, unsigned int offset, unsigned int length);
virtual void close();
- virtual __int64 skip(__int64 n) { return n; }
+ virtual int64_t skip(int64_t n) { return n; }
private:
ConsoleSaveFile *m_saveFile;
diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp
index d4db4e25..0b7c8d66 100644
--- a/Minecraft.World/ConsoleSaveFileOriginal.cpp
+++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp
@@ -35,7 +35,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
// We'll only be committing these as required to grow the storage we need, which will
// the storage to grow without having to use realloc.
- // AP - The Vita doesn't have virtual memory so a pretend system has been implemented in PSVitaStubs.cpp.
+ // AP - The Vita doesn't have virtual memory so a pretend system has been implemented in PSVitaStubs.cpp.
// All access to the memory must be done via the access function as the pointer returned from VirtualAlloc
// can't be used directly.
pvHeap = VirtualAlloc(NULL, MAX_PAGE_COUNT * CSF_PAGE_SIZE, RESERVE_ALLOCATION, PAGE_READWRITE );
@@ -116,7 +116,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
#endif
app.DebugPrintf("Filesize - %d, Adjusted size - %d\n",fileSize,storageLength);
fileSize = storageLength;
- }
+ }
#ifdef __PSVITA__
if(plat == SAVE_FILE_PLATFORM_PSVITA)
@@ -202,7 +202,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
}
else
- {
+ {
// Clear the first 8 bytes that reference the header
header.WriteHeader( pvSaveMem );
}
@@ -213,7 +213,7 @@ ConsoleSaveFileOriginal::~ConsoleSaveFileOriginal()
VirtualFree( pvHeap, MAX_PAGE_COUNT * CSF_PAGE_SIZE, MEM_DECOMMIT );
pagesCommitted = 0;
// Make sure we don't have any thumbnail data still waiting round - we can't need it now we've destroyed the save file anyway
-#if defined _XBOX
+#if defined _XBOX
app.GetSaveThumbnail(NULL,NULL);
#elif defined __PS3__
app.GetSaveThumbnail(NULL,NULL, NULL,NULL);
@@ -565,7 +565,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt
if ( uiCopyEnd > uiFromEnd )
{
// Needs to be clamped to the end of our region
- uiCopyEnd = uiFromEnd;
+ uiCopyEnd = uiFromEnd;
}
#ifdef __PSVITA__
// AP - use this to access the virtual memory
@@ -775,7 +775,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
BYTE bTextMetadata[88];
ZeroMemory(bTextMetadata,88);
- __int64 seed = 0;
+ int64_t seed = 0;
bool hasSeed = false;
if(MinecraftServer::getInstance()!= NULL && MinecraftServer::getInstance()->levels[0]!=NULL)
{
@@ -791,7 +791,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
#ifdef _XBOX
StorageManager.SaveSaveData( compLength+8,pbThumbnailData,dwThumbnailDataSize,bTextMetadata,iTextMetadataBytes );
- delete [] pbThumbnailData;
+ delete [] pbThumbnailData;
#ifndef _CONTENT_PACKAGE
if( app.DebugSettingsOn())
{
diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp
index 61316299..0f4c6479 100644
--- a/Minecraft.World/CustomLevelSource.cpp
+++ b/Minecraft.World/CustomLevelSource.cpp
@@ -13,7 +13,7 @@
const double CustomLevelSource::SNOW_SCALE = 0.3;
const double CustomLevelSource::SNOW_CUTOFF = 0.5;
-CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures )
+CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures )
{
#ifdef _OVERRIDE_HEIGHTMAP
m_XZSize = level->getLevelData()->getXZSize();
@@ -328,7 +328,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
run = runDepth;
if (y >= waterHeight - 1) blocks[offs] = top;
else blocks[offs] = material;
- }
+ }
else if (run > 0)
{
run--;
@@ -402,7 +402,7 @@ LevelChunk *CustomLevelSource::getChunk(int xOffs, int zOffs)
// addCaves(xOffs, zOffs, blocks);
// addTowns(xOffs, zOffs, blocks);
- // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method
+ // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method
// 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also
// now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore.
@@ -507,8 +507,8 @@ void CustomLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
}
pprandom->setSeed(level->getSeed());
- __int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
- __int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t xScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
bool hasVillage = false;
diff --git a/Minecraft.World/CustomLevelSource.h b/Minecraft.World/CustomLevelSource.h
index 7739fc95..9a9cb8cf 100644
--- a/Minecraft.World/CustomLevelSource.h
+++ b/Minecraft.World/CustomLevelSource.h
@@ -46,7 +46,7 @@ private:
const bool generateStructures;
public:
- CustomLevelSource(Level *level, __int64 seed, bool generateStructures);
+ CustomLevelSource(Level *level, int64_t seed, bool generateStructures);
~CustomLevelSource();
public:
@@ -77,6 +77,6 @@ public:
public:
virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z);
- virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z);
+ virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z);
virtual void recreateLogicStructuresForChunk(int chunkX, int chunkZ);
};
diff --git a/Minecraft.World/DataInput.h b/Minecraft.World/DataInput.h
index 258b2717..f61eceb5 100644
--- a/Minecraft.World/DataInput.h
+++ b/Minecraft.World/DataInput.h
@@ -13,7 +13,7 @@ public:
virtual double readDouble() = 0;
virtual float readFloat() = 0;
virtual int readInt() = 0;
- virtual __int64 readLong() = 0;
+ virtual int64_t readLong() = 0;
virtual short readShort() = 0;
virtual wchar_t readChar() = 0;
virtual wstring readUTF() = 0;
diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp
index 97721c94..18deed39 100644
--- a/Minecraft.World/DataInputStream.cpp
+++ b/Minecraft.World/DataInputStream.cpp
@@ -32,8 +32,8 @@ int DataInputStream::read()
//
//The read(b) method has the same effect as:
//
-// read(b, 0, b.length)
-//
+// read(b, 0, b.length)
+//
//Overrides:
//read in class FilterInputStream
//Parameters:
@@ -102,7 +102,7 @@ unsigned char DataInputStream::readUnsignedByte()
//Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is:
//(char)((a << 8) | (b & 0xff))
-//
+//
//This method is suitable for reading bytes written by the writeChar method of interface DataOutput.
//Returns:
//the char value read.
@@ -110,7 +110,7 @@ wchar_t DataInputStream::readChar()
{
int a = stream->read();
int b = stream->read();
- return (wchar_t)((a << 8) | (b & 0xff));
+ return (wchar_t)((a << 8) | (b & 0xff));
}
//Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b.
@@ -170,7 +170,7 @@ bool DataInputStream::readFully(charArray b)
//the double value read.
double DataInputStream::readDouble()
{
- __int64 bits = readLong();
+ int64_t bits = readLong();
return Double::longBitsToDouble( bits );
}
@@ -188,10 +188,10 @@ float DataInputStream::readFloat()
}
//Reads four input bytes and returns an int value. Let a-d be the first through fourth bytes read. The value returned is:
-//
+//
// (((a & 0xff) << 24) | ((b & 0xff) << 16) |
// ((c & 0xff) << 8) | (d & 0xff))
-//
+//
//This method is suitable for reading bytes written by the writeInt method of interface DataOutput.
//Returns:
//the int value read.
@@ -207,7 +207,7 @@ int DataInputStream::readInt()
}
//Reads eight input bytes and returns a long value. Let a-h be the first through eighth bytes read. The value returned is:
-//
+//
// (((long)(a & 0xff) << 56) |
// ((long)(b & 0xff) << 48) |
// ((long)(c & 0xff) << 40) |
@@ -216,23 +216,23 @@ int DataInputStream::readInt()
// ((long)(f & 0xff) << 16) |
// ((long)(g & 0xff) << 8) |
// ((long)(h & 0xff)))
-//
+//
//This method is suitable for reading bytes written by the writeLong method of interface DataOutput.
//
//Returns:
//the long value read.
-__int64 DataInputStream::readLong()
+int64_t DataInputStream::readLong()
{
- __int64 a = stream->read();
- __int64 b = stream->read();
- __int64 c = stream->read();
- __int64 d = stream->read();
- __int64 e = stream->read();
- __int64 f = stream->read();
- __int64 g = stream->read();
- __int64 h = stream->read();
-
- __int64 bits = (((a & 0xff) << 56) |
+ int64_t a = stream->read();
+ int64_t b = stream->read();
+ int64_t c = stream->read();
+ int64_t d = stream->read();
+ int64_t e = stream->read();
+ int64_t f = stream->read();
+ int64_t g = stream->read();
+ int64_t h = stream->read();
+
+ int64_t bits = (((a & 0xff) << 56) |
((b & 0xff) << 48) |
((c & 0xff) << 40) |
((d & 0xff) << 32) |
@@ -246,7 +246,7 @@ __int64 DataInputStream::readLong()
//Reads two input bytes and returns a short value. Let a be the first byte read and b be the second byte. The value returned is:
//(short)((a << 8) | (b & 0xff))
-//
+//
//This method is suitable for reading the bytes written by the writeShort method of interface DataOutput.
//Returns:
//the 16-bit value read.
@@ -279,13 +279,13 @@ unsigned short DataInputStream::readUnsignedShort()
//then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character:
//
//(char)(((a& 0x1F) << 6) | (b & 0x3F))
-//
+//
//If the first byte of a group matches the bit pattern 1110xxxx, then the group consists of that byte a and two more bytes b and c.
//If there is no byte c (because byte a was one of the last two of the bytes to be read), or either byte b or byte c does not match the bit
//pattern 10xxxxxx, then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character:
//
// (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
-//
+//
//If the first byte of a group matches the pattern 1111xxxx or the pattern 10xxxxxx, then a UTFDataFormatException is thrown.
//If end of file is encountered at any time during this entire process, then an EOFException is thrown.
//
@@ -312,7 +312,7 @@ wstring DataInputStream::readUTF()
outputString.push_back(theChar);
}*/
-
+
unsigned short currentByteIndex = 0;
while( currentByteIndex < UTFLength )
{
@@ -397,7 +397,7 @@ wstring DataInputStream::readUTF()
{
// TODO 4J Stu - EOFException
break;
- }
+ }
// No more bytes to read
if( !(currentByteIndex < UTFLength) )
@@ -427,7 +427,7 @@ wstring DataInputStream::readUTF()
continue;
}
}
-
+
return outputString;
}
@@ -493,7 +493,7 @@ int DataInputStream::readUTFChar()
{
// TODO 4J Stu - EOFException
return returnValue;
- }
+ }
int thirdByte = stream->read();
@@ -542,7 +542,7 @@ void DataInputStream::deleteChildStream()
//n - the number of bytes to be skipped.
//Returns:
//the actual number of bytes skipped.
-__int64 DataInputStream::skip(__int64 n)
+int64_t DataInputStream::skip(int64_t n)
{
return stream->skip(n);
}
diff --git a/Minecraft.World/DataInputStream.h b/Minecraft.World/DataInputStream.h
index 0b228a0d..67604c28 100644
--- a/Minecraft.World/DataInputStream.h
+++ b/Minecraft.World/DataInputStream.h
@@ -25,12 +25,12 @@ public:
virtual double readDouble();
virtual float readFloat();
virtual int readInt();
- virtual __int64 readLong();
+ virtual int64_t readLong();
virtual short readShort();
virtual wstring readUTF();
void deleteChildStream();
virtual int readUTFChar();
virtual PlayerUID readPlayerUID(); // 4J Added
- virtual __int64 skip(__int64 n);
+ virtual int64_t skip(int64_t n);
virtual int skipBytes(int n);
}; \ No newline at end of file
diff --git a/Minecraft.World/DataOutput.h b/Minecraft.World/DataOutput.h
index 648be6df..7ebf96da 100644
--- a/Minecraft.World/DataOutput.h
+++ b/Minecraft.World/DataOutput.h
@@ -10,7 +10,7 @@ public:
virtual void writeDouble(double a) = 0;
virtual void writeFloat(float a) = 0;
virtual void writeInt(int a) = 0;
- virtual void writeLong(__int64 a) = 0;
+ virtual void writeLong(int64_t a) = 0;
virtual void writeShort(short a) = 0;
virtual void writeBoolean(bool v) = 0;
virtual void writeChar(wchar_t v) = 0;
diff --git a/Minecraft.World/DataOutputStream.cpp b/Minecraft.World/DataOutputStream.cpp
index 8d350f0b..1a24e31a 100644
--- a/Minecraft.World/DataOutputStream.cpp
+++ b/Minecraft.World/DataOutputStream.cpp
@@ -78,7 +78,7 @@ void DataOutputStream::writeByte(byte a)
//v - a double value to be written.
void DataOutputStream::writeDouble(double a)
{
- __int64 bits = Double::doubleToLongBits( a );
+ int64_t bits = Double::doubleToLongBits( a );
writeLong( bits );
// TODO 4J Stu - Error handling?
@@ -116,7 +116,7 @@ void DataOutputStream::writeInt(int a)
//In no exception is thrown, the counter written is incremented by 8.
//Parameters:
//v - a long to be written.
-void DataOutputStream::writeLong(__int64 a)
+void DataOutputStream::writeLong(int64_t a)
{
stream->write( (a >> 56) & 0xff );
stream->write( (a >> 48) & 0xff );
@@ -186,7 +186,7 @@ void DataOutputStream::writeBoolean(bool b)
{
stream->write( b ? (byte)1 : (byte)0 );
// TODO 4J Stu - Error handling?
- written += 1;
+ written += 1;
}
//Writes a string to the underlying output stream using modified UTF-8 encoding in a machine-independent manner.
@@ -228,7 +228,7 @@ void DataOutputStream::writeUTF(const wstring& str)
byteArray bytearr(utflen+2);
bytearr[count++] = (byte) ((utflen >> 8) & 0xFF);
- bytearr[count++] = (byte) ((utflen >> 0) & 0xFF);
+ bytearr[count++] = (byte) ((utflen >> 0) & 0xFF);
int i=0;
for (i=0; i<strlen; i++)
diff --git a/Minecraft.World/DataOutputStream.h b/Minecraft.World/DataOutputStream.h
index 8a8c0e12..7ecfcd44 100644
--- a/Minecraft.World/DataOutputStream.h
+++ b/Minecraft.World/DataOutputStream.h
@@ -26,12 +26,12 @@ public:
virtual void writeDouble(double a);
virtual void writeFloat(float a);
virtual void writeInt(int a);
- virtual void writeLong(__int64 a);
+ virtual void writeLong(int64_t a);
virtual void writeShort(short a);
virtual void writeUnsignedShort(unsigned short a);
virtual void writeChar(wchar_t a);
virtual void writeChars(const wstring& a);
- virtual void writeBoolean(bool b);
+ virtual void writeBoolean(bool b);
virtual void writeUTF(const wstring& a);
virtual void writePlayerUID(PlayerUID player);
virtual void flush();
diff --git a/Minecraft.World/DerivedLevelData.cpp b/Minecraft.World/DerivedLevelData.cpp
index 198b8c76..bc7bf03f 100644
--- a/Minecraft.World/DerivedLevelData.cpp
+++ b/Minecraft.World/DerivedLevelData.cpp
@@ -22,7 +22,7 @@ CompoundTag *DerivedLevelData::createTag(vector<shared_ptr<Player> > *players)
return wrapped->createTag(players);
}
-__int64 DerivedLevelData::getSeed()
+int64_t DerivedLevelData::getSeed()
{
return wrapped->getSeed();
}
@@ -43,17 +43,17 @@ int DerivedLevelData::getZSpawn()
return wrapped->getZSpawn();
}
-__int64 DerivedLevelData::getGameTime()
+int64_t DerivedLevelData::getGameTime()
{
return wrapped->getGameTime();
}
-__int64 DerivedLevelData::getDayTime()
+int64_t DerivedLevelData::getDayTime()
{
return wrapped->getDayTime();
}
-__int64 DerivedLevelData::getSizeOnDisk()
+int64_t DerivedLevelData::getSizeOnDisk()
{
return wrapped->getSizeOnDisk();
}
@@ -73,7 +73,7 @@ int DerivedLevelData::getVersion()
return wrapped->getVersion();
}
-__int64 DerivedLevelData::getLastPlayed()
+int64_t DerivedLevelData::getLastPlayed()
{
return wrapped->getLastPlayed();
}
@@ -103,7 +103,7 @@ GameType *DerivedLevelData::getGameType()
return wrapped->getGameType();
}
-void DerivedLevelData::setSeed(__int64 seed)
+void DerivedLevelData::setSeed(int64_t seed)
{
}
@@ -119,15 +119,15 @@ void DerivedLevelData::setZSpawn(int zSpawn)
{
}
-void DerivedLevelData::setGameTime(__int64 time)
+void DerivedLevelData::setGameTime(int64_t time)
{
}
-void DerivedLevelData::setDayTime(__int64 time)
+void DerivedLevelData::setDayTime(int64_t time)
{
}
-void DerivedLevelData::setSizeOnDisk(__int64 sizeOnDisk)
+void DerivedLevelData::setSizeOnDisk(int64_t sizeOnDisk)
{
}
diff --git a/Minecraft.World/DerivedLevelData.h b/Minecraft.World/DerivedLevelData.h
index ad612cc9..9b439053 100644
--- a/Minecraft.World/DerivedLevelData.h
+++ b/Minecraft.World/DerivedLevelData.h
@@ -18,29 +18,29 @@ protected:
public:
CompoundTag *createTag();
CompoundTag *createTag(vector<shared_ptr<Player> > *players);
- __int64 getSeed();
+ int64_t getSeed();
int getXSpawn();
int getYSpawn();
int getZSpawn();
- __int64 getGameTime();
- __int64 getDayTime();
- __int64 getSizeOnDisk();
+ int64_t getGameTime();
+ int64_t getDayTime();
+ int64_t getSizeOnDisk();
CompoundTag *getLoadedPlayerTag();
wstring getLevelName();
int getVersion();
- __int64 getLastPlayed();
+ int64_t getLastPlayed();
bool isThundering();
int getThunderTime();
bool isRaining();
int getRainTime();
GameType *getGameType();
- void setSeed(__int64 seed);
+ void setSeed(int64_t seed);
void setXSpawn(int xSpawn);
void setYSpawn(int ySpawn);
void setZSpawn(int zSpawn);
- void setGameTime(__int64 time);
- void setDayTime(__int64 time);
- void setSizeOnDisk(__int64 sizeOnDisk);
+ void setGameTime(int64_t time);
+ void setDayTime(int64_t time);
+ void setSizeOnDisk(int64_t sizeOnDisk);
void setLoadedPlayerTag(CompoundTag *loadedPlayerTag);
void setDimension(int dimension);
void setSpawn(int xSpawn, int ySpawn, int zSpawn);
diff --git a/Minecraft.World/Dimension.cpp b/Minecraft.World/Dimension.cpp
index 697da010..479edae8 100644
--- a/Minecraft.World/Dimension.cpp
+++ b/Minecraft.World/Dimension.cpp
@@ -45,13 +45,13 @@ void Dimension::init()
}
else
#endif
- if (level->getLevelData()->getGenerator() == LevelType::lvl_flat)
+ if (level->getLevelData()->getGenerator() == LevelType::lvl_flat)
{
FlatGeneratorInfo *generator = FlatGeneratorInfo::fromValue(level->getLevelData()->getGeneratorOptions());
biomeSource = new FixedBiomeSource(Biome::biomes[generator->getBiome()], 0.5f, 0.5f);
delete generator;
}
- else
+ else
{
biomeSource = new BiomeSource(level);
}
@@ -84,11 +84,11 @@ ChunkSource *Dimension::createRandomLevelSource() const
}
else
#endif
- if (levelType == LevelType::lvl_flat)
+ if (levelType == LevelType::lvl_flat)
{
return new FlatLevelSource(level, level->getSeed(), level->getLevelData()->isGenerateMapFeatures());
- }
- else
+ }
+ else
{
return new RandomLevelSource(level, level->getSeed(), level->getLevelData()->isGenerateMapFeatures());
}
@@ -113,7 +113,7 @@ bool Dimension::isValidSpawn(int x, int z) const
return true;
}
-float Dimension::getTimeOfDay(__int64 time, float a) const
+float Dimension::getTimeOfDay(int64_t time, float a) const
{
int dayStep = (int) (time % Level::TICKS_PER_DAY);
float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f;
@@ -125,7 +125,7 @@ float Dimension::getTimeOfDay(__int64 time, float a) const
return td;
}
-int Dimension::getMoonPhase(__int64 time) const
+int Dimension::getMoonPhase(int64_t time) const
{
return ((int) (time / Level::TICKS_PER_DAY)) % 8;
}
@@ -210,16 +210,16 @@ Pos *Dimension::getSpawnPos()
return NULL;
}
-int Dimension::getSpawnYPosition()
+int Dimension::getSpawnYPosition()
{
- if (levelType == LevelType::lvl_flat)
+ if (levelType == LevelType::lvl_flat)
{
return 4;
}
return Level::genDepth / 2;
}
-bool Dimension::hasBedrockFog()
+bool Dimension::hasBedrockFog()
{
// 4J-PB - turn off bedrock fog if the host player doesn't want it
if(app.GetGameHostOption(eGameHostOption_BedrockFog)==0)
@@ -230,9 +230,9 @@ bool Dimension::hasBedrockFog()
return (levelType != LevelType::lvl_flat && !hasCeiling);
}
-double Dimension::getClearColorScale()
+double Dimension::getClearColorScale()
{
- if (levelType == LevelType::lvl_flat)
+ if (levelType == LevelType::lvl_flat)
{
return 1.0;
}
diff --git a/Minecraft.World/Dimension.h b/Minecraft.World/Dimension.h
index 5cccd68b..ca040e21 100644
--- a/Minecraft.World/Dimension.h
+++ b/Minecraft.World/Dimension.h
@@ -38,8 +38,8 @@ public:
virtual bool isValidSpawn(int x, int z) const;
- virtual float getTimeOfDay(__int64 time, float a) const;
- virtual int getMoonPhase(__int64 time) const;
+ virtual float getTimeOfDay(int64_t time, float a) const;
+ virtual int getMoonPhase(int64_t time) const;
virtual bool isNaturalDimension();
private:
static const int fogColor = 0xc0d8ff;
@@ -56,7 +56,7 @@ public:
virtual Pos *getSpawnPos();
int getSpawnYPosition();
- virtual bool hasBedrockFog();
+ virtual bool hasBedrockFog();
double getClearColorScale();
virtual bool isFoggyAt(int x, int z);
diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp
index facd949a..150df216 100644
--- a/Minecraft.World/DirectoryLevelStorage.cpp
+++ b/Minecraft.World/DirectoryLevelStorage.cpp
@@ -108,19 +108,19 @@ void _MapDataMappings_old::setMapping(int id, PlayerUID xuid, int dimension)
#ifdef _LARGE_WORLDS
void DirectoryLevelStorage::PlayerMappings::addMapping(int id, int centreX, int centreZ, int dimension, int scale)
{
- __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3);
+ int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3);
m_mappings[index] = id;
//app.DebugPrintf("Adding mapping: %d - (%d,%d)/%d/%d [%I64d - 0x%016llx]\n", id, centreX, centreZ, dimension, scale, index, index);
}
bool DirectoryLevelStorage::PlayerMappings::getMapping(int &id, int centreX, int centreZ, int dimension, int scale)
{
- //__int64 zMasked = centreZ & 0x1FFFFFFF;
- //__int64 xMasked = centreX & 0x1FFFFFFF;
- //__int64 zShifted = zMasked << 34;
- //__int64 xShifted = xMasked << 5;
+ //int64_t zMasked = centreZ & 0x1FFFFFFF;
+ //int64_t xMasked = centreX & 0x1FFFFFFF;
+ //int64_t zShifted = zMasked << 34;
+ //int64_t xShifted = xMasked << 5;
//app.DebugPrintf("xShifted = %d (0x%016x), zShifted = %I64d (0x%016llx)\n", xShifted, xShifted, zShifted, zShifted);
- __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3);
+ int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3);
auto it = m_mappings.find(index);
if(it != m_mappings.end())
{
@@ -151,7 +151,7 @@ void DirectoryLevelStorage::PlayerMappings::readMappings(DataInputStream *dis)
int count = dis->readInt();
for(unsigned int i = 0; i < count; ++i)
{
- __int64 index = dis->readLong();
+ int64_t index = dis->readLong();
int id = dis->readInt();
m_mappings[index] = id;
app.DebugPrintf(" -- %lld (0x%016llx) = %d\n", index, index, id);
diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h
index 3c811ef3..6d305ba3 100644
--- a/Minecraft.World/DirectoryLevelStorage.h
+++ b/Minecraft.World/DirectoryLevelStorage.h
@@ -54,7 +54,7 @@ typedef struct _MapDataMappings_old
void setMapping(int id, PlayerUID xuid, int dimension);
} MapDataMappings_old;
-class DirectoryLevelStorage : public LevelStorage, public PlayerIO
+class DirectoryLevelStorage : public LevelStorage, public PlayerIO
{
private:
/* 4J Jev, Probably no need for this as theres no exceptions being thrown.
@@ -65,7 +65,7 @@ private:
const ConsoleSavePath playerDir;
//const File dataDir;
const ConsoleSavePath dataDir;
- const __int64 sessionId;
+ const int64_t sessionId;
const wstring levelId;
static const wstring sc_szPlayerDir;
@@ -75,7 +75,7 @@ private:
{
friend class DirectoryLevelStorage;
private:
- unordered_map<__int64, short> m_mappings;
+ unordered_map<int64_t, short> m_mappings;
public:
void addMapping(int id, int centreX, int centreZ, int dimension, int scale);
@@ -92,7 +92,7 @@ private:
#else
MapDataMappings m_mapDataMappings;
MapDataMappings m_saveableMapDataMappings;
-#endif
+#endif
bool m_bHasLoadedMapDataMappings;
unordered_map<wstring, ByteArrayOutputStream *> m_cachedSaveData;
diff --git a/Minecraft.World/EmptyLevelChunk.cpp b/Minecraft.World/EmptyLevelChunk.cpp
index 1353ca4d..4a19e875 100644
--- a/Minecraft.World/EmptyLevelChunk.cpp
+++ b/Minecraft.World/EmptyLevelChunk.cpp
@@ -215,7 +215,7 @@ bool EmptyLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z
return false;
}
-Random *EmptyLevelChunk::getRandom(__int64 l)
+Random *EmptyLevelChunk::getRandom(int64_t l)
{
return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l);
}
diff --git a/Minecraft.World/EmptyLevelChunk.h b/Minecraft.World/EmptyLevelChunk.h
index 06bffea9..e22180df 100644
--- a/Minecraft.World/EmptyLevelChunk.h
+++ b/Minecraft.World/EmptyLevelChunk.h
@@ -49,7 +49,7 @@ public:
int getBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter
int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter
bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added
- Random *getRandom(__int64 l);
+ Random *getRandom(int64_t l);
bool isEmpty();
virtual void reSyncLighting() {}; // 4J added
};
diff --git a/Minecraft.World/EnchantmentMenu.h b/Minecraft.World/EnchantmentMenu.h
index e09b94c6..62408f1d 100644
--- a/Minecraft.World/EnchantmentMenu.h
+++ b/Minecraft.World/EnchantmentMenu.h
@@ -23,7 +23,7 @@ private:
bool m_costsChanged; // 4J Added
public:
- __int64 nameSeed;
+ int64_t nameSeed;
public:
int costs[3];
diff --git a/Minecraft.World/FileHeader.h b/Minecraft.World/FileHeader.h
index 4444409f..bfc6ff01 100644
--- a/Minecraft.World/FileHeader.h
+++ b/Minecraft.World/FileHeader.h
@@ -102,7 +102,7 @@ public:
};
- __int64 lastModifiedTime; // 8B
+ int64_t lastModifiedTime; // 8B
};
typedef FileEntrySaveDataV2 FileEntrySaveData;
@@ -128,7 +128,7 @@ public:
currentFilePointer = data.startOffset;
}
- unsigned int getFileSize() { return data.length; }
+ unsigned int getFileSize() { return data.length; }
bool isRegionFile() { return data.filename[0] == 0; } // When using ConsoleSaveFileSplit only
unsigned int getRegionFileIndex() { return data.regionIndex; } // When using ConsoleSaveFileSplit only
@@ -191,7 +191,7 @@ protected:
vector<FileEntry *> *getDatFilesWithMacAndUserID(const PlayerUID& pUID);
vector<FileEntry *> *getDatFilesWithPrimaryUser();
#endif
-
+
void setSaveVersion(int version) { m_saveVersion = version; }
int getSaveVersion() { return m_saveVersion; }
void setOriginalSaveVersion(int version) { m_originalSaveVersion = version; }
@@ -205,5 +205,5 @@ protected:
void setEndian(ByteOrder endian) { m_saveEndian = endian; }
static ByteOrder getEndian(ESavePlatform plat);
bool isLocalEndianDifferent(ESavePlatform plat){return m_localEndian != getEndian(plat); }
-
+
};
diff --git a/Minecraft.World/FileInputStream.cpp b/Minecraft.World/FileInputStream.cpp
index 7c0e844f..5e0f6ca5 100644
--- a/Minecraft.World/FileInputStream.cpp
+++ b/Minecraft.World/FileInputStream.cpp
@@ -164,8 +164,8 @@ void FileInputStream::close()
{
//printf("\n\nFileInputStream::close - TRYING TO CLOSE AN INVALID FILE HANDLE\n\n");
return;
- }
-
+ }
+
BOOL result = CloseHandle( m_fileHandle );
if( result == 0 )
@@ -185,7 +185,7 @@ void FileInputStream::close()
//n - the number of bytes to be skipped.
//Returns:
//the actual number of bytes skipped.
-__int64 FileInputStream::skip(__int64 n)
+int64_t FileInputStream::skip(int64_t n)
{
#ifdef _XBOX
LARGE_INTEGER li;
diff --git a/Minecraft.World/FileInputStream.h b/Minecraft.World/FileInputStream.h
index e855a2d7..99ce776f 100644
--- a/Minecraft.World/FileInputStream.h
+++ b/Minecraft.World/FileInputStream.h
@@ -12,7 +12,7 @@ public:
virtual int read(byteArray b);
virtual int read(byteArray b, unsigned int offset, unsigned int length);
virtual void close();
- virtual __int64 skip(__int64 n);
+ virtual int64_t skip(int64_t n);
private:
HANDLE m_fileHandle;
diff --git a/Minecraft.World/FlatLevelSource.cpp b/Minecraft.World/FlatLevelSource.cpp
index 7a31374e..ec2c0f96 100644
--- a/Minecraft.World/FlatLevelSource.cpp
+++ b/Minecraft.World/FlatLevelSource.cpp
@@ -11,7 +11,7 @@
//FlatLevelSource::villageFeature = new VillageFeature(1);
-FlatLevelSource::FlatLevelSource(Level *level, __int64 seed, bool generateStructures)
+FlatLevelSource::FlatLevelSource(Level *level, int64_t seed, bool generateStructures)
{
m_XZSize = level->getLevelData()->getXZSize();
@@ -32,26 +32,26 @@ FlatLevelSource::~FlatLevelSource()
delete villageFeature;
}
-void FlatLevelSource::prepareHeights(byteArray blocks)
+void FlatLevelSource::prepareHeights(byteArray blocks)
{
int height = blocks.length / (16 * 16);
- for (int xc = 0; xc < 16; xc++)
+ for (int xc = 0; xc < 16; xc++)
{
- for (int zc = 0; zc < 16; zc++)
+ for (int zc = 0; zc < 16; zc++)
{
- for (int yc = 0; yc < height; yc++)
+ for (int yc = 0; yc < height; yc++)
{
int block = 0;
- if (yc == 0)
+ if (yc == 0)
{
block = Tile::unbreakable_Id;
- }
- else if (yc <= 2)
+ }
+ else if (yc <= 2)
{
block = Tile::dirt_Id;
- }
- else if (yc == 3)
+ }
+ else if (yc == 3)
{
block = Tile::grass_Id;
}
@@ -61,12 +61,12 @@ void FlatLevelSource::prepareHeights(byteArray blocks)
}
}
-LevelChunk *FlatLevelSource::create(int x, int z)
+LevelChunk *FlatLevelSource::create(int x, int z)
{
return getChunk(x, z);
}
-LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs)
+LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs)
{
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
int chunksSize = Level::genDepth * 16 * 16;
@@ -80,7 +80,7 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs)
// double[] temperatures = level.getBiomeSource().temperatures;
- if (generateStructures)
+ if (generateStructures)
{
villageFeature->apply(this, level, xOffs, zOffs, blocks);
}
@@ -96,43 +96,43 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs)
}
-bool FlatLevelSource::hasChunk(int x, int y)
+bool FlatLevelSource::hasChunk(int x, int y)
{
return true;
}
-void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
+void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
{
// 4J - changed from random to pprandom so we can run in parallel with getChunk etc.
pprandom->setSeed(level->getSeed());
- __int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
- __int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t xScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
- if (generateStructures)
+ if (generateStructures)
{
villageFeature->postProcess(level, pprandom, xt, zt);
}
-
+
app.processSchematics(parent->getChunk(xt,zt));
}
-bool FlatLevelSource::save(bool force, ProgressListener *progressListener)
+bool FlatLevelSource::save(bool force, ProgressListener *progressListener)
{
return true;
}
-bool FlatLevelSource::tick()
+bool FlatLevelSource::tick()
{
return false;
}
-bool FlatLevelSource::shouldSave()
+bool FlatLevelSource::shouldSave()
{
return true;
}
-wstring FlatLevelSource::gatherStats()
+wstring FlatLevelSource::gatherStats()
{
return L"FlatLevelSource";
}
@@ -140,7 +140,7 @@ wstring FlatLevelSource::gatherStats()
vector<Biome::MobSpawnerData *> *FlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z)
{
Biome *biome = level->getBiome(x, z);
- if (biome == NULL)
+ if (biome == NULL)
{
return NULL;
}
diff --git a/Minecraft.World/FlatLevelSource.h b/Minecraft.World/FlatLevelSource.h
index 8f8a506d..99338cd9 100644
--- a/Minecraft.World/FlatLevelSource.h
+++ b/Minecraft.World/FlatLevelSource.h
@@ -24,13 +24,13 @@ private:
boolean generateStructures;
VillageFeature *villageFeature;// = new VillageFeature(1);
-public:
- FlatLevelSource(Level *level, __int64 seed, bool generateStructures);
+public:
+ FlatLevelSource(Level *level, int64_t seed, bool generateStructures);
~FlatLevelSource();
-private: void prepareHeights(byteArray blocks);
+private: void prepareHeights(byteArray blocks);
-public:
+public:
virtual LevelChunk *create(int x, int z);
virtual LevelChunk *getChunk(int xOffs, int zOffs);
virtual bool hasChunk(int x, int y);
diff --git a/Minecraft.World/FuzzyZoomLayer.cpp b/Minecraft.World/FuzzyZoomLayer.cpp
index 65c6709e..54155ff5 100644
--- a/Minecraft.World/FuzzyZoomLayer.cpp
+++ b/Minecraft.World/FuzzyZoomLayer.cpp
@@ -2,7 +2,7 @@
#include "System.h"
#include "net.minecraft.world.level.newbiome.layer.h"
-FuzzyZoomLayer::FuzzyZoomLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
@@ -61,7 +61,7 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d)
return d;
}
-shared_ptr<Layer>FuzzyZoomLayer::zoom(__int64 seed, shared_ptr<Layer>sup, int count)
+shared_ptr<Layer>FuzzyZoomLayer::zoom(int64_t seed, shared_ptr<Layer>sup, int count)
{
shared_ptr<Layer> result = sup;
for (int i = 0; i < count; i++)
diff --git a/Minecraft.World/FuzzyZoomLayer.h b/Minecraft.World/FuzzyZoomLayer.h
index bc8f5e48..19526931 100644
--- a/Minecraft.World/FuzzyZoomLayer.h
+++ b/Minecraft.World/FuzzyZoomLayer.h
@@ -5,7 +5,7 @@
class FuzzyZoomLayer : public Layer
{
public:
- FuzzyZoomLayer(__int64 seedMixup, shared_ptr<Layer>parent);
+ FuzzyZoomLayer(int64_t seedMixup, shared_ptr<Layer>parent);
intArray getArea(int xo, int yo, int w, int h);
protected:
@@ -13,5 +13,5 @@ protected:
int random(int a, int b, int c, int d);
public:
- static shared_ptr<Layer>zoom(__int64 seed, shared_ptr<Layer>sup, int count);
+ static shared_ptr<Layer>zoom(int64_t seed, shared_ptr<Layer>sup, int count);
}; \ No newline at end of file
diff --git a/Minecraft.World/GZIPInputStream.h b/Minecraft.World/GZIPInputStream.h
index f852518b..b9242576 100644
--- a/Minecraft.World/GZIPInputStream.h
+++ b/Minecraft.World/GZIPInputStream.h
@@ -13,5 +13,5 @@ public:
virtual int read(byteArray b) { return stream->read( b ); };
virtual int read(byteArray b, unsigned int offset, unsigned int length) { return stream->read(b, offset, length); };
virtual void close() { return stream->close(); };
- virtual __int64 skip(__int64 n) { return 0; };
+ virtual int64_t skip(int64_t n) { return 0; };
}; \ No newline at end of file
diff --git a/Minecraft.World/GrowMushroomIslandLayer.cpp b/Minecraft.World/GrowMushroomIslandLayer.cpp
index 14857366..d204502d 100644
--- a/Minecraft.World/GrowMushroomIslandLayer.cpp
+++ b/Minecraft.World/GrowMushroomIslandLayer.cpp
@@ -3,7 +3,7 @@
#include "net.minecraft.world.level.biome.h"
-GrowMushroomIslandLayer::GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
+GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
{
this->parent = parent;
}
@@ -25,10 +25,10 @@ intArray GrowMushroomIslandLayer::getArea(int xo, int yo, int w, int h)
int n2 = p[(x + 2) + (y + 0) * pw];
int n3 = p[(x + 0) + (y + 2) * pw];
int n4 = p[(x + 2) + (y + 2) * pw];
-
+
int c = p[(x + 1) + (y + 1) * pw];
- if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) )
+ if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) )
{
result[x + y * w] = Biome::mushroomIsland->id;
}
diff --git a/Minecraft.World/GrowMushroomIslandLayer.h b/Minecraft.World/GrowMushroomIslandLayer.h
index 3bca4d5c..6b0860f7 100644
--- a/Minecraft.World/GrowMushroomIslandLayer.h
+++ b/Minecraft.World/GrowMushroomIslandLayer.h
@@ -4,6 +4,6 @@
class GrowMushroomIslandLayer : public Layer
{
public:
- GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr<Layer> parent);
+ GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/HellDimension.cpp b/Minecraft.World/HellDimension.cpp
index 85e2a25a..63cb0df7 100644
--- a/Minecraft.World/HellDimension.cpp
+++ b/Minecraft.World/HellDimension.cpp
@@ -48,7 +48,7 @@ ChunkSource *HellDimension::createRandomLevelSource() const
}
else
#endif
- if (levelType == LevelType::lvl_flat)
+ if (levelType == LevelType::lvl_flat)
{
return new HellFlatLevelSource(level, level->getSeed());
}
@@ -68,7 +68,7 @@ bool HellDimension::isValidSpawn(int x, int z) const
return false;
}
-float HellDimension::getTimeOfDay(__int64 time, float a) const
+float HellDimension::getTimeOfDay(int64_t time, float a) const
{
return 0.5f;
}
diff --git a/Minecraft.World/HellDimension.h b/Minecraft.World/HellDimension.h
index b37f2b53..fa95d9b2 100644
--- a/Minecraft.World/HellDimension.h
+++ b/Minecraft.World/HellDimension.h
@@ -14,7 +14,7 @@ public:
virtual ChunkSource *createRandomLevelSource() const;
virtual bool isNaturalDimension();
virtual bool isValidSpawn(int x, int y) const;
- virtual float getTimeOfDay(__int64 time, float a) const;
+ virtual float getTimeOfDay(int64_t time, float a) const;
virtual bool mayRespawn() const;
virtual bool isFoggyAt(int x, int z);
diff --git a/Minecraft.World/HellFlatLevelSource.cpp b/Minecraft.World/HellFlatLevelSource.cpp
index 4957f617..95144627 100644
--- a/Minecraft.World/HellFlatLevelSource.cpp
+++ b/Minecraft.World/HellFlatLevelSource.cpp
@@ -4,7 +4,7 @@
#include "net.minecraft.world.level.storage.h"
#include "HellFlatLevelSource.h"
-HellFlatLevelSource::HellFlatLevelSource(Level *level, __int64 seed)
+HellFlatLevelSource::HellFlatLevelSource(Level *level, int64_t seed)
{
int xzSize = level->getLevelData()->getXZSize();
int hellScale = level->getLevelData()->getHellScale();
@@ -26,17 +26,17 @@ void HellFlatLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks)
{
int height = blocks.length / (16 * 16);
- for (int xc = 0; xc < 16; xc++)
+ for (int xc = 0; xc < 16; xc++)
{
- for (int zc = 0; zc < 16; zc++)
+ for (int zc = 0; zc < 16; zc++)
{
- for (int yc = 0; yc < height; yc++)
+ for (int yc = 0; yc < height; yc++)
{
int block = 0;
if ( (yc <= 6) || ( yc >= 121 ) )
{
block = Tile::netherRack_Id;
- }
+ }
blocks[xc << 11 | zc << 7 | yc] = (byte) block;
}
@@ -159,8 +159,8 @@ void HellFlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
// we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value
// is consistent for each world generation. Also changed all uses of random here to pprandom.
pprandom->setSeed(level->getSeed());
- __int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
- __int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t xScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
int count = pprandom->nextInt(pprandom->nextInt(10) + 1) + 1;
@@ -211,7 +211,7 @@ wstring HellFlatLevelSource::gatherStats()
vector<Biome::MobSpawnerData *> *HellFlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z)
{
Biome *biome = level->getBiome(x, z);
- if (biome == NULL)
+ if (biome == NULL)
{
return NULL;
}
diff --git a/Minecraft.World/HellFlatLevelSource.h b/Minecraft.World/HellFlatLevelSource.h
index 2e58f160..4ad94891 100644
--- a/Minecraft.World/HellFlatLevelSource.h
+++ b/Minecraft.World/HellFlatLevelSource.h
@@ -26,7 +26,7 @@ private:
Level *level;
public:
- HellFlatLevelSource(Level *level, __int64 seed);
+ HellFlatLevelSource(Level *level, int64_t seed);
~HellFlatLevelSource();
private:
diff --git a/Minecraft.World/HellRandomLevelSource.cpp b/Minecraft.World/HellRandomLevelSource.cpp
index 31bb3d69..66444d13 100644
--- a/Minecraft.World/HellRandomLevelSource.cpp
+++ b/Minecraft.World/HellRandomLevelSource.cpp
@@ -7,7 +7,7 @@
#include "BiomeSource.h"
#include "HellRandomLevelSource.h"
-HellRandomLevelSource::HellRandomLevelSource(Level *level, __int64 seed)
+HellRandomLevelSource::HellRandomLevelSource(Level *level, int64_t seed)
{
int xzSize = level->getLevelData()->getXZSize();
int hellScale = level->getLevelData()->getHellScale();
@@ -430,8 +430,8 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
// we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value
// is consistent for each world generation. Also changed all uses of random here to pprandom.
pprandom->setSeed(level->getSeed());
- __int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
- __int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t xScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
netherBridgeFeature->postProcess(level, pprandom, xt, zt);
diff --git a/Minecraft.World/HellRandomLevelSource.h b/Minecraft.World/HellRandomLevelSource.h
index 2a0c3c86..5142aa28 100644
--- a/Minecraft.World/HellRandomLevelSource.h
+++ b/Minecraft.World/HellRandomLevelSource.h
@@ -37,7 +37,7 @@ private:
Level *level;
public:
- HellRandomLevelSource(Level *level, __int64 seed);
+ HellRandomLevelSource(Level *level, int64_t seed);
~HellRandomLevelSource();
NetherBridgeFeature *netherBridgeFeature;
diff --git a/Minecraft.World/InputStream.h b/Minecraft.World/InputStream.h
index af0ff593..234e85b5 100644
--- a/Minecraft.World/InputStream.h
+++ b/Minecraft.World/InputStream.h
@@ -11,7 +11,7 @@ public:
virtual int read(byteArray b) = 0;
virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0;
virtual void close() = 0;
- virtual __int64 skip(__int64 n) = 0;
+ virtual int64_t skip(int64_t n) = 0;
static InputStream *getResourceAsStream(const wstring &fileName);
}; \ No newline at end of file
diff --git a/Minecraft.World/IslandLayer.cpp b/Minecraft.World/IslandLayer.cpp
index b502f384..0a6cc3fa 100644
--- a/Minecraft.World/IslandLayer.cpp
+++ b/Minecraft.World/IslandLayer.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "net.minecraft.world.level.newbiome.layer.h"
-IslandLayer::IslandLayer(__int64 seedMixup) : Layer(seedMixup)
+IslandLayer::IslandLayer(int64_t seedMixup) : Layer(seedMixup)
{
}
diff --git a/Minecraft.World/IslandLayer.h b/Minecraft.World/IslandLayer.h
index 09e90eb3..90995636 100644
--- a/Minecraft.World/IslandLayer.h
+++ b/Minecraft.World/IslandLayer.h
@@ -5,7 +5,7 @@
class IslandLayer : public Layer
{
public:
- IslandLayer(__int64 seedMixup);
+ IslandLayer(int64_t seedMixup);
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/JavaMath.cpp b/Minecraft.World/JavaMath.cpp
index 92843695..87778c56 100644
--- a/Minecraft.World/JavaMath.cpp
+++ b/Minecraft.World/JavaMath.cpp
@@ -34,9 +34,9 @@ double Math::random()
//a - a floating-point value to be rounded to a long.
//Returns:
//the value of the argument rounded to the nearest long value.
-__int64 Math::round( double d )
+int64_t Math::round( double d )
{
- return (__int64)floor( d + 0.5 );
+ return (int64_t)floor( d + 0.5 );
}
int Math::_max(int a, int b)
@@ -59,7 +59,7 @@ float Math::_min(float a, float b)
return a < b ? a : b;
}
-float Math::wrapDegrees(float input)
+float Math::wrapDegrees(float input)
{
while(input>=360.0f)input-=360.0f;
if (input >= 180.0f) input -= 360.0f;
@@ -67,7 +67,7 @@ float Math::wrapDegrees(float input)
return input;
}
-double Math::wrapDegrees(double input)
+double Math::wrapDegrees(double input)
{
while(input>=360.0)input-=360.0;
if (input >= 180.0) input -= 360.0;
diff --git a/Minecraft.World/JavaMath.h b/Minecraft.World/JavaMath.h
index fcd095c8..b64832e9 100644
--- a/Minecraft.World/JavaMath.h
+++ b/Minecraft.World/JavaMath.h
@@ -8,7 +8,7 @@ private:
public:
static double random();
- static __int64 round( double d );
+ static int64_t round( double d );
static int _max(int a, int b);
static float _max(float a, float b);
static int _min(int a, int b);
diff --git a/Minecraft.World/LargeCaveFeature.cpp b/Minecraft.World/LargeCaveFeature.cpp
index c05447cf..5ca539d5 100644
--- a/Minecraft.World/LargeCaveFeature.cpp
+++ b/Minecraft.World/LargeCaveFeature.cpp
@@ -4,12 +4,12 @@
#include "net.minecraft.world.level.biome.h"
#include "LargeCaveFeature.h"
-void LargeCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom)
+void LargeCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom)
{
addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5);
}
-void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale)
+void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale)
{
double xMid = xOffs * 16 + 8;
double zMid = zOffs * 16 + 8;
@@ -123,7 +123,7 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b
}
if (detectedWater) continue;
- for (int xx = x0; xx < x1; xx++)
+ for (int xx = x0; xx < x1; xx++)
{
double xd = ((xx + xOffs * 16 + 0.5) - xCave) / rad;
for (int zz = z0; zz < z1; zz++)
@@ -142,7 +142,7 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b
if (block == Tile::grass_Id) hasGrass = true;
if (block == Tile::stone_Id || block == Tile::dirt_Id || block == Tile::grass_Id)
{
- if (yy < 10)
+ if (yy < 10)
{
blocks[p] = (byte) Tile::lava_Id;
}
diff --git a/Minecraft.World/LargeCaveFeature.h b/Minecraft.World/LargeCaveFeature.h
index 5188aca7..66eadde9 100644
--- a/Minecraft.World/LargeCaveFeature.h
+++ b/Minecraft.World/LargeCaveFeature.h
@@ -5,7 +5,7 @@
class LargeCaveFeature : public LargeFeature
{
protected:
- void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom);
- void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale);
+ void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom);
+ void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale);
virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks);
};
diff --git a/Minecraft.World/LargeFeature.cpp b/Minecraft.World/LargeFeature.cpp
index 2e43fac7..23dc532f 100644
--- a/Minecraft.World/LargeFeature.cpp
+++ b/Minecraft.World/LargeFeature.cpp
@@ -21,15 +21,15 @@ void LargeFeature::apply(ChunkSource *ChunkSource, Level *level, int xOffs, int
this->level = level;
random->setSeed(level->getSeed());
- __int64 xScale = random->nextLong();
- __int64 zScale = random->nextLong();
+ int64_t xScale = random->nextLong();
+ int64_t zScale = random->nextLong();
for (int x = xOffs - r; x <= xOffs + r; x++)
{
for (int z = zOffs - r; z <= zOffs + r; z++)
{
- __int64 xx = x * xScale;
- __int64 zz = z * zScale;
+ int64_t xx = x * xScale;
+ int64_t zz = z * zScale;
random->setSeed(xx ^ zz ^ level->getSeed());
addFeature(level, x, z, xOffs, zOffs, blocks);
}
diff --git a/Minecraft.World/LargeHellCaveFeature.cpp b/Minecraft.World/LargeHellCaveFeature.cpp
index b1e636eb..6aa1aec5 100644
--- a/Minecraft.World/LargeHellCaveFeature.cpp
+++ b/Minecraft.World/LargeHellCaveFeature.cpp
@@ -3,12 +3,12 @@
#include "LargeHellCaveFeature.h"
#include "net.minecraft.world.level.tile.h"
-void LargeHellCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom)
+void LargeHellCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom)
{
addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5);
}
-void LargeHellCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale)
+void LargeHellCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale)
{
double xMid = xOffs * 16 + 8;
double zMid = zOffs * 16 + 8;
diff --git a/Minecraft.World/LargeHellCaveFeature.h b/Minecraft.World/LargeHellCaveFeature.h
index ab6558b8..4217c8b0 100644
--- a/Minecraft.World/LargeHellCaveFeature.h
+++ b/Minecraft.World/LargeHellCaveFeature.h
@@ -5,7 +5,7 @@
class LargeHellCaveFeature : public LargeFeature
{
protected:
- void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom);
- void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale);
+ void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom);
+ void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale);
virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks);
};
diff --git a/Minecraft.World/Layer.cpp b/Minecraft.World/Layer.cpp
index 956a8917..f90f1fa8 100644
--- a/Minecraft.World/Layer.cpp
+++ b/Minecraft.World/Layer.cpp
@@ -16,7 +16,7 @@ libdivide::divider<long long> fast_d7(7);
libdivide::divider<long long> fast_d10(10);
#endif
-LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType)
+LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType)
{
// 4J - Some changes moved here from 1.2.3. Temperature & downfall layers are no longer created & returned, and a debug layer is isn't.
// For reference with regard to future merging, things NOT brought forward from the 1.2.3 version are new layer types that we
@@ -58,7 +58,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType)
biomeLayer = shared_ptr<Layer>(new ZoomLayer(1000 + i, biomeLayer));
if (i == 0) biomeLayer = shared_ptr<Layer>(new AddIslandLayer(3, biomeLayer));
-
+
if (i == 0)
{
// 4J - moved mushroom islands to here. This skips 3 zooms that the old location of the add was, making them about 1/8 of the original size. Adding
@@ -68,13 +68,13 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType)
}
if (i == 1 )
- {
+ {
// 4J - now expand mushroom islands up again. This does a simple region grow to add a new mushroom island element when any of the neighbours are also mushroom islands.
// This helps make the islands into nice compact shapes of the type that are actually likely to be able to make an island out of the sea in a small space. Also
// helps the shore layer from doing too much damage in shrinking the islands we are making
- biomeLayer = shared_ptr<Layer>(new GrowMushroomIslandLayer(5, biomeLayer));
+ biomeLayer = shared_ptr<Layer>(new GrowMushroomIslandLayer(5, biomeLayer));
// Note - this reduces the size of mushroom islands by turning their edges into shores. We are doing this at i == 1 rather than i == 0 as the original does
- biomeLayer = shared_ptr<Layer>(new ShoreLayer(1000, biomeLayer));
+ biomeLayer = shared_ptr<Layer>(new ShoreLayer(1000, biomeLayer));
biomeLayer = shared_ptr<Layer>(new SwampRiversLayer(1000, biomeLayer));
}
@@ -107,7 +107,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType)
return result;
}
-Layer::Layer(__int64 seedMixup)
+Layer::Layer(int64_t seedMixup)
{
parent = nullptr;
@@ -120,7 +120,7 @@ Layer::Layer(__int64 seedMixup)
this->seedMixup += seedMixup;
}
-void Layer::init(__int64 seed)
+void Layer::init(int64_t seed)
{
this->seed = seed;
if (parent != NULL) parent->init(seed);
@@ -132,7 +132,7 @@ void Layer::init(__int64 seed)
this->seed += seedMixup;
}
-void Layer::initRandom(__int64 x, __int64 y)
+void Layer::initRandom(int64_t x, int64_t y)
{
rval = seed;
rval *= rval * 6364136223846793005l + 1442695040888963407l;
diff --git a/Minecraft.World/Layer.h b/Minecraft.World/Layer.h
index a444a629..6f31e94a 100644
--- a/Minecraft.World/Layer.h
+++ b/Minecraft.World/Layer.h
@@ -11,22 +11,22 @@ class LevelType;
class Layer
{
private:
- __int64 seed;
+ int64_t seed;
protected:
shared_ptr<Layer>parent;
private:
- __int64 rval;
- __int64 seedMixup;
+ int64_t rval;
+ int64_t seedMixup;
public:
- static LayerArray getDefaultLayers(__int64 seed, LevelType *levelType);
+ static LayerArray getDefaultLayers(int64_t seed, LevelType *levelType);
- Layer(__int64 seedMixup);
+ Layer(int64_t seedMixup);
- virtual void init(__int64 seed);
- virtual void initRandom(__int64 x, __int64 y);
+ virtual void init(int64_t seed);
+ virtual void initRandom(int64_t x, int64_t y);
protected:
int nextRandom(int max);
diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp
index b977ad7d..ef79fb39 100644
--- a/Minecraft.World/Level.cpp
+++ b/Minecraft.World/Level.cpp
@@ -178,7 +178,7 @@ void Level::initCacheComplete(lightCache_t *cache, int xc, int yc, int zc)
}
// Set a brightness value, going through the cache if enabled for this thread
-void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness)
+void inline Level::setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness)
{
if( cache == NULL )
{
@@ -195,8 +195,8 @@ void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse,
( ( z & 0x3f0 ) >> 4 );
#ifdef _LARGE_WORLDS
// Add in the higher bits for x and z
- posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) |
- ( ( ((__uint64)z) & 0x3FFFC00L) << 22);
+ posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) |
+ ( ( ((uint64_t)z) & 0x3FFFC00L) << 22);
#endif
lightCache_t cacheValue = cache[idx];
@@ -254,8 +254,8 @@ inline int Level::getBrightnessCached(lightCache_t *cache, LightLayer::variety l
( ( z & 0x3f0 ) >> 4 );
#ifdef _LARGE_WORLDS
// Add in the higher bits for x and z
- posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) |
- ( ( ((__uint64)z) & 0x3FFFC00L) << 22);
+ posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) |
+ ( ( ((uint64_t)z) & 0x3FFFC00L) << 22);
#endif
lightCache_t cacheValue = cache[idx];
@@ -321,8 +321,8 @@ inline int Level::getEmissionCached(lightCache_t *cache, int ct, int x, int y, i
( ( z & 0x3f0 ) >> 4 );
#ifdef _LARGE_WORLDS
// Add in the higher bits for x and z
- posbits |= ( ( ((__uint64)x) & 0x3FFFC00) << 38) |
- ( ( ((__uint64)z) & 0x3FFFC00) << 22);
+ posbits |= ( ( ((uint64_t)x) & 0x3FFFC00) << 38) |
+ ( ( ((uint64_t)z) & 0x3FFFC00) << 22);
#endif
lightCache_t cacheValue = cache[idx];
@@ -397,8 +397,8 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay
( ( z & 0x3f0 ) >> 4 );
#ifdef _LARGE_WORLDS
// Add in the higher bits for x and z
- posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) |
- ( ( ((__uint64)z) & 0x3FFFC00L) << 22);
+ posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) |
+ ( ( ((uint64_t)z) & 0x3FFFC00L) << 22);
#endif
lightCache_t cacheValue = cache[idx];
@@ -460,7 +460,7 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay
// this hasn't been updated (for client threads) for each individual lighting update as would have been the case with the non-cached lighting. There's two reasons for this
// (1) it's more efficient, since we aren't doing so many individual calls to the level listener to let the renderer know what has been updated
// (2) it lets the lighting actually complete before we get any visual representation of the update, otherwise we end up seeing some strange partial updates
-void Level::flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer)
+void Level::flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer)
{
// cacheUse has a single bit for each x, y and z to say whether anything with that x, y or z has been written to
if( cacheUse == 0 ) return;
@@ -3438,7 +3438,7 @@ int Level::getExpectedLight(lightCache_t *cache, int x, int y, int z, LightLayer
void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool force, bool rootOnlyEmissive)
{
lightCache_t *cache = (lightCache_t *)TlsGetValue(tlsIdxLightCache);
- __uint64 cacheUse = 0;
+ uint64_t cacheUse = 0;
if( force )
{
@@ -4281,13 +4281,13 @@ void Level::checkSession()
}
-void Level::setGameTime(__int64 time)
+void Level::setGameTime(int64_t time)
{
// 4J : WESTY : Added to track game time played by players for other awards.
if (time != 0) // Ignore setting time to 0, done at level start and during tutorial.
{
// Determine step in time and ensure it is reasonable ( we only have an int to store the player stat).
- __int64 timeDiff = time - levelData->getGameTime();
+ int64_t timeDiff = time - levelData->getGameTime();
if (timeDiff < 0)
{
@@ -4313,22 +4313,22 @@ void Level::setGameTime(__int64 time)
levelData->setGameTime(time);
}
-__int64 Level::getSeed()
+int64_t Level::getSeed()
{
return levelData->getSeed();
}
-__int64 Level::getGameTime()
+int64_t Level::getGameTime()
{
return levelData->getGameTime();
}
-__int64 Level::getDayTime()
+int64_t Level::getDayTime()
{
return levelData->getDayTime();
}
-void Level::setDayTime(__int64 newTime)
+void Level::setDayTime(int64_t newTime)
{
levelData->setDayTime(newTime);
}
@@ -4524,7 +4524,7 @@ Tickable *Level::makeSoundUpdater(shared_ptr<Minecart> minecart)
Random *Level::getRandomFor(int x, int z, int blend)
{
- __int64 seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend;
+ int64_t seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend;
random->setSeed(seed);
return random;
}
diff --git a/Minecraft.World/Level.h b/Minecraft.World/Level.h
index 6e6b28cd..946b21e3 100644
--- a/Minecraft.World/Level.h
+++ b/Minecraft.World/Level.h
@@ -245,27 +245,27 @@ public:
void setBrightnessNoUpdateOnClient(LightLayer::variety layer, int x, int y, int z, int brightness); // 4J added
#ifdef _LARGE_WORLDS
- typedef __uint64 lightCache_t;
+ typedef uint64_t lightCache_t;
#else
typedef unsigned int lightCache_t;
#endif
- inline void setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness);
+ inline void setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness);
inline int getBrightnessCached(lightCache_t *cache, LightLayer::variety layer, int x, int y, int z);
inline int getEmissionCached(lightCache_t *cache, int ct, int x, int y, int z);
inline int getBlockingCached(lightCache_t *cache, LightLayer::variety layer, int *ct, int x, int y, int z);
void initCachePartial(lightCache_t *cache, int xc, int yc, int zc);
void initCacheComplete(lightCache_t *cache, int xc, int yc, int zc);
- void flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer);
+ void flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer);
bool cachewritten;
static const int LIGHTING_SHIFT = 24;
static const int BLOCKING_SHIFT = 20;
static const int EMISSION_SHIFT = 16;
#ifdef _LARGE_WORLDS
- static const __int64 LIGHTING_WRITEBACK = 0x80000000LL;
- static const __int64 EMISSION_VALID = 0x40000000LL;
- static const __int64 BLOCKING_VALID = 0x20000000LL;
- static const __int64 LIGHTING_VALID = 0x10000000LL;
+ static const int64_t LIGHTING_WRITEBACK = 0x80000000LL;
+ static const int64_t EMISSION_VALID = 0x40000000LL;
+ static const int64_t BLOCKING_VALID = 0x20000000LL;
+ static const int64_t LIGHTING_VALID = 0x10000000LL;
static const lightCache_t POSITION_MASK = 0xffffffff0000ffffLL;
#else
static const int LIGHTING_WRITEBACK = 0x80000000;
@@ -465,11 +465,11 @@ public:
void setBlocksAndData(int x, int y, int z, int xs, int ys, int zs, byteArray data, bool includeLighting = true);
virtual void disconnect(bool sendDisconnect = true);
void checkSession();
- void setGameTime(__int64 time);
- __int64 getSeed();
- __int64 getGameTime();
- __int64 getDayTime();
- void setDayTime(__int64 newTime);
+ void setGameTime(int64_t time);
+ int64_t getSeed();
+ int64_t getGameTime();
+ int64_t getDayTime();
+ void setDayTime(int64_t newTime);
Pos *getSharedSpawnPos();
void setSpawnPos(int x, int y, int z);
void setSpawnPos(Pos *spawnPos);
diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp
index d4be5ac2..e4958ecf 100644
--- a/Minecraft.World/LevelChunk.cpp
+++ b/Minecraft.World/LevelChunk.cpp
@@ -394,7 +394,7 @@ void LevelChunk::startSharingTilesAndData(int forceMs)
else
{
// Only force if it has been more than forceMs milliseconds since we last wanted to unshare this chunk
- __int64 timenow = System::currentTimeMillis();
+ int64_t timenow = System::currentTimeMillis();
if( ( timenow - lastUnsharedTime ) < forceMs )
{
LeaveCriticalSection(&m_csSharing);
@@ -1940,7 +1940,7 @@ void LevelChunk::setCheckAllLight()
checkLightPosition = 0;
}
-Random *LevelChunk::getRandom(__int64 l)
+Random *LevelChunk::getRandom(int64_t l)
{
return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l);
}
diff --git a/Minecraft.World/LevelChunk.h b/Minecraft.World/LevelChunk.h
index 661fbdac..fdb2ba6c 100644
--- a/Minecraft.World/LevelChunk.h
+++ b/Minecraft.World/LevelChunk.h
@@ -109,7 +109,7 @@ public:
static const int sTerrainPopulatedFromS = 8;
static const int sTerrainPopulatedFromSW = 16;
static const int sTerrainPopulatedAllAffecting = 30; // All the post-processing that can actually place tiles in this chunk are complete
- static const int sTerrainPopulatedFromNW = 32;
+ static const int sTerrainPopulatedFromNW = 32;
static const int sTerrainPopulatedFromN = 64;
static const int sTerrainPopulatedFromNE = 128;
static const int sTerrainPopulatedFromE = 256;
@@ -135,11 +135,11 @@ public:
void stopSharingTilesAndData(); // 4J added
virtual void reSyncLighting(); // 4J added
void startSharingTilesAndData(int forceMs = 0); // 4J added
- __int64 lastUnsharedTime; // 4J added
- __int64 lastSaveTime;
+ int64_t lastUnsharedTime; // 4J added
+ int64_t lastSaveTime;
bool seenByPlayer;
int lowestHeightmap;
- __int64 inhabitedTime;
+ int64_t inhabitedTime;
#ifdef _LARGE_WORLDS
bool m_bUnloaded;
@@ -217,7 +217,7 @@ public:
virtual bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added
virtual void setCheckAllLight();
- virtual Random *getRandom(__int64 l);
+ virtual Random *getRandom(int64_t l);
virtual bool isEmpty();
virtual void attemptCompression();
@@ -243,9 +243,9 @@ public:
byteArray getBiomes();
void setBiomes(byteArray biomes);
bool biomeHasRain(int x, int z); // 4J added
- bool biomeHasSnow(int x, int z); // 4J added
+ bool biomeHasSnow(int x, int z); // 4J added
private:
- void updateBiomeFlags(int x, int z); // 4J added
+ void updateBiomeFlags(int x, int z); // 4J added
public:
void compressLighting(); // 4J added
void compressBlocks(); // 4J added
diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp
index 91b72fe8..05bc2060 100644
--- a/Minecraft.World/LevelData.cpp
+++ b/Minecraft.World/LevelData.cpp
@@ -14,18 +14,18 @@ LevelData::LevelData(CompoundTag *tag)
{
seed = tag->getLong(L"RandomSeed");
m_pGenerator = LevelType::lvl_normal;
- if (tag->contains(L"generatorName"))
+ if (tag->contains(L"generatorName"))
{
wstring generatorName = tag->getString(L"generatorName");
m_pGenerator = LevelType::getLevelType(generatorName);
- if (m_pGenerator == NULL)
+ if (m_pGenerator == NULL)
{
m_pGenerator = LevelType::lvl_normal;
- }
- else if (m_pGenerator->hasReplacement())
+ }
+ else if (m_pGenerator->hasReplacement())
{
int generatorVersion = 0;
- if (tag->contains(L"generatorVersion"))
+ if (tag->contains(L"generatorVersion"))
{
generatorVersion = tag->getInt(L"generatorVersion");
}
@@ -96,7 +96,7 @@ LevelData::LevelData(CompoundTag *tag)
hasBeenInCreative = tag->getBoolean(L"hasBeenInCreative"); // 4J added so we can not award achievements to levels modified in creative
// 4J added - for stronghold position
- bStronghold = tag->getBoolean(L"hasStronghold");
+ bStronghold = tag->getBoolean(L"hasStronghold");
if(bStronghold==false)
{
@@ -111,7 +111,7 @@ LevelData::LevelData(CompoundTag *tag)
}
// 4J added - for stronghold end portal position
- bStrongholdEndPortal = tag->getBoolean(L"hasStrongholdEndPortal");
+ bStrongholdEndPortal = tag->getBoolean(L"hasStrongholdEndPortal");
if(bStrongholdEndPortal==false)
{
@@ -148,7 +148,7 @@ LevelData::LevelData(CompoundTag *tag)
default: assert(0); break;
}
assert(newWorldSize > m_xzSize);
- m_xzSize = newWorldSize;
+ m_xzSize = newWorldSize;
m_hellScale = newHellScale;
}
#endif
@@ -182,20 +182,20 @@ LevelData::LevelData(CompoundTag *tag)
#endif
/* 4J - we don't store this anymore
- if (tag->contains(L"Player"))
+ if (tag->contains(L"Player"))
{
loadedPlayerTag = tag->getCompound(L"Player");
dimension = loadedPlayerTag->getInt(L"Dimension");
}
else
- {
+ {
this->loadedPlayerTag = NULL;
}
*/
dimension = 0;
}
-LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName)
+LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName)
{
seed = levelSettings->getSeed();
gameType = levelSettings->getGameType();
@@ -207,7 +207,7 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName)
generatorOptions = levelSettings->getLevelTypeOptions();
allowCommands = levelSettings->getAllowCommands();
- // 4J Stu - Default initers
+ // 4J Stu - Default initers
xSpawn = 0;
ySpawn = 0;
zSpawn = 0;
@@ -319,13 +319,13 @@ CompoundTag *LevelData::createTag()
return tag;
}
-CompoundTag *LevelData::createTag(vector<shared_ptr<Player> > *players)
+CompoundTag *LevelData::createTag(vector<shared_ptr<Player> > *players)
{
// 4J - removed all code for storing tags for players
return createTag();
}
-void LevelData::setTagData(CompoundTag *tag)
+void LevelData::setTagData(CompoundTag *tag)
{
tag->putLong(L"RandomSeed", seed);
tag->putString(L"generatorName", m_pGenerator->getGeneratorName());
@@ -373,17 +373,17 @@ void LevelData::setTagData(CompoundTag *tag)
tag->putInt(L"HellScale", m_hellScale);
}
-__int64 LevelData::getSeed()
+int64_t LevelData::getSeed()
{
return seed;
}
-int LevelData::getXSpawn()
+int LevelData::getXSpawn()
{
return xSpawn;
}
-int LevelData::getYSpawn()
+int LevelData::getYSpawn()
{
return ySpawn;
}
@@ -393,7 +393,7 @@ int LevelData::getZSpawn()
return zSpawn;
}
-int LevelData::getXStronghold()
+int LevelData::getXStronghold()
{
return xStronghold;
}
@@ -404,7 +404,7 @@ int LevelData::getZStronghold()
return zStronghold;
}
-int LevelData::getXStrongholdEndPortal()
+int LevelData::getXStrongholdEndPortal()
{
return xStrongholdEndPortal;
}
@@ -415,17 +415,17 @@ int LevelData::getZStrongholdEndPortal()
return zStrongholdEndPortal;
}
-__int64 LevelData::getGameTime()
+int64_t LevelData::getGameTime()
{
return gameTime;
}
-__int64 LevelData::getDayTime()
+int64_t LevelData::getDayTime()
{
return dayTime;
}
-__int64 LevelData::getSizeOnDisk()
+int64_t LevelData::getSizeOnDisk()
{
return sizeOnDisk;
}
@@ -441,7 +441,7 @@ CompoundTag *LevelData::getLoadedPlayerTag()
// return dimension;
//}
-void LevelData::setSeed(__int64 seed)
+void LevelData::setSeed(int64_t seed)
{
this->seed = seed;
}
@@ -451,7 +451,7 @@ void LevelData::setXSpawn(int xSpawn)
this->xSpawn = xSpawn;
}
-void LevelData::setYSpawn(int ySpawn)
+void LevelData::setYSpawn(int ySpawn)
{
this->ySpawn = ySpawn;
}
@@ -502,17 +502,17 @@ void LevelData::setZStrongholdEndPortal(int zStrongholdEndPortal)
this->zStrongholdEndPortal = zStrongholdEndPortal;
}
-void LevelData::setGameTime(__int64 time)
+void LevelData::setGameTime(int64_t time)
{
gameTime = time;
}
-void LevelData::setDayTime(__int64 time)
+void LevelData::setDayTime(int64_t time)
{
dayTime = time;
}
-void LevelData::setSizeOnDisk(__int64 sizeOnDisk)
+void LevelData::setSizeOnDisk(int64_t sizeOnDisk)
{
this->sizeOnDisk = sizeOnDisk;
}
@@ -524,7 +524,7 @@ void LevelData::setLoadedPlayerTag(CompoundTag *loadedPlayerTag)
}
// 4J Remove TU9 as it's never used
-//void LevelData::setDimension(int dimension)
+//void LevelData::setDimension(int dimension)
//{
// this->dimension = dimension;
//}
@@ -536,7 +536,7 @@ void LevelData::setSpawn(int xSpawn, int ySpawn, int zSpawn)
this->zSpawn = zSpawn;
}
-wstring LevelData::getLevelName()
+wstring LevelData::getLevelName()
{
return levelName;
}
@@ -546,7 +546,7 @@ void LevelData::setLevelName(const wstring& levelName)
this->levelName = levelName;
}
-int LevelData::getVersion()
+int LevelData::getVersion()
{
return version;
}
@@ -556,7 +556,7 @@ void LevelData::setVersion(int version)
this->version = version;
}
-__int64 LevelData::getLastPlayed()
+int64_t LevelData::getLastPlayed()
{
return lastPlayed;
}
@@ -581,7 +581,7 @@ void LevelData::setThunderTime(int thunderTime)
this->thunderTime = thunderTime;
}
-bool LevelData::isRaining()
+bool LevelData::isRaining()
{
return raining;
}
@@ -621,8 +621,8 @@ void LevelData::setGameType(GameType *gameType)
this->gameType = gameType;
// 4J Added
- hasBeenInCreative = hasBeenInCreative ||
- (gameType == GameType::CREATIVE) ||
+ hasBeenInCreative = hasBeenInCreative ||
+ (gameType == GameType::CREATIVE) ||
(app.GetGameHostOption(eGameHostOption_CheatsEnabled) > 0);
}
@@ -641,12 +641,12 @@ void LevelData::setHasBeenInCreative(bool value)
hasBeenInCreative = value;
}
-LevelType *LevelData::getGenerator()
+LevelType *LevelData::getGenerator()
{
return m_pGenerator;
}
-void LevelData::setGenerator(LevelType *generator)
+void LevelData::setGenerator(LevelType *generator)
{
m_pGenerator = generator;
}
diff --git a/Minecraft.World/LevelData.h b/Minecraft.World/LevelData.h
index 2ab243c3..9c8d08ed 100644
--- a/Minecraft.World/LevelData.h
+++ b/Minecraft.World/LevelData.h
@@ -13,16 +13,16 @@ class LevelData
{
friend class DerivedLevelData;
private:
- __int64 seed;
+ int64_t seed;
LevelType *m_pGenerator;// = LevelType.normal;
wstring generatorOptions;
int xSpawn;
int ySpawn;
int zSpawn;
- __int64 gameTime;
- __int64 dayTime;
- __int64 lastPlayed;
- __int64 sizeOnDisk;
+ int64_t gameTime;
+ int64_t dayTime;
+ int64_t lastPlayed;
+ int64_t sizeOnDisk;
// CompoundTag *loadedPlayerTag; // 4J removed
int dimension;
wstring levelName;
@@ -84,7 +84,7 @@ protected:
virtual void setTagData(CompoundTag *tag); // 4J - removed CompoundTag *playerTag
public:
- virtual __int64 getSeed();
+ virtual int64_t getSeed();
virtual int getXSpawn();
virtual int getYSpawn();
virtual int getZSpawn();
@@ -92,12 +92,12 @@ public:
virtual int getZStronghold();
virtual int getXStrongholdEndPortal();
virtual int getZStrongholdEndPortal();
- virtual __int64 getGameTime();
- virtual __int64 getDayTime();
- virtual __int64 getSizeOnDisk();
+ virtual int64_t getGameTime();
+ virtual int64_t getDayTime();
+ virtual int64_t getSizeOnDisk();
virtual CompoundTag *getLoadedPlayerTag();
//int getDimension(); // 4J Removed TU 9 as it's never accurate
- virtual void setSeed(__int64 seed);
+ virtual void setSeed(int64_t seed);
virtual void setXSpawn(int xSpawn);
virtual void setYSpawn(int ySpawn);
virtual void setZSpawn(int zSpawn);
@@ -110,9 +110,9 @@ public:
virtual void setXStrongholdEndPortal(int xStrongholdEndPortal);
virtual void setZStrongholdEndPortal(int zStrongholdEndPortal);
- virtual void setGameTime(__int64 time);
- virtual void setDayTime(__int64 time);
- virtual void setSizeOnDisk(__int64 sizeOnDisk);
+ virtual void setGameTime(int64_t time);
+ virtual void setDayTime(int64_t time);
+ virtual void setSizeOnDisk(int64_t sizeOnDisk);
virtual void setLoadedPlayerTag(CompoundTag *loadedPlayerTag);
//void setDimension(int dimension); // 4J Removed TU 9 as it's never used
virtual void setSpawn(int xSpawn, int ySpawn, int zSpawn);
@@ -120,7 +120,7 @@ public:
virtual void setLevelName(const wstring& levelName);
virtual int getVersion();
virtual void setVersion(int version);
- virtual __int64 getLastPlayed();
+ virtual int64_t getLastPlayed();
virtual bool isThundering();
virtual void setThundering(bool thundering);
virtual int getThunderTime();
diff --git a/Minecraft.World/LevelSettings.cpp b/Minecraft.World/LevelSettings.cpp
index dca8ce61..a81a4032 100644
--- a/Minecraft.World/LevelSettings.cpp
+++ b/Minecraft.World/LevelSettings.cpp
@@ -85,7 +85,7 @@ GameType *GameType::byName(const wstring &name)
return SURVIVAL;
}
-void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale)
+void LevelSettings::_init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale)
{
this->seed = seed;
this->gameType = gameType;
@@ -100,11 +100,11 @@ void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeat
m_hellScale = hellScale;
}
-LevelSettings::LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) :
- seed(seed),
- gameType(gameType),
+LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) :
+ seed(seed),
+ gameType(gameType),
hardcore(hardcore),
- generateMapFeatures(generateMapFeatures),
+ generateMapFeatures(generateMapFeatures),
newSeaLevel(newSeaLevel),
levelType(levelType),
startingBonusItems(false)
@@ -140,7 +140,7 @@ bool LevelSettings::hasStartingBonusItems()
return startingBonusItems;
}
-__int64 LevelSettings::getSeed()
+int64_t LevelSettings::getSeed()
{
return seed;
}
@@ -155,7 +155,7 @@ bool LevelSettings::isHardcore()
return hardcore;
}
-LevelType *LevelSettings::getLevelType()
+LevelType *LevelSettings::getLevelType()
{
return levelType;
}
diff --git a/Minecraft.World/LevelSettings.h b/Minecraft.World/LevelSettings.h
index 906a6f70..73f588f6 100644
--- a/Minecraft.World/LevelSettings.h
+++ b/Minecraft.World/LevelSettings.h
@@ -37,7 +37,7 @@ public:
class LevelSettings
{
private:
- __int64 seed;
+ int64_t seed;
GameType *gameType;
bool generateMapFeatures;
bool hardcore;
@@ -49,16 +49,16 @@ private:
int m_xzSize; // 4J Added
int m_hellScale;
- void _init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param
+ void _init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param
public:
- LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param
+ LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param
LevelSettings(LevelData *levelData);
LevelSettings *enableStartingBonusItems(); // 4J - brought forward from 1.3.2
LevelSettings *enableSinglePlayerCommands();
LevelSettings *setLevelTypeOptions(const wstring &options);
bool hasStartingBonusItems(); // 4J - brought forward from 1.3.2
- __int64 getSeed();
+ int64_t getSeed();
GameType *getGameType();
bool isHardcore();
LevelType *getLevelType();
diff --git a/Minecraft.World/LevelSummary.cpp b/Minecraft.World/LevelSummary.cpp
index d8e7ddee..915abaf6 100644
--- a/Minecraft.World/LevelSummary.cpp
+++ b/Minecraft.World/LevelSummary.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "LevelSummary.h"
-LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) :
+LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) :
levelId( levelId ),
levelName( levelName ),
lastPlayed( lastPlayed ),
@@ -13,7 +13,7 @@ LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __i
{
}
-wstring LevelSummary::getLevelId()
+wstring LevelSummary::getLevelId()
{
return levelId;
}
@@ -23,28 +23,28 @@ wstring LevelSummary::getLevelName()
return levelName;
}
-__int64 LevelSummary::getSizeOnDisk()
+int64_t LevelSummary::getSizeOnDisk()
{
return sizeOnDisk;
}
-bool LevelSummary::isRequiresConversion()
+bool LevelSummary::isRequiresConversion()
{
return requiresConversion;
}
-__int64 LevelSummary::getLastPlayed()
+int64_t LevelSummary::getLastPlayed()
{
return lastPlayed;
}
-int LevelSummary::compareTo(LevelSummary *rhs)
+int LevelSummary::compareTo(LevelSummary *rhs)
{
if (lastPlayed < rhs->lastPlayed)
{
return 1;
}
- if (lastPlayed > rhs->lastPlayed)
+ if (lastPlayed > rhs->lastPlayed)
{
return -1;
}
diff --git a/Minecraft.World/LevelSummary.h b/Minecraft.World/LevelSummary.h
index bbf391ff..ce5699a2 100644
--- a/Minecraft.World/LevelSummary.h
+++ b/Minecraft.World/LevelSummary.h
@@ -7,20 +7,20 @@ class LevelSummary
{
const wstring levelId;
const wstring levelName;
- const __int64 lastPlayed;
- const __int64 sizeOnDisk;
+ const int64_t lastPlayed;
+ const int64_t sizeOnDisk;
const bool requiresConversion;
GameType *gameMode;
const bool hardcore;
const bool _hasCheats;
public:
- LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats);
+ LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats);
wstring getLevelId();
wstring getLevelName();
- __int64 getSizeOnDisk();
+ int64_t getSizeOnDisk();
bool isRequiresConversion();
- __int64 getLastPlayed();
+ int64_t getLastPlayed();
int compareTo(LevelSummary *rhs);
GameType *getGameMode();
bool isHardcore();
diff --git a/Minecraft.World/LightningBolt.h b/Minecraft.World/LightningBolt.h
index 28d5e004..2a14e88a 100644
--- a/Minecraft.World/LightningBolt.h
+++ b/Minecraft.World/LightningBolt.h
@@ -16,7 +16,7 @@ private:
int life;
public:
- __int64 seed;
+ int64_t seed;
private:
int flashes;
diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp
index bfe69226..44ed62b3 100644
--- a/Minecraft.World/LoginPacket.cpp
+++ b/Minecraft.World/LoginPacket.cpp
@@ -66,7 +66,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o
}
// Server -> Client
-LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale)
+LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale)
{
this->userName = userName;
this->clientVersion = clientVersion;
@@ -94,13 +94,13 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *
m_hellScale = hellScale;
}
-void LoginPacket::read(DataInputStream *dis) //throws IOException
+void LoginPacket::read(DataInputStream *dis) //throws IOException
{
clientVersion = dis->readInt();
userName = readUtf(dis, Player::MAX_NAME_LENGTH);
wstring typeName = readUtf(dis, 16);
m_pLevelType = LevelType::getLevelType(typeName);
- if (m_pLevelType == NULL)
+ if (m_pLevelType == NULL)
{
m_pLevelType = LevelType::lvl_normal;
}
@@ -131,15 +131,15 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException
}
-void LoginPacket::write(DataOutputStream *dos) //throws IOException
+void LoginPacket::write(DataOutputStream *dos) //throws IOException
{
dos->writeInt(clientVersion);
writeUtf(userName, dos);
- if (m_pLevelType == NULL)
+ if (m_pLevelType == NULL)
{
writeUtf(L"", dos);
- }
- else
+ }
+ else
{
writeUtf(m_pLevelType->getGeneratorName(), dos);
}
@@ -171,13 +171,13 @@ void LoginPacket::handle(PacketListener *listener)
listener->handleLogin(shared_from_this());
}
-int LoginPacket::getEstimatedSize()
+int LoginPacket::getEstimatedSize()
{
int length=0;
- if (m_pLevelType != NULL)
+ if (m_pLevelType != NULL)
{
length = (int)m_pLevelType->getGeneratorName().length();
}
- return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(__int64) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int));
+ return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int));
}
diff --git a/Minecraft.World/LoginPacket.h b/Minecraft.World/LoginPacket.h
index 09041135..bf7164fa 100644
--- a/Minecraft.World/LoginPacket.h
+++ b/Minecraft.World/LoginPacket.h
@@ -9,10 +9,10 @@ class LoginPacket : public Packet, public enable_shared_from_this<LoginPacket>
public:
int clientVersion;
wstring userName;
- __int64 seed;
+ int64_t seed;
char dimension;
PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added
- char difficulty; // 4J Added
+ char difficulty; // 4J Added
bool m_friendsOnlyUGC; // 4J Added
DWORD m_ugcPlayersVersion; // 4J Added
INT m_multiplayerInstanceId; //4J Added for sentient
@@ -31,7 +31,7 @@ public:
BYTE maxPlayers;
LoginPacket();
- LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client
+ LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client
LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server
virtual void read(DataInputStream *dis);
diff --git a/Minecraft.World/LongTag.h b/Minecraft.World/LongTag.h
index 8cfae41d..6a016715 100644
--- a/Minecraft.World/LongTag.h
+++ b/Minecraft.World/LongTag.h
@@ -4,10 +4,10 @@
class LongTag : public Tag
{
public:
- __int64 data;
+ int64_t data;
LongTag(const wstring &name) : Tag(name) {}
- LongTag(const wstring &name, __int64 data) : Tag(name) {this->data = data; }
-
+ LongTag(const wstring &name, int64_t data) : Tag(name) {this->data = data; }
+
void write(DataOutput *dos) { dos->writeLong(data); }
void load(DataInput *dis, int tagDepth) { data = dis->readLong(); }
diff --git a/Minecraft.World/McRegionChunkStorage.cpp b/Minecraft.World/McRegionChunkStorage.cpp
index 344ff6c7..87dabf0b 100644
--- a/Minecraft.World/McRegionChunkStorage.cpp
+++ b/Minecraft.World/McRegionChunkStorage.cpp
@@ -45,7 +45,7 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstr
for(int i = 0; i < count; ++i)
{
- __int64 index = dis.readLong();
+ int64_t index = dis.readLong();
CompoundTag *tag = NbtIo::read(&dis);
ByteArrayOutputStream bos;
@@ -78,7 +78,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
// If we can't find the chunk in the save file, then we should remove any entities we might have for that chunk
if(regionChunkInputStream == NULL)
{
- __int64 index = ((__int64)(x) << 32) | (((__int64)(z))&0x00000000FFFFFFFF);
+ int64_t index = ((int64_t)(x) << 32) | (((int64_t)(z))&0x00000000FFFFFFFF);
auto it = m_entityData.find(index);
if(it != m_entityData.end())
@@ -242,7 +242,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk)
{
#ifdef SPLIT_SAVES
PIXBeginNamedEvent(0,"Saving entities");
- __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF);
+ int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF);
delete m_entityData[index].data;
@@ -276,7 +276,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk)
void McRegionChunkStorage::loadEntities(Level *level, LevelChunk *levelChunk)
{
#ifdef SPLIT_SAVES
- __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF);
+ int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF);
auto it = m_entityData.find(index);
if(it != m_entityData.end())
diff --git a/Minecraft.World/McRegionChunkStorage.h b/Minecraft.World/McRegionChunkStorage.h
index 50dabd52..47ae1c99 100644
--- a/Minecraft.World/McRegionChunkStorage.h
+++ b/Minecraft.World/McRegionChunkStorage.h
@@ -16,7 +16,7 @@ private:
ConsoleSaveFile *m_saveFile;
static CRITICAL_SECTION cs_memory;
- unordered_map<__int64, byteArray> m_entityData;
+ unordered_map<int64_t, byteArray> m_entityData;
static std::deque<DataOutputStream *> s_chunkDataQueue;
static int s_runningThreadCount;
diff --git a/Minecraft.World/Mth.cpp b/Minecraft.World/Mth.cpp
index ab990e6c..77987917 100644
--- a/Minecraft.World/Mth.cpp
+++ b/Minecraft.World/Mth.cpp
@@ -51,9 +51,9 @@ int Mth::floor(float v)
return v < i ? i - 1 : i;
}
-__int64 Mth::lfloor(double v)
+int64_t Mth::lfloor(double v)
{
- __int64 i = (__int64) v;
+ int64_t i = (int64_t) v;
return v < i ? i - 1 : i;
}
@@ -221,8 +221,8 @@ wstring Mth::createInsecureUUID(Random *random)
{
wchar_t output[33];
output[32] = 0;
- __int64 high = (random->nextLong() & ~UUID_VERSION) | UUID_VERSION_TYPE_4;
- __int64 low = (random->nextLong() & ~UUID_VARIANT) | UUID_VARIANT_2;
+ int64_t high = (random->nextLong() & ~UUID_VERSION) | UUID_VERSION_TYPE_4;
+ int64_t low = (random->nextLong() & ~UUID_VARIANT) | UUID_VARIANT_2;
for(int i = 0; i < 16; i++ )
{
wchar_t nybbleHigh = high & 0xf;
diff --git a/Minecraft.World/Mth.h b/Minecraft.World/Mth.h
index 4ce90893..59c9e037 100644
--- a/Minecraft.World/Mth.h
+++ b/Minecraft.World/Mth.h
@@ -10,10 +10,10 @@ public:
static const float RADDEG;
static const float RAD_TO_GRAD;
- static const __int64 UUID_VERSION = 0x000000000000f000L;
- static const __int64 UUID_VERSION_TYPE_4 = 0x0000000000004000L;
- static const __int64 UUID_VARIANT = 0xc000000000000000L;
- static const __int64 UUID_VARIANT_2 = 0x8000000000000000L;
+ static const int64_t UUID_VERSION = 0x000000000000f000L;
+ static const int64_t UUID_VERSION_TYPE_4 = 0x0000000000004000L;
+ static const int64_t UUID_VARIANT = 0xc000000000000000L;
+ static const int64_t UUID_VARIANT_2 = 0x8000000000000000L;
private:
static float *_sin;
private:
@@ -25,7 +25,7 @@ public :
static float sqrt(float x);
static float sqrt(double x);
static int floor(float v);
- static __int64 lfloor(double v);
+ static int64_t lfloor(double v);
static int fastFloor(double x);
static int floor(double v);
static int absFloor(double v);
diff --git a/Minecraft.World/NbtSlotFile.cpp b/Minecraft.World/NbtSlotFile.cpp
index 8bae14c6..bb820ce0 100644
--- a/Minecraft.World/NbtSlotFile.cpp
+++ b/Minecraft.World/NbtSlotFile.cpp
@@ -4,7 +4,7 @@
byteArray NbtSlotFile::READ_BUFFER(1024*1024);
-__int64 NbtSlotFile::largest = 0;
+int64_t NbtSlotFile::largest = 0;
NbtSlotFile::NbtSlotFile(File file)
{
diff --git a/Minecraft.World/NbtSlotFile.h b/Minecraft.World/NbtSlotFile.h
index 93b4fe57..c717c657 100644
--- a/Minecraft.World/NbtSlotFile.h
+++ b/Minecraft.World/NbtSlotFile.h
@@ -19,7 +19,7 @@ private:
int fileSlotMapLength;
vector<int> freeFileSlots;
int totalFileSlots;
- static __int64 largest;
+ static int64_t largest;
public:
NbtSlotFile(File file);
diff --git a/Minecraft.World/NotGateTile.cpp b/Minecraft.World/NotGateTile.cpp
index 3aa9aee1..8d41c839 100644
--- a/Minecraft.World/NotGateTile.cpp
+++ b/Minecraft.World/NotGateTile.cpp
@@ -229,7 +229,7 @@ int NotGateTile::cloneTileId(Level *level, int x, int y, int z)
return Tile::redstoneTorch_on_Id;
}
-void NotGateTile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime)
+void NotGateTile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime)
{
deque<Toggle> *toggles = recentToggles[level];
diff --git a/Minecraft.World/NotGateTile.h b/Minecraft.World/NotGateTile.h
index b1f3431d..989aedc7 100644
--- a/Minecraft.World/NotGateTile.h
+++ b/Minecraft.World/NotGateTile.h
@@ -19,9 +19,9 @@ public:
{
public:
int x, y, z;
- __int64 when;
+ int64_t when;
- Toggle(int x, int y, int z, __int64 when)
+ Toggle(int x, int y, int z, int64_t when)
{
this->x = x;
this->y = y;
@@ -61,6 +61,6 @@ public:
public:
void animateTick(Level *level, int xt, int yt, int zt, Random *random);
int cloneTileId(Level *level, int x, int y, int z);
- void levelTimeChanged(Level *level, __int64 delta, __int64 newTime);
+ void levelTimeChanged(Level *level, int64_t delta, int64_t newTime);
bool isMatching(int id);
}; \ No newline at end of file
diff --git a/Minecraft.World/OldChunkStorage.cpp b/Minecraft.World/OldChunkStorage.cpp
index 24263d0d..983c517d 100644
--- a/Minecraft.World/OldChunkStorage.cpp
+++ b/Minecraft.World/OldChunkStorage.cpp
@@ -279,7 +279,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, DataOutputStream *dos)
vector<TickNextTickData > *ticksInChunk = level->fetchTicksInChunk(lc, false);
if (ticksInChunk != NULL)
{
- __int64 levelTime = level->getGameTime();
+ int64_t levelTime = level->getGameTime();
ListTag<CompoundTag> *tickTags = new ListTag<CompoundTag>();
for( int i = 0; i < ticksInChunk->size(); i++ )
@@ -367,7 +367,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, CompoundTag *tag)
vector<TickNextTickData > *ticksInChunk = level->fetchTicksInChunk(lc, false);
if (ticksInChunk != NULL)
{
- __int64 levelTime = level->getGameTime();
+ int64_t levelTime = level->getGameTime();
ListTag<CompoundTag> *tickTags = new ListTag<CompoundTag>();
for( int i = 0; i < ticksInChunk->size(); i++ )
diff --git a/Minecraft.World/Packet.cpp b/Minecraft.World/Packet.cpp
index a37cb2ad..61e3cc63 100644
--- a/Minecraft.World/Packet.cpp
+++ b/Minecraft.World/Packet.cpp
@@ -252,11 +252,11 @@ void Packet::updatePacketStatsPIX()
for( auto it = outgoingStatistics.begin(); it != outgoingStatistics.end(); it++ )
{
Packet::PacketStatistics *stat = it->second;
- __int64 count = stat->getRunningCount();
+ int64_t count = stat->getRunningCount();
wchar_t pixName[256];
swprintf_s(pixName,L"Packet count %d",stat->id);
// PIXReportCounter(pixName,(float)count);
- __int64 total = stat->getRunningTotal();
+ int64_t total = stat->getRunningTotal();
swprintf_s(pixName,L"Packet bytes %d",stat->id);
PIXReportCounter(pixName,(float)total);
stat->IncrementPos();
@@ -451,10 +451,10 @@ int Packet::PacketStatistics::getTotalSize()
return totalSize;
}
-__int64 Packet::PacketStatistics::getRunningTotal()
+int64_t Packet::PacketStatistics::getRunningTotal()
{
- __int64 total = 0;
- __int64 currentTime = System::currentTimeMillis();
+ int64_t total = 0;
+ int64_t currentTime = System::currentTimeMillis();
for( int i = 0; i < TOTAL_TICKS; i++ )
{
if( currentTime - timeSamples[i] <= 1000 )
@@ -465,10 +465,10 @@ __int64 Packet::PacketStatistics::getRunningTotal()
return total;
}
-__int64 Packet::PacketStatistics::getRunningCount()
+int64_t Packet::PacketStatistics::getRunningCount()
{
- __int64 total = 0;
- __int64 currentTime = System::currentTimeMillis();
+ int64_t total = 0;
+ int64_t currentTime = System::currentTimeMillis();
for( int i = 0; i < TOTAL_TICKS; i++ )
{
if( currentTime - timeSamples[i] <= 1000 )
diff --git a/Minecraft.World/Packet.h b/Minecraft.World/Packet.h
index 7c30f6aa..c639c8f1 100644
--- a/Minecraft.World/Packet.h
+++ b/Minecraft.World/Packet.h
@@ -15,7 +15,7 @@ typedef shared_ptr<Packet> (*packetCreateFn)();
class Packet
{
public:
- class PacketStatistics
+ class PacketStatistics
{
private:
int count;
@@ -24,9 +24,9 @@ public:
static const int TOTAL_TICKS = 100;
// 4J Added
- __int64 countSamples[TOTAL_TICKS];
- __int64 sizeSamples[TOTAL_TICKS];
- __int64 timeSamples[TOTAL_TICKS];
+ int64_t countSamples[TOTAL_TICKS];
+ int64_t sizeSamples[TOTAL_TICKS];
+ int64_t timeSamples[TOTAL_TICKS];
int samplesPos;
public:
@@ -38,8 +38,8 @@ public:
int getCount();
int getTotalSize();
double getAverageSize();
- __int64 getRunningTotal();
- __int64 getRunningCount();
+ int64_t getRunningTotal();
+ int64_t getRunningCount();
void IncrementPos();
};
@@ -58,7 +58,7 @@ public:
static void map(int id, bool receiveOnClient, bool receiveOnServer, bool sendToAnyClient, bool renderStats, const type_info& clazz, packetCreateFn );
public:
- const __int64 createTime;
+ const int64_t createTime;
Packet();
diff --git a/Minecraft.World/PerlinNoise.cpp b/Minecraft.World/PerlinNoise.cpp
index b4fd8004..b4c65e55 100644
--- a/Minecraft.World/PerlinNoise.cpp
+++ b/Minecraft.World/PerlinNoise.cpp
@@ -77,8 +77,8 @@ doubleArray PerlinNoise::getRegion(doubleArray buffer, int x, int y, int z, int
double xx = x * pow * xScale;
double yy = y * pow * yScale;
double zz = z * pow * zScale;
- __int64 xb = Mth::lfloor(xx);
- __int64 zb = Mth::lfloor(zz);
+ int64_t xb = Mth::lfloor(xx);
+ int64_t zb = Mth::lfloor(zz);
xx -= xb;
zz -= zb;
xb %= 16777216;
diff --git a/Minecraft.World/PortalForcer.cpp b/Minecraft.World/PortalForcer.cpp
index b3850807..d0a12988 100644
--- a/Minecraft.World/PortalForcer.cpp
+++ b/Minecraft.World/PortalForcer.cpp
@@ -6,7 +6,7 @@
#include "..\Minecraft.Client\ServerLevel.h"
#include "PortalForcer.h"
-PortalForcer::PortalPosition::PortalPosition(int x, int y, int z, __int64 time) : Pos(x, y, z)
+PortalForcer::PortalPosition::PortalPosition(int x, int y, int z, int64_t time) : Pos(x, y, z)
{
lastUsed = time;
}
@@ -502,15 +502,15 @@ next_second: continue;
return true;
}
-void PortalForcer::tick(__int64 time)
+void PortalForcer::tick(int64_t time)
{
if (time % (SharedConstants::TICKS_PER_SECOND * 5) == 0)
{
- __int64 cutoff = time - SharedConstants::TICKS_PER_SECOND * 30;
+ int64_t cutoff = time - SharedConstants::TICKS_PER_SECOND * 30;
for (auto it = cachedPortalKeys.begin(); it != cachedPortalKeys.end();)
{
- __int64 key = *it;
+ int64_t key = *it;
PortalPosition *pos = cachedPortals[key];
if (pos == NULL || pos->lastUsed < cutoff)
diff --git a/Minecraft.World/PortalForcer.h b/Minecraft.World/PortalForcer.h
index a589d9b3..d85adc17 100644
--- a/Minecraft.World/PortalForcer.h
+++ b/Minecraft.World/PortalForcer.h
@@ -8,16 +8,16 @@ public:
class PortalPosition : public Pos
{
public:
- __int64 lastUsed;
+ int64_t lastUsed;
- PortalPosition(int x, int y, int z, __int64 time);
+ PortalPosition(int x, int y, int z, int64_t time);
};
private:
ServerLevel *level;
Random *random;
- unordered_map<__int64, PortalPosition *> cachedPortals;
- vector<__int64> cachedPortalKeys;
+ unordered_map<int64_t, PortalPosition *> cachedPortals;
+ vector<int64_t> cachedPortalKeys;
public:
PortalForcer(ServerLevel *level);
@@ -26,5 +26,5 @@ public:
void force(shared_ptr<Entity> e, double xOriginal, double yOriginal, double zOriginal, float yRotOriginal);
bool findPortal(shared_ptr<Entity> e, double xOriginal, double yOriginal, double zOriginal, float yRotOriginal);
bool createPortal(shared_ptr<Entity> e);
- void tick(__int64 time);
+ void tick(int64_t time);
}; \ No newline at end of file
diff --git a/Minecraft.World/Random.cpp b/Minecraft.World/Random.cpp
index 9176bf38..d4e3a545 100644
--- a/Minecraft.World/Random.cpp
+++ b/Minecraft.World/Random.cpp
@@ -1,4 +1,4 @@
-#include "stdafx.h"
+#include "stdafx.h"
#include "Random.h"
#include "System.h"
@@ -6,19 +6,19 @@ Random::Random()
{
// 4J - jave now uses the system nanosecond counter added to a "seedUniquifier" to get an initial seed. Our nanosecond timer is actually only millisecond accuate, so
// use QueryPerformanceCounter here instead
- __int64 seed;
+ int64_t seed;
QueryPerformanceCounter((LARGE_INTEGER *)&seed);
seed += 8682522807148012LL;
setSeed(seed);
}
-Random::Random(__int64 seed)
+Random::Random(int64_t seed)
{
setSeed(seed);
}
-void Random::setSeed(__int64 s)
+void Random::setSeed(int64_t s)
{
this->seed = (s ^ 0x5DEECE66DLL) & ((1LL << 48) - 1);
haveNextNextGaussian = false;
@@ -41,7 +41,7 @@ void Random::nextBytes(byte *bytes, unsigned int count)
double Random::nextDouble()
{
- return (((__int64)next(26) << 27) + next(27))
+ return (((int64_t)next(26) << 27) + next(27))
/ (double)(1LL << 53);
}
@@ -56,7 +56,7 @@ double Random::nextGaussian()
{
double v1, v2, s;
do
- {
+ {
v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0
v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0
s = v1 * v1 + v2 * v2;
@@ -79,7 +79,7 @@ int Random::nextInt(int n)
if ((n & -n) == n) // i.e., n is a power of 2
- return (int)(((__int64)next(31) * n) >> 31); // 4J Stu - Made __int64 instead of long
+ return (int)(((int64_t)next(31) * n) >> 31); // 4J Stu - Made int64_t instead of long
int bits, val;
do
@@ -95,9 +95,9 @@ float Random::nextFloat()
return next(24) / ((float)(1 << 24));
}
-__int64 Random::nextLong()
+int64_t Random::nextLong()
{
- return ((__int64)next(32) << 32) + next(32);
+ return ((int64_t)next(32) << 32) + next(32);
}
bool Random::nextBoolean()
diff --git a/Minecraft.World/Random.h b/Minecraft.World/Random.h
index 9af3a3c2..cfb6af26 100644
--- a/Minecraft.World/Random.h
+++ b/Minecraft.World/Random.h
@@ -3,21 +3,21 @@
class Random
{
private:
- __int64 seed;
+ int64_t seed;
bool haveNextNextGaussian;
double nextNextGaussian;
protected:
int next(int bits);
public:
Random();
- Random(__int64 seed);
- void setSeed(__int64 s);
+ Random(int64_t seed);
+ void setSeed(int64_t s);
void nextBytes(byte *bytes, unsigned int count);
double nextDouble();
double nextGaussian();
int nextInt();
int nextInt(int to);
float nextFloat();
- __int64 nextLong();
+ int64_t nextLong();
bool nextBoolean();
}; \ No newline at end of file
diff --git a/Minecraft.World/RandomLevelSource.cpp b/Minecraft.World/RandomLevelSource.cpp
index 2b93578a..ae06c1f8 100644
--- a/Minecraft.World/RandomLevelSource.cpp
+++ b/Minecraft.World/RandomLevelSource.cpp
@@ -26,7 +26,7 @@ static PerlinNoise_DataIn g_depthNoise_SPU __attribute__((__aligned__(16)));
const double RandomLevelSource::SNOW_SCALE = 0.3;
const double RandomLevelSource::SNOW_CUTOFF = 0.5;
-RandomLevelSource::RandomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures )
+RandomLevelSource::RandomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures )
{
m_XZSize = level->getLevelData()->getXZSize();
#ifdef _LARGE_WORLDS
@@ -166,9 +166,9 @@ float RandomLevelSource::getHeightFalloff(int xxx, int zzz, int* pEMin)
float comp = 0.0f;
int emin = getMinDistanceToEdge(xxx, zzz, worldSize, falloffStart);
// check if we have a larger world that should have moats
- int expandedWorldSizes[3] = {LEVEL_WIDTH_CLASSIC*16,
- LEVEL_WIDTH_SMALL*16,
- LEVEL_WIDTH_MEDIUM*16};
+ int expandedWorldSizes[3] = {LEVEL_WIDTH_CLASSIC*16,
+ LEVEL_WIDTH_SMALL*16,
+ LEVEL_WIDTH_MEDIUM*16};
bool expandedMoatValues[3] = {m_classicEdgeMoat, m_smallEdgeMoat, m_mediumEdgeMoat};
for(int i=0;i<3;i++)
{
@@ -435,7 +435,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
run = runDepth;
if (y >= waterHeight - 1) blocks[offs] = top;
else blocks[offs] = material;
- }
+ }
else if (run > 0)
{
run--;
@@ -503,7 +503,7 @@ LevelChunk *RandomLevelSource::getChunk(int xOffs, int zOffs)
// addCaves(xOffs, zOffs, blocks);
// addTowns(xOffs, zOffs, blocks);
- // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method
+ // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method
// 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also
// now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore.
@@ -629,7 +629,7 @@ doubleArray RandomLevelSource::getHeights(doubleArray buffer, int x, int y, int
if (rdepth < -1) rdepth = -1;
rdepth = rdepth / 1.4;
rdepth /= 2;
- }
+ }
else
{
if (rdepth > 1) rdepth = 1;
@@ -766,8 +766,8 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
}
pprandom->setSeed(level->getSeed());
- __int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
- __int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t xScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
bool hasVillage = false;
diff --git a/Minecraft.World/RandomLevelSource.h b/Minecraft.World/RandomLevelSource.h
index 740a9db2..ef145df0 100644
--- a/Minecraft.World/RandomLevelSource.h
+++ b/Minecraft.World/RandomLevelSource.h
@@ -47,7 +47,7 @@ private:
floatArray pows;
public:
- RandomLevelSource(Level *level, __int64 seed, bool generateStructures);
+ RandomLevelSource(Level *level, int64_t seed, bool generateStructures);
~RandomLevelSource();
public:
diff --git a/Minecraft.World/RegionFile.cpp b/Minecraft.World/RegionFile.cpp
index 2cfd9078..5c29f94e 100644
--- a/Minecraft.World/RegionFile.cpp
+++ b/Minecraft.World/RegionFile.cpp
@@ -19,7 +19,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
chunkTimestamps = new int[SECTOR_INTS];
memset(chunkTimestamps,0,SECTOR_BYTES);
- /* 4J Jev, using files instead of strings:
+ /* 4J Jev, using files instead of strings:
strncpy(fileName,path,MAX_PATH_SIZE); */
fileName = path;
@@ -30,7 +30,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
// 4J - removed try/catch
// try {
-
+
/* 4J - Removed as _lastModifed not used and this is always failing as checking wrong thing
if( path->exists() )
{
@@ -45,7 +45,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
{
// 4J altered - the original code used to write out 2 empty sectors here, which we don't want to do as we might be at a point where we shouldn't be touching the save file.
// This now happens in insertInitialSectors when we do a first write to the region
- m_bIsEmpty = true;
+ m_bIsEmpty = true;
sizeDelta += SECTOR_BYTES * 2;
}
@@ -70,7 +70,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
}
/* set up the available sector map */
-
+
int nSectors;
if( m_bIsEmpty ) // 4J - added this case for our empty files that we now don't create
{
@@ -133,7 +133,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
void RegionFile::writeAllOffsets() // used for the file ConsoleSaveFile conversion between platforms
{
- if(m_bIsEmpty == false)
+ if(m_bIsEmpty == false)
{
// save all the offsets and timestamps
m_saveFile->LockSaveAccess();
@@ -158,7 +158,7 @@ RegionFile::~RegionFile()
m_saveFile->closeHandle( fileEntry );
}
-__int64 RegionFile::lastModified()
+int64_t RegionFile::lastModified()
{
return _lastModified;
}
@@ -198,9 +198,9 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was
m_saveFile->LockSaveAccess();
- //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
+ //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN);
-
+
unsigned int length;
unsigned int decompLength;
unsigned int readDecompLength;
@@ -227,7 +227,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was
if (length > SECTOR_BYTES * numSectors)
{
// debugln("READ", x, z, "invalid length: " + length + " > 4096 * " + numSectors);
-
+
m_saveFile->ReleaseSaveAccess();
return NULL;
}
@@ -257,7 +257,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was
delete [] data;
// 4J - was InflaterInputStream in here too, but we've already decompressed
- DataInputStream *ret = new DataInputStream(new ByteArrayInputStream( byteArray( decomp, readDecompLength) ));
+ DataInputStream *ret = new DataInputStream(new ByteArrayInputStream( byteArray( decomp, readDecompLength) ));
return ret;
// } catch (IOException e) {
@@ -269,7 +269,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was
DataOutputStream *RegionFile::getChunkDataOutputStream(int x, int z)
{
// 4J - was DeflatorOutputStream in here too, but we've already compressed
- return new DataOutputStream( new ChunkBuffer(this, x, z));
+ return new DataOutputStream( new ChunkBuffer(this, x, z));
}
/* write a chunk at (x,z) with length bytes of data to disk */
@@ -372,7 +372,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync
* file
*/
// debug("SAVE", x, z, length, "grow");
- //SetFilePointer(file,0,0,FILE_END);
+ //SetFilePointer(file,0,0,FILE_END);
m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_END );
sectorNumber = (int)sectorFree->size();
@@ -406,12 +406,12 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync
void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int compLength)
{
DWORD numberOfBytesWritten = 0;
- //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
+ //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN );
// 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data
// We store length and decompression length as ints, then length bytes of xbox LZX compressed data
-
+
// 4J Stu - We need to do the compression at a level above this, where it is checking for free space
compLength |= 0x80000000; // 4J - signify that this has been encoded with RLE method ( see code in getChunkDataInputStream() for matching detection of this)
@@ -425,7 +425,7 @@ void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int co
void RegionFile::zero(int sectorNumber, int length)
{
DWORD numberOfBytesWritten = 0;
- //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
+ //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN );
m_saveFile->zeroFile( fileEntry, length, &numberOfBytesWritten );
}
@@ -473,7 +473,7 @@ void RegionFile::setOffset(int x, int z, int offset)
DWORD numberOfBytesWritten = 0;
offsets[x + z * 32] = offset;
m_saveFile->setFilePointer( fileEntry, (x + z * 32) * 4, NULL, FILE_BEGIN );
-
+
m_saveFile->writeFile(fileEntry,&offset,4,&numberOfBytesWritten);
}
@@ -487,7 +487,7 @@ void RegionFile::setTimestamp(int x, int z, int value)
DWORD numberOfBytesWritten = 0;
chunkTimestamps[x + z * 32] = value;
m_saveFile->setFilePointer( fileEntry, SECTOR_BYTES + (x + z * 32) * 4, NULL, FILE_BEGIN );
-
+
m_saveFile->writeFile(fileEntry,&value,4,&numberOfBytesWritten);
}
diff --git a/Minecraft.World/RegionFile.h b/Minecraft.World/RegionFile.h
index 0717c8c2..520ca6a1 100644
--- a/Minecraft.World/RegionFile.h
+++ b/Minecraft.World/RegionFile.h
@@ -16,7 +16,7 @@ private:
static const int VERSION_GZIP = 1;
static const int VERSION_DEFLATE = 2;
static const int VERSION_XBOX = 3;
-
+
static const int SECTOR_BYTES = 4096;
static const int SECTOR_INTS = SECTOR_BYTES / 4;
@@ -31,7 +31,7 @@ private:
int *chunkTimestamps;
vector<bool> *sectorFree;
int sizeDelta;
- __int64 _lastModified;
+ int64_t _lastModified;
bool m_bIsEmpty; // 4J added
public:
@@ -39,7 +39,7 @@ public:
~RegionFile();
/* the modification date of the region file when it was first opened */
- __int64 lastModified();
+ int64_t lastModified();
/* gets how much the region file has grown since it was last checked */
int getSizeDelta();
diff --git a/Minecraft.World/RegionHillsLayer.cpp b/Minecraft.World/RegionHillsLayer.cpp
index dad114b0..a1e17524 100644
--- a/Minecraft.World/RegionHillsLayer.cpp
+++ b/Minecraft.World/RegionHillsLayer.cpp
@@ -3,7 +3,7 @@
#include "IntCache.h"
#include "RegionHillsLayer.h"
-RegionHillsLayer::RegionHillsLayer(__int64 seed, shared_ptr<Layer> parent) : Layer(seed)
+RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr<Layer> parent) : Layer(seed)
{
this->parent = parent;
}
diff --git a/Minecraft.World/RegionHillsLayer.h b/Minecraft.World/RegionHillsLayer.h
index 30d7eced..5ad0bb75 100644
--- a/Minecraft.World/RegionHillsLayer.h
+++ b/Minecraft.World/RegionHillsLayer.h
@@ -5,7 +5,7 @@
class RegionHillsLayer : public Layer
{
public:
- RegionHillsLayer(__int64 seed, shared_ptr<Layer> parent);
+ RegionHillsLayer(int64_t seed, shared_ptr<Layer> parent);
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/RespawnPacket.cpp b/Minecraft.World/RespawnPacket.cpp
index 5c04bbeb..ecc0b7f0 100644
--- a/Minecraft.World/RespawnPacket.cpp
+++ b/Minecraft.World/RespawnPacket.cpp
@@ -5,7 +5,7 @@
#include "RespawnPacket.h"
#include "LevelType.h"
-RespawnPacket::RespawnPacket()
+RespawnPacket::RespawnPacket()
{
this->dimension = 0;
this->difficulty = 1;
@@ -19,7 +19,7 @@ RespawnPacket::RespawnPacket()
m_hellScale = HELL_LEVEL_MAX_SCALE;
}
-RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale)
+RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale)
{
this->dimension = dimension;
this->mapSeed = mapSeed;
@@ -35,7 +35,7 @@ RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, Gam
}
-void RespawnPacket::handle(PacketListener *listener)
+void RespawnPacket::handle(PacketListener *listener)
{
listener->handleRespawn(shared_from_this());
}
@@ -47,7 +47,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException
mapHeight = dis->readShort();
wstring typeName = readUtf(dis, 16);
m_pLevelType = LevelType::getLevelType(typeName);
- if (m_pLevelType == NULL)
+ if (m_pLevelType == NULL)
{
m_pLevelType = LevelType::lvl_normal;
}
@@ -63,16 +63,16 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException
}
-void RespawnPacket::write(DataOutputStream *dos) //throws IOException
+void RespawnPacket::write(DataOutputStream *dos) //throws IOException
{
dos->writeByte(dimension);
dos->writeByte(playerGameType->getId());
dos->writeShort(mapHeight);
- if (m_pLevelType == NULL)
+ if (m_pLevelType == NULL)
{
writeUtf(L"", dos);
- }
- else
+ }
+ else
{
writeUtf(m_pLevelType->getGeneratorName(), dos);
}
@@ -86,10 +86,10 @@ void RespawnPacket::write(DataOutputStream *dos) //throws IOException
#endif
}
-int RespawnPacket::getEstimatedSize()
+int RespawnPacket::getEstimatedSize()
{
int length=0;
- if (m_pLevelType != NULL)
+ if (m_pLevelType != NULL)
{
length = (int)m_pLevelType->getGeneratorName().length();
}
diff --git a/Minecraft.World/RespawnPacket.h b/Minecraft.World/RespawnPacket.h
index dc341ea1..3caf1ee3 100644
--- a/Minecraft.World/RespawnPacket.h
+++ b/Minecraft.World/RespawnPacket.h
@@ -11,7 +11,7 @@ class RespawnPacket : public Packet, public enable_shared_from_this<RespawnPacke
public:
char dimension;
char difficulty;
- __int64 mapSeed;
+ int64_t mapSeed;
int mapHeight;
GameType *playerGameType;
bool m_newSeaLevel; // 4J added
@@ -21,7 +21,7 @@ public:
int m_hellScale; // 4J Added
RespawnPacket();
- RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale);
+ RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale);
virtual void handle(PacketListener *listener);
virtual void read(DataInputStream *dis);
diff --git a/Minecraft.World/RiverInitLayer.cpp b/Minecraft.World/RiverInitLayer.cpp
index e9497896..86110e13 100644
--- a/Minecraft.World/RiverInitLayer.cpp
+++ b/Minecraft.World/RiverInitLayer.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "net.minecraft.world.level.newbiome.layer.h"
-RiverInitLayer::RiverInitLayer(__int64 seed, shared_ptr<Layer>parent) : Layer(seed)
+RiverInitLayer::RiverInitLayer(int64_t seed, shared_ptr<Layer>parent) : Layer(seed)
{
this->parent = parent;
}
diff --git a/Minecraft.World/RiverInitLayer.h b/Minecraft.World/RiverInitLayer.h
index 6deb50e9..bc8dca1b 100644
--- a/Minecraft.World/RiverInitLayer.h
+++ b/Minecraft.World/RiverInitLayer.h
@@ -5,7 +5,7 @@
class RiverInitLayer : public Layer
{
public:
- RiverInitLayer(__int64 seed, shared_ptr<Layer>parent);
+ RiverInitLayer(int64_t seed, shared_ptr<Layer>parent);
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/RiverLayer.cpp b/Minecraft.World/RiverLayer.cpp
index 8f805bab..14cf3142 100644
--- a/Minecraft.World/RiverLayer.cpp
+++ b/Minecraft.World/RiverLayer.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.biome.h"
#include "net.minecraft.world.level.newbiome.layer.h"
-RiverLayer::RiverLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+RiverLayer::RiverLayer(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
diff --git a/Minecraft.World/RiverLayer.h b/Minecraft.World/RiverLayer.h
index 657ac07c..a76d3fab 100644
--- a/Minecraft.World/RiverLayer.h
+++ b/Minecraft.World/RiverLayer.h
@@ -5,6 +5,6 @@
class RiverLayer : public Layer
{
public:
- RiverLayer(__int64 seedMixup, shared_ptr<Layer>parent);
+ RiverLayer(int64_t seedMixup, shared_ptr<Layer>parent);
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/RiverMixerLayer.cpp b/Minecraft.World/RiverMixerLayer.cpp
index 62dfdd6c..4de49245 100644
--- a/Minecraft.World/RiverMixerLayer.cpp
+++ b/Minecraft.World/RiverMixerLayer.cpp
@@ -2,13 +2,13 @@
#include "net.minecraft.world.level.biome.h"
#include "net.minecraft.world.level.newbiome.layer.h"
-RiverMixerLayer::RiverMixerLayer(__int64 seed, shared_ptr<Layer>biomes, shared_ptr<Layer>rivers) : Layer(seed)
+RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptr<Layer>biomes, shared_ptr<Layer>rivers) : Layer(seed)
{
this->biomes = biomes;
this->rivers = rivers;
}
-void RiverMixerLayer::init(__int64 seed)
+void RiverMixerLayer::init(int64_t seed)
{
biomes->init(seed);
rivers->init(seed);
diff --git a/Minecraft.World/RiverMixerLayer.h b/Minecraft.World/RiverMixerLayer.h
index eec51610..3a069c41 100644
--- a/Minecraft.World/RiverMixerLayer.h
+++ b/Minecraft.World/RiverMixerLayer.h
@@ -9,8 +9,8 @@ private:
shared_ptr<Layer>rivers;
public:
- RiverMixerLayer(__int64 seed, shared_ptr<Layer>biomes, shared_ptr<Layer>rivers);
+ RiverMixerLayer(int64_t seed, shared_ptr<Layer>biomes, shared_ptr<Layer>rivers);
- virtual void init(__int64 seed);
+ virtual void init(int64_t seed);
virtual intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/SetTimePacket.cpp b/Minecraft.World/SetTimePacket.cpp
index 5936255c..e7ea3b42 100644
--- a/Minecraft.World/SetTimePacket.cpp
+++ b/Minecraft.World/SetTimePacket.cpp
@@ -4,13 +4,13 @@
#include "PacketListener.h"
#include "SetTimePacket.h"
-SetTimePacket::SetTimePacket()
+SetTimePacket::SetTimePacket()
{
gameTime = 0;
dayTime = 0;
}
-SetTimePacket::SetTimePacket(__int64 gameTime, __int64 dayTime, bool tickDayTime)
+SetTimePacket::SetTimePacket(int64_t gameTime, int64_t dayTime, bool tickDayTime)
{
this->gameTime = gameTime;
this->dayTime = dayTime;
@@ -32,7 +32,7 @@ void SetTimePacket::read(DataInputStream *dis) //throws IOException
dayTime = dis->readLong();
}
-void SetTimePacket::write(DataOutputStream *dos) //throws IOException
+void SetTimePacket::write(DataOutputStream *dos) //throws IOException
{
dos->writeLong(gameTime);
dos->writeLong(dayTime);
diff --git a/Minecraft.World/SetTimePacket.h b/Minecraft.World/SetTimePacket.h
index 7ded9ce1..a0fa2ad9 100644
--- a/Minecraft.World/SetTimePacket.h
+++ b/Minecraft.World/SetTimePacket.h
@@ -6,11 +6,11 @@ using namespace std;
class SetTimePacket : public Packet, public enable_shared_from_this<SetTimePacket>
{
public:
- __int64 gameTime;
- __int64 dayTime;
+ int64_t gameTime;
+ int64_t dayTime;
SetTimePacket();
- SetTimePacket(__int64 gameTime, __int64 dayTime, bool tickDayTime);
+ SetTimePacket(int64_t gameTime, int64_t dayTime, bool tickDayTime);
virtual void read(DataInputStream *dis);
virtual void write(DataOutputStream *dos);
diff --git a/Minecraft.World/ShoreLayer.cpp b/Minecraft.World/ShoreLayer.cpp
index 297571f5..7ae52557 100644
--- a/Minecraft.World/ShoreLayer.cpp
+++ b/Minecraft.World/ShoreLayer.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.newbiome.layer.h"
#include "net.minecraft.world.level.biome.h"
-ShoreLayer::ShoreLayer(__int64 seed, shared_ptr<Layer> parent) : Layer(seed)
+ShoreLayer::ShoreLayer(int64_t seed, shared_ptr<Layer> parent) : Layer(seed)
{
this->parent = parent;
}
diff --git a/Minecraft.World/ShoreLayer.h b/Minecraft.World/ShoreLayer.h
index 96aea152..a7053004 100644
--- a/Minecraft.World/ShoreLayer.h
+++ b/Minecraft.World/ShoreLayer.h
@@ -4,6 +4,6 @@
class ShoreLayer : public Layer
{
public:
- ShoreLayer(__int64 seed, shared_ptr<Layer> parent);
+ ShoreLayer(int64_t seed, shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/SkyIslandDimension.cpp b/Minecraft.World/SkyIslandDimension.cpp
index 0746c92c..aa68bd5e 100644
--- a/Minecraft.World/SkyIslandDimension.cpp
+++ b/Minecraft.World/SkyIslandDimension.cpp
@@ -16,7 +16,7 @@ ChunkSource *SkyIslandDimension::createRandomLevelSource() const
return new SkyIslandRandomLevelSource(level, level->getSeed());
}
-float SkyIslandDimension::getTimeOfDay(__int64 time, float a) const
+float SkyIslandDimension::getTimeOfDay(int64_t time, float a) const
{
return 0.0f;
}
diff --git a/Minecraft.World/SmoothLayer.cpp b/Minecraft.World/SmoothLayer.cpp
index a5545cc5..e94ae36d 100644
--- a/Minecraft.World/SmoothLayer.cpp
+++ b/Minecraft.World/SmoothLayer.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "net.minecraft.world.level.newbiome.layer.h"
-SmoothLayer::SmoothLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+SmoothLayer::SmoothLayer(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
diff --git a/Minecraft.World/SmoothLayer.h b/Minecraft.World/SmoothLayer.h
index eec3f19e..14e3d152 100644
--- a/Minecraft.World/SmoothLayer.h
+++ b/Minecraft.World/SmoothLayer.h
@@ -5,7 +5,7 @@
class SmoothLayer : public Layer
{
public:
- SmoothLayer(__int64 seedMixup, shared_ptr<Layer>parent);
+ SmoothLayer(int64_t seedMixup, shared_ptr<Layer>parent);
virtual intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/SmoothZoomLayer.cpp b/Minecraft.World/SmoothZoomLayer.cpp
index 3e1c55a1..2df34a3b 100644
--- a/Minecraft.World/SmoothZoomLayer.cpp
+++ b/Minecraft.World/SmoothZoomLayer.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.newbiome.layer.h"
#include "System.h"
-SmoothZoomLayer::SmoothZoomLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
@@ -50,7 +50,7 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h)
return result;
}
-shared_ptr<Layer>SmoothZoomLayer::zoom(__int64 seed, shared_ptr<Layer>sup, int count)
+shared_ptr<Layer>SmoothZoomLayer::zoom(int64_t seed, shared_ptr<Layer>sup, int count)
{
shared_ptr<Layer>result = sup;
for (int i = 0; i < count; i++)
diff --git a/Minecraft.World/SmoothZoomLayer.h b/Minecraft.World/SmoothZoomLayer.h
index b2ac4e78..90cc292e 100644
--- a/Minecraft.World/SmoothZoomLayer.h
+++ b/Minecraft.World/SmoothZoomLayer.h
@@ -5,8 +5,8 @@
class SmoothZoomLayer : public Layer
{
public:
- SmoothZoomLayer(__int64 seedMixup, shared_ptr<Layer>parent);
+ SmoothZoomLayer(int64_t seedMixup, shared_ptr<Layer>parent);
virtual intArray getArea(int xo, int yo, int w, int h);
- static shared_ptr<Layer>zoom(__int64 seed, shared_ptr<Layer>sup, int count);
+ static shared_ptr<Layer>zoom(int64_t seed, shared_ptr<Layer>sup, int count);
}; \ No newline at end of file
diff --git a/Minecraft.World/Socket.h b/Minecraft.World/Socket.h
index 0019f984..c4ec9fc8 100644
--- a/Minecraft.World/Socket.h
+++ b/Minecraft.World/Socket.h
@@ -36,7 +36,7 @@ private:
virtual int read(byteArray b);
virtual int read(byteArray b, unsigned int offset, unsigned int length);
virtual void close();
- virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented
+ virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented
virtual void flush() {}
};
@@ -68,7 +68,7 @@ private:
virtual int read(byteArray b);
virtual int read(byteArray b, unsigned int offset, unsigned int length);
virtual void close();
- virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented
+ virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented
virtual void flush() {}
};
class SocketOutputStreamNetwork : public SocketOutputStream
@@ -86,13 +86,13 @@ private:
virtual void close();
virtual void flush() {}
};
-
+
bool m_hostServerConnection; // true if this is the connection between the host player and server
bool m_hostLocal; // true if this player on the same machine as the host
int m_end; // 0 for client side or 1 for host side
// For local connections between the host player and the server
- static CRITICAL_SECTION s_hostQueueLock[2];
+ static CRITICAL_SECTION s_hostQueueLock[2];
static std::queue<byte> s_hostQueue[2];
static SocketOutputStreamLocal *s_hostOutStream[2];
static SocketInputStreamLocal *s_hostInStream[2];
@@ -108,7 +108,7 @@ private:
static ServerConnection *s_serverConnection;
BYTE networkPlayerSmallId;
-public:
+public:
C4JThread::Event* m_socketClosedEvent;
INetworkPlayer *getPlayer();
diff --git a/Minecraft.World/SparseDataStorage.cpp b/Minecraft.World/SparseDataStorage.cpp
index 6db131e7..780c9819 100644
--- a/Minecraft.World/SparseDataStorage.cpp
+++ b/Minecraft.World/SparseDataStorage.cpp
@@ -40,7 +40,7 @@ SparseDataStorage::SparseDataStorage()
// Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case
#pragma warning ( disable : 4826 )
- dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL);
+ dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL);
#pragma warning ( default : 4826 )
#ifdef DATA_COMPRESSION_STATS
count = 128;
@@ -59,7 +59,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper)
// Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case
#pragma warning ( disable : 4826 )
- dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL);
+ dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL);
#pragma warning ( default : 4826 )
#ifdef DATA_COMPRESSION_STATS
count = 128;
@@ -70,7 +70,7 @@ SparseDataStorage::~SparseDataStorage()
{
unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff);
// Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc
-
+
#ifdef _XBOX
if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE )
{
@@ -87,7 +87,7 @@ SparseDataStorage::~SparseDataStorage()
SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom)
{
// Extra details of source storage
- __int64 sourceDataAndCount = copyFrom->dataAndCount;
+ int64_t sourceDataAndCount = copyFrom->dataAndCount;
unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff);
int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff;
@@ -97,7 +97,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom)
// AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called.
// This should never happen and this isn't a proper solution but fixes it for now.
#pragma warning ( disable : 4826 )
- dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL );
+ dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL );
#pragma warning ( default : 4826 )
XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 );
@@ -126,7 +126,7 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset)
for( int y = 0; y < 128; y++ )
{
bool all0 = true;
-
+
for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked
{
int pos = ( xz << 7 ) | y;
@@ -176,9 +176,9 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset)
// Get new data and count packed info
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)allocatedPlaneCount) << 48;
+ newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48;
updateDataAndCount( newDataAndCount );
}
@@ -230,7 +230,7 @@ int SparseDataStorage::get(int x, int y, int z)
{
unsigned char *planeIndices, *data;
getPlaneIndicesAndData(&planeIndices, &data);
-
+
if( planeIndices[y] == ALL_0_INDEX )
{
return 0;
@@ -370,7 +370,7 @@ int SparseDataStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z0
}
}
ptrdiff_t count = pucOut - &dataInOut.data[offset];
-
+
return (int)count;
}
@@ -380,7 +380,7 @@ void SparseDataStorage::addNewPlane(int y)
do
{
// Get last packed data pointer & count
- __int64 lastDataAndCount = dataAndCount;
+ int64_t lastDataAndCount = dataAndCount;
// Unpack count & data pointer
int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff);
@@ -388,9 +388,9 @@ void SparseDataStorage::addNewPlane(int y)
// Find out what to prefill the newly allocated line with
unsigned char planeIndex = lastDataPointer[y];
-
+
if( planeIndex < ALL_0_INDEX ) return; // Something has already allocated this line - we're done
-
+
int linesUsed = lastLinesUsed + 1;
// Allocate new memory storage, copy over anything from old storage, and initialise remainder
@@ -401,14 +401,14 @@ void SparseDataStorage::addNewPlane(int y)
// Get new data and count packed info
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)linesUsed) << 48;
+ newDataAndCount |= ((int64_t)linesUsed) << 48;
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
- __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
-
+ int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
+
if( lastDataAndCount2 == lastDataAndCount )
{
success = true;
@@ -473,20 +473,20 @@ void SparseDataStorage::tick()
}
// Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen.
-void SparseDataStorage::updateDataAndCount(__int64 newDataAndCount)
+void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount)
{
// Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this
// with any other simultaneous writes that might be happening.
bool success = false;
do
{
- __int64 lastDataAndCount = dataAndCount;
+ int64_t lastDataAndCount = dataAndCount;
unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff);
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
- __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
-
+ int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
+
if( lastDataAndCount2 == lastDataAndCount )
{
success = true;
@@ -508,7 +508,7 @@ int SparseDataStorage::compress()
unsigned char _planeIndices[128];
bool needsCompressed = false;
- __int64 lastDataAndCount = dataAndCount;
+ int64_t lastDataAndCount = dataAndCount;
unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff);
unsigned char *data = planeIndices + 128;
@@ -558,13 +558,13 @@ int SparseDataStorage::compress()
// Get new data and count packed info
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)planesToAlloc) << 48;
+ newDataAndCount |= ((int64_t)planesToAlloc) << 48;
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
- __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
+ int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
if( lastDataAndCount2 != lastDataAndCount )
{
@@ -576,7 +576,7 @@ int SparseDataStorage::compress()
{
// Success
queueForDelete( planeIndices );
-// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices);
+// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices);
#ifdef DATA_COMPRESSION_STATS
count = planesToAlloc;
#endif
@@ -617,9 +617,9 @@ void SparseDataStorage::read(DataInputStream *dis)
dis->readFully(wrapper);
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)count) << 48;
+ newDataAndCount |= ((int64_t)count) << 48;
updateDataAndCount(newDataAndCount);
}
diff --git a/Minecraft.World/SparseDataStorage.h b/Minecraft.World/SparseDataStorage.h
index 93d5c424..16289cda 100644
--- a/Minecraft.World/SparseDataStorage.h
+++ b/Minecraft.World/SparseDataStorage.h
@@ -18,9 +18,9 @@
// To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details...
-// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth
+// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth
// of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64).
-// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
+// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
// the rest of the data is variable in size to accomodate however many planes are required to be stored
// (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated,
// then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore.
@@ -36,7 +36,7 @@ class SparseDataStorage
friend class TileCompressData_SPU;
private:
// unsigned char planeIndices[128];
- __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits)
+ int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits)
// unsigned char *data;
// unsigned int allocatedPlaneCount;
@@ -64,7 +64,7 @@ public:
void addNewPlane(int y);
void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data);
- void updateDataAndCount(__int64 newDataAndCount);
+ void updateDataAndCount(int64_t newDataAndCount);
int compress();
bool isCompressed();
diff --git a/Minecraft.World/SparseLightStorage.cpp b/Minecraft.World/SparseLightStorage.cpp
index f9a2f0cb..a0ba41b1 100644
--- a/Minecraft.World/SparseLightStorage.cpp
+++ b/Minecraft.World/SparseLightStorage.cpp
@@ -40,7 +40,7 @@ SparseLightStorage::SparseLightStorage(bool sky)
// Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case
#pragma warning ( disable : 4826 )
- dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL);
+ dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL);
#pragma warning ( default : 4826 )
#ifdef LIGHT_COMPRESSION_STATS
count = 127;
@@ -59,7 +59,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper)
// Data and count packs together the pointer to our data and the count of planes allocated - 0 planes allocated in this case
#pragma warning ( disable : 4826 )
- dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL);
+ dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL);
#pragma warning ( default : 4826 )
#ifdef LIGHT_COMPRESSION_STATS
count = 0;
@@ -70,7 +70,7 @@ SparseLightStorage::~SparseLightStorage()
{
unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff);
// Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc
-
+
#ifdef _XBOX
if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE )
{
@@ -87,7 +87,7 @@ SparseLightStorage::~SparseLightStorage()
SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom)
{
// Extra details of source storage
- __int64 sourceDataAndCount = copyFrom->dataAndCount;
+ int64_t sourceDataAndCount = copyFrom->dataAndCount;
unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff);
int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff;
@@ -97,7 +97,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom)
// AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called.
// This should never happen and this isn't a proper solution but fixes it for now.
#pragma warning ( disable : 4826 )
- dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL );
+ dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL );
#pragma warning ( default : 4826 )
XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 );
@@ -125,7 +125,7 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset)
{
bool all0 = true;
bool all15 = true;
-
+
for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked
{
int pos = ( xz << 7 ) | y;
@@ -180,9 +180,9 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset)
// Get new data and count packed info
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)allocatedPlaneCount) << 48;
+ newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48;
updateDataAndCount( newDataAndCount );
}
@@ -245,7 +245,7 @@ int SparseLightStorage::get(int x, int y, int z)
{
unsigned char *planeIndices, *data;
getPlaneIndicesAndData(&planeIndices, &data);
-
+
if( planeIndices[y] == ALL_0_INDEX )
{
return 0;
@@ -312,7 +312,7 @@ void SparseLightStorage::setAllBright()
}
// Data and count packs together the pointer to our data and the count of planes allocated, which is currently zero
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ( (__int64) planeIndices ) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ( (int64_t) planeIndices ) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
updateDataAndCount( newDataAndCount );
@@ -375,7 +375,7 @@ int SparseLightStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z
}
}
ptrdiff_t count = pucOut - &dataInOut.data[offset];
-
+
return (int)count;
}
@@ -385,7 +385,7 @@ void SparseLightStorage::addNewPlane(int y)
do
{
// Get last packed data pointer & count
- __int64 lastDataAndCount = dataAndCount;
+ int64_t lastDataAndCount = dataAndCount;
// Unpack count & data pointer
int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff);
@@ -407,14 +407,14 @@ void SparseLightStorage::addNewPlane(int y)
// Get new data and count packed info
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)linesUsed) << 48;
+ newDataAndCount |= ((int64_t)linesUsed) << 48;
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
- __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
-
+ int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
+
if( lastDataAndCount2 == lastDataAndCount )
{
success = true;
@@ -479,20 +479,20 @@ void SparseLightStorage::tick()
}
// Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen.
-void SparseLightStorage::updateDataAndCount(__int64 newDataAndCount)
+void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount)
{
// Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this
// with any other simultaneous writes that might be happening.
bool success = false;
do
{
- __int64 lastDataAndCount = dataAndCount;
+ int64_t lastDataAndCount = dataAndCount;
unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff);
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
- __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
-
+ int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
+
if( lastDataAndCount2 == lastDataAndCount )
{
success = true;
@@ -514,7 +514,7 @@ int SparseLightStorage::compress()
unsigned char _planeIndices[128];
bool needsCompressed = false;
- __int64 lastDataAndCount = dataAndCount;
+ int64_t lastDataAndCount = dataAndCount;
unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff);
unsigned char *data = planeIndices + 128;
@@ -575,13 +575,13 @@ int SparseLightStorage::compress()
// Get new data and count packed info
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)planesToAlloc) << 48;
+ newDataAndCount |= ((int64_t)planesToAlloc) << 48;
// Attempt to update the data & count atomically. This command will Only succeed if the data stored at
// dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place
- __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
+ int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount );
if( lastDataAndCount2 != lastDataAndCount )
{
@@ -593,7 +593,7 @@ int SparseLightStorage::compress()
{
// Success
queueForDelete( planeIndices );
-// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices);
+// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices);
#ifdef LIGHT_COMPRESSION_STATS
count = planesToAlloc;
#endif
@@ -634,9 +634,9 @@ void SparseLightStorage::read(DataInputStream *dis)
dis->readFully(wrapper);
#pragma warning ( disable : 4826 )
- __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL;
+ int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL;
#pragma warning ( default : 4826 )
- newDataAndCount |= ((__int64)count) << 48;
+ newDataAndCount |= ((int64_t)count) << 48;
updateDataAndCount( newDataAndCount );
}
diff --git a/Minecraft.World/SparseLightStorage.h b/Minecraft.World/SparseLightStorage.h
index d05d7645..c4cfbd04 100644
--- a/Minecraft.World/SparseLightStorage.h
+++ b/Minecraft.World/SparseLightStorage.h
@@ -20,9 +20,9 @@
// To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details...
-// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth
+// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth
// of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64).
-// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
+// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
// the rest of the data is variable in size to accomodate however many planes are required to be stored
// (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated,
// then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore.
@@ -38,7 +38,7 @@ class SparseLightStorage
friend class TileCompressData_SPU;
private:
// unsigned char planeIndices[128];
- __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits)
+ int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits)
// unsigned char *data;
// unsigned int allocatedPlaneCount;
@@ -66,7 +66,7 @@ public:
void addNewPlane(int y);
void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data);
- void updateDataAndCount(__int64 newDataAndCount);
+ void updateDataAndCount(int64_t newDataAndCount);
int compress();
bool isCompressed();
diff --git a/Minecraft.World/StructureFeature.cpp b/Minecraft.World/StructureFeature.cpp
index dfb214a5..bbce7e1a 100644
--- a/Minecraft.World/StructureFeature.cpp
+++ b/Minecraft.World/StructureFeature.cpp
@@ -169,10 +169,10 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
restoreSavedData(level);
random->setSeed(level->getSeed());
- __int64 xScale = random->nextLong();
- __int64 zScale = random->nextLong();
- __int64 xx = (cellX >> 4) * xScale;
- __int64 zz = (cellZ >> 4) * zScale;
+ int64_t xScale = random->nextLong();
+ int64_t zScale = random->nextLong();
+ int64_t xx = (cellX >> 4) * xScale;
+ int64_t zz = (cellZ >> 4) * zScale;
random->setSeed(xx ^ zz ^ level->getSeed());
addFeature(level, cellX >> 4, cellZ >> 4, 0, 0, byteArray());
diff --git a/Minecraft.World/StructureFeature.h b/Minecraft.World/StructureFeature.h
index ace5593d..52103243 100644
--- a/Minecraft.World/StructureFeature.h
+++ b/Minecraft.World/StructureFeature.h
@@ -26,7 +26,7 @@ private:
protected:
- unordered_map<__int64, StructureStart *> cachedStructures;
+ unordered_map<int64_t, StructureStart *> cachedStructures;
public:
StructureFeature();
@@ -49,7 +49,7 @@ public:
TilePos *getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ);
protected:
- vector<TilePos> *getGuesstimatedFeaturePositions();
+ vector<TilePos> *getGuesstimatedFeaturePositions();
private:
virtual void restoreSavedData(Level *level);
@@ -58,7 +58,7 @@ private:
/**
* Returns true if the given chunk coordinates should hold a structure
* source.
- *
+ *
* @param x
* chunk x
* @param z
@@ -71,7 +71,7 @@ protected:
/**
* Creates a new instance of a structure source at the given chunk
* coordinates.
- *
+ *
* @param x
* chunk x
* @param z
diff --git a/Minecraft.World/SwampRiversLayer.cpp b/Minecraft.World/SwampRiversLayer.cpp
index 68cef8a8..cd22cae8 100644
--- a/Minecraft.World/SwampRiversLayer.cpp
+++ b/Minecraft.World/SwampRiversLayer.cpp
@@ -3,7 +3,7 @@
#include "IntCache.h"
#include "SwampRiversLayer.h"
-SwampRiversLayer::SwampRiversLayer(__int64 seed, shared_ptr<Layer> parent) : Layer(seed)
+SwampRiversLayer::SwampRiversLayer(int64_t seed, shared_ptr<Layer> parent) : Layer(seed)
{
this->parent = parent;
}
diff --git a/Minecraft.World/SwampRiversLayer.h b/Minecraft.World/SwampRiversLayer.h
index f724ad82..97bab0f4 100644
--- a/Minecraft.World/SwampRiversLayer.h
+++ b/Minecraft.World/SwampRiversLayer.h
@@ -5,7 +5,7 @@
class SwampRiversLayer : public Layer
{
public:
- SwampRiversLayer(__int64 seed, shared_ptr<Layer> parent);
+ SwampRiversLayer(int64_t seed, shared_ptr<Layer> parent);
intArray getArea(int xo, int yo, int w, int h);
}; \ No newline at end of file
diff --git a/Minecraft.World/System.h b/Minecraft.World/System.h
index 06e265cc..1d48b408 100644
--- a/Minecraft.World/System.h
+++ b/Minecraft.World/System.h
@@ -20,16 +20,16 @@ public:
ArrayCopyFunctionDeclaration(Biome *)
ArrayCopyFunctionDeclaration(int)
- static __int64 nanoTime();
- static __int64 currentTimeMillis();
- static __int64 currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves
+ static int64_t nanoTime();
+ static int64_t currentTimeMillis();
+ static int64_t currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves
static void ReverseUSHORT(unsigned short *pusVal);
static void ReverseSHORT(short *psVal);
static void ReverseULONG(unsigned long *pulVal);
static void ReverseULONG(unsigned int *pulVal);
static void ReverseINT(int *piVal);
- static void ReverseULONGLONG(__int64 *pullVal);
+ static void ReverseULONGLONG(int64_t *pullVal);
static void ReverseWCHARA(WCHAR *pwch,int iLen);
};
diff --git a/Minecraft.World/TheEndDimension.cpp b/Minecraft.World/TheEndDimension.cpp
index ccc8641b..031d6de4 100644
--- a/Minecraft.World/TheEndDimension.cpp
+++ b/Minecraft.World/TheEndDimension.cpp
@@ -19,7 +19,7 @@ ChunkSource *TheEndDimension::createRandomLevelSource() const
return new TheEndLevelRandomLevelSource(level, level->getSeed());
}
-float TheEndDimension::getTimeOfDay(__int64 time, float a) const
+float TheEndDimension::getTimeOfDay(int64_t time, float a) const
{
return 0.0f;
}
diff --git a/Minecraft.World/TheEndDimension.h b/Minecraft.World/TheEndDimension.h
index 95bd6980..268be6f6 100644
--- a/Minecraft.World/TheEndDimension.h
+++ b/Minecraft.World/TheEndDimension.h
@@ -6,7 +6,7 @@ class TheEndDimension : public Dimension
public:
virtual void init();
virtual ChunkSource *createRandomLevelSource() const;
- virtual float getTimeOfDay(__int64 time, float a) const;
+ virtual float getTimeOfDay(int64_t time, float a) const;
virtual float *getSunriseColor(float td, float a);
virtual Vec3 *getFogColor(float td, float a) const;
virtual bool hasGround();
diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp
index 67d85a92..f9f38470 100644
--- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp
+++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp
@@ -9,7 +9,7 @@
#include "net.minecraft.world.level.storage.h"
#include "TheEndLevelRandomLevelSource.h"
-TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, __int64 seed)
+TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, int64_t seed)
{
m_XZSize = END_LEVEL_MIN_WIDTH;
@@ -370,10 +370,10 @@ void TheEndLevelRandomLevelSource::postProcess(ChunkSource *parent, int xt, int
// 4J - added. The original java didn't do any setting of the random seed here, and passes the level random to the biome decorator.
// We'll be running our postProcess in parallel with getChunk etc. so we need to use a separate random - have used the same initialisation code as
- // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation.
+ // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation.
pprandom->setSeed(level->getSeed());
- __int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
- __int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t xScale = pprandom->nextLong() / 2 * 2 + 1;
+ int64_t zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
Biome *biome = level->getBiome(xo + 16, zo + 16);
diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.h b/Minecraft.World/TheEndLevelRandomLevelSource.h
index 4a2a4f2a..a95a84fa 100644
--- a/Minecraft.World/TheEndLevelRandomLevelSource.h
+++ b/Minecraft.World/TheEndLevelRandomLevelSource.h
@@ -9,7 +9,7 @@ public:
static const double SNOW_CUTOFF;
static const double SNOW_SCALE;
static const bool FLOATING_ISLANDS;
-
+
static const int CHUNK_HEIGHT = 4;
static const int CHUNK_WIDTH = 8;
private:
@@ -30,7 +30,7 @@ private:
Level *level;
public:
- TheEndLevelRandomLevelSource(Level *level, __int64 seed);
+ TheEndLevelRandomLevelSource(Level *level, int64_t seed);
~TheEndLevelRandomLevelSource();
void prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes);
diff --git a/Minecraft.World/TickNextTickData.h b/Minecraft.World/TickNextTickData.h
index 04d9ed5e..60fe3be3 100644
--- a/Minecraft.World/TickNextTickData.h
+++ b/Minecraft.World/TickNextTickData.h
@@ -12,7 +12,7 @@ private:
public:
int x, y, z, tileId;
- __int64 m_delay;
+ int64_t m_delay;
int priorityTilt;
private:
@@ -23,7 +23,7 @@ public:
bool equals(const TickNextTickData *o) const;
int hashCode() const;
- TickNextTickData *delay(__int64 l);
+ TickNextTickData *delay(int64_t l);
void setPriorityTilt(int priorityTilt);
int compareTo(const TickNextTickData *tnd) const;
@@ -35,19 +35,19 @@ public:
struct TickNextTickDataKeyHash
{
- int operator() (const TickNextTickData &k) const
+ int operator() (const TickNextTickData &k) const
{ return TickNextTickData::hash_fnct (k); }
};
struct TickNextTickDataKeyEq
{
- bool operator() (const TickNextTickData &x, const TickNextTickData &y) const
+ bool operator() (const TickNextTickData &x, const TickNextTickData &y) const
{ return TickNextTickData::eq_test (x, y); }
};
struct TickNextTickDataKeyCompare
{
- bool operator() (const TickNextTickData &x, const TickNextTickData &y) const
+ bool operator() (const TickNextTickData &x, const TickNextTickData &y) const
{ return TickNextTickData::compare_fnct (x, y); }
}; \ No newline at end of file
diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp
index a07fdfe4..67148274 100644
--- a/Minecraft.World/Tile.cpp
+++ b/Minecraft.World/Tile.cpp
@@ -1358,7 +1358,7 @@ void Tile::handleRain(Level *level, int x, int y, int z)
{
}
-void Tile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime)
+void Tile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime)
{
}
diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h
index 142b32e6..307c4106 100644
--- a/Minecraft.World/Tile.h
+++ b/Minecraft.World/Tile.h
@@ -59,13 +59,13 @@ protected:
ThreadStorage();
};
static DWORD tlsIdxShape;
-public:
+public:
// Each new thread that needs to use Vec3 pools will need to call one of the following 2 functions, to either create its own
// local storage, or share the default storage already allocated by the main thread
static void CreateNewThreadStorage();
static void ReleaseThreadStorage();
-public:
+public:
static const int TILE_NUM_COUNT = 4096;
static const int TILE_NUM_MASK = 0xfff; // 4096 - 1
static const int TILE_NUM_SHIFT = 12; // 4096 is 12 bits
@@ -118,7 +118,7 @@ public:
static SoundType *SOUND_NORMAL;
static SoundType *SOUND_WOOD;
static SoundType *SOUND_GRAVEL;
- static SoundType *SOUND_GRASS;
+ static SoundType *SOUND_GRASS;
static SoundType *SOUND_STONE;
static SoundType *SOUND_METAL;
static SoundType *SOUND_GLASS;
@@ -704,7 +704,7 @@ public:
virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr<Player> player);
virtual void onRemoving(Level *level, int x, int y, int z, int data);
virtual void handleRain(Level *level, int x, int y, int z);
- virtual void levelTimeChanged(Level *level, __int64 delta, __int64 newTime);
+ virtual void levelTimeChanged(Level *level, int64_t delta, int64_t newTime);
virtual bool useOwnCloneData();
virtual bool canInstantlyTick();
virtual bool dropFromExplosion(Explosion *explosion);
@@ -719,7 +719,7 @@ protected:
public:
virtual void registerIcons(IconRegister *iconRegister);
- virtual wstring getTileItemIconName();
+ virtual wstring getTileItemIconName();
// AP - added this function so we can generate the faceFlags for a block in a single fast function
int getFaceFlags(LevelSource *level, int x, int y, int z);
diff --git a/Minecraft.World/VoronoiZoom.cpp b/Minecraft.World/VoronoiZoom.cpp
index 78323dfa..f62cc9b6 100644
--- a/Minecraft.World/VoronoiZoom.cpp
+++ b/Minecraft.World/VoronoiZoom.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.newbiome.layer.h"
#include "System.h"
-VoronoiZoom::VoronoiZoom(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+VoronoiZoom::VoronoiZoom(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
diff --git a/Minecraft.World/VoronoiZoom.h b/Minecraft.World/VoronoiZoom.h
index c0738c90..43a8de66 100644
--- a/Minecraft.World/VoronoiZoom.h
+++ b/Minecraft.World/VoronoiZoom.h
@@ -5,7 +5,7 @@
class VoronoiZoom : public Layer
{
public:
- VoronoiZoom(__int64 seedMixup, shared_ptr<Layer>parent);
+ VoronoiZoom(int64_t seedMixup, shared_ptr<Layer>parent);
virtual intArray getArea(int xo, int yo, int w, int h);
diff --git a/Minecraft.World/WaterLevelChunk.cpp b/Minecraft.World/WaterLevelChunk.cpp
index 7727898b..3f4bd704 100644
--- a/Minecraft.World/WaterLevelChunk.cpp
+++ b/Minecraft.World/WaterLevelChunk.cpp
@@ -148,7 +148,7 @@ bool WaterLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z
return false;
}
-Random *WaterLevelChunk::getRandom(__int64 l)
+Random *WaterLevelChunk::getRandom(int64_t l)
{
return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l);
}
diff --git a/Minecraft.World/WaterLevelChunk.h b/Minecraft.World/WaterLevelChunk.h
index d2753cfa..619eb65c 100644
--- a/Minecraft.World/WaterLevelChunk.h
+++ b/Minecraft.World/WaterLevelChunk.h
@@ -40,7 +40,7 @@ public:
void setBlocks(byteArray newBlocks, int sub);
int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter;
bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p);
- Random *getRandom(__int64 l);
+ Random *getRandom(int64_t l);
virtual Biome *getBiome(int x, int z, BiomeSource *biomeSource);
virtual void reSyncLighting() {}; // 4J added
};
diff --git a/Minecraft.World/ZoneFile.cpp b/Minecraft.World/ZoneFile.cpp
index fc1f36bf..661cb7dd 100644
--- a/Minecraft.World/ZoneFile.cpp
+++ b/Minecraft.World/ZoneFile.cpp
@@ -6,7 +6,7 @@
const int ZoneFile::slotsLength = ZonedChunkStorage::CHUNKS_PER_ZONE * ZonedChunkStorage::CHUNKS_PER_ZONE;
-ZoneFile::ZoneFile(__int64 key, File file, File entityFile) : slots(slotsLength)
+ZoneFile::ZoneFile(int64_t key, File file, File entityFile) : slots(slotsLength)
{
lastUse = 0;
diff --git a/Minecraft.World/ZoneFile.h b/Minecraft.World/ZoneFile.h
index d7b8cc82..5adb60ee 100644
--- a/Minecraft.World/ZoneFile.h
+++ b/Minecraft.World/ZoneFile.h
@@ -17,18 +17,18 @@ private:
short slotCount;
public:
- __int64 lastUse;
+ int64_t lastUse;
private:
HANDLE channel;
public:
- __int64 key;
+ int64_t key;
File file;
NbtSlotFile *entityFile;
- ZoneFile(__int64 key, File file, File entityFile);
+ ZoneFile(int64_t key, File file, File entityFile);
~ZoneFile();
void readHeader();
diff --git a/Minecraft.World/ZoneIo.cpp b/Minecraft.World/ZoneIo.cpp
index f1838c86..0bd2a637 100644
--- a/Minecraft.World/ZoneIo.cpp
+++ b/Minecraft.World/ZoneIo.cpp
@@ -2,7 +2,7 @@
#include "ByteBuffer.h"
#include "ZoneIo.h"
-ZoneIo::ZoneIo(HANDLE channel, __int64 pos)
+ZoneIo::ZoneIo(HANDLE channel, int64_t pos)
{
this->channel = channel;
this->pos = pos;
diff --git a/Minecraft.World/ZoneIo.h b/Minecraft.World/ZoneIo.h
index 22473583..59840564 100644
--- a/Minecraft.World/ZoneIo.h
+++ b/Minecraft.World/ZoneIo.h
@@ -7,10 +7,10 @@ class ZoneIo
{
private:
HANDLE channel;
- __int64 pos;
+ int64_t pos;
public:
- ZoneIo(HANDLE channel, __int64 pos);
+ ZoneIo(HANDLE channel, int64_t pos);
void write(byteArray bb, int size);
void write(ByteBuffer *bb, int size);
ByteBuffer *read(int size);
diff --git a/Minecraft.World/ZonedChunkStorage.cpp b/Minecraft.World/ZonedChunkStorage.cpp
index 5c6bf192..596d7c48 100644
--- a/Minecraft.World/ZonedChunkStorage.cpp
+++ b/Minecraft.World/ZonedChunkStorage.cpp
@@ -50,7 +50,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create)
int xZone = x >> CHUNKS_PER_ZONE_BITS;
int zZone = z >> CHUNKS_PER_ZONE_BITS;
- __int64 key = xZone + (zZone << 20l);
+ int64_t key = xZone + (zZone << 20l);
// 4J - was !zoneFiles.containsKey(key)
if (zoneFiles.find(key) == zoneFiles.end())
{
@@ -107,8 +107,8 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z)
header->flip();
int xOrg = header->getInt();
int zOrg = header->getInt();
- __int64 time = header->getLong();
- __int64 flags = header->getLong();
+ int64_t time = header->getLong();
+ int64_t flags = header->getLong();
lc->terrainPopulated = (flags & BIT_TERRAIN_POPULATED) != 0;
@@ -121,7 +121,7 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z)
void ZonedChunkStorage::save(Level *level, LevelChunk *lc)
{
- __int64 flags = 0;
+ int64_t flags = 0;
if (lc->terrainPopulated) flags |= BIT_TERRAIN_POPULATED;
ByteBuffer *header = ByteBuffer::allocate(CHUNK_HEADER_SIZE);
@@ -176,7 +176,7 @@ void ZonedChunkStorage::flush()
for ( auto& it : zoneFiles )
{
ZoneFile *zoneFile = it.second;
- if ( zoneFile )
+ if ( zoneFile )
zoneFile->close();
}
zoneFiles.clear();
diff --git a/Minecraft.World/ZonedChunkStorage.h b/Minecraft.World/ZonedChunkStorage.h
index ed7e3b65..c8b89db9 100644
--- a/Minecraft.World/ZonedChunkStorage.h
+++ b/Minecraft.World/ZonedChunkStorage.h
@@ -14,24 +14,24 @@ class ZonedChunkStorage : public ChunkStorage
{
public:
static const int BIT_TERRAIN_POPULATED;
-
+
static const int CHUNKS_PER_ZONE_BITS; // = 32
static const int CHUNKS_PER_ZONE; // ^2
-
+
static const int CHUNK_WIDTH;
-
+
static const int CHUNK_HEADER_SIZE;
static const int CHUNK_SIZE;
static const int CHUNK_LAYERS ;
static const int CHUNK_SIZE_BYTES;
-
+
static const ByteOrder BYTEORDER;
File dir;
private:
- unordered_map<__int64, ZoneFile *> zoneFiles;
- __int64 tickCount;
+ unordered_map<int64_t, ZoneFile *> zoneFiles;
+ int64_t tickCount;
public:
ZonedChunkStorage(File dir);
diff --git a/Minecraft.World/ZoomLayer.cpp b/Minecraft.World/ZoomLayer.cpp
index bef24709..c2123785 100644
--- a/Minecraft.World/ZoomLayer.cpp
+++ b/Minecraft.World/ZoomLayer.cpp
@@ -2,7 +2,7 @@
#include "net.minecraft.world.level.newbiome.layer.h"
#include "System.h"
-ZoomLayer::ZoomLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
+ZoomLayer::ZoomLayer(int64_t seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
{
this->parent = parent;
}
@@ -81,7 +81,7 @@ int ZoomLayer::random(int a, int b, int c, int d)
return d;
}
-shared_ptr<Layer>ZoomLayer::zoom(__int64 seed, shared_ptr<Layer> sup, int count)
+shared_ptr<Layer>ZoomLayer::zoom(int64_t seed, shared_ptr<Layer> sup, int count)
{
shared_ptr<Layer>result = sup;
for (int i = 0; i < count; i++)
diff --git a/Minecraft.World/ZoomLayer.h b/Minecraft.World/ZoomLayer.h
index f865f088..8ec93c8a 100644
--- a/Minecraft.World/ZoomLayer.h
+++ b/Minecraft.World/ZoomLayer.h
@@ -5,7 +5,7 @@
class ZoomLayer : public Layer
{
public:
- ZoomLayer(__int64 seedMixup, shared_ptr<Layer> parent);
+ ZoomLayer(int64_t seedMixup, shared_ptr<Layer> parent);
virtual intArray getArea(int xo, int yo, int w, int h);
@@ -14,5 +14,5 @@ protected:
int random(int a, int b, int c, int d);
public:
- static shared_ptr<Layer> zoom(__int64 seed, shared_ptr<Layer>sup, int count);
+ static shared_ptr<Layer> zoom(int64_t seed, shared_ptr<Layer>sup, int count);
}; \ No newline at end of file
diff --git a/Minecraft.World/stdafx.h b/Minecraft.World/stdafx.h
index 37c3960c..2e170ad2 100644
--- a/Minecraft.World/stdafx.h
+++ b/Minecraft.World/stdafx.h
@@ -4,13 +4,7 @@
//
#pragma once
-#ifdef __PS3__
-#else
-#endif
-
-#if ( defined _XBOX || defined _WINDOWS64 || defined _DURANGO )
-typedef unsigned __int64 __uint64;
-#endif
+#include <cstdint>
#ifdef _WINDOWS64
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
diff --git a/Minecraft.World/system.cpp b/Minecraft.World/system.cpp
index b6dd56d9..f9bd07a7 100644
--- a/Minecraft.World/system.cpp
+++ b/Minecraft.World/system.cpp
@@ -21,7 +21,7 @@ void System::arraycopy(arrayWithLength<BYTE> src, unsigned int srcPos, arrayWith
assert( srcPos >=0 && srcPos <= src.length);
assert( srcPos + length <= src.length );
assert( dstPos + length <= dst->length );
-
+
memcpy( dst->data + dstPos, src.data + srcPos, length);
}
@@ -30,7 +30,7 @@ void System::arraycopy(arrayWithLength<int> src, unsigned int srcPos, arrayWithL
assert( srcPos >=0 && srcPos <= src.length);
assert( srcPos + length <= src.length );
assert( dstPos + length <= dst->length );
-
+
memcpy( dst->data + dstPos, src.data + srcPos, length * sizeof(int) );
}
@@ -47,10 +47,10 @@ void System::arraycopy(arrayWithLength<int> src, unsigned int srcPos, arrayWithL
// long startTime = System.nanoTime();
// // ... the code being measured ...
// long estimatedTime = System.nanoTime() - startTime;
-//
+//
//Returns:
//The current value of the system timer, in nanoseconds.
-__int64 System::nanoTime()
+int64_t System::nanoTime()
{
#if defined _WINDOWS64 || defined _XBOX || defined _WIN32
static LARGE_INTEGER s_frequency = { 0 };
@@ -64,7 +64,7 @@ __int64 System::nanoTime()
// Using double to avoid 64-bit overflow during multiplication for long uptime
// Precision is sufficient for ~100 days of uptime.
- return (__int64)((double)counter.QuadPart * 1000000000.0 / (double)s_frequency.QuadPart);
+ return (int64_t)((double)counter.QuadPart * 1000000000.0 / (double)s_frequency.QuadPart);
#else
return GetTickCount() * 1000000LL;
#endif
@@ -73,21 +73,21 @@ __int64 System::nanoTime()
//Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond,
//the granularity of the value depends on the underlying operating system and may be larger. For example,
//many operating systems measure time in units of tens of milliseconds.
-//See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time"
+//See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time"
//and coordinated universal time (UTC).
//
//Returns:
//the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
-__int64 System::currentTimeMillis()
+int64_t System::currentTimeMillis()
{
#ifdef __PS3__
-// sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC).
-// The value is separated into two parts: sec stores the elapsed time in seconds, and nsec
+// sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC).
+// The value is separated into two parts: sec stores the elapsed time in seconds, and nsec
// stores the value that is smaller than a second in nanoseconds.
sys_time_sec_t sec;
sys_time_nsec_t nsec;
sys_time_get_current_time(&sec, &nsec);
- __int64 msec = (sec * 1000) + (nsec / (1000*1000));
+ int64_t msec = (sec * 1000) + (nsec / (1000*1000));
return msec;
#elif defined __ORBIS__
@@ -100,7 +100,7 @@ __int64 System::currentTimeMillis()
return sceKernelGetProcessTimeWide() / 1000;
/* SceDateTime Time;
sceRtcGetCurrentClockLocalTime(&Time);
- __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000);
+ int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000);
return systTime;*/
#else
@@ -121,7 +121,7 @@ __int64 System::currentTimeMillis()
}
// 4J Stu - Added this so that we can use real-world timestamps in PSVita saves. Particularly required for the save transfers to be smooth
-__int64 System::currentRealTimeMillis()
+int64_t System::currentRealTimeMillis()
{
#ifdef __PSVITA__
SceFiosDate fileTime = sceFiosDateGetCurrent();
@@ -189,9 +189,9 @@ void System::ReverseINT(int *piVal)
pchVal1[3]=pchVal2[0];
}
-void System::ReverseULONGLONG(__int64 *pullVal)
+void System::ReverseULONGLONG(int64_t *pullVal)
{
- __int64 ullValue=*pullVal;
+ int64_t ullValue=*pullVal;
unsigned char *pchVal1=(unsigned char *)pullVal;
unsigned char *pchVal2=(unsigned char *)&ullValue;