Remove all MSVC __int64 (#742)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
static void staticCtor();
|
||||
|
||||
private:
|
||||
__int64 clientSideRenderTick;
|
||||
int64_t clientSideRenderTick;
|
||||
float clientSideRenderScale;
|
||||
|
||||
bool isActive;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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); }
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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_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 bits = (((a & 0xff) << 56) |
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ private:
|
||||
bool m_costsChanged; // 4J Added
|
||||
|
||||
public:
|
||||
__int64 nameSeed;
|
||||
int64_t nameSeed;
|
||||
|
||||
public:
|
||||
int costs[3];
|
||||
|
||||
@@ -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); }
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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; };
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ private:
|
||||
Level *level;
|
||||
|
||||
public:
|
||||
HellFlatLevelSource(Level *level, __int64 seed);
|
||||
HellFlatLevelSource(Level *level, int64_t seed);
|
||||
~HellFlatLevelSource();
|
||||
|
||||
private:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
Level *level;
|
||||
|
||||
public:
|
||||
HellRandomLevelSource(Level *level, __int64 seed);
|
||||
HellRandomLevelSource(Level *level, int64_t seed);
|
||||
~HellRandomLevelSource();
|
||||
|
||||
NetherBridgeFeature *netherBridgeFeature;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -16,7 +16,7 @@ private:
|
||||
int life;
|
||||
|
||||
public:
|
||||
__int64 seed;
|
||||
int64_t seed;
|
||||
|
||||
private:
|
||||
int flashes;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
byteArray NbtSlotFile::READ_BUFFER(1024*1024);
|
||||
__int64 NbtSlotFile::largest = 0;
|
||||
int64_t NbtSlotFile::largest = 0;
|
||||
|
||||
NbtSlotFile::NbtSlotFile(File file)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
int fileSlotMapLength;
|
||||
vector<int> freeFileSlots;
|
||||
int totalFileSlots;
|
||||
static __int64 largest;
|
||||
static int64_t largest;
|
||||
|
||||
public:
|
||||
NbtSlotFile(File file);
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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++ )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user