Remove all MSVC __int64 (#742)
This commit is contained in:
@@ -19,17 +19,17 @@ private:
|
||||
ConsoleSchematicFile::ESchematicRotation m_rotation;
|
||||
int m_dimension;
|
||||
|
||||
__int64 m_totalBlocksChanged;
|
||||
__int64 m_totalBlocksChangedLighting;
|
||||
int64_t m_totalBlocksChanged;
|
||||
int64_t m_totalBlocksChangedLighting;
|
||||
bool m_completed;
|
||||
|
||||
void updateLocationBox();
|
||||
public:
|
||||
public:
|
||||
ApplySchematicRuleDefinition(LevelGenerationOptions *levelGenOptions);
|
||||
~ApplySchematicRuleDefinition();
|
||||
|
||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; }
|
||||
|
||||
|
||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void ConsoleSchematicFile::save(DataOutputStream *dos)
|
||||
dos->writeInt(m_zSize);
|
||||
|
||||
byteArray ba(new BYTE[ m_data.length ], m_data.length);
|
||||
Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length,
|
||||
Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length,
|
||||
m_data.data, m_data.length);
|
||||
|
||||
dos->writeInt(ba.length);
|
||||
@@ -71,13 +71,13 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
||||
m_ySize = dis->readInt();
|
||||
m_zSize = dis->readInt();
|
||||
|
||||
int compressedSize = dis->readInt();
|
||||
int compressedSize = dis->readInt();
|
||||
byteArray compressedBuffer(compressedSize);
|
||||
dis->readFully(compressedBuffer);
|
||||
|
||||
if(m_data.data != NULL)
|
||||
{
|
||||
delete [] m_data.data;
|
||||
delete [] m_data.data;
|
||||
m_data.data = NULL;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
||||
double z = pos->get(2)->data;
|
||||
|
||||
if( type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME )
|
||||
{
|
||||
{
|
||||
x = ((IntTag *) eTag->get(L"TileX") )->data;
|
||||
y = ((IntTag *) eTag->get(L"TileY") )->data;
|
||||
z = ((IntTag *) eTag->get(L"TileZ") )->data;
|
||||
@@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
|
||||
delete tag;
|
||||
}
|
||||
|
||||
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
{
|
||||
int xStart = static_cast<int>(std::fmax<double>(destinationBox->x0, (double)chunk->x*16));
|
||||
int xEnd = static_cast<int>(std::fmin<double>(destinationBox->x1, (double)((xStart >> 4) << 4) + 16));
|
||||
@@ -281,7 +281,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
|
||||
// blockData[i] = Tile::endStone_Id;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
PIXBeginNamedEvent(0,"Setting Block data");
|
||||
chunk->setBlockData(blockData);
|
||||
PIXEndNamedEvent();
|
||||
@@ -323,7 +323,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
|
||||
|
||||
// At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so
|
||||
// we can do the sort of lighting that might propagate out of the chunk.
|
||||
__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||
{
|
||||
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
||||
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
||||
@@ -445,7 +445,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
|
||||
|
||||
if ( teCopy != NULL )
|
||||
{
|
||||
{
|
||||
CompoundTag *teData = new CompoundTag();
|
||||
te->save(teData);
|
||||
|
||||
@@ -478,7 +478,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
for (auto it = m_entities.begin(); it != m_entities.end();)
|
||||
{
|
||||
Vec3 *source = it->first;
|
||||
|
||||
|
||||
double targetX = source->x;
|
||||
double targetY = source->y + destinationBox->y0;
|
||||
double targetZ = source->z;
|
||||
@@ -498,7 +498,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
if( e->GetType() == eTYPE_PAINTING )
|
||||
{
|
||||
shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
|
||||
|
||||
|
||||
double tileX = painting->xTile;
|
||||
double tileZ = painting->zTile;
|
||||
schematicCoordToChunkCoord(destinationBox, painting->xTile, painting->zTile, rot, tileX, tileZ);
|
||||
@@ -511,7 +511,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
else if( e->GetType() == eTYPE_ITEM_FRAME )
|
||||
{
|
||||
shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
|
||||
|
||||
|
||||
double tileX = frame->xTile;
|
||||
double tileZ = frame->zTile;
|
||||
schematicCoordToChunkCoord(destinationBox, frame->xTile, frame->zTile, rot, tileX, tileZ);
|
||||
@@ -559,7 +559,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
zStart-=1;
|
||||
else if(zStart < 0 && zStart%2 !=0)
|
||||
zStart-=1;
|
||||
|
||||
|
||||
// We want the end to be odd to have a total size that is even
|
||||
if(xEnd > 0 && xEnd%2 == 0)
|
||||
xEnd+=1;
|
||||
@@ -613,7 +613,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
|
||||
// Every x is a whole row
|
||||
for(int xPos = xStart; xPos < xStart + xSize; ++xPos)
|
||||
{
|
||||
{
|
||||
int xc = xPos >> 4;
|
||||
|
||||
int x0 = xPos - xc * 16;
|
||||
@@ -622,7 +622,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
if (x1 > 16) x1 = 16;
|
||||
|
||||
for(int zPos = zStart; zPos < zStart + zSize;)
|
||||
{
|
||||
{
|
||||
int zc = zPos >> 4;
|
||||
|
||||
int z0 = zStart - zc * 16;
|
||||
@@ -713,11 +713,11 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
}
|
||||
|
||||
// 4J-JEV: Changed to check for instances of minecarts and hangingEntities instead of just eTYPE_PAINTING, eTYPE_ITEM_FRAME and eTYPE_MINECART
|
||||
if (mobCanBeSaved || e->instanceof(eTYPE_MINECART) || e->GetType() == eTYPE_BOAT || e->instanceof(eTYPE_HANGING_ENTITY))
|
||||
if (mobCanBeSaved || e->instanceof(eTYPE_MINECART) || e->GetType() == eTYPE_BOAT || e->instanceof(eTYPE_HANGING_ENTITY))
|
||||
{
|
||||
CompoundTag *eTag = new CompoundTag();
|
||||
if( e->save(eTag) )
|
||||
{
|
||||
{
|
||||
ListTag<DoubleTag> *pos = (ListTag<DoubleTag> *) eTag->getList(L"Pos");
|
||||
|
||||
pos->get(0)->data -= xStart;
|
||||
@@ -725,7 +725,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
pos->get(2)->data -= zStart;
|
||||
|
||||
if( e->instanceof(eTYPE_HANGING_ENTITY) )
|
||||
{
|
||||
{
|
||||
((IntTag *) eTag->get(L"TileX") )->data -= xStart;
|
||||
((IntTag *) eTag->get(L"TileY") )->data -= yStart;
|
||||
((IntTag *) eTag->get(L"TileZ") )->data -= zStart;
|
||||
@@ -766,7 +766,7 @@ void ConsoleSchematicFile::getBlocksAndData(LevelChunk *chunk, byteArray *data,
|
||||
// skyLightP += skyLightData.length;
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
||||
bool bHasLower, bHasUpper;
|
||||
bHasLower = bHasUpper = false;
|
||||
int lowerY0, lowerY1, upperY0, upperY1;
|
||||
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
vector<shared_ptr<TileEntity> > m_tileEntities;
|
||||
vector< pair<Vec3 *, CompoundTag *> > m_entities;
|
||||
|
||||
public:
|
||||
public:
|
||||
byteArray m_data;
|
||||
|
||||
public:
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
void save(DataOutputStream *dos);
|
||||
void load(DataInputStream *dis);
|
||||
|
||||
__int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
__int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||
|
||||
static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes);
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
typedef struct _ValueType
|
||||
{
|
||||
union{
|
||||
__int64 i64;
|
||||
int64_t i64;
|
||||
int i;
|
||||
char c;
|
||||
bool b;
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
virtual ~GameRule();
|
||||
|
||||
Connection *getConnection() { return m_connection; }
|
||||
|
||||
|
||||
ValueType getParameter(const wstring ¶meterName);
|
||||
void setParameter(const wstring ¶meterName,ValueType value);
|
||||
GameRuleDefinition *getGameRuleDefinition();
|
||||
|
||||
@@ -385,7 +385,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
||||
// Read File.
|
||||
|
||||
// version_number
|
||||
__int64 version = dis.readShort();
|
||||
int64_t version = dis.readShort();
|
||||
unsigned char compressionType = 0;
|
||||
if(version == 0)
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
|
||||
{
|
||||
if(attributeName.compare(L"seed") == 0)
|
||||
{
|
||||
m_seed = _fromString<__int64>(attributeValue);
|
||||
m_seed = _fromString<int64_t>(attributeValue);
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed);
|
||||
}
|
||||
else if(attributeName.compare(L"spawnX") == 0)
|
||||
@@ -700,7 +700,7 @@ void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete
|
||||
bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; }
|
||||
void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; }
|
||||
|
||||
__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
||||
int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
||||
int LevelGenerationOptions::getLevelHasBeenInCreative() { return m_bHasBeenInCreative; }
|
||||
Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; }
|
||||
bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; }
|
||||
|
||||
@@ -19,7 +19,7 @@ class GrSource
|
||||
public:
|
||||
// 4J-JEV:
|
||||
// Moved all this here; I didn't like that all this header information
|
||||
// was being mixed in with all the game information as they have
|
||||
// was being mixed in with all the game information as they have
|
||||
// completely different lifespans.
|
||||
|
||||
virtual bool requiresTexturePack()=0;
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
|
||||
private:
|
||||
// This should match the "MapOptionsRule" definition in the XML schema
|
||||
__int64 m_seed;
|
||||
int64_t m_seed;
|
||||
bool m_useFlatWorld;
|
||||
Pos *m_spawnPos;
|
||||
int m_bHasBeenInCreative;
|
||||
@@ -171,13 +171,13 @@ public:
|
||||
~LevelGenerationOptions();
|
||||
|
||||
virtual ConsoleGameRules::EGameRuleType getActionType();
|
||||
|
||||
|
||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
__int64 getLevelSeed();
|
||||
int64_t getLevelSeed();
|
||||
int getLevelHasBeenInCreative();
|
||||
Pos *getSpawnPos();
|
||||
bool getuseFlatWorld();
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
private:
|
||||
void clearSchematics();
|
||||
|
||||
public:
|
||||
public:
|
||||
ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen);
|
||||
|
||||
public:
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
|
||||
void loadBaseSaveData();
|
||||
static int packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask);
|
||||
|
||||
|
||||
// 4J-JEV:
|
||||
// ApplySchematicRules contain limited state
|
||||
// which needs to be reset BEFORE a new game starts.
|
||||
|
||||
Reference in New Issue
Block a user