diff --git a/Minecraft.Client/Level/DemoLevel.h b/Minecraft.Client/Level/DemoLevel.h index 4bfa37984..085e5a506 100644 --- a/Minecraft.Client/Level/DemoLevel.h +++ b/Minecraft.Client/Level/DemoLevel.h @@ -3,7 +3,7 @@ class DemoLevel : public Level { private: - static const __int64 DEMO_LEVEL_SEED = + static const int64_t DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); static const int DEMO_SPAWN_X = 796; static const int DEMO_SPAWN_Y = 72; diff --git a/Minecraft.Client/Level/MultiPlayerLevel.cpp b/Minecraft.Client/Level/MultiPlayerLevel.cpp index 22bdbb304..a34ba8ec5 100644 --- a/Minecraft.Client/Level/MultiPlayerLevel.cpp +++ b/Minecraft.Client/Level/MultiPlayerLevel.cpp @@ -131,7 +131,7 @@ void MultiPlayerLevel::tick() { // 4J HEG - Copy the connections vector to prevent crash when moving to // Nether std::vector connectionsTemp = connections; - for (AUTO_VAR(connection, connectionsTemp.begin()); + for (auto connection = connectionsTemp.begin(); connection < connectionsTemp.end(); ++connection) { (*connection)->tick(); } @@ -391,8 +391,8 @@ void MultiPlayerLevel::tickTiles() { PIXEndNamedEvent(); PIXBeginNamedEvent(0, "Ticking client side tiles"); - AUTO_VAR(itEndCtp, chunksToPoll.end()); - for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) { + auto itEndCtp = chunksToPoll.end(); + for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) { ChunkPos cp = *it; int xo = cp.x * 16; int zo = cp.z * 16; @@ -432,7 +432,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr e) { // 4J Stu - Add this remove from the reEntries collection to stop us // continually removing and re-adding things, in particular the // MultiPlayerLocalPlayer when they die - AUTO_VAR(it, reEntries.find(e)); + auto it = reEntries.find(e); if (it != reEntries.end()) { reEntries.erase(it); } @@ -443,7 +443,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr e) { void MultiPlayerLevel::entityAdded(std::shared_ptr e) { Level::entityAdded(e); - AUTO_VAR(it, reEntries.find(e)); + auto it = reEntries.find(e); if (it != reEntries.end()) { reEntries.erase(it); } @@ -451,7 +451,7 @@ void MultiPlayerLevel::entityAdded(std::shared_ptr e) { void MultiPlayerLevel::entityRemoved(std::shared_ptr e) { Level::entityRemoved(e); - AUTO_VAR(it, forced.find(e)); + auto it = forced.find(e); if (it != forced.end()) { reEntries.insert(e); } @@ -472,14 +472,14 @@ void MultiPlayerLevel::putEntity(int id, std::shared_ptr e) { } std::shared_ptr MultiPlayerLevel::getEntity(int id) { - AUTO_VAR(it, entitiesById.find(id)); + auto it = entitiesById.find(id); if (it == entitiesById.end()) return nullptr; return it->second; } std::shared_ptr MultiPlayerLevel::removeEntity(int id) { std::shared_ptr e; - AUTO_VAR(it, entitiesById.find(id)); + auto it = entitiesById.find(id); if (it != entitiesById.end()) { e = it->second; entitiesById.erase(it); @@ -495,10 +495,10 @@ std::shared_ptr MultiPlayerLevel::removeEntity(int id) { // remove entities slightly differently void MultiPlayerLevel::removeEntities( std::vector >* list) { - for (AUTO_VAR(it, list->begin()); it < list->end(); ++it) { + for (auto it = list->begin(); it < list->end(); ++it) { std::shared_ptr e = *it; - AUTO_VAR(reIt, reEntries.find(e)); + auto reIt = reEntries.find(e); if (reIt != reEntries.end()) { reEntries.erase(reIt); } @@ -613,12 +613,12 @@ bool MultiPlayerLevel::doSetTileAndData(int x, int y, int z, int tile, void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) { if (sendDisconnect) { - for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) { + for (auto it = connections.begin(); it < connections.end(); ++it) { (*it)->sendAndDisconnect(std::shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting))); } } else { - for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) { + for (auto it = connections.begin(); it < connections.end(); ++it) { (*it)->close(); } } @@ -704,7 +704,7 @@ void MultiPlayerLevel::animateTickDoWork() { MemSect(0); for (int i = 0; i < ticksPerChunk; i++) { - for (AUTO_VAR(it, chunksToAnimate.begin()); it != chunksToAnimate.end(); + for (auto it = chunksToAnimate.begin(); it != chunksToAnimate.end(); it++) { int packed = *it; // 4jcraft changed the extraction logic to be safe @@ -809,9 +809,9 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() { // entities.removeAll(entitiesToRemove); EnterCriticalSection(&m_entitiesCS); - for (AUTO_VAR(it, entities.begin()); it != entities.end();) { + for (auto it = entities.begin(); it != entities.end();) { bool found = false; - for (AUTO_VAR(it2, entitiesToRemove.begin()); + for (auto it2 = entitiesToRemove.begin(); it2 != entitiesToRemove.end(); it2++) { if ((*it) == (*it2)) { found = true; @@ -826,8 +826,8 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() { } LeaveCriticalSection(&m_entitiesCS); - AUTO_VAR(endIt, entitiesToRemove.end()); - for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) { + auto endIt = entitiesToRemove.end(); + for (auto it = entitiesToRemove.begin(); it != endIt; it++) { std::shared_ptr e = *it; int xc = e->xChunk; int zc = e->zChunk; @@ -839,7 +839,7 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() { // 4J Stu - Is there a reason do this in a separate loop? Thats what the // Java does... endIt = entitiesToRemove.end(); - for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) { + for (auto it = entitiesToRemove.begin(); it != endIt; it++) { entityRemoved(*it); } entitiesToRemove.clear(); @@ -884,7 +884,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c, new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting))); } - AUTO_VAR(it, find(connections.begin(), connections.end(), c)); + auto it = find(connections.begin(), connections.end(), c); if (it != connections.end()) { connections.erase(it); } @@ -892,7 +892,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c, void MultiPlayerLevel::tickAllConnections() { PIXBeginNamedEvent(0, "Connection ticking"); - for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) { + for (auto it = connections.begin(); it < connections.end(); ++it) { (*it)->tick(); } PIXEndNamedEvent(); diff --git a/Minecraft.Client/Level/ServerLevel.cpp b/Minecraft.Client/Level/ServerLevel.cpp index 065db15d6..60d48e2f4 100644 --- a/Minecraft.Client/Level/ServerLevel.cpp +++ b/Minecraft.Client/Level/ServerLevel.cpp @@ -189,7 +189,7 @@ ServerLevel::~ServerLevel() { delete mobSpawner; EnterCriticalSection(&m_csQueueSendTileUpdates); - for (AUTO_VAR(it, m_queuedSendTileUpdates.begin()); + for (auto it = m_queuedSendTileUpdates.begin(); it != m_queuedSendTileUpdates.end(); ++it) { Pos* p = *it; delete p; @@ -270,8 +270,8 @@ void ServerLevel::tick() { if (!SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward // from 1.8.2 { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->skyColorChanged(); } } @@ -361,8 +361,8 @@ void ServerLevel::updateSleepingPlayerList() { allPlayersSleeping = !players.empty(); m_bAtLeastOnePlayerSleeping = false; - AUTO_VAR(itEnd, players.end()); - for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { + auto itEnd = players.end(); + for (auto it = players.begin(); it != itEnd; it++) { if (!(*it)->isSleeping()) { allPlayersSleeping = false; // break; @@ -377,7 +377,7 @@ void ServerLevel::awakenAllPlayers() { allPlayersSleeping = false; m_bAtLeastOnePlayerSleeping = false; - AUTO_VAR(itEnd, players.end()); + auto itEnd = players.end(); for (std::vector >::iterator it = players.begin(); it != itEnd; it++) { if ((*it)->isSleeping()) { @@ -398,7 +398,7 @@ void ServerLevel::stopWeather() { bool ServerLevel::allPlayersAreSleeping() { if (allPlayersSleeping && !isClientSide) { // all players are sleeping, but have they slept long enough? - AUTO_VAR(itEnd, players.end()); + auto itEnd = players.end(); for (std::vector >::iterator it = players.begin(); it != itEnd; it++) { @@ -483,8 +483,8 @@ void ServerLevel::tickTiles() { if (app.GetGameSettingsDebugMask() & (1L << eDebugSetting_RegularLightning)) prob = 100; - AUTO_VAR(itEndCtp, chunksToPoll.end()); - for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) { + auto itEndCtp = chunksToPoll.end(); + for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) { ChunkPos cp = *it; int xo = cp.x * 16; int zo = cp.z * 16; @@ -653,7 +653,7 @@ bool ServerLevel::tickPendingTicks(bool force) { } if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; - AUTO_VAR(itTickList, tickNextTickList.begin()); + auto itTickList = tickNextTickList.begin(); for (int i = 0; i < count; i++) { TickNextTickData td = *(itTickList); if (!force && td.m_delay > levelData->getGameTime()) { @@ -665,7 +665,7 @@ bool ServerLevel::tickPendingTicks(bool force) { toBeTicked.push_back(td); } - for (AUTO_VAR(it, toBeTicked.begin()); it != toBeTicked.end();) { + for (auto it = toBeTicked.begin(); it != toBeTicked.end();) { TickNextTickData td = *it; it = toBeTicked.erase(it); @@ -707,7 +707,7 @@ std::vector* ServerLevel::fetchTicksInChunk(LevelChunk* chunk, for (int i = 0; i < 2; i++) { if (i == 0) { - for (AUTO_VAR(it, tickNextTickList.begin()); + for (auto it = tickNextTickList.begin(); it != tickNextTickList.end();) { TickNextTickData td = *it; @@ -729,7 +729,7 @@ std::vector* ServerLevel::fetchTicksInChunk(LevelChunk* chunk, if (!toBeTicked.empty()) { app.DebugPrintf("To be ticked size: %d\n", toBeTicked.size()); } - for (AUTO_VAR(it, toBeTicked.begin()); it != toBeTicked.end();) { + for (auto it = toBeTicked.begin(); it != toBeTicked.end();) { TickNextTickData td = *it; if (td.x >= xMin && td.x < xMax && td.z >= zMin && @@ -954,7 +954,7 @@ void ServerLevel::save(bool force, ProgressListener* progressListener, // clean cache std::vector* loadedChunkList = cache->getLoadedChunkList(); - for (AUTO_VAR(it, loadedChunkList->begin()); + for (auto it = loadedChunkList->begin(); it != loadedChunkList->end(); ++it) { LevelChunk* lc = *it; if (!chunkMap->hasChunk(lc->x, lc->z)) { @@ -1010,7 +1010,7 @@ void ServerLevel::entityAdded(std::shared_ptr e) { std::vector >* es = e->getSubEntities(); if (es != nullptr) { // for (int i = 0; i < es.length; i++) - for (AUTO_VAR(it, es->begin()); it != es->end(); ++it) { + for (auto it = es->begin(); it != es->end(); ++it) { entitiesById.insert( intEntityMap::value_type((*it)->entityId, (*it))); } @@ -1024,7 +1024,7 @@ void ServerLevel::entityRemoved(std::shared_ptr e) { std::vector >* es = e->getSubEntities(); if (es != nullptr) { // for (int i = 0; i < es.length; i++) - for (AUTO_VAR(it, es->begin()); it != es->end(); ++it) { + for (auto it = es->begin(); it != es->end(); ++it) { entitiesById.erase((*it)->entityId); } } @@ -1070,7 +1070,7 @@ std::shared_ptr ServerLevel::explode(std::shared_ptr source, } std::vector > sentTo; - for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { + for (auto it = players.begin(); it != players.end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); if (player->dimension != dimension->id) continue; @@ -1115,7 +1115,7 @@ void ServerLevel::tileEvent(int x, int y, int z, int tile, int b0, int b1) { // TileEventPacket(x, y, z, b0, b1)); TileEventData newEvent(x, y, z, tile, b0, b1); // for (TileEventData te : tileEvents[activeTileEventsList]) - for (AUTO_VAR(it, tileEvents[activeTileEventsList].begin()); + for (auto it = tileEvents[activeTileEventsList].begin(); it != tileEvents[activeTileEventsList].end(); ++it) { if ((*it).equals(newEvent)) { return; @@ -1132,7 +1132,7 @@ void ServerLevel::runTileEvents() { activeTileEventsList ^= 1; // for (TileEventData te : tileEvents[runList]) - for (AUTO_VAR(it, tileEvents[runList].begin()); + for (auto it = tileEvents[runList].begin(); it != tileEvents[runList].end(); ++it) { if (doTileEvent(&(*it))) { TileEventData te = *it; @@ -1185,7 +1185,7 @@ void ServerLevel::setTimeAndAdjustTileTicks(int64_t newTime) { // in the set. Instead move to a vector, do the adjustment, put back in the // set. std::vector temp; - for (AUTO_VAR(it, tickNextTickList.begin()); it != tickNextTickList.end(); + for (auto it = tickNextTickList.begin(); it != tickNextTickList.end(); ++it) { temp.push_back(*it); temp.back().m_delay += delta; @@ -1215,7 +1215,7 @@ void ServerLevel::sendParticles(const std::wstring& name, double x, double y, name, (float)x, (float)y, (float)z, (float)xDist, (float)yDist, (float)zDist, (float)speed, count)); - for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { + for (auto it = players.begin(); it != players.end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); player->connection->send(packet); @@ -1232,7 +1232,7 @@ void ServerLevel::queueSendTileUpdate(int x, int y, int z) { void ServerLevel::runQueuedSendTileUpdates() { EnterCriticalSection(&m_csQueueSendTileUpdates); - for (AUTO_VAR(it, m_queuedSendTileUpdates.begin()); + for (auto it = m_queuedSendTileUpdates.begin(); it != m_queuedSendTileUpdates.end(); ++it) { Pos* p = *it; sendTileUpdated(p->x, p->y, p->z); @@ -1372,7 +1372,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr e) { EnterCriticalSection(&m_limiterCS); // printf("entity removed: item entity count //%d\n",m_itemEntities.size()); - AUTO_VAR(it, find(m_itemEntities.begin(), m_itemEntities.end(), e)); + auto it = find(m_itemEntities.begin(), m_itemEntities.end(), e); if (it != m_itemEntities.end()) { // printf("Item to remove found\n"); m_itemEntities.erase(it); @@ -1384,8 +1384,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr e) { EnterCriticalSection(&m_limiterCS); // printf("entity removed: item entity count //%d\n",m_itemEntities.size()); - AUTO_VAR(it, - find(m_hangingEntities.begin(), m_hangingEntities.end(), e)); + auto it = + find(m_hangingEntities.begin(), m_hangingEntities.end(), e); if (it != m_hangingEntities.end()) { // printf("Item to remove found\n"); m_hangingEntities.erase(it); @@ -1397,7 +1397,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr e) { EnterCriticalSection(&m_limiterCS); // printf("entity removed: arrow entity count //%d\n",m_arrowEntities.size()); - AUTO_VAR(it, find(m_arrowEntities.begin(), m_arrowEntities.end(), e)); + auto it = find(m_arrowEntities.begin(), m_arrowEntities.end(), e); if (it != m_arrowEntities.end()) { // printf("Item to remove found\n"); m_arrowEntities.erase(it); @@ -1409,8 +1409,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr e) { EnterCriticalSection(&m_limiterCS); // printf("entity removed: experience orb entity count //%d\n",m_arrowEntities.size()); - AUTO_VAR(it, find(m_experienceOrbEntities.begin(), - m_experienceOrbEntities.end(), e)); + auto it = find(m_experienceOrbEntities.begin(), + m_experienceOrbEntities.end(), e); if (it != m_experienceOrbEntities.end()) { // printf("Item to remove found\n"); m_experienceOrbEntities.erase(it); diff --git a/Minecraft.Client/Level/ServerLevelListener.cpp b/Minecraft.Client/Level/ServerLevelListener.cpp index 668e90392..1f19a12ae 100644 --- a/Minecraft.Client/Level/ServerLevelListener.cpp +++ b/Minecraft.Client/Level/ServerLevelListener.cpp @@ -120,7 +120,7 @@ void ServerLevelListener::globalLevelEvent(int type, int sourceX, int sourceY, void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z, int progress) { // for (ServerPlayer p : server->getPlayers()->players) - for (AUTO_VAR(it, server->getPlayers()->players.begin()); + for (auto it = server->getPlayers()->players.begin(); it != server->getPlayers()->players.end(); ++it) { std::shared_ptr p = *it; if (p == nullptr || p->level != level || p->entityId == id) continue; diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index a30857dda..6bde98705 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -3467,7 +3467,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { // // see if we can react to this // if(app.GetXuiAction(iPad)==eAppAction_Idle) // { - // app.SetAction(iPad,eAppAction_DebugText,(LPVOID)wchInput); + // app.SetAction(iPad,eAppAction_DebugText,(void*)wchInput); // } // } // } @@ -4484,8 +4484,8 @@ void Minecraft::tickAllConnections() { bool Minecraft::addPendingClientTextureRequest( const std::wstring& textureName) { - AUTO_VAR(it, find(m_pendingTextureRequests.begin(), - m_pendingTextureRequests.end(), textureName)); + auto it = find(m_pendingTextureRequests.begin(), + m_pendingTextureRequests.end(), textureName); if (it == m_pendingTextureRequests.end()) { m_pendingTextureRequests.push_back(textureName); return true; @@ -4494,8 +4494,8 @@ bool Minecraft::addPendingClientTextureRequest( } void Minecraft::handleClientTextureReceived(const std::wstring& textureName) { - AUTO_VAR(it, find(m_pendingTextureRequests.begin(), - m_pendingTextureRequests.end(), textureName)); + auto it = find(m_pendingTextureRequests.begin(), + m_pendingTextureRequests.end(), textureName); if (it != m_pendingTextureRequests.end()) { m_pendingTextureRequests.erase(it); } diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index a7e4c23d0..f1f9b81db 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -107,7 +107,7 @@ MinecraftServer::MinecraftServer() { MinecraftServer::~MinecraftServer() {} -bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData* initData, +bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData* initData, std::uint32_t initSettings, bool findSeed) { // 4J - removed settings = new Settings(new File(L"server.properties")); @@ -323,7 +323,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer* mcprogress) { } bool MinecraftServer::loadLevel(LevelStorageSource* storageSource, - const std::wstring& name, __int64 levelSeed, + const std::wstring& name, int64_t levelSeed, LevelType* pLevelType, NetworkGameInitData* initData) { // 4J - TODO - do with new save stuff @@ -1396,7 +1396,7 @@ void MinecraftServer::broadcastStopSavingPacket() { void MinecraftServer::tick() { std::vector toRemove; - for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++) { + for (auto it = ironTimers.begin(); it != ironTimers.end(); it++) { int t = it->second; if (t > 0) { ironTimers[it->first] = t - 1; @@ -1512,7 +1512,7 @@ void MinecraftServer::handleConsoleInput(const std::wstring& msg, void MinecraftServer::handleConsoleInputs() { while (consoleInput.size() > 0) { - AUTO_VAR(it, consoleInput.begin()); + auto it = consoleInput.begin(); ConsoleInput* input = *it; consoleInput.erase(it); // commands->handleCommand(input); // 4J - removed @@ -1612,8 +1612,8 @@ void MinecraftServer::chunkPacketManagement_PreTick() { do { int longestTime = 0; - AUTO_VAR(playerConnectionBest, playersOrig.begin()); - for (AUTO_VAR(it, playersOrig.begin()); it != playersOrig.end(); + auto playerConnectionBest = playersOrig.begin(); + for (auto it = playersOrig.begin(); it != playersOrig.end(); it++) { int thisTime = 0; INetworkPlayer* np = (*it)->getNetworkPlayer(); diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h index 84ecf085f..737f49fd2 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/MinecraftServer.h @@ -25,9 +25,9 @@ class CommandDispatcher; typedef struct _LoadSaveDataThreadParam { void* data; - __int64 fileSize; + int64_t fileSize; const std::wstring saveName; - _LoadSaveDataThreadParam(void* data, __int64 filesize, + _LoadSaveDataThreadParam(void* data, int64_t filesize, const std::wstring& saveName) : data(data), fileSize(filesize), saveName(saveName) {} } LoadSaveDataThreadParam; @@ -135,11 +135,11 @@ public: private: // 4J Added - LoadSaveDataThreadParam - bool initServer(__int64 seed, NetworkGameInitData* initData, + bool initServer(int64_t seed, NetworkGameInitData* initData, std::uint32_t initSettings, bool findSeed); void postProcessTerminate(ProgressRenderer* mcprogress); bool loadLevel(LevelStorageSource* storageSource, const std::wstring& name, - __int64 levelSeed, LevelType* pLevelType, + int64_t levelSeed, LevelType* pLevelType, NetworkGameInitData* initData); void setProgress(const std::wstring& status, int progress); void endProgress(); @@ -184,7 +184,7 @@ public: public: void halt(); - void run(__int64 seed, void* lpParameter); + void run(int64_t seed, void* lpParameter); void broadcastStartSavingPacket(); void broadcastStopSavingPacket(); diff --git a/Minecraft.Client/Network/ClientConnection.cpp b/Minecraft.Client/Network/ClientConnection.cpp index 8f46f8b43..5199afdd6 100644 --- a/Minecraft.Client/Network/ClientConnection.cpp +++ b/Minecraft.Client/Network/ClientConnection.cpp @@ -605,7 +605,7 @@ void ClientConnection::handleAddEntity( if (subEntities != nullptr) { int offs = packet->id - e->entityId; // for (int i = 0; i < subEntities.length; i++) - for (AUTO_VAR(it, subEntities->begin()); it != subEntities->end(); + for (auto it = subEntities->begin(); it != subEntities->end(); ++it) { (*it)->entityId += offs; // subEntities[i].entityId += offs; @@ -2003,7 +2003,7 @@ void ClientConnection::handleAddMob(std::shared_ptr packet) { if (subEntities != nullptr) { int offs = packet->id - mob->entityId; // for (int i = 0; i < subEntities.length; i++) - for (AUTO_VAR(it, subEntities->begin()); it != subEntities->end(); + for (auto it = subEntities->begin(); it != subEntities->end(); ++it) { // subEntities[i].entityId += offs; (*it)->entityId += offs; @@ -3444,7 +3444,7 @@ void ClientConnection::handleUpdateAttributes( (std::dynamic_pointer_cast(entity))->getAttributes(); std::unordered_set attributeSnapshots = packet->getValues(); - for (AUTO_VAR(it, attributeSnapshots.begin()); + for (auto it = attributeSnapshots.begin(); it != attributeSnapshots.end(); ++it) { UpdateAttributesPacket::AttributeSnapshot* attribute = *it; AttributeInstance* instance = @@ -3465,7 +3465,7 @@ void ClientConnection::handleUpdateAttributes( std::unordered_set* modifiers = attribute->getModifiers(); - for (AUTO_VAR(it2, modifiers->begin()); it2 != modifiers->end(); + for (auto it2 = modifiers->begin(); it2 != modifiers->end(); ++it2) { AttributeModifier* modifier = *it2; instance->addModifier( diff --git a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp index cdeac60e8..0b03a5fdd 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp @@ -98,8 +98,8 @@ MultiPlayerChunkCache::~MultiPlayerChunkCache() { delete cache; delete hasData; - AUTO_VAR(itEnd, loadedChunkList.end()); - for (AUTO_VAR(it, loadedChunkList.begin()); it != itEnd; it++) delete *it; + auto itEnd = loadedChunkList.end(); + for (auto it = loadedChunkList.begin(); it != itEnd; it++) delete *it; DeleteCriticalSection(&m_csLoadCreate); } diff --git a/Minecraft.Client/Network/PendingConnection.cpp b/Minecraft.Client/Network/PendingConnection.cpp index 208555dd3..b9046375d 100644 --- a/Minecraft.Client/Network/PendingConnection.cpp +++ b/Minecraft.Client/Network/PendingConnection.cpp @@ -93,7 +93,7 @@ void PendingConnection::sendPreLoginResponse() { StorageManager.GetSaveUniqueFilename(szUniqueMapName); PlayerList* playerList = MinecraftServer::getInstance()->getPlayers(); - for (AUTO_VAR(it, playerList->players.begin()); + for (auto it = playerList->players.begin(); it != playerList->players.end(); ++it) { std::shared_ptr player = *it; // If the offline Xuid is invalid but the online one is not then that's diff --git a/Minecraft.Client/Network/PlayerChunkMap.cpp b/Minecraft.Client/Network/PlayerChunkMap.cpp index d1f8cc505..0608cc5a5 100644 --- a/Minecraft.Client/Network/PlayerChunkMap.cpp +++ b/Minecraft.Client/Network/PlayerChunkMap.cpp @@ -40,7 +40,7 @@ PlayerChunkMap::PlayerChunk::~PlayerChunk() { delete changedTiles.data; } // output flag array and adds to it for this ServerPlayer. void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int* flags, bool* flagToBeRemoved) { - for (AUTO_VAR(it, players.begin()); it != players.end(); it++) { + for (auto it = players.begin(); it != players.end(); it++) { std::shared_ptr serverPlayer = *it; serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved); } @@ -89,7 +89,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr player) { // app.DebugPrintf("--- PlayerChunkMap::PlayerChunk::remove // x=%d\tz=%d\n",x,z); - AUTO_VAR(it, find(players.begin(), players.end(), player)); + auto it = find(players.begin(), players.end(), player); if (it == players.end()) { app.DebugPrintf( "--- INFO - Removing player from chunk x=%d\t z=%d, but they are " @@ -104,20 +104,20 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr player) { { LevelChunk* chunk = parent->level->getChunk(pos.x, pos.z); updateInhabitedTime(chunk); - AUTO_VAR(it, find(parent->knownChunks.begin(), - parent->knownChunks.end(), this)); + auto it = find(parent->knownChunks.begin(), + parent->knownChunks.end(), this); if (it != parent->knownChunks.end()) parent->knownChunks.erase(it); } int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); - AUTO_VAR(it, parent->chunks.find(id)); + auto it = parent->chunks.find(id); if (it != parent->chunks.end()) { toDelete = it->second; // Don't delete until the end of the // function, as this might be this instance parent->chunks.erase(it); } if (changes > 0) { - AUTO_VAR(it, find(parent->changedChunks.begin(), - parent->changedChunks.end(), this)); + auto it = find(parent->changedChunks.begin(), + parent->changedChunks.end(), this); parent->changedChunks.erase(it); } parent->getLevel()->cache->drop(pos.x, pos.z); @@ -135,7 +135,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr player) { bool noOtherPlayersFound = true; if (thisNetPlayer != nullptr) { - for (AUTO_VAR(it, players.begin()); it < players.end(); ++it) { + for (auto it = players.begin(); it < players.end(); ++it) { std::shared_ptr currPlayer = *it; INetworkPlayer* currNetPlayer = currPlayer->connection->getNetworkPlayer(); @@ -405,7 +405,7 @@ PlayerChunkMap::PlayerChunkMap(ServerLevel* level, int dimension, int radius) { } PlayerChunkMap::~PlayerChunkMap() { - for (AUTO_VAR(it, chunks.begin()); it != chunks.end(); it++) { + for (auto it = chunks.begin(); it != chunks.end(); it++) { delete it->second; } } @@ -471,7 +471,7 @@ bool PlayerChunkMap::hasChunk(int x, int z) { PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z, bool create) { int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); - AUTO_VAR(it, chunks.find(id)); + auto it = chunks.find(id); PlayerChunk* chunk = nullptr; if (it != chunks.end()) { @@ -490,7 +490,7 @@ PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z, void PlayerChunkMap::getChunkAndAddPlayer( int x, int z, std::shared_ptr player) { int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); - AUTO_VAR(it, chunks.find(id)); + auto it = chunks.find(id); if (it != chunks.end()) { it->second->add(player); @@ -503,14 +503,14 @@ void PlayerChunkMap::getChunkAndAddPlayer( // there. Otherwise attempt to remove from main chunk map. void PlayerChunkMap::getChunkAndRemovePlayer( int x, int z, std::shared_ptr player) { - for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++) { + for (auto it = addRequests.begin(); it != addRequests.end(); it++) { if ((it->x == x) && (it->z == z) && (it->player == player)) { addRequests.erase(it); return; } } int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); - AUTO_VAR(it, chunks.find(id)); + auto it = chunks.find(id); if (it != chunks.end()) { it->second->remove(player); @@ -526,8 +526,8 @@ void PlayerChunkMap::tickAddRequests(std::shared_ptr player) { int pz = (int)player->z; int minDistSq = -1; - AUTO_VAR(itNearest, addRequests.end()); - for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++) { + auto itNearest = addRequests.end(); + for (auto it = addRequests.begin(); it != addRequests.end(); it++) { if (it->player == player) { int xm = (it->x * 16) + 8; int zm = (it->z * 16) + 8; @@ -693,13 +693,13 @@ void PlayerChunkMap::remove(std::shared_ptr player) { if (playerChunk != nullptr) playerChunk->remove(player); } - AUTO_VAR(it, find(players.begin(), players.end(), player)); + auto it = find(players.begin(), players.end(), player); if (players.size() > 0 && it != players.end()) players.erase(find(players.begin(), players.end(), player)); // 4J - added - also remove any queued requests to be added to playerchunks // here - for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end();) { + for (auto it = addRequests.begin(); it != addRequests.end();) { if (it->player == player) { it = addRequests.erase(it); } else { @@ -764,10 +764,10 @@ bool PlayerChunkMap::isPlayerIn(std::shared_ptr player, if (chunk == nullptr) { return false; } else { - AUTO_VAR(it1, - find(chunk->players.begin(), chunk->players.end(), player)); - AUTO_VAR(it2, find(player->chunksToSend.begin(), - player->chunksToSend.end(), chunk->pos)); + auto it1 = + find(chunk->players.begin(), chunk->players.end(), player); + auto it2 = find(player->chunksToSend.begin(), + player->chunksToSend.end(), chunk->pos); return it1 != chunk->players.end() && it2 == player->chunksToSend.end(); } diff --git a/Minecraft.Client/Network/PlayerConnection.cpp b/Minecraft.Client/Network/PlayerConnection.cpp index f8b7c9eda..4ff287b25 100644 --- a/Minecraft.Client/Network/PlayerConnection.cpp +++ b/Minecraft.Client/Network/PlayerConnection.cpp @@ -851,8 +851,8 @@ void PlayerConnection::handleTextureAndGeometry( void PlayerConnection::handleTextureReceived(const std::wstring& textureName) { // This sends the server received texture out to any other players waiting // for the data - AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(), - textureName)); + auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(), + textureName); if (it != m_texturesRequested.end()) { std::uint8_t* pbData = nullptr; unsigned int dwBytes = 0; @@ -870,8 +870,8 @@ void PlayerConnection::handleTextureAndGeometryReceived( const std::wstring& textureName) { // This sends the server received texture out to any other players waiting // for the data - AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(), - textureName)); + auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(), + textureName); if (it != m_texturesRequested.end()) { std::uint8_t* pbData = nullptr; unsigned int dwTextureBytes = 0; @@ -1270,7 +1270,7 @@ void PlayerConnection::handleSetCreativeModeSlot( void PlayerConnection::handleContainerAck( std::shared_ptr packet) { - AUTO_VAR(it, expectedAcks.find(player->containerMenu->containerId)); + auto it = expectedAcks.find(player->containerMenu->containerId); if (it != expectedAcks.end() && packet->uid == it->second && player->containerMenu->containerId == packet->containerId && @@ -1335,7 +1335,7 @@ void PlayerConnection::handlePlayerInfo( player->isModerator()) { std::shared_ptr serverPlayer; // Find the player being edited - for (AUTO_VAR(it, server->getPlayers()->players.begin()); + for (auto it = server->getPlayers()->players.begin(); it != server->getPlayers()->players.end(); ++it) { std::shared_ptr checkingPlayer = *it; if (checkingPlayer->connection->getNetworkPlayer() != nullptr && diff --git a/Minecraft.Client/Network/PlayerList.cpp b/Minecraft.Client/Network/PlayerList.cpp index a3aad94bc..50a1ff7b6 100644 --- a/Minecraft.Client/Network/PlayerList.cpp +++ b/Minecraft.Client/Network/PlayerList.cpp @@ -54,7 +54,7 @@ PlayerList::PlayerList(MinecraftServer* server) { } PlayerList::~PlayerList() { - for (AUTO_VAR(it, players.begin()); it < players.end(); it++) { + for (auto it = players.begin(); it < players.end(); it++) { (*it)->connection = nullptr; // Must remove reference to connection, or // else there is a circular dependency delete (*it)->gameMode; // Gamemode also needs deleted as it references @@ -100,7 +100,7 @@ void PlayerList::placeNewPlayer(Connection* connection, { bool usedIndexes[MINECRAFT_NET_MAX_PLAYERS]; ZeroMemory(&usedIndexes, MINECRAFT_NET_MAX_PLAYERS * sizeof(bool)); - for (AUTO_VAR(it, players.begin()); it < players.end(); ++it) { + for (auto it = players.begin(); it < players.end(); ++it) { usedIndexes[(int)(*it)->getPlayerIndex()] = true; } for (unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { @@ -267,8 +267,8 @@ void PlayerList::placeNewPlayer(Connection* connection, level->getGameTime(), level->getDayTime(), level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT)))); - AUTO_VAR(activeEffects, player->getActiveEffects()); - for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); + auto activeEffects = player->getActiveEffects(); + for (auto it = activeEffects->begin(); it != activeEffects->end(); ++it) { MobEffectInstance* effect = *it; playerConnection->send(std::shared_ptr( @@ -294,7 +294,7 @@ void PlayerList::placeNewPlayer(Connection* connection, // to true so that respawning works when the EndPoem is closed INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); if (thisPlayer != nullptr) { - for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { + for (auto it = players.begin(); it != players.end(); ++it) { std::shared_ptr servPlayer = *it; INetworkPlayer* checkPlayer = servPlayer->connection->getNetworkPlayer(); @@ -521,7 +521,7 @@ void PlayerList::remove(std::shared_ptr player) { } level->removeEntity(player); level->getChunkMap()->remove(player); - AUTO_VAR(it, find(players.begin(), players.end(), player)); + auto it = find(players.begin(), players.end(), player); if (it != players.end()) { players.erase(it); } @@ -632,7 +632,7 @@ std::shared_ptr PlayerList::respawn( } serverPlayer->getLevel()->getChunkMap()->remove(serverPlayer); - AUTO_VAR(it, find(players.begin(), players.end(), serverPlayer)); + auto it = find(players.begin(), players.end(), serverPlayer); if (it != players.end()) { players.erase(it); } @@ -752,7 +752,7 @@ std::shared_ptr PlayerList::respawn( if (keepAllPlayerData) { std::vector* activeEffects = player->getActiveEffects(); - for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); + for (auto it = activeEffects->begin(); it != activeEffects->end(); ++it) { MobEffectInstance* effect = *it; @@ -893,7 +893,7 @@ void PlayerList::toggleDimension(std::shared_ptr player, // 4J Stu - Fix for #64683 - Customer Encountered: TU7: Content: Gameplay: // Potion effects are removed after using the Nether Portal std::vector* activeEffects = player->getActiveEffects(); - for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); + for (auto it = activeEffects->begin(); it != activeEffects->end(); ++it) { MobEffectInstance* effect = *it; @@ -1409,7 +1409,7 @@ int PlayerList::getPlayerCount() { return (int)players.size(); } int PlayerList::getPlayerCount(ServerLevel* level) { int count = 0; - for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { + for (auto it = players.begin(); it != players.end(); ++it) { if ((*it)->level == level) ++count; } @@ -1455,7 +1455,7 @@ std::shared_ptr PlayerList::findAlivePlayerOnSystem( INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); if (thisPlayer != nullptr) { - for (AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { + for (auto itP = players.begin(); itP != players.end(); ++itP) { std::shared_ptr newPlayer = *itP; INetworkPlayer* otherPlayer = @@ -1488,8 +1488,8 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr player, #endif bool playerRemoved = false; - AUTO_VAR(it, find(receiveAllPlayers[dimIndex].begin(), - receiveAllPlayers[dimIndex].end(), player)); + auto it = find(receiveAllPlayers[dimIndex].begin(), + receiveAllPlayers[dimIndex].end(), player); if (it != receiveAllPlayers[dimIndex].end()) { #if !defined(_CONTENT_PACKAGE) app.DebugPrintf( @@ -1502,7 +1502,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr player, INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer(); if (thisPlayer != nullptr && playerRemoved) { - for (AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { + for (auto itP = players.begin(); itP != players.end(); ++itP) { std::shared_ptr newPlayer = *itP; INetworkPlayer* otherPlayer = @@ -1528,7 +1528,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr player, // 4J Stu - Something went wrong, or possibly the QNet player left // before we got here. Re-check all active players and make sure they // have someone on their system to receive all packets - for (AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { + for (auto itP = players.begin(); itP != players.end(); ++itP) { std::shared_ptr newPlayer = *itP; INetworkPlayer* checkingPlayer = newPlayer->connection->getNetworkPlayer(); @@ -1540,7 +1540,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr player, else if (newPlayer->dimension == 1) newPlayerDim = 2; bool foundPrimary = false; - for (AUTO_VAR(it, receiveAllPlayers[newPlayerDim].begin()); + for (auto it = receiveAllPlayers[newPlayerDim].begin(); it != receiveAllPlayers[newPlayerDim].end(); ++it) { std::shared_ptr primaryPlayer = *it; INetworkPlayer* primPlayer = @@ -1589,7 +1589,7 @@ void PlayerList::addPlayerToReceiving(std::shared_ptr player) { #endif shouldAddPlayer = false; } else { - for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); + for (auto it = receiveAllPlayers[playerDim].begin(); it != receiveAllPlayers[playerDim].end(); ++it) { std::shared_ptr oldPlayer = *it; INetworkPlayer* checkingPlayer = @@ -1617,7 +1617,7 @@ bool PlayerList::canReceiveAllPackets(std::shared_ptr player) { playerDim = 1; else if (player->dimension == 1) playerDim = 2; - for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); + for (auto it = receiveAllPlayers[playerDim].begin(); it != receiveAllPlayers[playerDim].end(); ++it) { std::shared_ptr newPlayer = *it; if (newPlayer == player) { @@ -1644,7 +1644,7 @@ bool PlayerList::isXuidBanned(PlayerUID xuid) { bool banned = false; - for (AUTO_VAR(it, m_bannedXuids.begin()); it != m_bannedXuids.end(); ++it) { + for (auto it = m_bannedXuids.begin(); it != m_bannedXuids.end(); ++it) { if (ProfileManager.AreXUIDSEqual(xuid, *it)) { banned = true; break; diff --git a/Minecraft.Client/Network/ServerChunkCache.cpp b/Minecraft.Client/Network/ServerChunkCache.cpp index 34e3f4d0f..c2b06b1ff 100644 --- a/Minecraft.Client/Network/ServerChunkCache.cpp +++ b/Minecraft.Client/Network/ServerChunkCache.cpp @@ -56,8 +56,8 @@ ServerChunkCache::~ServerChunkCache() { delete m_unloadedCache; #endif - AUTO_VAR(itEnd, m_loadedChunkList.end()); - for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) delete *it; + auto itEnd = m_loadedChunkList.end(); + for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) delete *it; DeleteCriticalSection(&m_csLoadCreate); } @@ -654,7 +654,7 @@ bool ServerChunkCache::saveAllEntities() { PIXBeginNamedEvent(0, "saving to NBT"); EnterCriticalSection(&m_csLoadCreate); - for (AUTO_VAR(it, m_loadedChunkList.begin()); it != m_loadedChunkList.end(); + for (auto it = m_loadedChunkList.begin(); it != m_loadedChunkList.end(); ++it) { storage->saveEntities(level, *it); } @@ -676,8 +676,8 @@ bool ServerChunkCache::save(bool force, ProgressListener* progressListener) { // 4J - added this to support progressListner int count = 0; if (progressListener != nullptr) { - AUTO_VAR(itEnd, m_loadedChunkList.end()); - for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) { + auto itEnd = m_loadedChunkList.end(); + for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) { LevelChunk* chunk = *it; if (chunk->shouldSave(force)) { count++; @@ -813,8 +813,8 @@ bool ServerChunkCache::tick() { // loadedChunks.remove(cp); // loadedChunkList.remove(chunk); - AUTO_VAR(it, find(m_loadedChunkList.begin(), - m_loadedChunkList.end(), chunk)); + auto it = find(m_loadedChunkList.begin(), + m_loadedChunkList.end(), chunk); if (it != m_loadedChunkList.end()) m_loadedChunkList.erase(it); @@ -855,7 +855,7 @@ TilePos* ServerChunkCache::findNearestMapFeature( void ServerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chunkZ) { } -int ServerChunkCache::runSaveThreadProc(LPVOID lpParam) { +int ServerChunkCache::runSaveThreadProc(void* lpParam) { SaveThreadData* params = (SaveThreadData*)lpParam; if (params->useSharedThreadStorage) { diff --git a/Minecraft.Client/Network/ServerCommandDispatcher.cpp b/Minecraft.Client/Network/ServerCommandDispatcher.cpp index 6d86fd41c..c363df0d7 100644 --- a/Minecraft.Client/Network/ServerCommandDispatcher.cpp +++ b/Minecraft.Client/Network/ServerCommandDispatcher.cpp @@ -57,7 +57,7 @@ void ServerCommandDispatcher::logAdminCommand( int customData, const std::wstring& additionalMessage) { PlayerList* playerList = MinecraftServer::getInstance()->getPlayers(); // for (Player player : MinecraftServer.getInstance().getPlayers().players) - for (AUTO_VAR(it, playerList->players.begin()); + for (auto it = playerList->players.begin(); it != playerList->players.end(); ++it) { std::shared_ptr player = *it; if (player != source && playerList->isOp(player)) { diff --git a/Minecraft.Client/Network/ServerConnection.cpp b/Minecraft.Client/Network/ServerConnection.cpp index 807e1d811..04285c507 100644 --- a/Minecraft.Client/Network/ServerConnection.cpp +++ b/Minecraft.Client/Network/ServerConnection.cpp @@ -102,8 +102,8 @@ void ServerConnection::tick() { bool ServerConnection::addPendingTextureRequest( const std::wstring& textureName) { - AUTO_VAR(it, find(m_pendingTextureRequests.begin(), - m_pendingTextureRequests.end(), textureName)); + auto it = find(m_pendingTextureRequests.begin(), + m_pendingTextureRequests.end(), textureName); if (it == m_pendingTextureRequests.end()) { m_pendingTextureRequests.push_back(textureName); return true; @@ -119,8 +119,8 @@ bool ServerConnection::addPendingTextureRequest( } void ServerConnection::handleTextureReceived(const std::wstring& textureName) { - AUTO_VAR(it, find(m_pendingTextureRequests.begin(), - m_pendingTextureRequests.end(), textureName)); + auto it = find(m_pendingTextureRequests.begin(), + m_pendingTextureRequests.end(), textureName); if (it != m_pendingTextureRequests.end()) { m_pendingTextureRequests.erase(it); } @@ -134,8 +134,8 @@ void ServerConnection::handleTextureReceived(const std::wstring& textureName) { void ServerConnection::handleTextureAndGeometryReceived( const std::wstring& textureName) { - AUTO_VAR(it, find(m_pendingTextureRequests.begin(), - m_pendingTextureRequests.end(), textureName)); + auto it = find(m_pendingTextureRequests.begin(), + m_pendingTextureRequests.end(), textureName); if (it != m_pendingTextureRequests.end()) { m_pendingTextureRequests.erase(it); } diff --git a/Minecraft.Client/Platform/Common/App_structs.h b/Minecraft.Client/Platform/Common/App_structs.h index 2e44678a5..f6fa6cd08 100644 --- a/Minecraft.Client/Platform/Common/App_structs.h +++ b/Minecraft.Client/Platform/Common/App_structs.h @@ -176,7 +176,7 @@ typedef struct _TMSPPRequest { C4JStorage::eTMS_FILETYPEVAL eFileTypeVal; // char szFilename[MAX_TMSFILENAME_SIZE]; int (*CallbackFunc)(void*, int, int, C4JStorage::PTMSPP_FILEDATA, - LPCSTR szFilename); + const char* szFilename); WCHAR wchFilename[MAX_TMSFILENAME_SIZE]; void* lpCallbackParam; diff --git a/Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp index 0450881fc..8d40e3a8b 100644 --- a/Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp @@ -1909,7 +1909,7 @@ void ConsoleSoundEngine::tick() { return; } - for (AUTO_VAR(it, scheduledSounds.begin()); it != scheduledSounds.end();) { + for (auto it = scheduledSounds.begin(); it != scheduledSounds.end();) { SoundEngine::ScheduledSound* next = *it; next->delay--; diff --git a/Minecraft.Client/Platform/Common/Colours/ColourTable.cpp b/Minecraft.Client/Platform/Common/Colours/ColourTable.cpp index 5915a6f6b..04cfb7fbd 100644 --- a/Minecraft.Client/Platform/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Platform/Common/Colours/ColourTable.cpp @@ -355,14 +355,14 @@ void ColourTable::loadColoursFromData(std::uint8_t* pbData, std::wstring colourId = dis.readUTF(); int colourValue = dis.readInt(); setColour(colourId, colourValue); - AUTO_VAR(it, s_colourNamesMap.find(colourId)); + auto it = s_colourNamesMap.find(colourId); } bais.reset(); } void ColourTable::setColour(const std::wstring& colourName, int value) { - AUTO_VAR(it, s_colourNamesMap.find(colourName)); + auto it = s_colourNamesMap.find(colourName); if (it != s_colourNamesMap.end()) { m_colourValues[(int)it->second] = value; } diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Platform/Common/Consoles_App.cpp index 1c3036c28..e6693239e 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Platform/Common/Consoles_App.cpp @@ -1127,7 +1127,7 @@ void CMinecraftApp::ActionGameSettings(int iPad, eGameSetting eVal) { PlayerList* players = MinecraftServer::getInstance()->getPlayerList(); - for (AUTO_VAR(it3, players->players.begin()); + for (auto it3 = players->players.begin(); it3 != players->players.end(); ++it3) { std::shared_ptr decorationPlayer = *it3; decorationPlayer->setShowOnMaps( @@ -4564,7 +4564,7 @@ bool CMinecraftApp::isXuidNotch(PlayerUID xuid) { } bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) { - AUTO_VAR(it, MojangData.find(xuid)); // 4J Stu - The .at and [] accessors + auto it = MojangData.find(xuid); // 4J Stu - The .at and [] accessors // insert elements if they don't exist if (it != MojangData.end()) { MOJANG_DATA* pMojangData = MojangData[xuid]; @@ -4582,7 +4582,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring& wName, EnterCriticalSection(&csMemFilesLock); // check it's not already in PMEMDATA pData = nullptr; - AUTO_VAR(it, m_MEM_Files.find(wName)); + auto it = m_MEM_Files.find(wName); if (it != m_MEM_Files.end()) { #if !defined(_CONTENT_PACKAGE) wprintf(L"Incrementing the memory texture file count for %ls\n", @@ -4625,7 +4625,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring& wName, void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring& wName) { EnterCriticalSection(&csMemFilesLock); - AUTO_VAR(it, m_MEM_Files.find(wName)); + auto it = m_MEM_Files.find(wName); if (it != m_MEM_Files.end()) { #if !defined(_CONTENT_PACKAGE) wprintf(L"Decrementing the memory texture file count for %ls\n", @@ -4650,7 +4650,7 @@ bool CMinecraftApp::DefaultCapeExists() { bool val = false; EnterCriticalSection(&csMemFilesLock); - AUTO_VAR(it, m_MEM_Files.find(wTex)); + auto it = m_MEM_Files.find(wTex); if (it != m_MEM_Files.end()) val = true; LeaveCriticalSection(&csMemFilesLock); @@ -4661,7 +4661,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring& wName) { bool val = false; EnterCriticalSection(&csMemFilesLock); - AUTO_VAR(it, m_MEM_Files.find(wName)); + auto it = m_MEM_Files.find(wName); if (it != m_MEM_Files.end()) val = true; LeaveCriticalSection(&csMemFilesLock); @@ -4672,7 +4672,7 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring& wName, std::uint8_t** ppbData, unsigned int* pByteCount) { EnterCriticalSection(&csMemFilesLock); - AUTO_VAR(it, m_MEM_Files.find(wName)); + auto it = m_MEM_Files.find(wName); if (it != m_MEM_Files.end()) { PMEMDATA pData = (*it).second; *ppbData = pData->pbData; @@ -4686,7 +4686,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t* pbData, EnterCriticalSection(&csMemTPDLock); // check it's not already in PMEMDATA pData = nullptr; - AUTO_VAR(it, m_MEM_TPD.find(iConfig)); + auto it = m_MEM_TPD.find(iConfig); if (it == m_MEM_TPD.end()) { pData = new MEMDATA(); pData->pbData = pbData; @@ -4703,7 +4703,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) { EnterCriticalSection(&csMemTPDLock); // check it's not already in PMEMDATA pData = nullptr; - AUTO_VAR(it, m_MEM_TPD.find(iConfig)); + auto it = m_MEM_TPD.find(iConfig); if (it != m_MEM_TPD.end()) { pData = m_MEM_TPD[iConfig]; delete pData; @@ -4720,7 +4720,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) { bool val = false; EnterCriticalSection(&csMemTPDLock); - AUTO_VAR(it, m_MEM_TPD.find(iConfig)); + auto it = m_MEM_TPD.find(iConfig); if (it != m_MEM_TPD.end()) val = true; LeaveCriticalSection(&csMemTPDLock); @@ -4730,7 +4730,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) { void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData, unsigned int* pByteCount) { EnterCriticalSection(&csMemTPDLock); - AUTO_VAR(it, m_MEM_TPD.find(iConfig)); + auto it = m_MEM_TPD.find(iConfig); if (it != m_MEM_TPD.end()) { PMEMDATA pData = (*it).second; *ppbData = pData->pbData; @@ -5549,8 +5549,8 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName, } #elif defined(__linux__) HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName, - int iGender, __uint64 ullOfferID_Full, - __uint64 ullOfferID_Trial, + int iGender, uint64_t ullOfferID_Full, + uint64_t ullOfferID_Trial, WCHAR* pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR* pDataFile) { @@ -5610,7 +5610,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char* pchDLCName, bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin, ULONGLONG* pullVal) { - AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); + auto it = DLCInfo_SkinName.find(FirstSkin); if (it == DLCInfo_SkinName.end()) { return false; } else { @@ -5620,7 +5620,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin, } bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID, ULONGLONG* pullVal) { - AUTO_VAR(it, DLCTextures_PackID.find(iPackID)); + auto it = DLCTextures_PackID.find(iPackID); if (it == DLCTextures_PackID.end()) { *pullVal = (ULONGLONG)0; return false; @@ -5632,7 +5632,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID, DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) { // DLC_INFO *pDLCInfo=nullptr; if (DLCInfo_Trial.size() > 0) { - AUTO_VAR(it, DLCInfo_Trial.find(ullOfferID_Trial)); + auto it = DLCInfo_Trial.find(ullOfferID_Trial); if (it == DLCInfo_Trial.end()) { // nothing for this @@ -5678,7 +5678,7 @@ ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) { DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) { if (DLCInfo_Full.size() > 0) { - AUTO_VAR(it, DLCInfo_Full.find(ullOfferID_Full)); + auto it = DLCInfo_Full.find(ullOfferID_Full); if (it == DLCInfo_Full.end()) { // nothing for this @@ -5857,7 +5857,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, static_cast(sizeof(BANNEDLISTDATA) * bannedListCount); PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount]; int iCount = 0; - for (AUTO_VAR(it, m_vBannedListA[iPad]->begin()); + for (auto it = m_vBannedListA[iPad]->begin(); it != m_vBannedListA[iPad]->end(); ++it) { PBANNEDLISTDATA pData = *it; memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA)); @@ -5876,7 +5876,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid, char* pszLevelName) { - for (AUTO_VAR(it, m_vBannedListA[iPad]->begin()); + for (auto it = m_vBannedListA[iPad]->begin(); it != m_vBannedListA[iPad]->end(); ++it) { PBANNEDLISTDATA pData = *it; if (IsEqualXUID(pData->xuid, xuid) && @@ -5896,7 +5896,7 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid, // we will have retrieved the banned level list from TMS, so remove this one // from it and write it back to TMS - for (AUTO_VAR(it, m_vBannedListA[iPad]->begin()); + for (auto it = m_vBannedListA[iPad]->begin(); it != m_vBannedListA[iPad]->end();) { PBANNEDLISTDATA pBannedListData = *it; @@ -6507,7 +6507,7 @@ unsigned int CMinecraftApp::CreateImageTextData(std::uint8_t* textMetadata, void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType, int x, int z) { // check we don't already have this in - for (AUTO_VAR(it, m_vTerrainFeatures.begin()); + for (auto it = m_vTerrainFeatures.begin(); it < m_vTerrainFeatures.end(); ++it) { FEATURE_DATA* pFeatureData = *it; @@ -6525,7 +6525,7 @@ void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType, } _eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) { - for (AUTO_VAR(it, m_vTerrainFeatures.begin()); + for (auto it = m_vTerrainFeatures.begin(); it < m_vTerrainFeatures.end(); ++it) { FEATURE_DATA* pFeatureData = *it; @@ -6538,7 +6538,7 @@ _eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) { bool CMinecraftApp::GetTerrainFeaturePosition(_eTerrainFeatureType eType, int* pX, int* pZ) { - for (AUTO_VAR(it, m_vTerrainFeatures.begin()); + for (auto it = m_vTerrainFeatures.begin(); it < m_vTerrainFeatures.end(); ++it) { FEATURE_DATA* pFeatureData = *it; @@ -6666,7 +6666,7 @@ unsigned int CMinecraftApp::AddDLCRequest(eDLCMarketplaceType eType, // If it's already in there, promote it to the top of the list int iPosition = 0; - for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); + for (auto it = m_DLCDownloadQueue.begin(); it != m_DLCDownloadQueue.end(); ++it) { DLCRequest* pCurrent = *it; @@ -6717,7 +6717,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromoted=false; - for(AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); it != + for(auto it = m_TMSPPDownloadQueue.begin(); it != m_TMSPPDownloadQueue.end(); ++it) { TMSPPRequest *pCurrent = *it; @@ -6776,7 +6776,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, // of a previous trial/full offer bool bAlreadyInQueue = false; - for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); + for (auto it = m_TMSPPDownloadQueue.begin(); it != m_TMSPPDownloadQueue.end(); ++it) { TMSPPRequest* pCurrent = *it; @@ -6843,7 +6843,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, // a previous trial/full offer bool bAlreadyInQueue = false; - for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); + for (auto it = m_TMSPPDownloadQueue.begin(); it != m_TMSPPDownloadQueue.end(); ++it) { TMSPPRequest* pCurrent = *it; @@ -6895,7 +6895,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool CMinecraftApp::CheckTMSDLCCanStop() { EnterCriticalSection(&csTMSPPDownloadQueue); - for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); + for (auto it = m_TMSPPDownloadQueue.begin(); it != m_TMSPPDownloadQueue.end(); ++it) { TMSPPRequest* pCurrent = *it; @@ -6921,7 +6921,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() { } EnterCriticalSection(&csDLCDownloadQueue); - for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); + for (auto it = m_DLCDownloadQueue.begin(); it != m_DLCDownloadQueue.end(); ++it) { DLCRequest* pCurrent = *it; @@ -6932,7 +6932,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() { } // Now look for the next retrieval - for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); + for (auto it = m_DLCDownloadQueue.begin(); it != m_DLCDownloadQueue.end(); ++it) { DLCRequest* pCurrent = *it; @@ -6964,13 +6964,13 @@ bool CMinecraftApp::RetrieveNextDLCContent() { int CMinecraftApp::TMSPPFileReturned(void* pParam, int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, - LPCSTR szFilename) { + const char* szFilename) { CMinecraftApp* pClass = (CMinecraftApp*)pParam; // find the right one in the vector EnterCriticalSection(&pClass->csTMSPPDownloadQueue); - for (AUTO_VAR(it, pClass->m_TMSPPDownloadQueue.begin()); + for (auto it = pClass->m_TMSPPDownloadQueue.begin(); it != pClass->m_TMSPPDownloadQueue.end(); ++it) { TMSPPRequest* pCurrent = *it; #if defined(_WINDOWS64) @@ -7030,7 +7030,7 @@ void CMinecraftApp::ClearAndResetDLCDownloadQueue() { int iPosition = 0; EnterCriticalSection(&csTMSPPDownloadQueue); - for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); + for (auto it = m_DLCDownloadQueue.begin(); it != m_DLCDownloadQueue.end(); ++it) { DLCRequest* pCurrent = *it; @@ -7052,7 +7052,7 @@ void CMinecraftApp::TickTMSPPFilesRetrieved() { void CMinecraftApp::ClearTMSPPFilesRetrieved() { int iPosition = 0; EnterCriticalSection(&csTMSPPDownloadQueue); - for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); + for (auto it = m_TMSPPDownloadQueue.begin(); it != m_TMSPPDownloadQueue.end(); ++it) { TMSPPRequest* pCurrent = *it; @@ -7070,7 +7070,7 @@ int CMinecraftApp::DLCOffersReturned(void* pParam, int iOfferC, // find the right one in the vector EnterCriticalSection(&pClass->csTMSPPDownloadQueue); - for (AUTO_VAR(it, pClass->m_DLCDownloadQueue.begin()); + for (auto it = pClass->m_DLCDownloadQueue.begin(); it != pClass->m_DLCDownloadQueue.end(); ++it) { DLCRequest* pCurrent = *it; @@ -7102,7 +7102,7 @@ bool CMinecraftApp::DLCContentRetrieved(eDLCMarketplaceType eType) { // If there's already a retrieve in progress, quit // we may have re-ordered the list, so need to check every item EnterCriticalSection(&csDLCDownloadQueue); - for (AUTO_VAR(it, m_DLCDownloadQueue.begin()); + for (auto it = m_DLCDownloadQueue.begin(); it != m_DLCDownloadQueue.end(); ++it) { DLCRequest* pCurrent = *it; @@ -7168,7 +7168,7 @@ std::vector* CMinecraftApp::SetAdditionalSkinBoxes( dwSkinID & 0x0FFFFFFF); // convert the skin boxes into model parts, and add to the humanoid model - for (AUTO_VAR(it, pvSkinBoxA->begin()); it != pvSkinBoxA->end(); ++it) { + for (auto it = pvSkinBoxA->begin(); it != pvSkinBoxA->end(); ++it) { if (pModel) { ModelPart* pModelPart = pModel->AddOrRetrievePart(*it); pvModelPart->push_back(pModelPart); @@ -7192,7 +7192,7 @@ std::vector* CMinecraftApp::GetAdditionalModelParts( EnterCriticalSection(&csAdditionalModelParts); std::vector* pvModelParts = nullptr; if (m_AdditionalModelParts.size() > 0) { - AUTO_VAR(it, m_AdditionalModelParts.find(dwSkinID)); + auto it = m_AdditionalModelParts.find(dwSkinID); if (it != m_AdditionalModelParts.end()) { pvModelParts = (*it).second; } @@ -7207,7 +7207,7 @@ std::vector* CMinecraftApp::GetAdditionalSkinBoxes( EnterCriticalSection(&csAdditionalSkinBoxes); std::vector* pvSkinBoxes = nullptr; if (m_AdditionalSkinBoxes.size() > 0) { - AUTO_VAR(it, m_AdditionalSkinBoxes.find(dwSkinID)); + auto it = m_AdditionalSkinBoxes.find(dwSkinID); if (it != m_AdditionalSkinBoxes.end()) { pvSkinBoxes = (*it).second; } @@ -7222,7 +7222,7 @@ unsigned int CMinecraftApp::GetAnimOverrideBitmask(std::uint32_t dwSkinID) { unsigned int uiAnimOverrideBitmask = 0L; if (m_AnimOverrides.size() > 0) { - AUTO_VAR(it, m_AnimOverrides.find(dwSkinID)); + auto it = m_AnimOverrides.find(dwSkinID); if (it != m_AnimOverrides.end()) { uiAnimOverrideBitmask = (*it).second; } @@ -7238,7 +7238,7 @@ void CMinecraftApp::SetAnimOverrideBitmask(std::uint32_t dwSkinID, EnterCriticalSection(&csAnimOverrideBitmask); if (m_AnimOverrides.size() > 0) { - AUTO_VAR(it, m_AnimOverrides.find(dwSkinID)); + auto it = m_AnimOverrides.find(dwSkinID); if (it != m_AnimOverrides.end()) { LeaveCriticalSection(&csAnimOverrideBitmask); return; // already in here diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Platform/Common/Consoles_App.h index 6c6c15cef..2487b0962 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Platform/Common/Consoles_App.h @@ -810,7 +810,7 @@ public: void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes, unsigned char* seedText, unsigned int& uiHostOptions, bool& bHostOptionsRead, std::uint32_t& uiTexturePack); - unsigned int CreateImageTextData(std::uint8_t* textMetadata, __int64 seed, + unsigned int CreateImageTextData(std::uint8_t* textMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); @@ -869,7 +869,7 @@ public: static int TMSPPFileReturned(void* pParam, int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, - LPCSTR szFilename); + const char* szFilename); DLC_INFO* GetDLCInfoTrialOffer(int iIndex); DLC_INFO* GetDLCInfoFullOffer(int iIndex); diff --git a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp index 660c49f54..13d0bc174 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp @@ -227,7 +227,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData, for (unsigned int j = 0; j < uiParameterCount; j++) { // EAudioParameterType paramType = e_AudioParamType_Invalid; - AUTO_VAR(it, parameterMapping.find(paramBuf.dwType)); + auto it = parameterMapping.find(paramBuf.dwType); if (it != parameterMapping.end()) { addParameter(type, (EAudioParameterType)paramBuf.dwType, diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp index a4ecb3a22..8b22e7499 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp @@ -101,7 +101,7 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData, return false; } - const __int64 endPosition = PortableFileIO::Tell(file); + const int64_t endPosition = PortableFileIO::Tell(file); if (endPosition <= 0 || endPosition > std::numeric_limits::max()) { std::fclose(file); @@ -151,7 +151,7 @@ DLCManager::DLCManager() { } DLCManager::~DLCManager() { - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = *it; delete pack; } @@ -174,7 +174,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType( unsigned int DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) { unsigned int packCount = 0; if (type != e_DLCType_All) { - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = *it; if (pack->getDLCItemsCount(type) > 0) { ++packCount; @@ -190,14 +190,14 @@ void DLCManager::addPack(DLCPack* pack) { m_packs.push_back(pack); } void DLCManager::removePack(DLCPack* pack) { if (pack != nullptr) { - AUTO_VAR(it, find(m_packs.begin(), m_packs.end(), pack)); + auto it = find(m_packs.begin(), m_packs.end(), pack); if (it != m_packs.end()) m_packs.erase(it); delete pack; } } void DLCManager::removeAllPacks(void) { - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = (DLCPack*)*it; delete pack; } @@ -206,7 +206,7 @@ void DLCManager::removeAllPacks(void) { } void DLCManager::LanguageChanged(void) { - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = (DLCPack*)*it; // update the language pack->UpdateLanguage(); @@ -217,7 +217,7 @@ DLCPack* DLCManager::getPack(const std::wstring& name) { DLCPack* pack = nullptr; // DWORD currentIndex = 0; DLCPack* currentPack = nullptr; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { currentPack = *it; std::wstring wsName = currentPack->getName(); @@ -236,7 +236,7 @@ DLCPack* DLCManager::getPack(unsigned int index, if (type != e_DLCType_All) { unsigned int currentIndex = 0; DLCPack* currentPack = nullptr; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { currentPack = *it; if (currentPack->getDLCItemsCount(type) > 0) { if (currentIndex == index) { @@ -271,7 +271,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found, } if (type != e_DLCType_All) { unsigned int index = 0; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* thisPack = *it; if (thisPack->getDLCItemsCount(type) > 0) { if (thisPack == pack) { @@ -284,7 +284,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found, } } else { unsigned int index = 0; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* thisPack = *it; if (thisPack == pack) { found = true; @@ -302,7 +302,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path, unsigned int foundIndex = 0; found = false; unsigned int index = 0; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = *it; if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) { if (pack->doesPackContainSkin(path)) { @@ -318,7 +318,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path, DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) { DLCPack* foundPack = nullptr; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = *it; if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) { if (pack->doesPackContainSkin(path)) { @@ -332,7 +332,7 @@ DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) { DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) { DLCSkinFile* foundSkinfile = nullptr; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { DLCPack* pack = *it; foundSkinfile = pack->getSkinFile(path); if (foundSkinfile != nullptr) { @@ -348,7 +348,7 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert( DLCPack* pack = nullptr; DLCPack* firstCorruptPack = nullptr; - for (AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { + for (auto it = m_packs.begin(); it != m_packs.end(); ++it) { pack = *it; if (pack->IsCorrupt()) { ++corruptDLCCount; @@ -529,7 +529,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed, // DLCManager::EDLCParameterType paramType = // DLCManager::e_DLCParamType_Invalid; - AUTO_VAR(it, parameterMapping.find(parBuf.dwType)); + auto it = parameterMapping.find(parBuf.dwType); if (it != parameterMapping.end()) { if (type == e_DLCType_PackConfig) { @@ -686,7 +686,7 @@ std::uint32_t DLCManager::retrievePackID(std::uint8_t* pbData, pbTemp += sizeof(int); ReadDlcStruct(¶mBuf, pbTemp); for (unsigned int j = 0; j < uiParameterCount; j++) { - AUTO_VAR(it, parameterMapping.find(paramBuf.dwType)); + auto it = parameterMapping.find(paramBuf.dwType); if (it != parameterMapping.end()) { if (type == e_DLCType_PackConfig) { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp index 8af40e08f..b7836a78f 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp @@ -29,12 +29,12 @@ DLCPack::DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask) { DLCPack::~DLCPack() { - for (AUTO_VAR(it, m_childPacks.begin()); it != m_childPacks.end(); ++it) { + for (auto it = m_childPacks.begin(); it != m_childPacks.end(); ++it) { delete *it; } for (unsigned int i = 0; i < DLCManager::e_DLCType_Max; ++i) { - for (AUTO_VAR(it, m_files[i].begin()); it != m_files[i].end(); ++it) { + for (auto it = m_files[i].begin(); it != m_files[i].end(); ++it) { delete *it; } } @@ -122,7 +122,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type, bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int& param) { - AUTO_VAR(it, m_parameters.find((int)type)); + auto it = m_parameters.find((int)type); if (it != m_parameters.end()) { switch (type) { case DLCManager::e_DLCParamType_NetherParticleColour: @@ -213,8 +213,8 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, } } else { g_pathCmpString = &path; - AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(), - pathCmp)); + auto it = std::find_if(m_files[type].begin(), m_files[type].end(), + pathCmp); hasFile = it != m_files[type].end(); if (!hasFile && m_parentPack) { hasFile = m_parentPack->doesPackContainFile(type, path); @@ -252,8 +252,7 @@ DLCFile* DLCPack::getFile(DLCManager::EDLCType type, const std::wstring& path) { } } else { g_pathCmpString = &path; - AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(), - pathCmp)); + auto it = std::find_if(m_files[type].begin(), m_files[type].end(), pathCmp); if (it == m_files[type].end()) { // Not found @@ -298,7 +297,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type, unsigned int foundIndex = 0; found = false; unsigned int index = 0; - for (AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it) { + for (auto it = m_files[type].begin(); it != m_files[type].end(); ++it) { if (path.compare((*it)->getPath()) == 0) { foundIndex = index; found = true; diff --git a/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp b/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp index 872cd02f1..4f9868d24 100644 --- a/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/AddItemRuleDefinition.cpp @@ -34,7 +34,7 @@ void AddItemRuleDefinition::writeAttributes(DataOutputStream* dos, void AddItemRuleDefinition::getChildren( std::vector* children) { GameRuleDefinition::getChildren(children); - for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); it++) + for (auto it = m_enchantments.begin(); it != m_enchantments.end(); it++) children->push_back(*it); } @@ -95,7 +95,7 @@ bool AddItemRuleDefinition::addItemToContainer( new ItemInstance(m_itemId, quantity, m_auxValue)); newItem->set4JData(m_dataTag); - for (AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); + for (auto it = m_enchantments.begin(); it != m_enchantments.end(); ++it) { (*it)->enchantItem(newItem); } diff --git a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h b/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h index 1f5a5cbc1..90afa1be1 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h +++ b/Minecraft.Client/Platform/Common/GameRules/ApplySchematicRuleDefinition.h @@ -20,8 +20,8 @@ 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(); diff --git a/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp b/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp index 7cc8e6723..5936ac788 100644 --- a/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/CompleteAllRuleDefinition.cpp @@ -28,7 +28,7 @@ bool CompleteAllRuleDefinition::onCollectItem( void CompleteAllRuleDefinition::updateStatus(GameRule* rule) { int goal = 0; int progress = 0; - for (AUTO_VAR(it, rule->m_parameters.begin()); + for (auto it = rule->m_parameters.begin(); it != rule->m_parameters.end(); ++it) { if (it->second.isPointer) { goal += it->second.gr->getGameRuleDefinition()->getGoal(); diff --git a/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp b/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp index 8a0642052..945dcd068 100644 --- a/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/CompoundGameRuleDefinition.cpp @@ -9,7 +9,7 @@ CompoundGameRuleDefinition::CompoundGameRuleDefinition() { } CompoundGameRuleDefinition::~CompoundGameRuleDefinition() { - for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { + for (auto it = m_children.begin(); it != m_children.end(); ++it) { delete (*it); } } @@ -17,7 +17,7 @@ CompoundGameRuleDefinition::~CompoundGameRuleDefinition() { void CompoundGameRuleDefinition::getChildren( std::vector* children) { GameRuleDefinition::getChildren(children); - for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); it++) + for (auto it = m_children.begin(); it != m_children.end(); it++) children->push_back(*it); } @@ -48,7 +48,7 @@ void CompoundGameRuleDefinition::populateGameRule( GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) { GameRule* newRule = nullptr; int i = 0; - for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { + for (auto it = m_children.begin(); it != m_children.end(); ++it) { newRule = new GameRule(*it, rule->getConnection()); (*it)->populateGameRule(type, newRule); @@ -66,7 +66,7 @@ void CompoundGameRuleDefinition::populateGameRule( bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x, int y, int z) { bool statusChanged = false; - for (AUTO_VAR(it, rule->m_parameters.begin()); + for (auto it = rule->m_parameters.begin(); it != rule->m_parameters.end(); ++it) { if (it->second.isPointer) { bool changed = it->second.gr->getGameRuleDefinition()->onUseTile( @@ -84,7 +84,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x, bool CompoundGameRuleDefinition::onCollectItem( GameRule* rule, std::shared_ptr item) { bool statusChanged = false; - for (AUTO_VAR(it, rule->m_parameters.begin()); + for (auto it = rule->m_parameters.begin(); it != rule->m_parameters.end(); ++it) { if (it->second.isPointer) { bool changed = @@ -102,7 +102,7 @@ bool CompoundGameRuleDefinition::onCollectItem( void CompoundGameRuleDefinition::postProcessPlayer( std::shared_ptr player) { - for (AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { + for (auto it = m_children.begin(); it != m_children.end(); ++it) { (*it)->postProcessPlayer(player); } } \ No newline at end of file diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp b/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp index 32912aaba..64c9db7af 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp @@ -18,7 +18,7 @@ void ConsoleGenerateStructure::getChildren( std::vector* children) { GameRuleDefinition::getChildren(children); - for (AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); it++) + for (auto it = m_actions.begin(); it != m_actions.end(); it++) children->push_back(*it); } @@ -104,7 +104,7 @@ BoundingBox* ConsoleGenerateStructure::getBoundingBox() { // Find the max bounds int maxX, maxY, maxZ; maxX = maxY = maxZ = 1; - for (AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); ++it) { + for (auto it = m_actions.begin(); it != m_actions.end(); ++it) { ConsoleGenerateStructureAction* action = *it; maxX = std::max(maxX, action->getEndX()); maxY = std::max(maxY, action->getEndY()); @@ -121,7 +121,7 @@ bool ConsoleGenerateStructure::postProcess(Level* level, Random* random, BoundingBox* chunkBB) { if (level->dimension->id != m_dimension) return false; - for (AUTO_VAR(it, m_actions.begin()); it != m_actions.end(); ++it) { + for (auto it = m_actions.begin(); it != m_actions.end(); ++it) { ConsoleGenerateStructureAction* action = *it; switch (action->getActionType()) { diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp index 8af41d83e..d3a929943 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.cpp @@ -169,7 +169,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) { ListTag* tileEntityTags = new ListTag(); tag->put(L"TileEntities", tileEntityTags); - for (AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end(); + for (auto it = m_tileEntities.begin(); it != m_tileEntities.end(); it++) { CompoundTag* cTag = new CompoundTag(); (*it)->save(cTag); @@ -179,14 +179,14 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) { ListTag* entityTags = new ListTag(); tag->put(L"Entities", entityTags); - for (AUTO_VAR(it, m_entities.begin()); it != m_entities.end(); it++) + for (auto it = m_entities.begin(); it != m_entities.end(); it++) entityTags->add((CompoundTag*)(*it).second->copy()); NbtIo::write(tag, dos); delete tag; } -__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk, +int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot) { @@ -328,7 +328,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk, // 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, +int64_t ConsoleSchematicFile::applyLighting(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot) { int xStart = std::max(destinationBox->x0, (double)chunk->x * 16); @@ -452,7 +452,7 @@ void ConsoleSchematicFile::schematicCoordToChunkCoord( void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot) { - for (AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end(); + for (auto it = m_tileEntities.begin(); it != m_tileEntities.end(); ++it) { std::shared_ptr te = *it; @@ -499,7 +499,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox, teCopy->setChanged(); } } - for (AUTO_VAR(it, m_entities.begin()); it != m_entities.end();) { + for (auto it = m_entities.begin(); it != m_entities.end();) { Vec3 source = it->first; double targetX = source.x; @@ -714,7 +714,7 @@ void ConsoleSchematicFile::generateSchematicFile( getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize); - for (AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); + for (auto it = tileEntities->begin(); it != tileEntities->end(); ++it) { std::shared_ptr te = *it; CompoundTag* teTag = new CompoundTag(); @@ -738,7 +738,7 @@ void ConsoleSchematicFile::generateSchematicFile( level->getEntities(nullptr, &bb); ListTag* entitiesTag = new ListTag(L"entities"); - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { std::shared_ptr e = *it; bool mobCanBeSaved = false; @@ -1070,7 +1070,7 @@ ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk* chunk, int x0, int y0, int z0, int x1, int y1, int z1) { std::vector >* result = new std::vector >; - for (AUTO_VAR(it, chunk->tileEntities.begin()); + for (auto it = chunk->tileEntities.begin(); it != chunk->tileEntities.end(); ++it) { std::shared_ptr te = it->second; if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h index adf862a0b..8a54f201d 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleSchematicFile.h @@ -70,9 +70,9 @@ public: void save(DataOutputStream* dos); void load(DataInputStream* dis); - __int64 applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox, + int64_t applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot); - __int64 applyLighting(LevelChunk* chunk, AABB* chunkBox, + int64_t applyLighting(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot); void applyTileEntities(LevelChunk* chunk, AABB* chunkBox, AABB* destinationBox, ESchematicRotation rot); diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRule.cpp b/Minecraft.Client/Platform/Common/GameRules/GameRule.cpp index 95e1a9037..35c52fc55 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRule.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/GameRule.cpp @@ -7,7 +7,7 @@ GameRule::GameRule(GameRuleDefinition* definition, Connection* connection) { } GameRule::~GameRule() { - for (AUTO_VAR(it, m_parameters.begin()); it != m_parameters.end(); ++it) { + for (auto it = m_parameters.begin(); it != m_parameters.end(); ++it) { if (it->second.isPointer) { delete it->second.gr; } @@ -51,7 +51,7 @@ void GameRule::onCollectItem(std::shared_ptr item) { void GameRule::write(DataOutputStream* dos) { // Find required parameters. dos->writeInt(m_parameters.size()); - for (AUTO_VAR(it, m_parameters.begin()); it != m_parameters.end(); it++) { + for (auto it = m_parameters.begin(); it != m_parameters.end(); it++) { std::wstring pName = (*it).first; ValueType vType = (*it).second; diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRule.h b/Minecraft.Client/Platform/Common/GameRules/GameRule.h index 5c9dccd56..f0b0586bb 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRule.h +++ b/Minecraft.Client/Platform/Common/GameRules/GameRule.h @@ -12,7 +12,7 @@ class GameRule { public: typedef struct _ValueType { union { - __int64 i64; + int64_t i64; int i; char c; bool b; diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp b/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp index eb10ef92f..87081110c 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/GameRuleDefinition.cpp @@ -24,7 +24,7 @@ void GameRuleDefinition::write(DataOutputStream* dos) { // Write children. dos->writeInt(children->size()); - for (AUTO_VAR(it, children->begin()); it != children->end(); it++) + for (auto it = children->begin(); it != children->end(); it++) (*it)->write(dos); } @@ -119,7 +119,7 @@ GameRuleDefinition::enumerateMap() { int i = 0; std::vector* gRules = enumerate(); - for (AUTO_VAR(it, gRules->begin()); it != gRules->end(); it++) + for (auto it = gRules->begin(); it != gRules->end(); it++) out->insert(std::pair(*it, i++)); return out; diff --git a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp index b25468802..a909492fa 100644 --- a/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/GameRuleManager.cpp @@ -348,7 +348,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream* dos) { std::unordered_map* files; files = getLevelGenerationOptions()->getUnfinishedSchematicFiles(); dos->writeInt(files->size()); - for (AUTO_VAR(it, files->begin()); it != files->end(); it++) { + for (auto it = files->begin(); it != files->end(); it++) { std::wstring filename = it->first; ConsoleSchematicFile* file = it->second; @@ -392,7 +392,7 @@ bool GameRuleManager::readRuleFile( // Read File. // version_number - __int64 version = dis.readShort(); + int64_t version = dis.readShort(); unsigned char compressionType = 0; if (version == 0) { for (int i = 0; i < 14; i++) dis.readByte(); // Read padding. @@ -528,7 +528,7 @@ bool GameRuleManager::readRuleFile( int tagId = contentDis->readInt(); ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid; - AUTO_VAR(it, tagIdMap.find(tagId)); + auto it = tagIdMap.find(tagId); if (it != tagIdMap.end()) tagVal = it->second; GameRuleDefinition* rule = nullptr; @@ -601,7 +601,7 @@ void GameRuleManager::readChildren( int tagId = dis->readInt(); ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid; - AUTO_VAR(it, tagIdMap->find(tagId)); + auto it = tagIdMap->find(tagId); if (it != tagIdMap->end()) tagVal = it->second; GameRuleDefinition* childRule = nullptr; diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp index a67b604a9..faf62e27a 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp @@ -74,21 +74,21 @@ LevelGenerationOptions::LevelGenerationOptions(DLCPack* parentPack) { LevelGenerationOptions::~LevelGenerationOptions() { clearSchematics(); if (m_spawnPos != nullptr) delete m_spawnPos; - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); ++it) { delete *it; } - for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); + for (auto it = m_structureRules.begin(); it != m_structureRules.end(); ++it) { delete *it; } - for (AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); + for (auto it = m_biomeOverrides.begin(); it != m_biomeOverrides.end(); ++it) { delete *it; } - for (AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) { + for (auto it = m_features.begin(); it != m_features.end(); ++it) { delete *it; } @@ -124,20 +124,20 @@ void LevelGenerationOptions::getChildren( GameRuleDefinition::getChildren(children); std::vector used_schematics; - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); it++) if (!(*it)->isComplete()) used_schematics.push_back(*it); - for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); + for (auto it = m_structureRules.begin(); it != m_structureRules.end(); it++) children->push_back(*it); - for (AUTO_VAR(it, used_schematics.begin()); it != used_schematics.end(); + for (auto it = used_schematics.begin(); it != used_schematics.end(); it++) children->push_back(*it); - for (AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); + for (auto it = m_biomeOverrides.begin(); it != m_biomeOverrides.end(); ++it) children->push_back(*it); - for (AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) + for (auto it = m_features.begin(); it != m_features.end(); ++it) children->push_back(*it); } @@ -170,7 +170,7 @@ GameRuleDefinition* LevelGenerationOptions::addChild( void LevelGenerationOptions::addAttribute(const std::wstring& attributeName, const std::wstring& attributeValue) { if (attributeName.compare(L"seed") == 0) { - m_seed = _fromString<__int64>(attributeValue); + m_seed = _fromString(attributeValue); app.DebugPrintf( "LevelGenerationOptions: Adding parameter m_seed=%I64d\n", m_seed); } else if (attributeName.compare(L"spawnX") == 0) { @@ -255,7 +255,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) { chunk->z); AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16, Level::maxBuildHeight, chunk->z * 16 + 16); - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); ++it) { ApplySchematicRuleDefinition* rule = *it; rule->processSchematic(&chunkBox, chunk); @@ -264,7 +264,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) { int cx = (chunk->x << 4); int cz = (chunk->z << 4); - for (AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); + for (auto it = m_structureRules.begin(); it != m_structureRules.end(); it++) { ConsoleGenerateStructure* structureStart = *it; @@ -283,7 +283,7 @@ void LevelGenerationOptions::processSchematicsLighting(LevelChunk* chunk) { chunk->x, chunk->z); AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16, Level::maxBuildHeight, chunk->z * 16 + 16); - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); ++it) { ApplySchematicRuleDefinition* rule = *it; rule->processSchematicLighting(&chunkBox, chunk); @@ -300,14 +300,14 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, // ground/sea level and b) tutorial world additions generally being above // ground/sea level if (!m_bHaveMinY) { - for (AUTO_VAR(it, m_schematicRules.begin()); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); ++it) { ApplySchematicRuleDefinition* rule = *it; int minY = rule->getMinY(); if (minY < m_minY) m_minY = minY; } - for (AUTO_VAR(it, m_structureRules.begin()); + for (auto it = m_structureRules.begin(); it != m_structureRules.end(); it++) { ConsoleGenerateStructure* structureStart = *it; int minY = structureStart->getMinY(); @@ -322,7 +322,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, if (y1 < m_minY) return false; bool intersects = false; - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); ++it) { ApplySchematicRuleDefinition* rule = *it; intersects = rule->checkIntersects(x0, y0, z0, x1, y1, z1); @@ -330,7 +330,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, } if (!intersects) { - for (AUTO_VAR(it, m_structureRules.begin()); + for (auto it = m_structureRules.begin(); it != m_structureRules.end(); it++) { ConsoleGenerateStructure* structureStart = *it; intersects = @@ -343,7 +343,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, } void LevelGenerationOptions::clearSchematics() { - for (AUTO_VAR(it, m_schematics.begin()); it != m_schematics.end(); ++it) { + for (auto it = m_schematics.begin(); it != m_schematics.end(); ++it) { delete it->second; } m_schematics.clear(); @@ -353,7 +353,7 @@ ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile( const std::wstring& filename, std::uint8_t* pbData, unsigned int dataLength) { // If we have already loaded this, just return - AUTO_VAR(it, m_schematics.find(filename)); + auto it = m_schematics.find(filename); if (it != m_schematics.end()) { #if !defined(_CONTENT_PACKAGE) wprintf(L"We have already loaded schematic file %ls\n", @@ -378,7 +378,7 @@ ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile( const std::wstring& filename) { ConsoleSchematicFile* schematic = nullptr; // If we have already loaded this, just return - AUTO_VAR(it, m_schematics.find(filename)); + auto it = m_schematics.find(filename); if (it != m_schematics.end()) { schematic = it->second; } @@ -389,7 +389,7 @@ void LevelGenerationOptions::releaseSchematicFile( const std::wstring& filename) { // 4J Stu - We don't want to delete them when done, but probably want to // keep a set of active schematics for the current world - // AUTO_VAR(it, m_schematics.find(filename)); + // auto it = m_schematics.find(filename); // if(it != m_schematics.end()) //{ // ConsoleSchematicFile *schematic = it->second; @@ -416,7 +416,7 @@ const wchar_t* LevelGenerationOptions::getString(const std::wstring& key) { void LevelGenerationOptions::getBiomeOverride(int biomeId, std::uint8_t& tile, std::uint8_t& topTile) { - for (AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); + for (auto it = m_biomeOverrides.begin(); it != m_biomeOverrides.end(); ++it) { BiomeOverride* bo = *it; if (bo->isBiome(biomeId)) { @@ -431,7 +431,7 @@ bool LevelGenerationOptions::isFeatureChunk( int* orientation) { bool isFeature = false; - for (AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) { + for (auto it = m_features.begin(); it != m_features.end(); ++it) { StartFeature* sf = *it; if (sf->isFeatureChunk(chunkX, chunkZ, feature, orientation)) { isFeature = true; @@ -446,14 +446,14 @@ LevelGenerationOptions::getUnfinishedSchematicFiles() { // Clean schematic rules. std::unordered_set usedFiles = std::unordered_set(); - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); it++) if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName()); // Clean schematic files. std::unordered_map* out = new std::unordered_map(); - for (AUTO_VAR(it, usedFiles.begin()); it != usedFiles.end(); it++) + for (auto it = usedFiles.begin(); it != usedFiles.end(); it++) out->insert(std::pair( *it, getSchematicFile(*it))); @@ -487,7 +487,7 @@ void LevelGenerationOptions::loadBaseSaveData() { } } -int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr, +int LevelGenerationOptions::packMounted(void* pParam, int iPad, DWORD dwErr, DWORD dwLicenceMask) { LevelGenerationOptions* lgo = (LevelGenerationOptions*)pParam; lgo->m_bLoadingData = false; @@ -545,7 +545,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr, DWORD dwFileSize = grf.length(); DWORD bytesRead; PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(fileHandle, pbData, dwFileSize, + bool bSuccess = ReadFile(fileHandle, pbData, dwFileSize, &bytesRead, nullptr); if (bSuccess == FALSE) { app.FatalLoadError(); @@ -602,7 +602,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr, if (fileHandle != INVALID_HANDLE_VALUE) { DWORD bytesRead, dwFileSize = GetFileSize(fileHandle, nullptr); PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(fileHandle, pbData, dwFileSize, + bool bSuccess = ReadFile(fileHandle, pbData, dwFileSize, &bytesRead, nullptr); if (bSuccess == FALSE) { app.FatalLoadError(); @@ -624,7 +624,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr, } void LevelGenerationOptions::reset_start() { - for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); + for (auto it = m_schematicRules.begin(); it != m_schematicRules.end(); it++) { (*it)->reset(); } diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h index 046fac0f5..8cb31e933 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h +++ b/Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.h @@ -219,7 +219,7 @@ public: getUnfinishedSchematicFiles(); void loadBaseSaveData(); - static int packMounted(LPVOID pParam, int iPad, DWORD dwErr, + static int packMounted(void* pParam, int iPad, DWORD dwErr, DWORD dwLicenceMask); // 4J-JEV: diff --git a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp b/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp index 4276d3008..8cb2b3eb8 100644 --- a/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp @@ -7,14 +7,14 @@ LevelRuleset::LevelRuleset() { m_stringTable = nullptr; } LevelRuleset::~LevelRuleset() { - for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); ++it) { + for (auto it = m_areas.begin(); it != m_areas.end(); ++it) { delete *it; } } void LevelRuleset::getChildren(std::vector* children) { CompoundGameRuleDefinition::getChildren(children); - for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); it++) + for (auto it = m_areas.begin(); it != m_areas.end(); it++) children->push_back(*it); } @@ -44,7 +44,7 @@ const wchar_t* LevelRuleset::getString(const std::wstring& key) { AABB* LevelRuleset::getNamedArea(const std::wstring& areaName) { AABB* area = nullptr; - for (AUTO_VAR(it, m_areas.begin()); it != m_areas.end(); ++it) { + for (auto it = m_areas.begin(); it != m_areas.end(); ++it) { if ((*it)->getName().compare(areaName) == 0) { area = (*it)->getArea(); break; diff --git a/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp b/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp index 51d85a94b..7444fc21e 100644 --- a/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/UpdatePlayerRuleDefinition.cpp @@ -17,7 +17,7 @@ UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() { } UpdatePlayerRuleDefinition::~UpdatePlayerRuleDefinition() { - for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) { + for (auto it = m_items.begin(); it != m_items.end(); ++it) { delete *it; } } @@ -54,7 +54,7 @@ void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream* dos, void UpdatePlayerRuleDefinition::getChildren( std::vector* children) { GameRuleDefinition::getChildren(children); - for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); it++) + for (auto it = m_items.begin(); it != m_items.end(); it++) children->push_back(*it); } @@ -147,7 +147,7 @@ void UpdatePlayerRuleDefinition::postProcessPlayer( if (m_spawnPos != nullptr || m_bUpdateYRot) player->absMoveTo(x, y, z, yRot, xRot); - for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) { + for (auto it = m_items.begin(); it != m_items.end(); ++it) { AddItemRuleDefinition* addItem = *it; addItem->addItemToContainer(player->inventory, -1); diff --git a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp b/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp index afa3d3e8d..621e5e9b5 100644 --- a/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/XboxStructureActionPlaceContainer.cpp @@ -12,7 +12,7 @@ XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer() { } XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() { - for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) { + for (auto it = m_items.begin(); it != m_items.end(); ++it) { delete *it; } } @@ -24,7 +24,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() { void XboxStructureActionPlaceContainer::getChildren( std::vector* children) { XboxStructureActionPlaceBlock::getChildren(children); - for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); it++) + for (auto it = m_items.begin(); it != m_items.end(); it++) children->push_back(*it); } @@ -88,7 +88,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel( Tile::UPDATE_CLIENTS); // Add items int slotId = 0; - for (AUTO_VAR(it, m_items.begin()); + for (auto it = m_items.begin(); it != m_items.end() && (slotId < container->getContainerSize()); ++it, ++slotId) { diff --git a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp b/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp index e1c8d8253..ff59f8255 100644 --- a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp +++ b/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.cpp @@ -54,7 +54,7 @@ SonyLeaderboardManager::~SonyLeaderboardManager() { DeleteCriticalSection(&m_csViewsLock); } -int SonyLeaderboardManager::scoreboardThreadEntry(LPVOID lpParam) { +int SonyLeaderboardManager::scoreboardThreadEntry(void* lpParam) { ShutdownManager::HasStarted(ShutdownManager::eLeaderboardThread); SonyLeaderboardManager* self = reinterpret_cast(lpParam); diff --git a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h b/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h index de6a4386e..88f5230c5 100644 --- a/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h +++ b/Minecraft.Client/Platform/Common/Leaderboards/SonyLeaderboardManager.h @@ -30,7 +30,7 @@ protected: // SceNpId m_myNpId; - static int scoreboardThreadEntry(LPVOID lpParam); + static int scoreboardThreadEntry(void* lpParam); void scoreboardThreadInternal(); virtual bool getScoreByIds(); diff --git a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp index c05da75ed..7fb3ad0f9 100644 --- a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp @@ -186,7 +186,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft, DWORD bytesRead, dwFileSize = GetFileSize(fileHandle, nullptr); PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = + bool bSuccess = ReadFile(fileHandle, pbData, dwFileSize, &bytesRead, nullptr); if (bSuccess == FALSE) { @@ -444,7 +444,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft, do { // We need to keep ticking the connections for players that // already logged in - for (AUTO_VAR(it, createdConnections.begin()); + for (auto it = createdConnections.begin(); it < createdConnections.end(); ++it) { (*it)->tick(); } @@ -482,8 +482,8 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft, idx, CONTEXT_PRESENCE_MULTIPLAYER, false); } else { connection->close(); - AUTO_VAR(it, find(createdConnections.begin(), - createdConnections.end(), connection)); + auto it = find(createdConnections.begin(), + createdConnections.end(), connection); if (it != createdConnections.end()) createdConnections.erase(it); } @@ -497,7 +497,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft, } if (g_NetworkManager.IsLeavingGame() || !IsInSession()) { - for (AUTO_VAR(it, createdConnections.begin()); + for (auto it = createdConnections.begin(); it < createdConnections.end(); ++it) { (*it)->close(); } @@ -940,7 +940,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) { // them being removed from the server when removed from the session if (pServer != nullptr) { PlayerList* players = pServer->getPlayers(); - for (AUTO_VAR(it, players->players.begin()); + for (auto it = players->players.begin(); it < players->players.end(); ++it) { std::shared_ptr servPlayer = *it; if (servPlayer->connection->isLocal() && @@ -1005,7 +1005,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) { pMinecraft->localplayers[index]->getXuid(); PlayerList* players = pServer->getPlayers(); - for (AUTO_VAR(it, players->players.begin()); + for (auto it = players->players.begin(); it < players->players.end(); ++it) { std::shared_ptr servPlayer = *it; if (servPlayer->getXuid() == localPlayerXuid) { diff --git a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h b/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h index c0b313d3c..656a1584a 100644 --- a/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h +++ b/Minecraft.Client/Platform/Common/Network/GameNetworkManager.h @@ -155,9 +155,9 @@ public: // Used for debugging output static const int messageQueue_length = 512; - static __int64 messageQueue[messageQueue_length]; + static int64_t messageQueue[messageQueue_length]; static const int byteQueue_length = 512; - static __int64 byteQueue[byteQueue_length]; + static int64_t byteQueue[byteQueue_length]; static int messageQueuePos; // Methods called from PlatformNetworkManager diff --git a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp index b8be5030f..46c28b4a9 100644 --- a/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Platform/Common/Network/PlatformNetworkManagerStub.cpp @@ -50,7 +50,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer* pQNetPlayer) { if (m_pIQNet->IsHost() && !m_bHostChanged) { // Do we already have a primary player for this system? bool systemHasPrimaryPlayer = false; - for (AUTO_VAR(it, m_machineQNetPrimaryPlayers.begin()); + for (auto it = m_machineQNetPrimaryPlayers.begin(); it < m_machineQNetPrimaryPlayers.end(); ++it) { IQNetPlayer* pQNetPrimaryPlayer = *it; if (pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer)) { @@ -512,7 +512,7 @@ INetworkPlayer* CPlatformNetworkManagerStub::addNetworkPlayer( void CPlatformNetworkManagerStub::removeNetworkPlayer( IQNetPlayer* pQNetPlayer) { INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer); - for (AUTO_VAR(it, currentNetworkPlayers.begin()); + for (auto it = currentNetworkPlayers.begin(); it != currentNetworkPlayers.end(); it++) { if (*it == pNetworkPlayer) { currentNetworkPlayers.erase(it); diff --git a/Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp b/Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp index 87cdb2126..440bfa90c 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/AreaTask.cpp @@ -21,7 +21,7 @@ bool AreaTask::isCompleted() { switch (m_completionState) { case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: { bool allSatisfied = true; - for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); + for (auto it = constraints.begin(); it != constraints.end(); ++it) { TutorialConstraint* constraint = *it; if (!constraint->isConstraintSatisfied(tutorial->getPad())) { diff --git a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp b/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp index 2442a083c..af7f0da78 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp @@ -45,7 +45,7 @@ bool InfoTask::isCompleted() { // If a menu is displayed, then we use the handleUIInput to complete the // task bAllComplete = true; - for (AUTO_VAR(it, completedMappings.begin()); + for (auto it = completedMappings.begin(); it != completedMappings.end(); ++it) { bool current = (*it).second; if (!current) { @@ -56,7 +56,7 @@ bool InfoTask::isCompleted() { } else { int iCurrent = 0; - for (AUTO_VAR(it, completedMappings.begin()); + for (auto it = completedMappings.begin(); it != completedMappings.end(); ++it) { bool current = (*it).second; if (!current) { @@ -94,7 +94,7 @@ void InfoTask::setAsCurrentTask(bool active /*= true*/) { void InfoTask::handleUIInput(int iAction) { if (bHasBeenActivated) { - for (AUTO_VAR(it, completedMappings.begin()); + for (auto it = completedMappings.begin(); it != completedMappings.end(); ++it) { if (iAction == (*it).first) { (*it).second = true; diff --git a/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp b/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp index f5a8ddbab..cdc40871d 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/ProcedureCompoundTask.cpp @@ -2,7 +2,7 @@ #include "ProcedureCompoundTask.h" ProcedureCompoundTask::~ProcedureCompoundTask() { - for (AUTO_VAR(it, m_taskSequence.begin()); it < m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < m_taskSequence.end(); ++it) { delete (*it); } @@ -19,8 +19,8 @@ int ProcedureCompoundTask::getDescriptionId() { // Return the id of the first task not completed int descriptionId = -1; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (!task->isCompleted()) { task->setAsCurrentTask(true); @@ -40,8 +40,8 @@ int ProcedureCompoundTask::getPromptId() { // Return the id of the first task not completed int promptId = -1; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (!task->isCompleted()) { promptId = task->getPromptId(); @@ -56,8 +56,8 @@ bool ProcedureCompoundTask::isCompleted() { bool allCompleted = true; bool isCurrentTask = true; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (allCompleted && isCurrentTask) { @@ -80,7 +80,7 @@ bool ProcedureCompoundTask::isCompleted() { if (allCompleted) { // Disable all constraints itEnd = m_taskSequence.end(); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->enableConstraints(false); } @@ -90,16 +90,16 @@ bool ProcedureCompoundTask::isCompleted() { } void ProcedureCompoundTask::onCrafted(std::shared_ptr item) { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->onCrafted(item); } } void ProcedureCompoundTask::handleUIInput(int iAction) { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->handleUIInput(iAction); } @@ -107,8 +107,8 @@ void ProcedureCompoundTask::handleUIInput(int iAction) { void ProcedureCompoundTask::setAsCurrentTask(bool active /*= true*/) { bool allCompleted = true; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (allCompleted && !task->isCompleted()) { task->setAsCurrentTask(true); @@ -123,8 +123,8 @@ bool ProcedureCompoundTask::ShowMinimumTime() { if (bIsCompleted) return false; bool showMinimumTime = false; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (!task->isCompleted()) { showMinimumTime = task->ShowMinimumTime(); @@ -138,8 +138,8 @@ bool ProcedureCompoundTask::hasBeenActivated() { if (bIsCompleted) return true; bool hasBeenActivated = false; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (!task->isCompleted()) { hasBeenActivated = task->hasBeenActivated(); @@ -150,8 +150,8 @@ bool ProcedureCompoundTask::hasBeenActivated() { } void ProcedureCompoundTask::setShownForMinimumTime() { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (!task->isCompleted()) { task->setShownForMinimumTime(); @@ -164,8 +164,8 @@ bool ProcedureCompoundTask::AllowFade() { if (bIsCompleted) return true; bool allowFade = true; - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; if (!task->isCompleted()) { allowFade = task->AllowFade(); @@ -178,8 +178,8 @@ bool ProcedureCompoundTask::AllowFade() { void ProcedureCompoundTask::useItemOn(Level* level, std::shared_ptr item, int x, int y, int z, bool bTestUseOnly) { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->useItemOn(level, item, x, y, z, bTestUseOnly); } @@ -187,8 +187,8 @@ void ProcedureCompoundTask::useItemOn(Level* level, void ProcedureCompoundTask::useItem(std::shared_ptr item, bool bTestUseOnly) { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->useItem(item, bTestUseOnly); } @@ -197,16 +197,16 @@ void ProcedureCompoundTask::useItem(std::shared_ptr item, void ProcedureCompoundTask::onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->onTake(item, invItemCountAnyAux, invItemCountThisAux); } } void ProcedureCompoundTask::onStateChange(eTutorial_State newState) { - AUTO_VAR(itEnd, m_taskSequence.end()); - for (AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) { + auto itEnd = m_taskSequence.end(); + for (auto it = m_taskSequence.begin(); it < itEnd; ++it) { TutorialTask* task = *it; task->onStateChange(newState); } diff --git a/Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp b/Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp index c0d28f0b5..a383972f3 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp @@ -1929,7 +1929,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad(iPad) { } Tutorial::~Tutorial() { - for (AUTO_VAR(it, m_globalConstraints.begin()); + for (auto it = m_globalConstraints.begin(); it != m_globalConstraints.end(); ++it) { delete (*it); } @@ -1939,11 +1939,11 @@ Tutorial::~Tutorial() { delete (*it).second; } for (unsigned int i = 0; i < e_Tutorial_State_Max; ++i) { - for (AUTO_VAR(it, activeTasks[i].begin()); it < activeTasks[i].end(); + for (auto it = activeTasks[i].begin(); it < activeTasks[i].end(); ++it) { delete (*it); } - for (AUTO_VAR(it, hints[i].begin()); it < hints[i].end(); ++it) { + for (auto it = hints[i].begin(); it < hints[i].end(); ++it) { delete (*it); } @@ -1968,7 +1968,7 @@ void Tutorial::setCompleted(int completableId) { // } int completableIndex = -1; - for (AUTO_VAR(it, s_completableTasks.begin()); + for (auto it = s_completableTasks.begin(); it < s_completableTasks.end(); ++it) { ++completableIndex; if (*it == completableId) { @@ -1996,7 +1996,7 @@ bool Tutorial::getCompleted(int completableId) { // } int completableIndex = -1; - for (AUTO_VAR(it, s_completableTasks.begin()); + for (auto it = s_completableTasks.begin(); it < s_completableTasks.end(); ++it) { ++completableIndex; if (*it == completableId) { @@ -2079,7 +2079,7 @@ void Tutorial::tick() { bool taskChanged = false; for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { - AUTO_VAR(it, constraintsToRemove[state].begin()); + auto it = constraintsToRemove[state].begin(); while (it < constraintsToRemove[state].end()) { ++(*it).second; if ((*it).second > m_iTutorialConstraintDelayRemoveTicks) { @@ -2152,7 +2152,7 @@ void Tutorial::tick() { } // Check constraints - for (AUTO_VAR(it, m_globalConstraints.begin()); + for (auto it = m_globalConstraints.begin(); it < m_globalConstraints.end(); ++it) { TutorialConstraint* constraint = *it; constraint->tick(m_iPad); @@ -2167,7 +2167,7 @@ void Tutorial::tick() { m_isFullTutorial || app.GetGameSettings(m_iPad, eGameSetting_Hints); if (hintsOn) { - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->tick(); @@ -2195,7 +2195,7 @@ void Tutorial::tick() { constraintChanged = true; currentFailedConstraint[m_CurrentState] = nullptr; } - for (AUTO_VAR(it, constraints[m_CurrentState].begin()); + for (auto it = constraints[m_CurrentState].begin(); it < constraints[m_CurrentState].end(); ++it) { TutorialConstraint* constraint = *it; if (!constraint->isConstraintSatisfied(m_iPad) && @@ -2210,7 +2210,7 @@ void Tutorial::tick() { currentFailedConstraint[m_CurrentState] == nullptr) { // Update tasks bool isCurrentTask = true; - AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + auto it = activeTasks[m_CurrentState].begin(); while (activeTasks[m_CurrentState].size() > 0 && it < activeTasks[m_CurrentState].end()) { TutorialTask* task = *it; @@ -2233,9 +2233,9 @@ void Tutorial::tick() { // 4J Stu - Move the delayed constraints to the // gameplay state so that they are in effect for // a bit longer - AUTO_VAR(itCon, + auto itCon = constraintsToRemove[m_CurrentState] - .begin()); + .begin(); while ( itCon != constraintsToRemove[m_CurrentState].end()) { @@ -2259,9 +2259,9 @@ void Tutorial::tick() { } // Fall through the the normal complete state case e_Tutorial_Completion_Complete_State: - for (AUTO_VAR( - itRem, - activeTasks[m_CurrentState].begin()); + for (auto + itRem = + activeTasks[m_CurrentState].begin(); itRem < activeTasks[m_CurrentState].end(); ++itRem) { delete (*itRem); @@ -2273,9 +2273,9 @@ void Tutorial::tick() { activeTasks[m_CurrentState].at( activeTasks[m_CurrentState].size() - 1); activeTasks[m_CurrentState].pop_back(); - for (AUTO_VAR( - itRem, - activeTasks[m_CurrentState].begin()); + for (auto + itRem = + activeTasks[m_CurrentState].begin(); itRem < activeTasks[m_CurrentState].end(); ++itRem) { delete (*itRem); @@ -2433,7 +2433,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) { if (!message->m_messageString.empty()) { text = message->m_messageString; } else { - AUTO_VAR(it, messages.find(message->m_messageId)); + auto it = messages.find(message->m_messageId); if (it != messages.end() && it->second != nullptr) { TutorialMessage* messageString = it->second; text = std::wstring(messageString->getMessageForDisplay()); @@ -2457,7 +2457,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) { if (!message->m_promptString.empty()) { text.append(message->m_promptString); } else if (message->m_promptId >= 0) { - AUTO_VAR(it, messages.find(message->m_promptId)); + auto it = messages.find(message->m_promptId); if (it != messages.end() && it->second != nullptr) { TutorialMessage* prompt = it->second; text.append(prompt->getMessageForDisplay()); @@ -2555,7 +2555,7 @@ void Tutorial::showTutorialPopup(bool show) { void Tutorial::useItemOn(Level* level, std::shared_ptr item, int x, int y, int z, bool bTestUseOnly) { - for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + for (auto it = activeTasks[m_CurrentState].begin(); it < activeTasks[m_CurrentState].end(); ++it) { TutorialTask* task = *it; task->useItemOn(level, item, x, y, z, bTestUseOnly); @@ -2564,7 +2564,7 @@ void Tutorial::useItemOn(Level* level, std::shared_ptr item, void Tutorial::useItemOn(std::shared_ptr item, bool bTestUseOnly) { - for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + for (auto it = activeTasks[m_CurrentState].begin(); it < activeTasks[m_CurrentState].end(); ++it) { TutorialTask* task = *it; task->useItem(item, bTestUseOnly); @@ -2572,7 +2572,7 @@ void Tutorial::useItemOn(std::shared_ptr item, } void Tutorial::completeUsingItem(std::shared_ptr item) { - for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + for (auto it = activeTasks[m_CurrentState].begin(); it < activeTasks[m_CurrentState].end(); ++it) { TutorialTask* task = *it; task->completeUsingItem(item); @@ -2581,7 +2581,7 @@ void Tutorial::completeUsingItem(std::shared_ptr item) { // Fix for #46922 - TU5: UI: Player receives a reminder that he is hungry // while "hunger bar" is full (triggered in split-screen mode) if (m_CurrentState != e_Tutorial_State_Gameplay) { - for (AUTO_VAR(it, activeTasks[e_Tutorial_State_Gameplay].begin()); + for (auto it = activeTasks[e_Tutorial_State_Gameplay].begin(); it < activeTasks[e_Tutorial_State_Gameplay].end(); ++it) { TutorialTask* task = *it; task->completeUsingItem(item); @@ -2592,7 +2592,7 @@ void Tutorial::completeUsingItem(std::shared_ptr item) { void Tutorial::startDestroyBlock(std::shared_ptr item, Tile* tile) { int hintNeeded = -1; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->startDestroyBlock(item, tile); @@ -2607,7 +2607,7 @@ void Tutorial::startDestroyBlock(std::shared_ptr item, void Tutorial::destroyBlock(Tile* tile) { int hintNeeded = -1; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->destroyBlock(tile); @@ -2623,7 +2623,7 @@ void Tutorial::destroyBlock(Tile* tile) { void Tutorial::attack(std::shared_ptr player, std::shared_ptr entity) { int hintNeeded = -1; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->attack(player->inventory->getSelected(), entity); @@ -2638,7 +2638,7 @@ void Tutorial::attack(std::shared_ptr player, void Tutorial::itemDamaged(std::shared_ptr item) { int hintNeeded = -1; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->itemDamaged(item); @@ -2654,7 +2654,7 @@ void Tutorial::itemDamaged(std::shared_ptr item) { void Tutorial::handleUIInput(int iAction) { if (m_hintDisplayed) return; - // for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < + // for(auto it = activeTasks[m_CurrentState].begin(); it < // activeTasks[m_CurrentState].end(); ++it) //{ // TutorialTask *task = *it; @@ -2667,7 +2667,7 @@ void Tutorial::handleUIInput(int iAction) { void Tutorial::createItemSelected(std::shared_ptr item, bool canMake) { int hintNeeded = -1; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->createItemSelected(item, canMake); @@ -2682,7 +2682,7 @@ void Tutorial::createItemSelected(std::shared_ptr item, void Tutorial::onCrafted(std::shared_ptr item) { for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { - for (AUTO_VAR(it, activeTasks[state].begin()); + for (auto it = activeTasks[state].begin(); it < activeTasks[state].end(); ++it) { TutorialTask* task = *it; task->onCrafted(item); @@ -2695,7 +2695,7 @@ void Tutorial::onTake(std::shared_ptr item, unsigned int invItemCountThisAux) { if (!m_hintDisplayed) { bool hintNeeded = false; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->onTake(item); @@ -2706,7 +2706,7 @@ void Tutorial::onTake(std::shared_ptr item, } for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { - for (AUTO_VAR(it, activeTasks[state].begin()); + for (auto it = activeTasks[state].begin(); it < activeTasks[state].end(); ++it) { TutorialTask* task = *it; task->onTake(item, invItemCountAnyAux, invItemCountThisAux); @@ -2738,7 +2738,7 @@ void Tutorial::onLookAt(int id, int iData) { if (m_hintDisplayed) return; bool hintNeeded = false; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->onLookAt(id, iData); @@ -2764,7 +2764,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr entity) { if (m_hintDisplayed) return; bool hintNeeded = false; - for (AUTO_VAR(it, hints[m_CurrentState].begin()); + for (auto it = hints[m_CurrentState].begin(); it < hints[m_CurrentState].end(); ++it) { TutorialHint* hint = *it; hintNeeded = hint->onLookAtEntity(entity->GetType()); @@ -2778,7 +2778,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr entity) { changeTutorialState(e_Tutorial_State_Horse); } - for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + for (auto it = activeTasks[m_CurrentState].begin(); it != activeTasks[m_CurrentState].end(); ++it) { (*it)->onLookAtEntity(entity); } @@ -2798,14 +2798,14 @@ void Tutorial::onRideEntity(std::shared_ptr entity) { } } - for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + for (auto it = activeTasks[m_CurrentState].begin(); it != activeTasks[m_CurrentState].end(); ++it) { (*it)->onRideEntity(entity); } } void Tutorial::onEffectChanged(MobEffect* effect, bool bRemoved) { - for (AUTO_VAR(it, activeTasks[m_CurrentState].begin()); + for (auto it = activeTasks[m_CurrentState].begin(); it < activeTasks[m_CurrentState].end(); ++it) { TutorialTask* task = *it; task->onEffectChanged(effect, bRemoved); @@ -2815,7 +2815,7 @@ void Tutorial::onEffectChanged(MobEffect* effect, bool bRemoved) { bool Tutorial::canMoveToPosition(double xo, double yo, double zo, double xt, double yt, double zt) { bool allowed = true; - for (AUTO_VAR(it, constraints[m_CurrentState].begin()); + for (auto it = constraints[m_CurrentState].begin(); it < constraints[m_CurrentState].end(); ++it) { TutorialConstraint* constraint = *it; if (!constraint->isConstraintSatisfied(m_iPad) && @@ -2837,7 +2837,7 @@ bool Tutorial::isInputAllowed(int mapping) { return true; bool allowed = true; - for (AUTO_VAR(it, constraints[m_CurrentState].begin()); + for (auto it = constraints[m_CurrentState].begin(); it < constraints[m_CurrentState].end(); ++it) { TutorialConstraint* constraint = *it; if (constraint->isMappingConstrained(m_iPad, mapping)) { @@ -2852,7 +2852,7 @@ std::vector* Tutorial::getTasks() { return &tasks; } unsigned int Tutorial::getCurrentTaskIndex() { unsigned int index = 0; - for (AUTO_VAR(it, tasks.begin()); it < tasks.end(); ++it) { + for (auto it = tasks.begin(); it < tasks.end(); ++it) { if (*it == currentTask[e_Tutorial_State_Gameplay]) break; ++index; @@ -2875,7 +2875,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c, if (c->getQueuedForRemoval()) { // If it is already queued for removal, remove it on the next tick - /*for(AUTO_VAR(it, constraintsToRemove[m_CurrentState].begin()); it < + /*for(auto it = constraintsToRemove[m_CurrentState].begin(); it < constraintsToRemove[m_CurrentState].end(); ++it) { if( it->first == c ) @@ -2889,7 +2889,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c, constraintsToRemove[m_CurrentState].push_back( std::pair(c, 0)); } else { - for (AUTO_VAR(it, constraintsToRemove[m_CurrentState].begin()); + for (auto it = constraintsToRemove[m_CurrentState].begin(); it < constraintsToRemove[m_CurrentState].end(); ++it) { if (it->first == c) { constraintsToRemove[m_CurrentState].erase(it); @@ -2897,8 +2897,8 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c, } } - AUTO_VAR(it, find(constraints[m_CurrentState].begin(), - constraints[m_CurrentState].end(), c)); + auto it = find(constraints[m_CurrentState].begin(), + constraints[m_CurrentState].end(), c); if (it != constraints[m_CurrentState].end()) constraints[m_CurrentState].erase( find(constraints[m_CurrentState].begin(), @@ -2990,7 +2990,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState, m_UIScene = scene; if (m_CurrentState != newState) { - for (AUTO_VAR(it, activeTasks[newState].begin()); + for (auto it = activeTasks[newState].begin(); it < activeTasks[newState].end(); ++it) { TutorialTask* task = *it; task->onStateChange(newState); diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp b/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp index ffafcb72e..2ae529c40 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp @@ -20,7 +20,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId, m_bShowMinimumTime(bShowMinimumTime), m_bShownForMinimumTime(false) { if (inConstraints != nullptr) { - for (AUTO_VAR(it, inConstraints->begin()); it < inConstraints->end(); + for (auto it = inConstraints->begin(); it < inConstraints->end(); ++it) { TutorialConstraint* constraint = *it; constraints.push_back(constraint); @@ -34,7 +34,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId, TutorialTask::~TutorialTask() { enableConstraints(false); - for (AUTO_VAR(it, constraints.begin()); it < constraints.end(); ++it) { + for (auto it = constraints.begin(); it < constraints.end(); ++it) { TutorialConstraint* constraint = *it; if (constraint->getQueuedForRemoval()) { @@ -53,7 +53,7 @@ void TutorialTask::enableConstraints(bool enable, bool delayRemove /*= false*/) { if (!enable && (areConstraintsEnabled || !delayRemove)) { // Remove - for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) { + for (auto it = constraints.begin(); it != constraints.end(); ++it) { TutorialConstraint* constraint = *it; // app.DebugPrintf(">>>>>>>> %i\n", constraints.size()); tutorial->RemoveConstraint(constraint, delayRemove); @@ -61,7 +61,7 @@ void TutorialTask::enableConstraints(bool enable, areConstraintsEnabled = false; } else if (!areConstraintsEnabled && enable) { // Add - for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) { + for (auto it = constraints.begin(); it != constraints.end(); ++it) { TutorialConstraint* constraint = *it; tutorial->AddConstraint(constraint); } diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp index 40d9f016b..36402027d 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -1095,9 +1095,9 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, ui.AnimateKeyPress(iPad, iAction, bRepeat, true, false); int buttonNum = 0; // 0 = LeftMouse, 1 = RightMouse - BOOL quickKeyHeld = FALSE; // Represents shift key on PC + bool quickKeyHeld = FALSE; // Represents shift key on PC - BOOL validKeyPress = FALSE; + bool validKeyPress = FALSE; bool itemEditorKeyPress = false; // Ignore input from other players diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp index 9bd972dd4..2fde1368c 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_CraftingMenu.cpp @@ -631,7 +631,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() { Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired = Recipes::getInstance()->getRecipeIngredientsArray(); int iRecipeC = (int)recipes->size(); - AUTO_VAR(itRecipe, recipes->begin()); + auto itRecipe = recipes->begin(); // dump out the recipe products diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp index 3a6d9f5f7..507ef4cd1 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp @@ -982,8 +982,8 @@ void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu* menu, // Fill the dynamic group if (m_dynamicGroupsCount > 0 && m_dynamicGroupsA != nullptr) { - for (AUTO_VAR(it, - categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin()); + for (auto it= + categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin(); it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() && lastSlotIndex < MAX_SIZE; ++it) { @@ -1195,7 +1195,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, } void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, - BOOL quickKeyHeld) { + bool quickKeyHeld) { // Drop items. Minecraft* pMinecraft = Minecraft::GetInstance(); diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp index 90964fa3d..d9b891408 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_TradingMenu.cpp @@ -180,7 +180,7 @@ void IUIScene_TradingMenu::updateDisplay() { m_activeOffers.clear(); int unfilteredIndex = 0; int firstValidTrade = INT_MAX; - for (AUTO_VAR(it, unfilteredOffers->begin()); + for (auto it = unfilteredOffers->begin(); it != unfilteredOffers->end(); ++it) { MerchantRecipe* recipe = *it; if (!recipe->isDeprecated()) { diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp index 035c58958..4c1bbfca7 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp @@ -44,7 +44,7 @@ void UIComponent_Panorama::tick() { Minecraft* pMinecraft = Minecraft::GetInstance(); EnterCriticalSection(&pMinecraft->m_setLevelCS); if (pMinecraft->level != nullptr) { - __int64 i64TimeOfDay = 0; + int64_t i64TimeOfDay = 0; // are we in the Nether? - Leave the time as 0 if we are, so we show // daylight if (pMinecraft->level->dimension->id == 0) { diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.h b/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.h index aeec87136..9df260f15 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.h +++ b/Minecraft.Client/Platform/Common/UI/UIControl_EnchantmentBook.h @@ -15,7 +15,7 @@ private: float flip, oFlip, flipT, flipA; float open, oOpen; - // BOOL m_bDirty; + // bool m_bDirty; // float m_fScale,m_fAlpha; // int m_iPad; std::shared_ptr last; diff --git a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp b/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp index 8ed1ff9aa..47ff9ad80 100644 --- a/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIControl_PlayerSkinPreview.cpp @@ -214,7 +214,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) { // *pAdditionalModelParts=mob->GetAdditionalModelParts(); if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) { - for (AUTO_VAR(it, m_pvAdditionalModelParts->begin()); + for (auto it = m_pvAdditionalModelParts->begin(); it != m_pvAdditionalModelParts->end(); ++it) { ModelPart* pModelPart = *it; @@ -227,7 +227,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) { // hide the additional parts if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) { - for (AUTO_VAR(it, m_pvAdditionalModelParts->begin()); + for (auto it = m_pvAdditionalModelParts->begin(); it != m_pvAdditionalModelParts->end(); ++it) { ModelPart* pModelPart = *it; diff --git a/Minecraft.Client/Platform/Common/UI/UIController.cpp b/Minecraft.Client/Platform/Common/UI/UIController.cpp index eb8965823..a178773d1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIController.cpp @@ -452,7 +452,7 @@ void UIController::tick() { // Clear out the cached movie file data int64_t currentTime = System::currentTimeMillis(); - for (AUTO_VAR(it, m_cachedMovieData.begin()); + for (auto it = m_cachedMovieData.begin(); it != m_cachedMovieData.end();) { if (it->second.m_expiry < currentTime) { delete[] it->second.m_ba.data; @@ -667,7 +667,7 @@ void UIController::CleanUpSkinReload() { } } - for (AUTO_VAR(it, m_queuedMessageBoxData.begin()); + for (auto it = m_queuedMessageBoxData.begin(); it != m_queuedMessageBoxData.end(); ++it) { QueuedMessageBoxData* queuedData = *it; ui.NavigateToScene(queuedData->iPad, eUIScene_MessageBox, @@ -682,7 +682,7 @@ void UIController::CleanUpSkinReload() { byteArray UIController::getMovieData(const std::wstring& filename) { // Cache everything we load in the current tick int64_t targetTime = System::currentTimeMillis() + (1000LL * 60); - AUTO_VAR(it, m_cachedMovieData.find(filename)); + auto it = m_cachedMovieData.find(filename); if (it == m_cachedMovieData.end()) { byteArray baFile = app.getArchiveFile(filename); CachedMovieData cmd; @@ -1095,8 +1095,8 @@ GDrawTexture* RADLINK UIController::TextureSubstitutionCreateCallback( void* user_callback_data, IggyUTF16* texture_name, S32* width, S32* height, void** destroy_callback_data) { UIController* uiController = (UIController*)user_callback_data; - AUTO_VAR(it, - uiController->m_substitutionTextures.find((wchar_t*)texture_name)); + auto it = + uiController->m_substitutionTextures.find((wchar_t*)texture_name); if (it != uiController->m_substitutionTextures.end()) { app.DebugPrintf("Found substitution texture %ls, with %d bytes\n", @@ -1158,7 +1158,7 @@ void UIController::registerSubstitutionTexture(const std::wstring& textureName, void UIController::unregisterSubstitutionTexture( const std::wstring& textureName, bool deleteData) { - AUTO_VAR(it, m_substitutionTextures.find(textureName)); + auto it = m_substitutionTextures.find(textureName); if (it != m_substitutionTextures.end()) { if (deleteData) delete[] it->second.data; @@ -1393,7 +1393,7 @@ size_t UIController::RegisterForCallbackId(UIScene* scene) { void UIController::UnregisterCallbackId(size_t id) { EnterCriticalSection(&m_registeredCallbackScenesCS); - AUTO_VAR(it, m_registeredCallbackScenes.find(id)); + auto it = m_registeredCallbackScenes.find(id); if (it != m_registeredCallbackScenes.end()) { m_registeredCallbackScenes.erase(it); } @@ -1402,7 +1402,7 @@ void UIController::UnregisterCallbackId(size_t id) { UIScene* UIController::GetSceneFromCallbackId(size_t id) { UIScene* scene = nullptr; - AUTO_VAR(it, m_registeredCallbackScenes.find(id)); + auto it = m_registeredCallbackScenes.find(id); if (it != m_registeredCallbackScenes.end()) { scene = it->second; } diff --git a/Minecraft.Client/Platform/Common/UI/UIController.h b/Minecraft.Client/Platform/Common/UI/UIController.h index b49f6ed5f..7f2b69d1b 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.h +++ b/Minecraft.Client/Platform/Common/UI/UIController.h @@ -16,7 +16,7 @@ class UIControl; // Base class for all shared functions between UIControllers class UIController : public IUIController { public: - static __int64 iggyAllocCount; + static int64_t iggyAllocCount; // MGH - added to prevent crash loading Iggy movies while the skins were // being reloaded @@ -390,19 +390,19 @@ public: virtual C4JStorage::EMessageResult RequestAlertMessage( UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad = XUSER_INDEX_ANY, - int (*Func)(LPVOID, int, const C4JStorage::EMessageResult) = nullptr, - LPVOID lpParam = nullptr, WCHAR* pwchFormatString = nullptr); + int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr, + void* lpParam = nullptr, WCHAR* pwchFormatString = nullptr); virtual C4JStorage::EMessageResult RequestErrorMessage( UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad = XUSER_INDEX_ANY, - int (*Func)(LPVOID, int, const C4JStorage::EMessageResult) = nullptr, - LPVOID lpParam = nullptr, WCHAR* pwchFormatString = nullptr); + int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr, + void* lpParam = nullptr, WCHAR* pwchFormatString = nullptr); private: virtual C4JStorage::EMessageResult RequestMessageBox( UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad, - int (*Func)(LPVOID, int, const C4JStorage::EMessageResult), - LPVOID lpParam, WCHAR* pwchFormatString, DWORD dwFocusButton, + int (*Func)(void*, int, const C4JStorage::EMessageResult), + void* lpParam, WCHAR* pwchFormatString, DWORD dwFocusButton, bool bIsError); public: diff --git a/Minecraft.Client/Platform/Common/UI/UILayer.cpp b/Minecraft.Client/Platform/Common/UI/UILayer.cpp index 0e6ef12f0..85e03cb12 100644 --- a/Minecraft.Client/Platform/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Platform/Common/UI/UILayer.cpp @@ -18,7 +18,7 @@ void UILayer::tick() { // so we need to make a copy of the scenes that we are going to try and // destroy this tick std::vector scenesToDeleteCopy; - for (AUTO_VAR(it, m_scenesToDelete.begin()); it != m_scenesToDelete.end(); + for (auto it = m_scenesToDelete.begin(); it != m_scenesToDelete.end(); it++) { UIScene* scene = (*it); scenesToDeleteCopy.push_back(scene); @@ -28,7 +28,7 @@ void UILayer::tick() { // Delete the scenes in our copy if they are ready to delete, otherwise add // back to the ones that are still to be deleted. Actually deleting a scene // might also add something back into m_scenesToDelete. - for (AUTO_VAR(it, scenesToDeleteCopy.begin()); + for (auto it = scenesToDeleteCopy.begin(); it != scenesToDeleteCopy.end(); it++) { UIScene* scene = (*it); if (scene->isReadyToDelete()) { @@ -45,12 +45,12 @@ void UILayer::tick() { } m_scenesToDestroy.clear(); - for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { + for (auto it = m_components.begin(); it != m_components.end(); ++it) { (*it)->tick(); } // Note: reverse iterator, the last element is the top of the stack int sceneIndex = m_sceneStack.size() - 1; - // for(AUTO_VAR(it,m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) + // for(auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) while (sceneIndex >= 0 && sceneIndex < m_sceneStack.size()) { //(*it)->tick(); UIScene* scene = m_sceneStack[sceneIndex]; @@ -63,9 +63,9 @@ void UILayer::tick() { void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) { if (!ui.IsExpectingOrReloadingSkin()) { - for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); + for (auto it = m_components.begin(); it != m_components.end(); ++it) { - AUTO_VAR(itRef, m_componentRefCount.find((*it)->getSceneType())); + auto itRef = m_componentRefCount.find((*it)->getSceneType()); if (itRef != m_componentRefCount.end() && itRef->second.second) { if ((*it)->isVisible()) { PIXBeginNamedEvent(0, "Rendering component %d", @@ -125,7 +125,7 @@ bool UILayer::HasFocus(int iPad) { bool UILayer::hidesLowerScenes() { bool hidesScenes = false; - for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { + for (auto it = m_components.begin(); it != m_components.end(); ++it) { if ((*it)->hidesLowerScenes()) { hidesScenes = true; break; @@ -147,16 +147,16 @@ void UILayer::getRenderDimensions(S32& width, S32& height) { } void UILayer::DestroyAll() { - for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { + for (auto it = m_components.begin(); it != m_components.end(); ++it) { (*it)->destroyMovie(); } - for (AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) { + for (auto it = m_sceneStack.begin(); it != m_sceneStack.end(); ++it) { (*it)->destroyMovie(); } } void UILayer::ReloadAll(bool force) { - for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { + for (auto it = m_components.begin(); it != m_components.end(); ++it) { (*it)->reloadMovie(force); } if (!m_sceneStack.empty()) { @@ -437,7 +437,7 @@ bool UILayer::NavigateBack(int iPad, EUIScene eScene) { } void UILayer::showComponent(int iPad, EUIScene scene, bool show) { - AUTO_VAR(it, m_componentRefCount.find(scene)); + auto it = m_componentRefCount.find(scene); if (it != m_componentRefCount.end()) { it->second.second = show; return; @@ -447,7 +447,7 @@ void UILayer::showComponent(int iPad, EUIScene scene, bool show) { bool UILayer::isComponentVisible(EUIScene scene) { bool visible = false; - AUTO_VAR(it, m_componentRefCount.find(scene)); + auto it = m_componentRefCount.find(scene); if (it != m_componentRefCount.end()) { visible = it->second.second; } @@ -455,11 +455,11 @@ bool UILayer::isComponentVisible(EUIScene scene) { } UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) { - AUTO_VAR(it, m_componentRefCount.find(scene)); + auto it = m_componentRefCount.find(scene); if (it != m_componentRefCount.end()) { ++it->second.first; - for (AUTO_VAR(itComp, m_components.begin()); + for (auto itComp = m_components.begin(); itComp != m_components.end(); ++itComp) { if ((*itComp)->getSceneType() == scene) { return *itComp; @@ -525,13 +525,13 @@ UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) { } void UILayer::removeComponent(EUIScene scene) { - AUTO_VAR(it, m_componentRefCount.find(scene)); + auto it = m_componentRefCount.find(scene); if (it != m_componentRefCount.end()) { --it->second.first; if (it->second.first <= 0) { m_componentRefCount.erase(it); - for (AUTO_VAR(compIt, m_components.begin()); + for (auto compIt = m_components.begin(); compIt != m_components.end();) { if ((*compIt)->getSceneType() == scene) { m_scenesToDelete.push_back((*compIt)); @@ -548,8 +548,8 @@ void UILayer::removeComponent(EUIScene scene) { void UILayer::removeScene(UIScene* scene) { - AUTO_VAR(newEnd, - std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene)); + auto newEnd = + std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene); m_sceneStack.erase(newEnd, m_sceneStack.end()); m_scenesToDelete.push_back(scene); @@ -571,7 +571,7 @@ void UILayer::closeAllScenes() { std::vector temp; temp.insert(temp.end(), m_sceneStack.begin(), m_sceneStack.end()); m_sceneStack.clear(); - for (AUTO_VAR(it, temp.begin()); it != temp.end(); ++it) { + for (auto it = temp.begin(); it != temp.end(); ++it) { m_scenesToDelete.push_back(*it); (*it)->handleDestroy(); // For anything that might require the pointer // be valid @@ -612,7 +612,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) { m_bIgnorePlayerJoinMenuDisplayed = false; bool layerFocusSet = false; - for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { + for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) { UIScene* scene = *it; // UPDATE FOCUS STATES @@ -695,7 +695,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) { void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool& handled) { // Note: reverse iterator, the last element is the top of the stack - for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { + for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) { UIScene* scene = *it; if (scene->hasFocus(iPad) && scene->canHandleInput()) { // 4J-PB - ignore repeats of action ABXY buttons @@ -719,7 +719,7 @@ void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, } void UILayer::HandleDLCMountingComplete() { - for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { + for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) { UIScene* topScene = *it; app.DebugPrintf("UILayer::HandleDLCMountingComplete - topScene\n"); topScene->HandleDLCMountingComplete(); @@ -727,7 +727,7 @@ void UILayer::HandleDLCMountingComplete() { } void UILayer::HandleDLCInstalled() { - for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { + for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) { UIScene* topScene = *it; topScene->HandleDLCInstalled(); } @@ -735,7 +735,7 @@ void UILayer::HandleDLCInstalled() { void UILayer::HandleMessage(EUIMessage message, void* data) { - for (AUTO_VAR(it, m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) { + for (auto it = m_sceneStack.rbegin(); it != m_sceneStack.rend(); ++it) { UIScene* topScene = *it; topScene->HandleMessage(message, data); } @@ -748,7 +748,7 @@ C4JRender::eViewportType UILayer::getViewport() { } void UILayer::handleUnlockFullVersion() { - for (AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) { + for (auto it = m_sceneStack.begin(); it != m_sceneStack.end(); ++it) { (*it)->handleUnlockFullVersion(); } } @@ -757,10 +757,10 @@ void UILayer::PrintTotalMemoryUsage(int64_t& totalStatic, int64_t& totalDynamic) { int64_t layerStatic = 0; int64_t layerDynamic = 0; - for (AUTO_VAR(it, m_components.begin()); it != m_components.end(); ++it) { + for (auto it = m_components.begin(); it != m_components.end(); ++it) { (*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic); } - for (AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) { + for (auto it = m_sceneStack.begin(); it != m_sceneStack.end(); ++it) { (*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic); } app.DebugPrintf(app.USER_SR, " \\- Layer static: %d , Layer dynamic: %d\n", diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.cpp b/Minecraft.Client/Platform/Common/UI/UIScene.cpp index 833a16933..f033acdb8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene.cpp @@ -38,7 +38,7 @@ UIScene::~UIScene() { /* Destroy the Iggy player. */ IggyPlayerDestroy(swf); - for (AUTO_VAR(it, m_registeredTextures.begin()); + for (auto it = m_registeredTextures.begin(); it != m_registeredTextures.end(); ++it) { ui.unregisterSubstitutionTexture(it->first, it->second); } @@ -90,7 +90,7 @@ void UIScene::reloadMovie(bool force) { handlePreReload(); // Reload controls - for (AUTO_VAR(it, m_controls.begin()); it != m_controls.end(); ++it) { + for (auto it = m_controls.begin(); it != m_controls.end(); ++it) { (*it)->ReInit(); } @@ -377,7 +377,7 @@ void UIScene::tick() { if (m_hasTickedOnce) m_bCanHandleInput = true; while (IggyPlayerReadyToTick(swf)) { tickTimers(); - for (AUTO_VAR(it, m_controls.begin()); it != m_controls.end(); ++it) { + for (auto it = m_controls.begin(); it != m_controls.end(); ++it) { (*it)->tick(); } IggyPlayerTickRS(swf); @@ -398,7 +398,7 @@ void UIScene::addTimer(int id, int ms) { } void UIScene::killTimer(int id) { - AUTO_VAR(it, m_timers.find(id)); + auto it = m_timers.find(id); if (it != m_timers.end()) { it->second.running = false; } @@ -406,7 +406,7 @@ void UIScene::killTimer(int id) { void UIScene::tickTimers() { int currentTime = System::currentTimeMillis(); - for (AUTO_VAR(it, m_timers.begin()); it != m_timers.end();) { + for (auto it = m_timers.begin(); it != m_timers.end();) { if (!it->second.running) { it = m_timers.erase(it); } else { @@ -423,7 +423,7 @@ void UIScene::tickTimers() { IggyName UIScene::registerFastName(const std::wstring& name) { IggyName var; - AUTO_VAR(it, m_fastNames.find(name)); + auto it = m_fastNames.find(name); if (it != m_fastNames.end()) { var = it->second; } else { @@ -551,7 +551,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion* region, PIXBeginNamedEvent(0, "Draw all cache"); // Draw all the cached slots - for (AUTO_VAR(it, m_cachedSlotDraw.begin()); + for (auto it = m_cachedSlotDraw.begin(); it != m_cachedSlotDraw.end(); ++it) { CachedSlotDrawData* drawData = *it; ui.setupCustomDrawMatrices(this, @@ -1094,7 +1094,7 @@ void UIScene::registerSubstitutionTexture(const std::wstring& textureName, bool UIScene::hasRegisteredSubstitutionTexture( const std::wstring& textureName) { - AUTO_VAR(it, m_registeredTextures.find(textureName)); + auto it = m_registeredTextures.find(textureName); return it != m_registeredTextures.end(); } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.h b/Minecraft.Client/Platform/Common/UI/UIScene.h index 70a05840e..c402672e2 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.h +++ b/Minecraft.Client/Platform/Common/UI/UIScene.h @@ -130,7 +130,7 @@ private: IggyMemoryUseInfo& memoryInfo); public: - void PrintTotalMemoryUsage(__int64& totalStatic, __int64& totalDynamic); + void PrintTotalMemoryUsage(int64_t& totalStatic, int64_t& totalDynamic); public: UIScene(int iPad, UILayer* parentLayer); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp index 7b8600110..90959caa8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.cpp @@ -601,7 +601,7 @@ void UIScene_CraftingMenu::HandleMessage(EUIMessage message, void* data) { }; } -void UIScene_CraftingMenu::handleInventoryUpdated(LPVOID data) { +void UIScene_CraftingMenu::handleInventoryUpdated(void* data) { HandleInventoryUpdated(); } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h b/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h index fb2ce18e7..1383312c1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h +++ b/Minecraft.Client/Platform/Common/UI/UIScene_CraftingMenu.h @@ -180,7 +180,7 @@ protected: virtual void UpdateMultiPanel(); virtual void HandleMessage(EUIMessage message, void* data); - void handleInventoryUpdated(LPVOID data); + void handleInventoryUpdated(void* data); // 4J - TomK If update tooltips is called then make sure the correct parent // is invoked! (both UIScene AND IUIScene_CraftingMenu have an instance of diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp index a4633245a..4b98dd05e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp @@ -708,12 +708,12 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, // start the game bool isFlat = pClass->m_MoreOptionsParams.bFlatWorld; - __int64 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData* param = new NetworkGameInitData(); if (wSeed.length() != 0) { - __int64 value = 0; + int64_t value = 0; unsigned int len = (unsigned int)wSeed.length(); // Check if the input string contains a numerical value @@ -728,7 +728,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, } // If the input string is a numerical value, convert it to a number - if (isNumber) value = _fromString<__int64>(wSeed); + if (isNumber) value = _fromString(wSeed); // If the value is not 0 use it, otherwise use the algorithm from the // java String.hashCode() function to hash it diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp index da44baba2..9002b3ba8 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_DeathMenu.cpp @@ -102,7 +102,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::ExitGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { if (g_NetworkManager.IsHost()) { uiIDA[0] = IDS_CONFIRM_CANCEL; @@ -113,7 +113,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad, &IUIScene_PauseMenu::ExitGameSaveDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { uiIDA[0] = IDS_CONFIRM_CANCEL; uiIDA[1] = IDS_CONFIRM_OK; @@ -122,7 +122,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::ExitGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } } } else { @@ -149,7 +149,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::ExitGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { TelemetryManager->RecordLevelExit( m_iPad, eSen_LevelExitStatus_Failed); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp index 0a10ec554..60a113ecf 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_EndPoem.cpp @@ -192,7 +192,7 @@ void UIScene_EndPoem::updateNoise() { std::wstring tag = L"{*NOISE*}"; - AUTO_VAR(it, m_noiseLengths.begin()); + auto it = m_noiseLengths.begin(); int found = (int)noiseString.find(tag); while (found != std::string::npos && it != m_noiseLengths.end()) { length = *it; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp index 5b7a8b210..8d32f3498 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp @@ -260,7 +260,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay() { int iValue = 0; IggyDataValue* UpdateValue = new IggyDataValue[activeEffects->size() * 2]; - for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); + for (auto it = activeEffects->begin(); it != activeEffects->end(); ++it) { MobEffectInstance* effect = *it; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp index 13a553907..0772f2772 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -166,7 +166,7 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu() { app.SetLiveLinkRequired(false); if (m_currentSessions) { - for (AUTO_VAR(it, m_currentSessions->begin()); + for (auto it = m_currentSessions->begin(); it < m_currentSessions->end(); ++it) { delete (*it); } @@ -641,7 +641,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() { int i = 0; - for (AUTO_VAR(it, app.getLevelGenerators()->begin()); + for (auto it = app.getLevelGenerators()->begin(); it != app.getLevelGenerators()->end(); ++it) { LevelGenerationOptions* levelGen = *it; @@ -1176,7 +1176,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() { unsigned int sessionIndex = 0; m_buttonListGames.setCurrentSelection(0); - for (AUTO_VAR(it, m_currentSessions->begin()); + for (auto it = m_currentSessions->begin(); it < m_currentSessions->end(); ++it) { FriendSessionInfo* sessionInfo = *it; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp index 2005dbd87..519113e4e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_PauseMenu.cpp @@ -360,7 +360,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::ExitGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { if (g_NetworkManager.IsHost()) { uiIDA[0] = IDS_CONFIRM_CANCEL; @@ -374,14 +374,14 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) { uiIDA, 3, m_iPad, &UIScene_PauseMenu:: ExitGameSaveDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { ui.RequestAlertMessage( IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad, &UIScene_PauseMenu:: ExitGameSaveDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } } else { uiIDA[0] = IDS_CONFIRM_CANCEL; @@ -391,7 +391,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::ExitGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } } } else { @@ -427,7 +427,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) { IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::ExitGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { int playTime = -1; @@ -460,7 +460,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() { ui.RequestAlertMessage(IDS_UNLOCK_TITLE, IDS_UNLOCK_TOSAVE_TEXT, uiIDA, 2, m_iPad, &UIScene_PauseMenu::UnlockFullSaveReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } return; @@ -488,7 +488,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() { IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, m_iPad, &UIScene_PauseMenu::WarningTrialTexturePackReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } return; @@ -512,7 +512,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() { ui.RequestAlertMessage( IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, m_iPad, &IUIScene_PauseMenu::SaveGameDialogReturned, - (LPVOID)GetCallbackUniqueId()); + (void*)GetCallbackUniqueId()); } else { // flag a app action of save game app.SetAction(m_iPad, eAppAction_SaveGame); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h b/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h index c4162ed9d..2a1f33619 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h +++ b/Minecraft.Client/Platform/Common/UI/UIScene_QuadrantSignin.h @@ -103,7 +103,7 @@ public: virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool& handled); // 4jcraft: made public for thumbnail thunk - static int AvatarReturned(LPVOID lpParam, PBYTE pbThumbnail, + static int AvatarReturned(void* lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes); private: diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp index 6ddad94a6..10aca8307 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.cpp @@ -279,6 +279,6 @@ void UIScene_TradingMenu::HandleMessage(EUIMessage message, void* data) { }; } -void UIScene_TradingMenu::handleInventoryUpdated(LPVOID data) { +void UIScene_TradingMenu::handleInventoryUpdated(void* data) { HandleInventoryUpdated(); } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h b/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h index 5445832e2..472827520 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h +++ b/Minecraft.Client/Platform/Common/UI/UIScene_TradingMenu.h @@ -78,7 +78,7 @@ protected: virtual void setOfferDescription(std::vector* description); virtual void HandleMessage(EUIMessage message, void* data); - void handleInventoryUpdated(LPVOID data); + void handleInventoryUpdated(void* data); int getPad() { return m_iPad; } }; \ No newline at end of file diff --git a/Minecraft.Client/Platform/Common/UI/UIStructs.h b/Minecraft.Client/Platform/Common/UI/UIStructs.h index 69a3e6860..e5c845f22 100644 --- a/Minecraft.Client/Platform/Common/UI/UIStructs.h +++ b/Minecraft.Client/Platform/Common/UI/UIStructs.h @@ -392,8 +392,8 @@ typedef struct _MessageBoxInfo { UINT* uiOptionA; UINT uiOptionC; DWORD dwPad; - int (*Func)(LPVOID, int, const C4JStorage::EMessageResult); - LPVOID lpParam; + int (*Func)(void*, int, const C4JStorage::EMessageResult); + void* lpParam; // C4JStringTable *pStringTable; // 4J Stu - We don't need this for our // internal message boxes wchar_t* pwchFormatString; diff --git a/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp b/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp index 6d3ab8d15..71db8d0dd 100644 --- a/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp +++ b/Minecraft.Client/Platform/Common/UI/UITTFFont.cpp @@ -21,7 +21,7 @@ UITTFFont::UITTFFont(const std::string& name, const std::string& path, app.FatalLoadError(); } - const __int64 endPosition = PortableFileIO::Tell(file); + const int64_t endPosition = PortableFileIO::Tell(file); if (endPosition < 0) { std::fclose(file); app.FatalLoadError(); diff --git a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp b/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp index 34f93065a..56a654683 100644 --- a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Platform/Common/XML/ATGXmlParser.cpp @@ -71,7 +71,7 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); m_pReadBuf[ NChars ] = '\0'; @@ -344,7 +344,7 @@ HRESULT XMLParser::AdvanceName() // and getting another chunk of the file if needed // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) +HRESULT XMLParser::AdvanceCharacter( bool bOkToFail ) { if( m_bSkipNextAdvance ) { @@ -737,7 +737,7 @@ ISAXCallback* XMLParser::GetSAXCallbackInterface() //------------------------------------------------------------------------------------- HRESULT XMLParser::MainParseLoop() { - BOOL bWhiteSpaceOnly = TRUE; + bool bWhiteSpaceOnly = TRUE; HRESULT hr = S_OK; if( FAILED( m_pISAXCallback->StartDocument() ) ) diff --git a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.h b/Minecraft.Client/Platform/Common/XML/ATGXmlParser.h index 12f597372..3369a4174 100644 --- a/Minecraft.Client/Platform/Common/XML/ATGXmlParser.h +++ b/Minecraft.Client/Platform/Common/XML/ATGXmlParser.h @@ -58,11 +58,11 @@ public: virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0; + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) = 0; virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0; virtual HRESULT CDATABegin( ) = 0; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0; + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ) = 0; virtual HRESULT CDATAEnd( ) = 0; virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0; @@ -111,7 +111,7 @@ public: private: HRESULT MainParseLoop(); - HRESULT AdvanceCharacter( BOOL bOkToFail = FALSE ); + HRESULT AdvanceCharacter( bool bOkToFail = FALSE ); VOID SkipNextAdvance(); HRESULT ConsumeSpace(); @@ -144,10 +144,10 @@ private: BYTE* m_pReadPtr; WCHAR* m_pWritePtr; // write pointer within m_pBuf - BOOL m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits - BOOL m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse + bool m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits + bool m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse - BOOL m_bSkipNextAdvance; + bool m_bSkipNextAdvance; WCHAR m_Ch; // Current character being parsed }; diff --git a/Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h b/Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h index 7ed172b77..fd681ee4b 100644 --- a/Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h +++ b/Minecraft.Client/Platform/Common/XML/xmlFilesCallback.h @@ -80,13 +80,13 @@ public: } }; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) { return S_OK; }; virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; virtual HRESULT CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; }; virtual HRESULT CDATAEnd( ){ return S_OK; }; @@ -161,13 +161,13 @@ public: } - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) { return S_OK; }; virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; virtual HRESULT CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; }; virtual HRESULT CDATAEnd( ){ return S_OK; }; @@ -313,13 +313,13 @@ public: } }; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) { return S_OK; }; virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; virtual HRESULT CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; }; virtual HRESULT CDATAEnd( ){ return S_OK; }; diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index 16bc61a70..0511420aa 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -164,7 +164,7 @@ DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEF void XSetThreadProcessor(HANDLE a, int b) {} // #if !(0) && !(0) -// BOOL XCloseHandle(HANDLE a) { return CloseHandle(a); } +// bool XCloseHandle(HANDLE a) { return CloseHandle(a); } // #endif // 0 DWORD XUserGetSigninInfo( @@ -181,7 +181,7 @@ LPCWSTR CXuiStringTable::Lookup(UINT nIndex) { return L"String"; } void CXuiStringTable::Clear() {} HRESULT CXuiStringTable::Load(LPCWSTR szId) { return S_OK; } -DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCount, PBOOL pfResult, void *pOverlapped) { return 0; } +DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCount, bool* pfResult, void *pOverlapped) { return 0; } HRESULT XMemDecompress( XMEMDECOMPRESSION_CONTEXT Context, @@ -302,7 +302,7 @@ void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context) //#if 1 DWORD XGetLanguage() { return 1; } DWORD XGetLocale() { return 0; } -DWORD XEnableGuestSignin(BOOL fEnable) { return 0; } +DWORD XEnableGuestSignin(bool fEnable) { return 0; } @@ -458,10 +458,10 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {} #if defined(__linux__) C4JStorage::C4JStorage() {} void C4JStorage::Tick() {} -C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; } +C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; } C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; } -bool C4JStorage::SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice) { return true; } -void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam) {} +bool C4JStorage::SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice) { return true; } +void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(void*, const ESavingMessage, int),void* lpParam) {} void C4JStorage::ResetSaveData() {} void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName) {} void C4JStorage::SetSaveTitle(LPCWSTR pwchDefaultSaveName) {} @@ -469,49 +469,49 @@ LPCWSTR C4JStorage::GetSaveTitle() { return L""; } bool C4JStorage::GetSaveUniqueNumber(INT *piVal) { return true; } bool C4JStorage::GetSaveUniqueFilename(char *pszName) { return true; } void C4JStorage::SetSaveUniqueFilename(char *szFilename) { } -void C4JStorage::SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam) {} +void C4JStorage::SetState(ESaveGameControlState eControlState,int( *Func)(void*,const bool),void* lpParam) {} void C4JStorage::SetSaveDisabled(bool bDisable) {} bool C4JStorage::GetSaveDisabled(void) { return false; } unsigned int C4JStorage::GetSaveSize() { return 0; } void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {} PVOID C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; } void C4JStorage::SaveSaveData(unsigned int ulBytes,PBYTE pbThumbnail,DWORD cbThumbnail,PBYTE pbTextData, DWORD dwTextLen) {} -void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam) {} +void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam) {} void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {} bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; } C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { return C4JStorage::ELoadGame_Idle; } bool C4JStorage::EnoughSpaceForAMinSaveGame() { return true; } void C4JStorage::SetSaveMessageVPosition(float fY) {} -//C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; } -C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; } +//C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(void*, int, CACHEINFOSTRUCT *, int, HRESULT),void* lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; } +C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(void* lpParam,SAVE_DETAILS *pSaveDetails,const bool),void* lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; } void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,XCONTENT_DATA &xContentData) {} void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t * *ppbImageData, unsigned int *pImageBytes) {} -C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam) {return C4JStorage::ESaveGame_Idle;} -C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam) { return C4JStorage::EDeleteGame_Idle; } +C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam) {return C4JStorage::ESaveGame_Idle;} +C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* lpParam) { return C4JStorage::EDeleteGame_Idle; } PSAVE_DETAILS C4JStorage::ReturnSavesInfo() {return nullptr;} -void C4JStorage::RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ) {} +void C4JStorage::RegisterMarketplaceCountsCallback(int ( *Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam ) {} void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot) {} C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(void *, int, std::uint32_t, int),void *lpParam, std::uint32_t dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; } unsigned int C4JStorage::CancelGetDLCOffers() { return 0; } void C4JStorage::ClearDLCOffers() {} XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; } int C4JStorage::GetOfferCount() { return 0; } -unsigned int C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial) { return 0; } +unsigned int C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial) { return 0; } unsigned int C4JStorage::GetAvailableDLCCount( int iPad) { return 0; } XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA retval = {0}; return retval; } -C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; } -std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,LPCSTR szMountDrive) { return 0; } -unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } -C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } +C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam) { return C4JStorage::EDLC_Idle; } +std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,const char* szMountDrive) { return 0; } +unsigned int C4JStorage::UnmountInstalledDLC(const char* szMountDrive) { return 0; } +C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(void*, WCHAR *,int, bool, int),void* lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int bufferSize) { return true; } bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; } void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {} unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; } struct PTMSPP_FILEDATA; -C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)/*=nullptr*/,LPVOID lpParam/*=nullptr*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;} +C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,const char* szFilename,int( *Func)(void*,int,int,PTMSPP_FILEDATA, const char*)/*=nullptr*/,void* lpParam/*=nullptr*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;} #endif #endif @@ -521,25 +521,25 @@ C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGloba HRESULT CSentientManager::Init() { return S_OK; } HRESULT CSentientManager::Tick() { return S_OK; } HRESULT CSentientManager::Flush() { return S_OK; } -BOOL CSentientManager::RecordPlayerSessionStart(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordPlayerSessionExit(DWORD dwUserId, int exitStatus) { return true; } -BOOL CSentientManager::RecordHeartBeat(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers) { return true; } -BOOL CSentientManager::RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus) { return true; } -BOOL CSentientManager::RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes) { return true; } -BOOL CSentientManager::RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID) { return true; } -BOOL CSentientManager::RecordPauseOrInactive(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordUnpauseOrActive(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID) { return true; } -BOOL CSentientManager::RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore) { return true; } -BOOL CSentientManager::RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) { return true; } -BOOL CSentientManager::RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID) { return true; } -BOOL CSentientManager::RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) { return true; } -BOOL CSentientManager::RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } -BOOL CSentientManager::RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } -BOOL CSentientManager::RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId) { return true; } -BOOL CSentientManager::RecordBanLevel(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordUnBanLevel(DWORD dwUserId) { return true; } +bool CSentientManager::RecordPlayerSessionStart(DWORD dwUserId) { return true; } +bool CSentientManager::RecordPlayerSessionExit(DWORD dwUserId, int exitStatus) { return true; } +bool CSentientManager::RecordHeartBeat(DWORD dwUserId) { return true; } +bool CSentientManager::RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers) { return true; } +bool CSentientManager::RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus) { return true; } +bool CSentientManager::RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes) { return true; } +bool CSentientManager::RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID) { return true; } +bool CSentientManager::RecordPauseOrInactive(DWORD dwUserId) { return true; } +bool CSentientManager::RecordUnpauseOrActive(DWORD dwUserId) { return true; } +bool CSentientManager::RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID) { return true; } +bool CSentientManager::RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore) { return true; } +bool CSentientManager::RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) { return true; } +bool CSentientManager::RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID) { return true; } +bool CSentientManager::RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) { return true; } +bool CSentientManager::RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } +bool CSentientManager::RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } +bool CSentientManager::RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId) { return true; } +bool CSentientManager::RecordBanLevel(DWORD dwUserId) { return true; } +bool CSentientManager::RecordUnBanLevel(DWORD dwUserId) { return true; } INT CSentientManager::GetMultiplayerInstanceID() { return 0; } INT CSentientManager::GenerateMultiplayerInstanceId() { return 0; } void CSentientManager::SetMultiplayerInstanceId(INT value) {} diff --git a/Minecraft.Client/Platform/Linux/Linux_App.cpp b/Minecraft.Client/Platform/Linux/Linux_App.cpp index 7a4f07515..7508766d8 100644 --- a/Minecraft.Client/Platform/Linux/Linux_App.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_App.cpp @@ -73,7 +73,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() { StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = + int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // // 4J - was (new Random())->nextLong() - now trying to actually // find a seed to suit our requirements diff --git a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp index 20d2cfbec..45454d461 100644 --- a/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp @@ -101,7 +101,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES] = { uint8_t* AddRichPresenceString(int iID); void FreeRichPresenceStrings(); -BOOL g_bWidescreen = TRUE; +bool g_bWidescreen = TRUE; void DefineActions(void) { // The app needs to define the actions required, and the possible mappings @@ -583,7 +583,7 @@ HRESULT InitDevice() { // Create a render target view ID3D11Texture2D* pBackBuffer = nullptr; hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), - (LPVOID*)&pBackBuffer); + (void**)&pBackBuffer); if (FAILED(hr)) return hr; // Create a depth stencil buffer @@ -716,7 +716,7 @@ int main(int argc, const char* argv[]) { StorageManager.Init(0, app.GetString(IDS_DEFAULT_SAVENAME), (char*)"savegame.dat", FIFTY_ONE_MB, &CConsoleMinecraftApp::DisplaySavingMessage, - (LPVOID)&app, (char*)""); + (void*)&app, (char*)""); //////////////// // Initialise // @@ -1049,7 +1049,7 @@ volatile int sectCheck = 48; CRITICAL_SECTION memCS; DWORD tlsIdx; -LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { +void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { if (!trackStarted) { void* p = XMemAllocDefault(dwSize, dwAllocAttributes); size_t realSize = XMemSizeDefault(p, dwAllocAttributes); @@ -1142,7 +1142,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) { void DumpMem() { int totalLeak = 0; - for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { + for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { if (it->second > 0) { app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f, it->first & 0x03ffffff, it->second, @@ -1176,7 +1176,7 @@ void MemSect(int section) { } else { value = (value << 6) | section; } - TlsSetValue(tlsIdx, (LPVOID)value); + TlsSetValue(tlsIdx, (void*)value); } void MemPixStuff() { @@ -1184,7 +1184,7 @@ void MemPixStuff() { int totals[MAX_SECT] = {0}; - for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { + for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { if (it->second > 0) { int sect = (it->first >> 26) & 0x3f; int bytes = it->first & 0x03ffffff; diff --git a/Minecraft.Client/Platform/Linux/Sentient/SentientManager.h b/Minecraft.Client/Platform/Linux/Sentient/SentientManager.h index 09181c170..2c0c2ddfd 100644 --- a/Minecraft.Client/Platform/Linux/Sentient/SentientManager.h +++ b/Minecraft.Client/Platform/Linux/Sentient/SentientManager.h @@ -26,45 +26,45 @@ public: HRESULT Flush(); - BOOL RecordPlayerSessionStart(DWORD dwUserId); - BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); - BOOL RecordHeartBeat(DWORD dwUserId); - BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, + bool RecordPlayerSessionStart(DWORD dwUserId); + bool RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); + bool RecordHeartBeat(DWORD dwUserId); + bool RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers); - BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); - BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, + bool RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); + bool RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes); - BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, + bool RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID); - BOOL RecordPauseOrInactive(DWORD dwUserId); - BOOL RecordUnpauseOrActive(DWORD dwUserId); - BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); - BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, + bool RecordPauseOrInactive(DWORD dwUserId); + bool RecordUnpauseOrActive(DWORD dwUserId); + bool RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); + bool RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore); - BOOL RecordMediaShareUpload(DWORD dwUserId, + bool RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); - BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, + bool RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID); - BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, + bool RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); - BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, + bool RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, + bool RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); - BOOL RecordBanLevel(DWORD dwUserId); - BOOL RecordUnBanLevel(DWORD dwUserId); + bool RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); + bool RecordBanLevel(DWORD dwUserId); + bool RecordUnBanLevel(DWORD dwUserId); INT GetMultiplayerInstanceID(); INT GenerateMultiplayerInstanceId(); diff --git a/Minecraft.Client/Platform/Linux/Sentient/SentientStats.h b/Minecraft.Client/Platform/Linux/Sentient/SentientStats.h index 7115e25d5..8b05924c3 100644 --- a/Minecraft.Client/Platform/Linux/Sentient/SentientStats.h +++ b/Minecraft.Client/Platform/Linux/Sentient/SentientStats.h @@ -12,77 +12,77 @@ // PlayerSessionStart // Player signed in or joined -BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); +bool SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); // PlayerSessionExit // Player signed out or left -BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); +bool SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); // HeartBeat // Sent every 60 seconds by title -BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); +bool SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); // LevelStart // Level started -BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); // LevelExit // Level exited -BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); +bool SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); // LevelSaveOrCheckpoint // Level saved explicitly or implicitly -BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); +bool SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); // LevelResume // Level resumed from a save or restarted at a checkpoint -BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); // PauseOrInactive // Player paused game or has become inactive, level and mode are for what the player is leaving -BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); // UnpauseOrActive // Player unpaused game or has become active, level and mode are for what the player is entering into -BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); // MenuShown // A menu screen or major menu area has been shown -BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); // AchievementUnlocked // An achievement was unlocked -BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); +bool SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); // MediaShareUpload // The user uploaded something to Kinect Share -BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); +bool SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); // UpsellPresented // The user is shown an upsell to purchase something -BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); +bool SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); // UpsellResponded // The user responded to the upsell -BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); +bool SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); // PlayerDiedOrFailed // The player died or failed a challenge - can be used for many types of failure -BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); // EnemyKilledOrOvercome // The player killed an enemy or overcame or solved a major challenge -BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); // SkinChanged // The player has changed their skin, level and mode are for what the player is currently in -BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); +bool SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); // BanLevel // The player has banned a level, level and mode are for what the player is currently in and banning -BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); // UnBanLevel // The player has ubbanned a level, level and mode are for what the player is currently in and unbanning -BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); diff --git a/Minecraft.Client/Platform/Linux/Stubs/d3d11_stubs.h b/Minecraft.Client/Platform/Linux/Stubs/d3d11_stubs.h index 4e922fcc9..80a468daa 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/d3d11_stubs.h +++ b/Minecraft.Client/Platform/Linux/Stubs/d3d11_stubs.h @@ -36,7 +36,7 @@ typedef RECT D3D11_RECT; typedef void ID3D11RenderTargetView; typedef void ID3D11DepthStencilView; typedef void ID3D11Buffer; -// typedef DWORD (*PTHREAD_START_ROUTINE)( LPVOID lpThreadParameter); +// typedef DWORD (*PTHREAD_START_ROUTINE)( void* lpThreadParameter); // typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; // Used only by windows/durango gdraw and UIController. Will be unnecessary once diff --git a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h b/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h index 11d12bceb..634b7eb32 100644 --- a/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h +++ b/Minecraft.Client/Platform/Linux/Stubs/winapi_stubs.h @@ -18,11 +18,6 @@ #define S_OK 0 typedef unsigned int DWORD; -typedef const char* LPCSTR; -typedef bool BOOL; -typedef BOOL* PBOOL; -typedef BOOL* LPBOOL; -typedef void* LPVOID; typedef wchar_t WCHAR; typedef unsigned char BYTE; typedef BYTE* PBYTE; @@ -62,10 +57,7 @@ typedef size_t SIZE_T; typedef WCHAR *LPWSTR, *PWSTR; typedef unsigned char boolean; // java brainrot #define __debugbreak() -#define __int32 int #define CONST const -typedef int64_t __int64; -typedef uint64_t __uint64; typedef unsigned long ULONG; // typedef unsigned char byte; typedef short SHORT; @@ -429,7 +421,7 @@ static inline HANDLE CreateFile(const wchar_t* lpFileName, dwFlagsAndAttributes, hTemplateFile); } -static inline BOOL CloseHandle(HANDLE hObject) { +static inline bool CloseHandle(HANDLE hObject) { if (hObject == INVALID_HANDLE_VALUE) return FALSE; return close((int)(intptr_t)hObject) == 0; } @@ -445,7 +437,7 @@ static inline DWORD GetFileSize(HANDLE hFile, DWORD* lpFileSizeHigh) { return (DWORD)(st.st_size & 0xFFFFFFFF); } -static inline BOOL GetFileSizeEx(HANDLE hFile, LARGE_INTEGER* lpFileSize) { +static inline bool GetFileSizeEx(HANDLE hFile, LARGE_INTEGER* lpFileSize) { struct stat st{}; if (fstat((int)(intptr_t)hFile, &st) != 0) return FALSE; if (lpFileSize) { @@ -456,7 +448,7 @@ static inline BOOL GetFileSizeEx(HANDLE hFile, LARGE_INTEGER* lpFileSize) { return TRUE; } -static inline BOOL ReadFile(HANDLE hFile, void* lpBuffer, +static inline bool ReadFile(HANDLE hFile, void* lpBuffer, DWORD nNumberOfBytesToRead, DWORD* lpNumberOfBytesRead, void* lpOverlapped) { ssize_t n = read((int)(intptr_t)hFile, lpBuffer, nNumberOfBytesToRead); @@ -464,7 +456,7 @@ static inline BOOL ReadFile(HANDLE hFile, void* lpBuffer, return n >= 0; } -static inline BOOL WriteFile(HANDLE hFile, const void* lpBuffer, +static inline bool WriteFile(HANDLE hFile, const void* lpBuffer, DWORD nNumberOfBytesToWrite, DWORD* lpNumberOfBytesWritten, void* lpOverlapped) { @@ -503,7 +495,7 @@ static inline DWORD GetFileAttributes(const char* lpFileName) { return GetFileAttributesA(lpFileName); } -static inline BOOL GetFileAttributesExA(const char* lpFileName, +static inline bool GetFileAttributesExA(const char* lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, void* lpFileInformation) { if (fInfoLevelId != GetFileExInfoStandard || !lpFileInformation) @@ -521,36 +513,36 @@ static inline BOOL GetFileAttributesExA(const char* lpFileName, return TRUE; } -static inline BOOL GetFileAttributesEx(const char* lpFileName, +static inline bool GetFileAttributesEx(const char* lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, void* lpFileInformation) { return GetFileAttributesExA(lpFileName, fInfoLevelId, lpFileInformation); } -static inline BOOL CreateDirectoryA(const char* lpPathName, +static inline bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes) { return mkdir(lpPathName, 0755) == 0; } -static inline BOOL CreateDirectory(const char* lpPathName, +static inline bool CreateDirectory(const char* lpPathName, void* lpSecurityAttributes) { return CreateDirectoryA(lpPathName, lpSecurityAttributes); } -static inline BOOL DeleteFileA(const char* lpFileName) { +static inline bool DeleteFileA(const char* lpFileName) { return unlink(lpFileName) == 0; } -static inline BOOL DeleteFile(const char* lpFileName) { +static inline bool DeleteFile(const char* lpFileName) { return DeleteFileA(lpFileName); } -static inline BOOL MoveFileA(const char* lpExistingFileName, +static inline bool MoveFileA(const char* lpExistingFileName, const char* lpNewFileName) { return rename(lpExistingFileName, lpNewFileName) == 0; } -static inline BOOL MoveFile(const char* lpExistingFileName, +static inline bool MoveFile(const char* lpExistingFileName, const char* lpNewFileName) { return MoveFileA(lpExistingFileName, lpNewFileName); } @@ -616,7 +608,7 @@ static inline HANDLE FindFirstFile(const char* lpFileName, } // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findnextfilea -static inline BOOL FindNextFileA(HANDLE hFindFile, +static inline bool FindNextFileA(HANDLE hFindFile, WIN32_FIND_DATAA* lpFindFileData) { if (hFindFile == INVALID_HANDLE_VALUE || !lpFindFileData) return FALSE; _LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile; @@ -642,13 +634,13 @@ static inline BOOL FindNextFileA(HANDLE hFindFile, return FALSE; } -static inline BOOL FindNextFile(HANDLE hFindFile, +static inline bool FindNextFile(HANDLE hFindFile, WIN32_FIND_DATAA* lpFindFileData) { return FindNextFileA(hFindFile, lpFindFileData); } // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findclose -static inline BOOL FindClose(HANDLE hFindFile) { +static inline bool FindClose(HANDLE hFindFile) { if (hFindFile == INVALID_HANDLE_VALUE) return FALSE; _LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile; closedir(fh->dir); @@ -710,7 +702,7 @@ static inline VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) { } // https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-systemtimetofiletime -static inline BOOL SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, +static inline bool SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, LPFILETIME lpFileTime) { struct tm tm = {}; tm.tm_year = lpSystemTime->wYear - 1900; @@ -731,7 +723,7 @@ static inline BOOL SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, } // https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-filetimetosystemtime -static inline BOOL FileTimeToSystemTime(const FILETIME* lpFileTime, +static inline bool FileTimeToSystemTime(const FILETIME* lpFileTime, LPSYSTEMTIME lpSystemTime) { ULONGLONG ft = ((ULONGLONG)lpFileTime->dwHighDateTime << 32) | lpFileTime->dwLowDateTime; @@ -751,13 +743,13 @@ static inline DWORD GetTickCount() { return (long long)ts.tv_sec * 1000 + (long long)ts.tv_nsec / 1000000; } -static inline BOOL QueryPerformanceFrequency(LARGE_INTEGER* lpFrequency) { +static inline bool QueryPerformanceFrequency(LARGE_INTEGER* lpFrequency) { // nanoseconds lpFrequency->QuadPart = 1000000000; return false; } -static inline BOOL QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) { +static inline bool QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); @@ -769,7 +761,7 @@ static inline BOOL QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) { } // https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringa -static inline VOID OutputDebugStringA(LPCSTR lpOutputString) { +static inline VOID OutputDebugStringA(const char* lpOutputString) { if (!lpOutputString) return; fputs(lpOutputString, stderr); } @@ -780,7 +772,7 @@ static inline VOID OutputDebugStringW(LPCWSTR lpOutputString) { fprintf(stderr, "%ls", lpOutputString); } -static inline VOID OutputDebugString(LPCSTR lpOutputString) { +static inline VOID OutputDebugString(const char* lpOutputString) { return OutputDebugStringA(lpOutputString); } @@ -800,12 +792,12 @@ static inline HANDLE CreateEvent(int manual_reset, int initial_state) { return (HANDLE)ev; } -static inline HANDLE CreateEvent(void*, BOOL manual_reset, BOOL initial_state, +static inline HANDLE CreateEvent(void*, bool manual_reset, bool initial_state, void*) { return CreateEvent(manual_reset, initial_state); } -static inline BOOL SetEvent(HANDLE hEvent) { +static inline bool SetEvent(HANDLE hEvent) { Event* ev = (Event*)hEvent; if (!ev) return FALSE; pthread_mutex_lock(&ev->mutex); @@ -818,7 +810,7 @@ static inline BOOL SetEvent(HANDLE hEvent) { return TRUE; } -static inline BOOL ResetEvent(HANDLE hEvent) { +static inline bool ResetEvent(HANDLE hEvent) { Event* ev = (Event*)hEvent; if (!ev) return FALSE; pthread_mutex_lock(&ev->mutex); @@ -877,7 +869,7 @@ static inline DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { static inline DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, - BOOL bWaitAll, + bool bWaitAll, DWORD dwMilliseconds) { if (bWaitAll) { for (DWORD i = 0; i < nCount; i++) @@ -1008,13 +1000,13 @@ static inline DWORD ResumeThread(HANDLE hThread) { return 0; } -static inline BOOL SetThreadPriority(HANDLE hThread, int nPriority) { +static inline bool SetThreadPriority(HANDLE hThread, int nPriority) { (void)hThread; (void)nPriority; return TRUE; } -static inline BOOL GetExitCodeThread(HANDLE hThread, DWORD* lpExitCode) { +static inline bool GetExitCodeThread(HANDLE hThread, DWORD* lpExitCode) { LinuxThread* lt = (LinuxThread*)hThread; if (!lt || !lpExitCode) return FALSE; *lpExitCode = lt->exitCode; @@ -1063,9 +1055,9 @@ static inline int swprintf_s(wchar_t* buf, size_t sz, const wchar_t* fmt, ...) { return ret; } -static inline HMODULE GetModuleHandle(LPCSTR lpModuleName) { return 0; } +static inline HMODULE GetModuleHandle(const char* lpModuleName) { return 0; } -static inline LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, +static inline void* VirtualAlloc(void* lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { // MEM_COMMIT | MEM_RESERVE → mmap anonymous int prot = 0; @@ -1086,7 +1078,7 @@ static inline LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, return p; } -static inline BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, +static inline bool VirtualFree(void* lpAddress, SIZE_T dwSize, DWORD dwFreeType) { if (lpAddress == nullptr) return FALSE; // MEM_RELEASE (0x8000) frees the whole region diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h index 8886beba7..11028daef 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h @@ -107,8 +107,8 @@ public: void SetMenuDisplayed(int iPad, bool bVal); -// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr); -// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr); +// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr); +// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr); EKeyboardResult RequestKeyboard(const wchar_t *Title, const wchar_t *Text, int iPad, unsigned int uiMaxChars, int( *Func)(void *,const bool), void *lpParam, C_4JInput::EKeyboardMode eMode); void GetText(uint16_t *UTF16String); diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h index 7fd928c94..12d16187a 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h @@ -54,21 +54,21 @@ public: bool IsSignedIn(int iQuadrant); bool IsSignedInLive(int iProf); bool IsGuest(int iQuadrant); - UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); + UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void*,const bool, const int iPad),void* lpParam,int iQuadrant=XUSER_INDEX_ANY); + UINT DisplayOfflineProfile(int( *Func)(void*,const bool, const int iPad),void* lpParam,int iQuadrant=XUSER_INDEX_ANY); + UINT RequestConvertOfflineToGuestUI(int( *Func)(void*,const bool, const int iPad),void* lpParam,int iQuadrant=XUSER_INDEX_ANY); void SetPrimaryPlayerChanged(bool bVal); bool QuerySigninStatus(void); void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid); - BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); - BOOL XUIDIsGuest(PlayerUID xuid); + bool AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); + bool XUIDIsGuest(PlayerUID xuid); bool AllowedToPlayMultiplayer(int iProf); bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge); void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame - void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed); - BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount ); + void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed); + bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount ); void ShowProfileCard(int iPad, PlayerUID targetUid); - bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); + bool GetProfileAvatar(int iPad,int( *Func)(void* lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), void* lpParam); void CancelProfileAvatarRequest(); @@ -78,18 +78,18 @@ public: char* GetGamertag(int iPad); std::wstring GetDisplayName(int iPad); bool IsFullVersion(); - void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); - void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); + void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam); + void SetNotificationsCallback(void ( *Func)(void*, DWORD, unsigned int),void* lpParam); bool RegionIsNorthAmerica(void); bool LocaleIsUSorCanada(void); HRESULT GetLiveConnectionStatus(); bool IsSystemUIDisplayed(); - void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam); + void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam); // PROFILE DATA - int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); - int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam); + int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam); PROFILESETTINGS * GetDashboardProfileSettings(int iPad); void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); @@ -116,7 +116,7 @@ public: // PURCHASE void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1); - void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam); + void SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam); // Debug void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage diff --git a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h index cc4dc87ac..ef135ccff 100644 --- a/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h @@ -239,31 +239,31 @@ public: // Messages C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=nullptr,LPVOID lpParam=nullptr, C4JStringTable *pStringTable=nullptr, WCHAR *pwchFormatString=nullptr,DWORD dwFocusButton=0); + int( *Func)(void*,int,const C4JStorage::EMessageResult)=nullptr,void* lpParam=nullptr, C4JStringTable *pStringTable=nullptr, WCHAR *pwchFormatString=nullptr,DWORD dwFocusButton=0); C4JStorage::EMessageResult GetMessageBoxResult(); // save device - bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false); + bool SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice=false); // savegame - void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID); + void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(void*, const ESavingMessage, int),void* lpParam,const char* szGroupID); void ResetSaveData(); // Call before a new save to clear out stored save file name void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName); void SetSaveTitle(LPCWSTR pwchDefaultSaveName); bool GetSaveUniqueNumber(INT *piVal); bool GetSaveUniqueFilename(char *pszName); void SetSaveUniqueFilename(char *szFilename); - void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam); + void SetState(ESaveGameControlState eControlState,int( *Func)(void*,const bool),void* lpParam); void SetSaveDisabled(bool bDisable); bool GetSaveDisabled(void); unsigned int GetSaveSize(); void GetSaveData(void *pvData,unsigned int *puiBytes); PVOID AllocateSaveData(unsigned int uiBytes); void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png - C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); - void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); + C4JStorage::ESaveGameState SaveSaveData(int( *Func)(void* ,const bool),void* lpParam); + void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam); void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); @@ -271,50 +271,50 @@ public: void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed // Get the info for the saves - C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); + C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(void* lpParam,SAVE_DETAILS *pSaveDetails,const bool),void* lpParam,char *pszSavePackName); PSAVE_DETAILS ReturnSavesInfo(); void ClearSavesInfo(); // Clears results - C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo + C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), void* lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo void GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData); void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes); // Load the save. Need to call GetSaveData once the callback is called - C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam); - C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); + C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam); + C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* lpParam); // DLC - void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); + void RegisterMarketplaceCountsCallback(int ( *Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(void*, int, DWORD, int),void* lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); DWORD CancelGetDLCOffers(); void ClearDLCOffers(); XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial=false); DWORD GetAvailableDLCCount( int iPad); - C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); + C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam); XCONTENT_DATA& GetDLC(DWORD dw); - DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=nullptr); - DWORD UnmountInstalledDLC(LPCSTR szMountDrive = nullptr); + DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(void*, int, DWORD,DWORD),void* lpParam,const char* szMountDrive=nullptr); + DWORD UnmountInstalledDLC(const char* szMountDrive = nullptr); void GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList); std::string GetMountedPath(std::string szMount); // Global title storage C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, - WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=nullptr,LPVOID lpParam=nullptr, int iAction=0); + WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(void*, WCHAR *,int, bool, int)=nullptr,void* lpParam=nullptr, int iAction=0); bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize); bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename); void StoreTMSPathName(WCHAR *pwchName=nullptr); // TMS++ - // C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=nullptr,LPVOID lpParam=nullptr, int iUserData=0); - // C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=nullptr,LPVOID lpParam=nullptr, int iUserData=0); - // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=nullptr,LPVOID lpParam=nullptr, int iUserData=0); - // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=nullptr, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(void*,int,int)=nullptr,void* lpParam=nullptr, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,void* lpParam, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,const char* szFilename,int( *Func)(void*,int,int,PTMSPP_FILEDATA, const char*)=nullptr,void* lpParam=nullptr, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(void*,int,int,PTMSPP_FILE_LIST)=nullptr,void* lpParam=nullptr, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,const char* szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(void*,int,int),void* lpParam=nullptr, int iUserData=0); // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename); // unsigned int CRC(unsigned char *buf, int len); diff --git a/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h b/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h index e88b5f8c3..6465f7577 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h +++ b/Minecraft.Client/Platform/Windows64/Iggy/include/rrCore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/mss.h b/Minecraft.Client/Platform/Windows64/Miles/include/mss.h index 9164a5f7b..f92230b9a 100644 --- a/Minecraft.Client/Platform/Windows64/Miles/include/mss.h +++ b/Minecraft.Client/Platform/Windows64/Miles/include/mss.h @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned int64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 diff --git a/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h b/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h index e88b5f8c3..6465f7577 100644 --- a/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h +++ b/Minecraft.Client/Platform/Windows64/Miles/include/rrcore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h b/Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h index 09181c170..2c0c2ddfd 100644 --- a/Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h +++ b/Minecraft.Client/Platform/Windows64/Sentient/SentientManager.h @@ -26,45 +26,45 @@ public: HRESULT Flush(); - BOOL RecordPlayerSessionStart(DWORD dwUserId); - BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); - BOOL RecordHeartBeat(DWORD dwUserId); - BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, + bool RecordPlayerSessionStart(DWORD dwUserId); + bool RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); + bool RecordHeartBeat(DWORD dwUserId); + bool RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers); - BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); - BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, + bool RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); + bool RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes); - BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, + bool RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID); - BOOL RecordPauseOrInactive(DWORD dwUserId); - BOOL RecordUnpauseOrActive(DWORD dwUserId); - BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); - BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, + bool RecordPauseOrInactive(DWORD dwUserId); + bool RecordUnpauseOrActive(DWORD dwUserId); + bool RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); + bool RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore); - BOOL RecordMediaShareUpload(DWORD dwUserId, + bool RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); - BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, + bool RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID); - BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, + bool RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); - BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, + bool RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, + bool RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); - BOOL RecordBanLevel(DWORD dwUserId); - BOOL RecordUnBanLevel(DWORD dwUserId); + bool RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); + bool RecordBanLevel(DWORD dwUserId); + bool RecordUnBanLevel(DWORD dwUserId); INT GetMultiplayerInstanceID(); INT GenerateMultiplayerInstanceId(); diff --git a/Minecraft.Client/Platform/Windows64/Sentient/SentientStats.h b/Minecraft.Client/Platform/Windows64/Sentient/SentientStats.h index 7115e25d5..8b05924c3 100644 --- a/Minecraft.Client/Platform/Windows64/Sentient/SentientStats.h +++ b/Minecraft.Client/Platform/Windows64/Sentient/SentientStats.h @@ -12,77 +12,77 @@ // PlayerSessionStart // Player signed in or joined -BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); +bool SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); // PlayerSessionExit // Player signed out or left -BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); +bool SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); // HeartBeat // Sent every 60 seconds by title -BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); +bool SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); // LevelStart // Level started -BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); // LevelExit // Level exited -BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); +bool SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); // LevelSaveOrCheckpoint // Level saved explicitly or implicitly -BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); +bool SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); // LevelResume // Level resumed from a save or restarted at a checkpoint -BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); // PauseOrInactive // Player paused game or has become inactive, level and mode are for what the player is leaving -BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); // UnpauseOrActive // Player unpaused game or has become active, level and mode are for what the player is entering into -BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); // MenuShown // A menu screen or major menu area has been shown -BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); // AchievementUnlocked // An achievement was unlocked -BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); +bool SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); // MediaShareUpload // The user uploaded something to Kinect Share -BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); +bool SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); // UpsellPresented // The user is shown an upsell to purchase something -BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); +bool SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); // UpsellResponded // The user responded to the upsell -BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); +bool SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); // PlayerDiedOrFailed // The player died or failed a challenge - can be used for many types of failure -BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); // EnemyKilledOrOvercome // The player killed an enemy or overcame or solved a major challenge -BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); // SkinChanged // The player has changed their skin, level and mode are for what the player is currently in -BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); +bool SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); // BanLevel // The player has banned a level, level and mode are for what the player is currently in and banning -BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); // UnBanLevel // The player has ubbanned a level, level and mode are for what the player is currently in and unbanning -BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp index 1838c6f95..2d8f67ac1 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp @@ -77,7 +77,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; diff --git a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp index f90b5bd95..ddb8fc2ad 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_Minecraft.cpp @@ -66,7 +66,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES] = { // running for a long time. //------------------------------------------------------------------------------------- -BOOL g_bWidescreen = TRUE; +bool g_bWidescreen = TRUE; int g_iScreenWidth = 1920; int g_iScreenHeight = 1080; @@ -476,7 +476,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance) { // In this function, we save the instance handle in a global variable and // create and display the main program window. // -BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { +bool InitInstance(HINSTANCE hInstance, int nCmdShow) { g_hInst = hInstance; // Store instance handle in our global variable RECT wr = {0, 0, g_iScreenWidth, @@ -601,7 +601,7 @@ HRESULT InitDevice() { // Create a render target view ID3D11Texture2D* pBackBuffer = nullptr; hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), - (LPVOID*)&pBackBuffer); + (void**)&pBackBuffer); if (FAILED(hr)) return hr; // Create a depth stencil buffer @@ -756,7 +756,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // Set a callback for the default player options to be set - when there is // no profile data for the player ProfileManager.SetDefaultOptionsCallback( - &CConsoleMinecraftApp::DefaultOptionsCallback, (LPVOID)&app); + &CConsoleMinecraftApp::DefaultOptionsCallback, (void*)&app); // QNet needs to be setup after profile manager, as we do not want its // Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does // mean that we need to have a callback in the ProfileManager for @@ -935,7 +935,7 @@ volatile int sectCheck = 48; CRITICAL_SECTION memCS; DWORD tlsIdx; -LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { +void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) { if (!trackStarted) { void* p = XMemAllocDefault(dwSize, dwAllocAttributes); size_t realSize = XMemSizeDefault(p, dwAllocAttributes); @@ -1028,7 +1028,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) { void DumpMem() { int totalLeak = 0; - for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { + for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { if (it->second > 0) { app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f, it->first & 0x03ffffff, it->second, @@ -1062,7 +1062,7 @@ void MemSect(int section) { } else { value = (value << 6) | section; } - TlsSetValue(tlsIdx, (LPVOID)value); + TlsSetValue(tlsIdx, (void*)value); } void MemPixStuff() { @@ -1070,7 +1070,7 @@ void MemPixStuff() { int totals[MAX_SECT] = {0}; - for (AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++) { + for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { if (it->second > 0) { int sect = (it->first >> 26) & 0x3f; int bytes = it->first & 0x03ffffff; diff --git a/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h b/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h index 12f597372..3369a4174 100644 --- a/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h +++ b/Minecraft.Client/Platform/Windows64/XML/ATGXmlParser.h @@ -58,11 +58,11 @@ public: virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0; + virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) = 0; virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0; virtual HRESULT CDATABegin( ) = 0; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0; + virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ) = 0; virtual HRESULT CDATAEnd( ) = 0; virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0; @@ -111,7 +111,7 @@ public: private: HRESULT MainParseLoop(); - HRESULT AdvanceCharacter( BOOL bOkToFail = FALSE ); + HRESULT AdvanceCharacter( bool bOkToFail = FALSE ); VOID SkipNextAdvance(); HRESULT ConsumeSpace(); @@ -144,10 +144,10 @@ private: BYTE* m_pReadPtr; WCHAR* m_pWritePtr; // write pointer within m_pBuf - BOOL m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits - BOOL m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse + bool m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits + bool m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse - BOOL m_bSkipNextAdvance; + bool m_bSkipNextAdvance; WCHAR m_Ch; // Current character being parsed }; diff --git a/Minecraft.Client/Platform/extraX64client.h b/Minecraft.Client/Platform/extraX64client.h index 0ba6980cd..b9c9d3d86 100644 --- a/Minecraft.Client/Platform/extraX64client.h +++ b/Minecraft.Client/Platform/extraX64client.h @@ -43,7 +43,7 @@ DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCount, - PBOOL pfResult, + bool* pfResult, void *pOverlapped); class XSOCIAL_IMAGEPOSTPARAMS diff --git a/Minecraft.Client/Platform/stdafx.h b/Minecraft.Client/Platform/stdafx.h index 9befa0cbe..9d840b274 100644 --- a/Minecraft.Client/Platform/stdafx.h +++ b/Minecraft.Client/Platform/stdafx.h @@ -14,7 +14,6 @@ // use - #pragma message(__LOC__"Need to do something here") -#define AUTO_VAR(_var, _val) auto _var = _val #include #include #include @@ -23,8 +22,6 @@ #ifdef __linux__ #include "../Platform/Linux/Stubs/LinuxStubs.h" -#else -typedef unsigned __int64 __uint64; #endif #ifdef _WINDOWS64 diff --git a/Minecraft.Client/Player/EntityTracker.cpp b/Minecraft.Client/Player/EntityTracker.cpp index 94faeae4e..2d8c5e0dd 100644 --- a/Minecraft.Client/Player/EntityTracker.cpp +++ b/Minecraft.Client/Player/EntityTracker.cpp @@ -30,7 +30,7 @@ void EntityTracker::addEntity(std::shared_ptr e) { addEntity(e, 32 * 16, 2); std::shared_ptr player = std::dynamic_pointer_cast(e); - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { if ((*it)->e != player) { (*it)->updatePlayer(this, player); } @@ -115,7 +115,7 @@ void EntityTracker::addEntity(std::shared_ptr e, int range, // to allow us to now choose to remove the player as a "seenBy" only when the // player has actually been removed from the level's own player array void EntityTracker::removeEntity(std::shared_ptr e) { - AUTO_VAR(it, entityMap.find(e->entityId)); + auto it = entityMap.find(e->entityId); if (it != entityMap.end()) { std::shared_ptr te = it->second; entityMap.erase(it); @@ -128,7 +128,7 @@ void EntityTracker::removePlayer(std::shared_ptr e) { if (e->GetType() == eTYPE_SERVERPLAYER) { std::shared_ptr player = std::dynamic_pointer_cast(e); - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { (*it)->removePlayer(player); } @@ -140,7 +140,7 @@ void EntityTracker::removePlayer(std::shared_ptr e) { void EntityTracker::tick() { std::vector > movedPlayers; - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { std::shared_ptr te = *it; te->tick(this, &level->players); if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) { @@ -182,7 +182,7 @@ void EntityTracker::tick() { for (unsigned int i = 0; i < movedPlayers.size(); i++) { std::shared_ptr player = movedPlayers[i]; if (player->connection == nullptr) continue; - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { std::shared_ptr te = *it; if (te->e != player) { te->updatePlayer(this, player); @@ -191,7 +191,7 @@ void EntityTracker::tick() { } // 4J Stu - We want to do this for dead players as they don't tick normally - for (AUTO_VAR(it, level->players.begin()); it != level->players.end(); + for (auto it = level->players.begin(); it != level->players.end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); @@ -203,7 +203,7 @@ void EntityTracker::tick() { void EntityTracker::broadcast(std::shared_ptr e, std::shared_ptr packet) { - AUTO_VAR(it, entityMap.find(e->entityId)); + auto it = entityMap.find(e->entityId); if (it != entityMap.end()) { std::shared_ptr te = it->second; te->broadcast(packet); @@ -212,7 +212,7 @@ void EntityTracker::broadcast(std::shared_ptr e, void EntityTracker::broadcastAndSend(std::shared_ptr e, std::shared_ptr packet) { - AUTO_VAR(it, entityMap.find(e->entityId)); + auto it = entityMap.find(e->entityId); if (it != entityMap.end()) { std::shared_ptr te = it->second; te->broadcastAndSend(packet); @@ -220,7 +220,7 @@ void EntityTracker::broadcastAndSend(std::shared_ptr e, } void EntityTracker::clear(std::shared_ptr serverPlayer) { - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { std::shared_ptr te = *it; te->clear(serverPlayer); } @@ -228,7 +228,7 @@ void EntityTracker::clear(std::shared_ptr serverPlayer) { void EntityTracker::playerLoadedChunk(std::shared_ptr player, LevelChunk* chunk) { - for (AUTO_VAR(it, entities.begin()); it != entities.end(); ++it) { + for (auto it = entities.begin(); it != entities.end(); ++it) { std::shared_ptr te = *it; if (te->e != player && te->e->xChunk == chunk->x && te->e->zChunk == chunk->z) { @@ -244,7 +244,7 @@ void EntityTracker::updateMaxRange() { std::shared_ptr EntityTracker::getTracker( std::shared_ptr e) { - AUTO_VAR(it, entityMap.find(e->entityId)); + auto it = entityMap.find(e->entityId); if (it != entityMap.end()) { return it->second; } diff --git a/Minecraft.Client/Player/ServerPlayer.cpp b/Minecraft.Client/Player/ServerPlayer.cpp index 154dfa113..3bb901dd4 100644 --- a/Minecraft.Client/Player/ServerPlayer.cpp +++ b/Minecraft.Client/Player/ServerPlayer.cpp @@ -153,8 +153,8 @@ void ServerPlayer::flagEntitiesToBeRemoved(unsigned int* flags, memset(flags, 0, 2048 / 32); } - AUTO_VAR(it, entitiesToRemove.begin()); - for (AUTO_VAR(it, entitiesToRemove.begin()); it != entitiesToRemove.end(); + auto it = entitiesToRemove.begin(); + for (auto it = entitiesToRemove.begin(); it != entitiesToRemove.end(); it++) { int index = *it; if (index < 2048) { @@ -259,7 +259,7 @@ void ServerPlayer::flushEntitiesToRemove() { intArray ids(amount); int pos = 0; - AUTO_VAR(it, entitiesToRemove.begin()); + auto it = entitiesToRemove.begin(); while (it != entitiesToRemove.end() && pos < amount) { ids[pos++] = *it; it = entitiesToRemove.erase(it); @@ -331,7 +331,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) { // the spiral of chunks that that method creates, long before // transmission of them is complete. double dist = DBL_MAX; - for (AUTO_VAR(it, chunksToSend.begin()); it != chunksToSend.end(); + for (auto it = chunksToSend.begin(); it != chunksToSend.end(); it++) { ChunkPos chunk = *it; if (level->isChunkFinalised(chunk.x, chunk.z)) { @@ -572,7 +572,7 @@ void ServerPlayer::doTickB() { players.push_back( std::dynamic_pointer_cast(shared_from_this())); - for (AUTO_VAR(it, objectives->begin()); it != objectives->end(); + for (auto it = objectives->begin(); it != objectives->end(); ++it) { Objective* objective = *it; getScoreboard() @@ -806,9 +806,9 @@ void ServerPlayer::changeDimension(int i) { thisPlayer->GetUserIndex()); } if (thisPlayer != nullptr) { - for (AUTO_VAR(it, MinecraftServer::getInstance() + for (auto it = MinecraftServer::getInstance() ->getPlayers() - ->players.begin()); + ->players.begin(); it != MinecraftServer::getInstance()->getPlayers()->players.end(); ++it) { diff --git a/Minecraft.Client/Player/TrackedEntity.cpp b/Minecraft.Client/Player/TrackedEntity.cpp index e03156314..7e6c54ae5 100644 --- a/Minecraft.Client/Player/TrackedEntity.cpp +++ b/Minecraft.Client/Player/TrackedEntity.cpp @@ -80,7 +80,7 @@ void TrackedEntity::tick(EntityTracker* tracker, !e->removed) { std::shared_ptr data = Item::map->getSavedData(item, e->level); - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); data->tickCarriedBy(player, item); @@ -378,7 +378,7 @@ void TrackedEntity::broadcast(std::shared_ptr packet) { // can be sent to any player, but we try to restrict the network impact // this has by not resending to the one machine - for (AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++) { + for (auto it = seenBy.begin(); it != seenBy.end(); it++) { std::shared_ptr player = *it; bool dontSend = false; if (sentTo.size()) { @@ -422,7 +422,7 @@ void TrackedEntity::broadcast(std::shared_ptr packet) { // This packet hasn't got canSendToAnyClient set, so just send to // everyone here, and it - for (AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++) { + for (auto it = seenBy.begin(); it != seenBy.end(); it++) { (*it)->connection->send(packet); } } @@ -441,13 +441,13 @@ void TrackedEntity::broadcastAndSend(std::shared_ptr packet) { } void TrackedEntity::broadcastRemoved() { - for (AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++) { + for (auto it = seenBy.begin(); it != seenBy.end(); it++) { (*it)->entitiesToRemove.push_back(e->entityId); } } void TrackedEntity::removePlayer(std::shared_ptr sp) { - AUTO_VAR(it, seenBy.find(sp)); + auto it = seenBy.find(sp); if (it != seenBy.end()) { sp->entitiesToRemove.push_back(e->entityId); seenBy.erase(it); @@ -635,7 +635,7 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker, std::dynamic_pointer_cast(e); std::vector* activeEffects = mob->getActiveEffects(); - for (AUTO_VAR(it, activeEffects->begin()); + for (auto it = activeEffects->begin(); it != activeEffects->end(); ++it) { MobEffectInstance* effect = *it; @@ -645,7 +645,7 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker, delete activeEffects; } } else if (visibility == eVisibility_NotVisible) { - AUTO_VAR(it, seenBy.find(sp)); + auto it = seenBy.find(sp); if (it != seenBy.end()) { seenBy.erase(it); sp->entitiesToRemove.push_back(e->entityId); @@ -838,7 +838,7 @@ std::shared_ptr TrackedEntity::getAddEntityPacket() { } void TrackedEntity::clear(std::shared_ptr sp) { - AUTO_VAR(it, seenBy.find(sp)); + auto it = seenBy.find(sp); if (it != seenBy.end()) { seenBy.erase(it); sp->entitiesToRemove.push_back(e->entityId); diff --git a/Minecraft.Client/Rendering/Chunk.cpp b/Minecraft.Client/Rendering/Chunk.cpp index 25621e9ce..1743b524b 100644 --- a/Minecraft.Client/Rendering/Chunk.cpp +++ b/Minecraft.Client/Rendering/Chunk.cpp @@ -33,7 +33,7 @@ void Chunk::reconcileRenderableTileEntities( const std::vector >& renderableTileEntities) { int key = levelRenderer->getGlobalIndexForChunk(this->x, this->y, this->z, level); - AUTO_VAR(it, globalRenderableTileEntities->find(key)); + auto it = globalRenderableTileEntities->find(key); if (!renderableTileEntities.empty()) { std::unordered_set currentRenderableTileEntitySet; currentRenderableTileEntitySet.reserve(renderableTileEntities.size()); @@ -45,7 +45,7 @@ void Chunk::reconcileRenderableTileEntities( LevelRenderer::RenderableTileEntityBucket& existingBucket = it->second; - for (AUTO_VAR(it2, existingBucket.tiles.begin()); + for (auto it2 = existingBucket.tiles.begin(); it2 != existingBucket.tiles.end(); it2++) { TileEntity* tileEntity = (*it2).get(); if (currentRenderableTileEntitySet.find(tileEntity) == @@ -78,7 +78,7 @@ void Chunk::reconcileRenderableTileEntities( } } } else if (it != globalRenderableTileEntities->end()) { - for (AUTO_VAR(it2, it->second.tiles.begin()); + for (auto it2 = it->second.tiles.begin(); it2 != it->second.tiles.end(); it2++) { (*it2)->setRenderRemoveStage( diff --git a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp b/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp index 916d3c0f3..305fe1bed 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/EntityRenderDispatcher.cpp @@ -176,7 +176,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() { renderers[eTYPE_LIGHTNINGBOLT] = new LightningBoltRenderer(); glDisable(GL_LIGHTING); - AUTO_VAR(itEnd, renderers.end()); + auto itEnd = renderers.end(); for (classToRendererMap::iterator it = renderers.begin(); it != itEnd; it++) { it->second->init(this); @@ -188,7 +188,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() { EntityRenderer* EntityRenderDispatcher::getRenderer(eINSTANCEOF e) { if ((e & eTYPE_PLAYER) == eTYPE_PLAYER) e = eTYPE_PLAYER; // EntityRenderer * r = renderers[e]; - AUTO_VAR(it, renderers.find(e)); // 4J Stu - The .at and [] accessors + auto it = renderers.find(e); // 4J Stu - The .at and [] accessors // insert elements if they don't exist if (it == renderers.end()) { @@ -304,7 +304,7 @@ Font* EntityRenderDispatcher::getFont() { return font; } void EntityRenderDispatcher::registerTerrainTextures( IconRegister* iconRegister) { // for (EntityRenderer renderer : renderers.values()) - for (AUTO_VAR(it, renderers.begin()); it != renderers.end(); ++it) { + for (auto it = renderers.begin(); it != renderers.end(); ++it) { EntityRenderer* renderer = it->second; renderer->registerTerrainTextures(iconRegister); } diff --git a/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp index 17986a24e..1fa12dcaf 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/HorseRenderer.cpp @@ -86,7 +86,7 @@ ResourceLocation* HorseRenderer::getOrCreateLayeredTextureLocation( std::shared_ptr horse) { std::wstring textureName = horse->getLayeredTextureHashName(); - AUTO_VAR(it, LAYERED_LOCATION_CACHE.find(textureName)); + auto it = LAYERED_LOCATION_CACHE.find(textureName); ResourceLocation* location; if (it != LAYERED_LOCATION_CACHE.end()) { diff --git a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp index 7c3dcd83b..9f1e6c31d 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp @@ -199,7 +199,7 @@ void PlayerRenderer::render(std::shared_ptr _mob, double x, double y, mob->GetAdditionalModelParts(); // turn them on if (pAdditionalModelParts != nullptr) { - for (AUTO_VAR(it, pAdditionalModelParts->begin()); + for (auto it = pAdditionalModelParts->begin(); it != pAdditionalModelParts->end(); ++it) { ModelPart* pModelPart = *it; @@ -211,7 +211,7 @@ void PlayerRenderer::render(std::shared_ptr _mob, double x, double y, // turn them off again if (pAdditionalModelParts && pAdditionalModelParts->size() != 0) { - for (AUTO_VAR(it, pAdditionalModelParts->begin()); + for (auto it = pAdditionalModelParts->begin(); it != pAdditionalModelParts->end(); ++it) { ModelPart* pModelPart = *it; diff --git a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp b/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp index 4c51405e2..282e4ffda 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/TileEntityRenderDispatcher.cpp @@ -48,7 +48,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() { renderers[eTYPE_BEACONTILEENTITY] = new BeaconRenderer(); glDisable(GL_LIGHTING); - AUTO_VAR(itEnd, renderers.end()); + auto itEnd = renderers.end(); for (classToTileRendererMap::iterator it = renderers.begin(); it != itEnd; it++) { if (it->second) it->second->init(this); @@ -58,7 +58,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() { TileEntityRenderer* TileEntityRenderDispatcher::getRenderer(eINSTANCEOF e) { TileEntityRenderer* r = nullptr; // TileEntityRenderer *r = renderers[e]; - AUTO_VAR(it, renderers.find(e)); // 4J Stu - The .at and [] accessors + auto it = renderers.find(e); // 4J Stu - The .at and [] accessors // insert elements if they don't exist if (it == renderers.end()) { @@ -143,7 +143,7 @@ void TileEntityRenderDispatcher::render(std::shared_ptr entity, void TileEntityRenderDispatcher::setLevel(Level* level) { this->level = level; - for (AUTO_VAR(it, renderers.begin()); it != renderers.end(); it++) { + for (auto it = renderers.begin(); it != renderers.end(); it++) { if (it->second) it->second->onNewLevel(level); } } diff --git a/Minecraft.Client/Rendering/GameRenderer.cpp b/Minecraft.Client/Rendering/GameRenderer.cpp index 4a7a93601..635264322 100644 --- a/Minecraft.Client/Rendering/GameRenderer.cpp +++ b/Minecraft.Client/Rendering/GameRenderer.cpp @@ -310,8 +310,8 @@ void GameRenderer::pick(float a) { mc->level->getEntities(mc->cameraTargetPlayer, &grown); double nearest = dist; - AUTO_VAR(itEnd, objects->end()); - for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { + auto itEnd = objects->end(); + for (auto it = objects->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // objects->at(i); if (!e->isPickable()) continue; diff --git a/Minecraft.Client/Rendering/GameRenderer.h b/Minecraft.Client/Rendering/GameRenderer.h index c359e45e2..0659f53af 100644 --- a/Minecraft.Client/Rendering/GameRenderer.h +++ b/Minecraft.Client/Rendering/GameRenderer.h @@ -135,7 +135,7 @@ private: public: void render(float a, bool bFirst); // 4J added bFirst void renderLevel(float a); - void renderLevel(float a, __int64 until); + void renderLevel(float a, int64_t until); private: Random* random; diff --git a/Minecraft.Client/Rendering/LevelRenderer.cpp b/Minecraft.Client/Rendering/LevelRenderer.cpp index 05111a503..38405101d 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.cpp +++ b/Minecraft.Client/Rendering/LevelRenderer.cpp @@ -564,8 +564,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) { level[playerIndex]->getAllEntities(); totalEntities = (int)entities.size(); - AUTO_VAR(itEndGE, level[playerIndex]->globalEntities.end()); - for (AUTO_VAR(it, level[playerIndex]->globalEntities.begin()); + auto itEndGE = level[playerIndex]->globalEntities.end(); + for (auto it = level[playerIndex]->globalEntities.begin(); it != itEndGE; it++) { std::shared_ptr entity = *it; // level->globalEntities[i]; renderedEntities++; @@ -573,8 +573,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) { EntityRenderDispatcher::instance->render(entity, a); } - AUTO_VAR(itEndEnts, entities.end()); - for (AUTO_VAR(it, entities.begin()); it != itEndEnts; it++) { + auto itEndEnts = entities.end(); + for (auto it = entities.begin(); it != itEndEnts; it++) { std::shared_ptr entity = *it; // entities[i]; bool shouldRender = @@ -620,13 +620,13 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) { // hashmap by chunk/dimension index. The index is calculated in the same way // as the global flags. EnterCriticalSection(&m_csRenderableTileEntities); - for (AUTO_VAR(it, renderableTileEntities.begin()); + for (auto it = renderableTileEntities.begin(); it != renderableTileEntities.end(); it++) { int idx = it->first; // Don't render if it isn't in the same dimension as this player if (!isGlobalIndexInSameDimension(idx, level[playerIndex])) continue; - for (AUTO_VAR(it2, it->second.tiles.begin()); + for (auto it2 = it->second.tiles.begin(); it2 != it->second.tiles.end(); it2++) { TileEntityRenderDispatcher::instance->render(*it2, a); } @@ -854,7 +854,7 @@ void LevelRenderer::tick() { ticks++; if ((ticks % SharedConstants::TICKS_PER_SECOND) == 0) { - AUTO_VAR(it, destroyingBlocks.begin()); + auto it = destroyingBlocks.begin(); while (it != destroyingBlocks.end()) { BlockDestructionProgress* block = it->second; @@ -2153,7 +2153,7 @@ void LevelRenderer::renderDestroyAnimation(Tesselator* t, t->offset((float)-xo, (float)-yo, (float)-zo); t->noColor(); - AUTO_VAR(it, destroyingBlocks.begin()); + auto it = destroyingBlocks.begin(); while (it != destroyingBlocks.end()) { BlockDestructionProgress* block = it->second; double xd = block->getX() - xo; @@ -3578,7 +3578,7 @@ void LevelRenderer::levelEvent(std::shared_ptr source, int type, int x, void LevelRenderer::destroyTileProgress(int id, int x, int y, int z, int progress) { if (progress < 0 || progress >= 10) { - AUTO_VAR(it, destroyingBlocks.find(id)); + auto it = destroyingBlocks.find(id); if (it != destroyingBlocks.end()) { delete it->second; destroyingBlocks.erase(it); @@ -3587,7 +3587,7 @@ void LevelRenderer::destroyTileProgress(int id, int x, int y, int z, } else { BlockDestructionProgress* entry = nullptr; - AUTO_VAR(it, destroyingBlocks.find(id)); + auto it = destroyingBlocks.find(id); if (it != destroyingBlocks.end()) entry = it->second; if (entry == nullptr || entry->getX() != x || entry->getY() != y || @@ -3867,7 +3867,7 @@ void LevelRenderer::fullyFlagRenderableTileEntitiesToBeRemoved() { if (itChunk == renderableTileEntities.end()) continue; RenderableTileEntityBucket& bucket = itChunk->second; - for (AUTO_VAR(itPending, itKey->second.begin()); + for (auto itPending = itKey->second.begin(); itPending != itKey->second.end(); itPending++) { if (bucket.indexByTile.find(*itPending) == bucket.indexByTile.end()) { diff --git a/Minecraft.Client/Rendering/Minimap.cpp b/Minecraft.Client/Rendering/Minimap.cpp index 2765562fc..4a9bf773b 100644 --- a/Minecraft.Client/Rendering/Minimap.cpp +++ b/Minecraft.Client/Rendering/Minimap.cpp @@ -122,7 +122,7 @@ void Minimap::render(std::shared_ptr player, Textures* textures, textures->bind( textures->loadTexture(TN_MISC_MAPICONS)); // L"/misc/mapicons.png")); - AUTO_VAR(itEnd, data->decorations.end()); + auto itEnd = data->decorations.end(); #if defined(_LARGE_WORLDS) std::vector m_edgeIcons; @@ -188,7 +188,7 @@ void Minimap::render(std::shared_ptr player, Textures* textures, textures->bind(textures->loadTexture(TN_MISC_ADDITIONALMAPICONS)); fIconZ = -0.04f; // 4J - moved to -0.04 (was -0.02) to stop z fighting - for (AUTO_VAR(it, m_edgeIcons.begin()); it != m_edgeIcons.end(); it++) { + for (auto it = m_edgeIcons.begin(); it != m_edgeIcons.end(); it++) { MapItemSavedData::MapDecoration* dec = *it; char imgIndex = dec->img; diff --git a/Minecraft.Client/Rendering/Models/ModelPart.cpp b/Minecraft.Client/Rendering/Models/ModelPart.cpp index 067331536..e04a3d716 100644 --- a/Minecraft.Client/Rendering/Models/ModelPart.cpp +++ b/Minecraft.Client/Rendering/Models/ModelPart.cpp @@ -55,10 +55,10 @@ void ModelPart::addChild(ModelPart* child) { } ModelPart* ModelPart::retrieveChild(SKIN_BOX* pBox) { - for (AUTO_VAR(it, children.begin()); it != children.end(); ++it) { + for (auto it = children.begin(); it != children.end(); ++it) { ModelPart* child = *it; - for (AUTO_VAR(itcube, child->cubes.begin()); + for (auto itcube = child->cubes.begin(); itcube != child->cubes.end(); ++itcube) { Cube* pCube = *itcube; diff --git a/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp b/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp index 12ca16013..9e8758378 100644 --- a/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp +++ b/Minecraft.Client/Rendering/Particles/ParticleEngine.cpp @@ -261,8 +261,8 @@ void ParticleEngine::moveParticleInList(std::shared_ptr particle, ? 0 : (particle->level->dimension->id == -1 ? 1 : 2); for (int tt = 0; tt < TEXTURE_COUNT; tt++) { - AUTO_VAR(it, find(particles[l][tt][source].begin(), - particles[l][tt][source].end(), particle)); + auto it = find(particles[l][tt][source].begin(), + particles[l][tt][source].end(), particle); if (it != particles[l][tt][source].end()) { (*it) = particles[l][tt][source].back(); particles[l][tt][source].pop_back(); diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp index 2dbc6e0e7..c5147b81b 100644 --- a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp @@ -23,10 +23,10 @@ namespace { bool ReadPortableBinaryFile(File& file, std::uint8_t*& data, unsigned int& size) { - const __int64 fileLength = file.length(); + const int64_t fileLength = file.length(); if (fileLength < 0 || fileLength > - static_cast<__int64>(std::numeric_limits::max())) { + static_cast(std::numeric_limits::max())) { data = nullptr; size = 0; return false; diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp b/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp index ccc4afffd..d6fd10592 100644 --- a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp +++ b/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp @@ -125,7 +125,7 @@ TexturePackRepository::getTexturePackIdNames() { std::vector >* packList = new std::vector >(); - for (AUTO_VAR(it, texturePacks->begin()); it != texturePacks->end(); ++it) { + for (auto it = texturePacks->begin(); it != texturePacks->end(); ++it) { TexturePack* pack = *it; packList->push_back(std::pair( pack->getId(), pack->getName())); @@ -142,7 +142,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) { // pack is installed app.SetRequiredTexturePackID(id); - AUTO_VAR(it, cacheById.find(id)); + auto it = cacheById.find(id); if (it != cacheById.end()) { TexturePack* newPack = it->second; if (newPack != selected) { @@ -177,7 +177,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) { } TexturePack* TexturePackRepository::getTexturePackById(std::uint32_t id) { - AUTO_VAR(it, cacheById.find(id)); + auto it = cacheById.find(id); if (it != cacheById.end()) { return it->second; } @@ -213,19 +213,19 @@ TexturePack* TexturePackRepository::addTexturePackFromDLC(DLCPack* dlcPack, } void TexturePackRepository::clearInvalidTexturePacks() { - for (AUTO_VAR(it, m_texturePacksToDelete.begin()); + for (auto it = m_texturePacksToDelete.begin(); it != m_texturePacksToDelete.end(); ++it) { delete *it; } } void TexturePackRepository::removeTexturePackById(std::uint32_t id) { - AUTO_VAR(it, cacheById.find(id)); + auto it = cacheById.find(id); if (it != cacheById.end()) { TexturePack* oldPack = it->second; - AUTO_VAR(it2, - find(texturePacks->begin(), texturePacks->end(), oldPack)); + auto it2 = + find(texturePacks->begin(), texturePacks->end(), oldPack); if (it2 != texturePacks->end()) { texturePacks->erase(it2); if (lastSelected == oldPack) { @@ -264,7 +264,7 @@ TexturePack* TexturePackRepository::getTexturePackByIndex(unsigned int index) { unsigned int TexturePackRepository::getTexturePackIndex(std::uint32_t id) { int currentIndex = 0; - for (AUTO_VAR(it, texturePacks->begin()); it != texturePacks->end(); ++it) { + for (auto it = texturePacks->begin(); it != texturePacks->end(); ++it) { TexturePack* pack = *it; if (pack->getId() == id) break; ++currentIndex; diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp index d2d72bfa4..efd0e9646 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp @@ -40,7 +40,7 @@ PreStitchedTextureMap::PreStitchedTextureMap(int type, const std::wstring& name, void PreStitchedTextureMap::stitch() { // Animated StitchedTextures store a vector of textures for each frame of // the animation. Free any pre-existing ones here. - for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end(); + for (auto it = animatedTextures.begin(); it != animatedTextures.end(); ++it) { StitchedTexture* animatedStitchedTexture = *it; animatedStitchedTexture->freeFrameTextures(); @@ -119,7 +119,7 @@ void PreStitchedTextureMap::stitch() { TextureManager::getInstance()->registerName(name, stitchResult); // stitchResult = stitcher->constructTexture(m_mipMap); - for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); + for (auto it = texturesByName.begin(); it != texturesByName.end(); ++it) { StitchedTexture* preStitched = (StitchedTexture*)it->second; @@ -132,7 +132,7 @@ void PreStitchedTextureMap::stitch() { } MemSect(52); - for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); + for (auto it = texturesByName.begin(); it != texturesByName.end(); ++it) { StitchedTexture* preStitched = (StitchedTexture*)(it->second); @@ -204,7 +204,7 @@ StitchedTexture* PreStitchedTextureMap::getTexture(const std::wstring& name) { void PreStitchedTextureMap::cycleAnimationFrames() { // for (StitchedTexture texture : animatedTextures) - for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end(); + for (auto it = animatedTextures.begin(); it != animatedTextures.end(); ++it) { StitchedTexture* texture = *it; texture->cycleFrames(); @@ -225,7 +225,7 @@ Icon* PreStitchedTextureMap::registerIcon(const std::wstring& name) { // new RuntimeException("Don't register null!").printStackTrace(); } - AUTO_VAR(it, texturesByName.find(name)); + auto it = texturesByName.find(name); if (it != texturesByName.end()) result = it->second; if (result == nullptr) { @@ -265,7 +265,7 @@ void PreStitchedTextureMap::loadUVs() { return; } - for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); + for (auto it = texturesByName.begin(); it != texturesByName.end(); ++it) { delete it->second; } diff --git a/Minecraft.Client/Textures/Stitching/StitchSlot.cpp b/Minecraft.Client/Textures/Stitching/StitchSlot.cpp index c886c6db2..b52980e17 100644 --- a/Minecraft.Client/Textures/Stitching/StitchSlot.cpp +++ b/Minecraft.Client/Textures/Stitching/StitchSlot.cpp @@ -109,7 +109,7 @@ bool StitchSlot::add(TextureHolder* textureHolder) { } // for (final StitchSlot subSlot : subSlots) - for (AUTO_VAR(it, subSlots->begin()); it != subSlots->end(); ++it) { + for (auto it = subSlots->begin(); it != subSlots->end(); ++it) { StitchSlot* subSlot = *it; if (subSlot->add(textureHolder)) { return true; @@ -124,7 +124,7 @@ void StitchSlot::collectAssignments(std::vector* result) { result->push_back(this); } else if (subSlots != nullptr) { // for (StitchSlot subSlot : subSlots) - for (AUTO_VAR(it, subSlots->begin()); it != subSlots->end(); ++it) { + for (auto it = subSlots->begin(); it != subSlots->end(); ++it) { StitchSlot* subSlot = *it; subSlot->collectAssignments(result); } diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp b/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp index aa1e5e40d..a91cc8c71 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp +++ b/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp @@ -43,7 +43,7 @@ StitchedTexture::StitchedTexture(const std::wstring& name, void StitchedTexture::freeFrameTextures() { if (frames != nullptr) { - for (AUTO_VAR(it, frames->begin()); it != frames->end(); ++it) { + for (auto it = frames->begin(); it != frames->end(); ++it) { TextureManager::getInstance()->unregisterTexture(L"", *it); delete *it; } @@ -54,7 +54,7 @@ void StitchedTexture::freeFrameTextures() { StitchedTexture::~StitchedTexture() { if (frames != nullptr) { - for (AUTO_VAR(it, frames->begin()); it != frames->end(); ++it) { + for (auto it = frames->begin(); it != frames->end(); ++it) { delete *it; } delete frames; @@ -218,7 +218,7 @@ void StitchedTexture::loadAnimationFrames(BufferedReader* bufferedReader) { if (line.length() > 0) { std::vector tokens = stringSplit(line, L','); // for (String token : tokens) - for (AUTO_VAR(it, tokens.begin()); it != tokens.end(); ++it) { + for (auto it = tokens.begin(); it != tokens.end(); ++it) { std::wstring token = *it; int multiPos = token.find_first_of('*'); if (multiPos > 0) { @@ -258,7 +258,7 @@ void StitchedTexture::loadAnimationFrames(const std::wstring& string) { std::vector tokens = stringSplit(trimString(string), L','); // for (String token : tokens) - for (AUTO_VAR(it, tokens.begin()); it != tokens.end(); ++it) { + for (auto it = tokens.begin(); it != tokens.end(); ++it) { std::wstring token = trimString(*it); int multiPos = token.find_first_of('*'); if (multiPos > 0) { diff --git a/Minecraft.Client/Textures/Stitching/Stitcher.cpp b/Minecraft.Client/Textures/Stitching/Stitcher.cpp index 0ffed99a6..611cd37dd 100644 --- a/Minecraft.Client/Textures/Stitching/Stitcher.cpp +++ b/Minecraft.Client/Textures/Stitching/Stitcher.cpp @@ -73,7 +73,7 @@ void Stitcher::stitch() { stitchedTexture = nullptr; // for (int i = 0; i < textureHolders.length; i++) - for (AUTO_VAR(it, texturesToBeStitched.begin()); + for (auto it = texturesToBeStitched.begin(); it != texturesToBeStitched.end(); ++it) { TextureHolder* textureHolder = *it; // textureHolders[i]; @@ -91,7 +91,7 @@ std::vector* Stitcher::gatherAreas() { std::vector* result = new std::vector(); // for (StitchSlot slot : storage) - for (AUTO_VAR(it, storage.begin()); it != storage.end(); ++it) { + for (auto it = storage.begin(); it != storage.end(); ++it) { StitchSlot* slot = *it; slot->collectAssignments(result); } diff --git a/Minecraft.Client/Textures/Stitching/TextureMap.cpp b/Minecraft.Client/Textures/Stitching/TextureMap.cpp index cc8637e27..08829e3e5 100644 --- a/Minecraft.Client/Textures/Stitching/TextureMap.cpp +++ b/Minecraft.Client/Textures/Stitching/TextureMap.cpp @@ -59,7 +59,7 @@ void TextureMap::stitch() { Stitcher* stitcher = TextureManager::getInstance()->createStitcher(name); - for (AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); + for (auto it = texturesByName.begin(); it != texturesByName.end(); ++it) { delete it->second; } @@ -83,7 +83,7 @@ void TextureMap::stitch() { // Extract frames from textures and add them to the stitchers // for (final String name : texturesToRegister.keySet()) - for (AUTO_VAR(it, texturesToRegister.begin()); + for (auto it = texturesToRegister.begin(); it != texturesToRegister.end(); ++it) { std::wstring name = it->first; @@ -120,9 +120,9 @@ void TextureMap::stitch() { stitchResult = stitcher->constructTexture(m_mipMap); // Extract all the final positions and store them - AUTO_VAR(areas, stitcher->gatherAreas()); + auto areas = stitcher->gatherAreas(); // for (StitchSlot slot : stitcher.gatherAreas()) - for (AUTO_VAR(it, areas->begin()); it != areas->end(); ++it) { + for (auto it = areas->begin(); it != areas->end(); ++it) { StitchSlot* slot = *it; TextureHolder* textureHolder = slot->getHolder(); @@ -133,7 +133,7 @@ void TextureMap::stitch() { StitchedTexture* stored = nullptr; - AUTO_VAR(itTex, texturesToRegister.find(textureName)); + auto itTex = texturesToRegister.find(textureName); if (itTex != texturesToRegister.end()) stored = itTex->second; // [EB]: What is this code for? debug warnings for when during @@ -194,7 +194,7 @@ void TextureMap::stitch() { missingPosition = texturesByName.find(NAME_MISSING_TEXTURE)->second; // for (StitchedTexture texture : texturesToRegister.values()) - for (AUTO_VAR(it, texturesToRegister.begin()); + for (auto it = texturesToRegister.begin(); it != texturesToRegister.end(); ++it) { StitchedTexture* texture = it->second; texture->replaceWith(missingPosition); @@ -212,7 +212,7 @@ StitchedTexture* TextureMap::getTexture(const std::wstring& name) { void TextureMap::cycleAnimationFrames() { // for (StitchedTexture texture : animatedTextures) - for (AUTO_VAR(it, animatedTextures.begin()); it != animatedTextures.end(); + for (auto it = animatedTextures.begin(); it != animatedTextures.end(); ++it) { StitchedTexture* texture = *it; texture->cycleFrames(); @@ -233,7 +233,7 @@ Icon* TextureMap::registerIcon(const std::wstring& name) { // TODO: [EB]: Why do we allow multiple registrations? StitchedTexture* result = nullptr; - AUTO_VAR(it, texturesToRegister.find(name)); + auto it = texturesToRegister.find(name); if (it != texturesToRegister.end()) result = it->second; if (result == nullptr) { diff --git a/Minecraft.Client/Textures/TextureManager.cpp b/Minecraft.Client/Textures/TextureManager.cpp index 79849f81f..355e53dc8 100644 --- a/Minecraft.Client/Textures/TextureManager.cpp +++ b/Minecraft.Client/Textures/TextureManager.cpp @@ -36,7 +36,7 @@ void TextureManager::registerName(const std::wstring& name, Texture* texture) { } void TextureManager::registerTexture(Texture* texture) { - for (AUTO_VAR(it, idToTextureMap.begin()); it != idToTextureMap.end(); + for (auto it = idToTextureMap.begin(); it != idToTextureMap.end(); ++it) { if (it->second == texture) { // Minecraft.getInstance().getLogger().warning("TextureManager.registerTexture @@ -55,10 +55,10 @@ void TextureManager::registerTexture(Texture* texture) { void TextureManager::unregisterTexture(const std::wstring& name, Texture* texture) { - AUTO_VAR(it, idToTextureMap.find(texture->getManagerId())); + auto it = idToTextureMap.find(texture->getManagerId()); if (it != idToTextureMap.end()) idToTextureMap.erase(it); - AUTO_VAR(it2, stringToIDMap.find(name)); + auto it2 = stringToIDMap.find(name); if (it2 != stringToIDMap.end()) stringToIDMap.erase(it2); } diff --git a/Minecraft.Client/Textures/Textures.cpp b/Minecraft.Client/Textures/Textures.cpp index 8c3ac36d2..7a5cacecf 100644 --- a/Minecraft.Client/Textures/Textures.cpp +++ b/Minecraft.Client/Textures/Textures.cpp @@ -993,7 +993,7 @@ void Textures::removeHttpTexture(const std::wstring& url) { int Textures::loadMemTexture(const std::wstring& url, const std::wstring& backup) { MemTexture* texture = nullptr; - AUTO_VAR(it, memTextures.find(url)); + auto it = memTextures.find(url); if (it != memTextures.end()) { texture = (*it).second; } @@ -1030,7 +1030,7 @@ int Textures::loadMemTexture(const std::wstring& url, int Textures::loadMemTexture(const std::wstring& url, int backup) { MemTexture* texture = nullptr; - AUTO_VAR(it, memTextures.find(url)); + auto it = memTextures.find(url); if (it != memTextures.end()) { texture = (*it).second; } @@ -1067,7 +1067,7 @@ int Textures::loadMemTexture(const std::wstring& url, int backup) { MemTexture* Textures::addMemTexture(const std::wstring& name, MemTextureProcessor* processor) { MemTexture* texture = nullptr; - AUTO_VAR(it, memTextures.find(name)); + auto it = memTextures.find(name); if (it != memTextures.end()) { texture = (*it).second; } @@ -1107,7 +1107,7 @@ MemTexture* Textures::addMemTexture(const std::wstring& name, void Textures::removeMemTexture(const std::wstring& url) { MemTexture* texture = nullptr; - AUTO_VAR(it, memTextures.find(url)); + auto it = memTextures.find(url); if (it != memTextures.end()) { texture = (*it).second; @@ -1153,7 +1153,7 @@ void Textures::tick( // 4J - go over all the memory textures once per frame, and free any that // haven't been used for a while. Ones that are being used will have their // ticksSinceLastUse reset in Textures::loadMemTexture. - for (AUTO_VAR(it, memTextures.begin()); it != memTextures.end();) { + for (auto it = memTextures.begin(); it != memTextures.end();) { MemTexture* tex = it->second; if (tex && diff --git a/Minecraft.Client/UI/Font.cpp b/Minecraft.Client/UI/Font.cpp index dbb70d87f..9971cec29 100644 --- a/Minecraft.Client/UI/Font.cpp +++ b/Minecraft.Client/UI/Font.cpp @@ -321,8 +321,8 @@ void Font::drawWordWrapInternal(const std::wstring& string, int x, int y, int w, int col, bool darken, int h) { std::vector lines = stringSplit(string, L'\n'); if (lines.size() > 1) { - AUTO_VAR(itEnd, lines.end()); - for (AUTO_VAR(it, lines.begin()); it != itEnd; it++) { + auto itEnd = lines.end(); + for (auto it = lines.begin(); it != itEnd; it++) { // 4J Stu - Don't draw text that will be partially cutoff/overlap // something it shouldn't if ((y + this->wordWrapHeight(*it, w)) > h) break; @@ -366,8 +366,8 @@ int Font::wordWrapHeight(const std::wstring& string, int w) { std::vector lines = stringSplit(string, L'\n'); if (lines.size() > 1) { int h = 0; - AUTO_VAR(itEnd, lines.end()); - for (AUTO_VAR(it, lines.begin()); it != itEnd; it++) { + auto itEnd = lines.end(); + for (auto it = lines.begin(); it != itEnd; it++) { h += this->wordWrapHeight(*it, w); } return h; diff --git a/Minecraft.Client/UI/Gui.cpp b/Minecraft.Client/UI/Gui.cpp index 48828f0ad..9cbd4f13d 100644 --- a/Minecraft.Client/UI/Gui.cpp +++ b/Minecraft.Client/UI/Gui.cpp @@ -933,7 +933,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { iSafezoneXHalf + 2, 20, 0xffffff); font->drawShadow( L"Seed: " + - _toString<__int64>(minecraft->level->getLevelData()->getSeed()), + _toString(minecraft->level->getLevelData()->getSeed()), iSafezoneXHalf + 2, 32 + 00, 0xffffff); font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf + 2, 32 + 10, 0xffffff); @@ -1331,8 +1331,8 @@ void Gui::tick() { // viewing the Pause Menu. We don't show the guiMessages when a menu is // up, so don't fade them out if (!ui.GetMenuDisplayed(iPad)) { - AUTO_VAR(itEnd, guiMessages[iPad].end()); - for (AUTO_VAR(it, guiMessages[iPad].begin()); it != itEnd; it++) { + auto itEnd = guiMessages[iPad].end(); + for (auto it = guiMessages[iPad].begin(); it != itEnd; it++) { (*it).ticks++; } } @@ -1506,8 +1506,8 @@ void Gui::displayClientMessage(int messageId, int iPad) { } // 4J Added -void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, - float dataAScale, int dataAWarning, __int64* dataB, +void Gui::renderGraph(int dataLength, int dataPos, int64_t* dataA, + float dataAScale, int dataAWarning, int64_t* dataB, float dataBScale, int dataBWarning) { int height = minecraft->height; // This causes us to cover xScale*dataLength pixels in the horizontal @@ -1541,7 +1541,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, t->color(0xff000000 + cc * 256); } - __int64 aVal = dataA[i] / dataAScale; + int64_t aVal = dataA[i] / dataAScale; t->vertex((float)(xScale * i + 0.5f), (float)(height - aVal + 0.5f), (float)(0)); @@ -1556,7 +1556,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, t->color(0xff808080 + cc / 2 * 256); } - __int64 bVal = dataB[i] / dataBScale; + int64_t bVal = dataB[i] / dataBScale; t->vertex((float)(xScale * i + (xScale - 1) + 0.5f), (float)(height - bVal + 0.5f), (float)(0)); @@ -1570,7 +1570,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64* dataA, } void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, - __int64 (*func)(unsigned int dataPos, + int64_t (*func)(unsigned int dataPos, unsigned int dataSource)) { int height = minecraft->height; @@ -1587,8 +1587,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, Tesselator* t = Tesselator::getInstance(); t->begin(GL_LINES); - __int64 thisVal = 0; - __int64 topVal = 0; + int64_t thisVal = 0; + int64_t topVal = 0; for (int i = 0; i < dataLength; i++) { thisVal = 0; topVal = 0; diff --git a/Minecraft.Client/UI/Gui.h b/Minecraft.Client/UI/Gui.h index 4077c9c40..1fb274e00 100644 --- a/Minecraft.Client/UI/Gui.h +++ b/Minecraft.Client/UI/Gui.h @@ -78,10 +78,10 @@ public: float getJukeboxOpacity(int iPad); // 4J Added - void renderGraph(int dataLength, int dataPos, __int64* dataA, - float dataAScale, int dataAWarning, __int64* dataB, + void renderGraph(int dataLength, int dataPos, int64_t* dataA, + float dataAScale, int dataAWarning, int64_t* dataB, float dataBScale, int dataBWarning); void renderStackedGraph(int dataPos, int dataLength, int dataSources, - __int64 (*func)(unsigned int dataPos, + int64_t (*func)(unsigned int dataPos, unsigned int dataSource)); }; diff --git a/Minecraft.Client/UI/Screen.cpp b/Minecraft.Client/UI/Screen.cpp index 5dd11484c..c6060629f 100644 --- a/Minecraft.Client/UI/Screen.cpp +++ b/Minecraft.Client/UI/Screen.cpp @@ -18,8 +18,8 @@ Screen::Screen() // 4J added } void Screen::render(int xm, int ym, float a) { - AUTO_VAR(itEnd, buttons.end()); - for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) { + auto itEnd = buttons.end(); + for (auto it = buttons.begin(); it != itEnd; it++) { Button* button = *it; // buttons[i]; button->render(minecraft, xm, ym); } @@ -49,8 +49,8 @@ void Screen::setClipboard(const std::wstring& str) { void Screen::mouseClicked(int x, int y, int buttonNum) { if (buttonNum == 0) { - AUTO_VAR(itEnd, buttons.end()); - for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) { + auto itEnd = buttons.end(); + for (auto it = buttons.begin(); it != itEnd; it++) { Button* button = *it; // buttons[i]; if (button->clicked(minecraft, x, y)) { clickedButton = button; diff --git a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp b/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp index 379638ae4..6222807b9 100644 --- a/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp +++ b/Minecraft.Client/UI/Screens/AbstractContainerScreen.cpp @@ -49,8 +49,8 @@ void AbstractContainerScreen::render(int xm, int ym, float a) { Slot* hoveredSlot = nullptr; - AUTO_VAR(itEnd, menu->slots.end()); - for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) { + auto itEnd = menu->slots.end(); + for (auto it = menu->slots.begin(); it != itEnd; it++) { Slot* slot = *it; // menu->slots.at(i); renderSlot(slot); @@ -300,8 +300,8 @@ void AbstractContainerScreen::renderSlot(Slot* slot) { } Slot* AbstractContainerScreen::findSlot(int x, int y) { - AUTO_VAR(itEnd, menu->slots.end()); - for (AUTO_VAR(it, menu->slots.begin()); it != itEnd; it++) { + auto itEnd = menu->slots.end(); + for (auto it = menu->slots.begin(); it != itEnd; it++) { Slot* slot = *it; // menu->slots.at(i); if (isHovering(slot, x, y)) return slot; } diff --git a/Minecraft.Client/UI/Screens/AchievementPopup.h b/Minecraft.Client/UI/Screens/AchievementPopup.h index 087903232..f47c47d73 100644 --- a/Minecraft.Client/UI/Screens/AchievementPopup.h +++ b/Minecraft.Client/UI/Screens/AchievementPopup.h @@ -11,7 +11,7 @@ private: std::wstring title; std::wstring desc; Achievement* ach; - __int64 startTime; + int64_t startTime; ItemRenderer* ir; bool isHelper; diff --git a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp b/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp index 8c77d0af5..a149f3723 100644 --- a/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/CreateWorldScreen.cpp @@ -195,13 +195,13 @@ void CreateWorldScreen::buttonClicked(Button* button) { std::wstring seedString = seedEdit->getValue(); - __int64 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData* param = new NetworkGameInitData(); if (seedString.length() != 0) { // try to convert it to a long first // try { // 4J - removed try/catch - __int64 value = _fromString<__int64>(seedString); + int64_t value = _fromString(seedString); bool isNumber = true; for (unsigned int i = 0; i < seedString.length(); ++i) { @@ -213,7 +213,7 @@ void CreateWorldScreen::buttonClicked(Button* button) { } } - if (isNumber) value = _fromString<__int64>(seedString); + if (isNumber) value = _fromString(seedString); if (value != 0) { seedValue = value; diff --git a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp index 0eee5b9ab..d5a682883 100644 --- a/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp +++ b/Minecraft.Client/UI/Screens/SelectWorldScreen.cpp @@ -273,7 +273,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, time.wYear, time.wHour, time.wMinute); // 4J - TODO Localise this id = id + L" (" + buffer; - __int64 size = levelSummary->getSizeOnDisk(); + int64_t size = levelSummary->getSizeOnDisk(); id = id + L", " + _toString(size / 1024 * 100 / 1024 / 100.0f) + L" MB)"; std::wstring info; diff --git a/Minecraft.Client/UI/ScrolledSelectionList.h b/Minecraft.Client/UI/ScrolledSelectionList.h index de1395695..a803b35f4 100644 --- a/Minecraft.Client/UI/ScrolledSelectionList.h +++ b/Minecraft.Client/UI/ScrolledSelectionList.h @@ -31,7 +31,7 @@ private: float yo; int lastSelection; - __int64 lastSelectionTime; + int64_t lastSelectionTime; bool renderSelection; bool _renderHeader; diff --git a/Minecraft.Client/Utils/ArchiveFile.cpp b/Minecraft.Client/Utils/ArchiveFile.cpp index e475886c3..16d952792 100644 --- a/Minecraft.Client/Utils/ArchiveFile.cpp +++ b/Minecraft.Client/Utils/ArchiveFile.cpp @@ -71,7 +71,7 @@ ArchiveFile::~ArchiveFile() { delete m_cachedData; } std::vector* ArchiveFile::getFileList() { std::vector* out = new std::vector(); - for (AUTO_VAR(it, m_index.begin()); it != m_index.end(); it++) + for (auto it = m_index.begin(); it != m_index.end(); it++) out->push_back(it->first); @@ -88,7 +88,7 @@ int ArchiveFile::getFileSize(const std::wstring& filename) { byteArray ArchiveFile::getFile(const std::wstring& filename) { byteArray out; - AUTO_VAR(it, m_index.find(filename)); + auto it = m_index.find(filename); if (it == m_index.end()) { app.DebugPrintf("Couldn't find file in archive\n"); diff --git a/Minecraft.Client/Utils/MemoryTracker.cpp b/Minecraft.Client/Utils/MemoryTracker.cpp index c9c39f8aa..918ab9338 100644 --- a/Minecraft.Client/Utils/MemoryTracker.cpp +++ b/Minecraft.Client/Utils/MemoryTracker.cpp @@ -20,7 +20,7 @@ int MemoryTracker::genTextures() { } void MemoryTracker::releaseLists(int id) { - AUTO_VAR(it, GL_LIST_IDS.find(id)); + auto it = GL_LIST_IDS.find(id); if (it != GL_LIST_IDS.end()) { glDeleteLists(id, it->second); GL_LIST_IDS.erase(it); @@ -36,7 +36,7 @@ void MemoryTracker::releaseTextures() { void MemoryTracker::release() { // for (Map.Entry entry : GL_LIST_IDS.entrySet()) - for (AUTO_VAR(it, GL_LIST_IDS.begin()); it != GL_LIST_IDS.end(); ++it) { + for (auto it = GL_LIST_IDS.begin(); it != GL_LIST_IDS.end(); ++it) { glDeleteLists(it->first, it->second); } GL_LIST_IDS.clear(); diff --git a/Minecraft.Client/Utils/StringTable.cpp b/Minecraft.Client/Utils/StringTable.cpp index 281a28b4e..63f5e2303 100644 --- a/Minecraft.Client/Utils/StringTable.cpp +++ b/Minecraft.Client/Utils/StringTable.cpp @@ -43,11 +43,11 @@ void StringTable::ProcessStringTableData(void) { int dataSize = 0; // - for (AUTO_VAR(it_locales, locales.begin()); + for (auto it_locales = locales.begin(); it_locales != locales.end() && (!foundLang); it_locales++) { bytesToSkip = 0; - for (AUTO_VAR(it, langSizeMap.begin()); it != langSizeMap.end(); ++it) { + for (auto it = langSizeMap.begin(); it != langSizeMap.end(); ++it) { if (it->first.compare(*it_locales) == 0) { app.DebugPrintf("StringTable:: Found language '%ls'.\n", it_locales->c_str()); @@ -135,7 +135,7 @@ const wchar_t* StringTable::getString(const std::wstring& id) { } #endif - AUTO_VAR(it, m_stringsMap.find(id)); + auto it = m_stringsMap.find(id); if (it != m_stringsMap.end()) { return it->second.c_str(); diff --git a/Minecraft.Client/Utils/Timer.cpp b/Minecraft.Client/Utils/Timer.cpp index 7a3851069..ef654c8ed 100644 --- a/Minecraft.Client/Utils/Timer.cpp +++ b/Minecraft.Client/Utils/Timer.cpp @@ -18,9 +18,9 @@ Timer::Timer(float ticksPerSecond) { } void Timer::advanceTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; if (passedMs > 1000) { @@ -30,7 +30,7 @@ void Timer::advanceTime() { } else { accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double)passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; @@ -76,9 +76,9 @@ void Timer::advanceTimeQuickly() { } void Timer::skipTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; if (passedMs > 1000) { @@ -88,7 +88,7 @@ void Timer::skipTime() { } else { accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double)passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; diff --git a/Minecraft.Client/Utils/Timer.h b/Minecraft.Client/Utils/Timer.h index c60ad51d3..0b958356e 100644 --- a/Minecraft.Client/Utils/Timer.h +++ b/Minecraft.Client/Utils/Timer.h @@ -17,9 +17,9 @@ public: float passedTime; private: - __int64 lastMs; - __int64 lastMsSysTime; - __int64 accumMs; + int64_t lastMs; + int64_t lastMsSysTime; + int64_t accumMs; double adjustTime; diff --git a/Minecraft.World/AI/Attributes/BaseAttributeMap.cpp b/Minecraft.World/AI/Attributes/BaseAttributeMap.cpp index b68534d29..c38b9f931 100644 --- a/Minecraft.World/AI/Attributes/BaseAttributeMap.cpp +++ b/Minecraft.World/AI/Attributes/BaseAttributeMap.cpp @@ -3,7 +3,7 @@ #include "BaseAttributeMap.h" BaseAttributeMap::~BaseAttributeMap() { - for (AUTO_VAR(it, attributesById.begin()); it != attributesById.end(); + for (auto it = attributesById.begin(); it != attributesById.end(); ++it) { delete it->second; } @@ -14,7 +14,7 @@ AttributeInstance* BaseAttributeMap::getInstance(Attribute* attribute) { } AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) { - AUTO_VAR(it, attributesById.find(id)); + auto it = attributesById.find(id); if (it != attributesById.end()) { return it->second; } else { @@ -23,7 +23,7 @@ AttributeInstance* BaseAttributeMap::getInstance(eATTRIBUTE_ID id) { } void BaseAttributeMap::getAttributes(std::vector& atts) { - for (AUTO_VAR(it, attributesById.begin()); it != attributesById.end(); + for (auto it = attributesById.begin(); it != attributesById.end(); ++it) { atts.push_back(it->second); } @@ -35,7 +35,7 @@ void BaseAttributeMap::onAttributeModified( void BaseAttributeMap::removeItemModifiers(std::shared_ptr item) { attrAttrModMap* modifiers = item->getAttributeModifiers(); - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { AttributeInstance* attribute = getInstance(it->first); AttributeModifier* modifier = it->second; @@ -52,7 +52,7 @@ void BaseAttributeMap::removeItemModifiers(std::shared_ptr item) { void BaseAttributeMap::addItemModifiers(std::shared_ptr item) { attrAttrModMap* modifiers = item->getAttributeModifiers(); - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { AttributeInstance* attribute = getInstance(it->first); AttributeModifier* modifier = it->second; diff --git a/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp b/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp index 6a26baa49..ef0688357 100644 --- a/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp +++ b/Minecraft.World/AI/Attributes/ModifiableAttributeInstance.cpp @@ -15,7 +15,7 @@ ModifiableAttributeInstance::ModifiableAttributeInstance( ModifiableAttributeInstance::~ModifiableAttributeInstance() { for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) { - for (AUTO_VAR(it, modifiers[i].begin()); it != modifiers[i].end(); + for (auto it = modifiers[i].begin(); it != modifiers[i].end(); ++it) { // Delete all modifiers delete *it; @@ -45,7 +45,7 @@ void ModifiableAttributeInstance::getModifiers( for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) { std::unordered_set* opModifiers = &modifiers[i]; - for (AUTO_VAR(it, opModifiers->begin()); it != opModifiers->end(); + for (auto it = opModifiers->begin(); it != opModifiers->end(); ++it) { result.insert(*it); } @@ -55,7 +55,7 @@ void ModifiableAttributeInstance::getModifiers( AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) { AttributeModifier* modifier = nullptr; - AUTO_VAR(it, modifierById.find(id)); + auto it = modifierById.find(id); if (it != modifierById.end()) { modifier = it->second; } @@ -65,7 +65,7 @@ AttributeModifier* ModifiableAttributeInstance::getModifier(eMODIFIER_ID id) { void ModifiableAttributeInstance::addModifiers( std::unordered_set* modifiers) { - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { addModifier(*it); } } @@ -94,7 +94,7 @@ void ModifiableAttributeInstance::setDirty() { void ModifiableAttributeInstance::removeModifier(AttributeModifier* modifier) { for (int i = 0; i < AttributeModifier::TOTAL_OPERATIONS; i++) { - for (AUTO_VAR(it, modifiers[i].begin()); it != modifiers[i].end(); + for (auto it = modifiers[i].begin(); it != modifiers[i].end(); ++it) { if (modifier->equals(*it)) { modifiers[i].erase(it); @@ -117,7 +117,7 @@ void ModifiableAttributeInstance::removeModifiers() { std::unordered_set removingModifiers; getModifiers(removingModifiers); - for (AUTO_VAR(it, removingModifiers.begin()); it != removingModifiers.end(); + for (auto it = removingModifiers.begin(); it != removingModifiers.end(); ++it) { removeModifier(*it); } @@ -137,7 +137,7 @@ double ModifiableAttributeInstance::calculateValue() { std::unordered_set* modifiers; modifiers = getModifiers(AttributeModifier::OPERATION_ADDITION); - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { AttributeModifier* modifier = *it; base += modifier->getAmount(); } @@ -145,13 +145,13 @@ double ModifiableAttributeInstance::calculateValue() { double result = base; modifiers = getModifiers(AttributeModifier::OPERATION_MULTIPLY_BASE); - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { AttributeModifier* modifier = *it; result += base * modifier->getAmount(); } modifiers = getModifiers(AttributeModifier::OPERATION_MULTIPLY_TOTAL); - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { AttributeModifier* modifier = *it; result *= 1 + modifier->getAmount(); } diff --git a/Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp b/Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp index 97a45e54b..a678ac6d7 100644 --- a/Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp +++ b/Minecraft.World/AI/Attributes/ServersideAttributeMap.cpp @@ -17,7 +17,7 @@ AttributeInstance* ServersideAttributeMap::getInstance(eATTRIBUTE_ID id) { // If we didn't find it, search by legacy name /*if (result == nullptr) { - AUTO_VAR(it, attributesByLegacy.find(name)); + auto it = attributesByLegacy.find(name); if(it != attributesByLegacy.end()) { result = it->second; @@ -29,7 +29,7 @@ AttributeInstance* ServersideAttributeMap::getInstance(eATTRIBUTE_ID id) { AttributeInstance* ServersideAttributeMap::registerAttribute( Attribute* attribute) { - AUTO_VAR(it, attributesById.find(attribute->getId())); + auto it = attributesById.find(attribute->getId()); if (it != attributesById.end()) { return it->second; } diff --git a/Minecraft.World/AI/Control/Sensing.cpp b/Minecraft.World/AI/Control/Sensing.cpp index 35963cb66..6802f15e6 100644 --- a/Minecraft.World/AI/Control/Sensing.cpp +++ b/Minecraft.World/AI/Control/Sensing.cpp @@ -13,10 +13,10 @@ bool Sensing::canSee(std::shared_ptr target) { // if ( find(seen.begin(), seen.end(), target) != seen.end() ) return true; // if ( find(unseen.begin(), unseen.end(), target) != unseen.end()) return // false; - for (AUTO_VAR(it, seen.begin()); it != seen.end(); ++it) { + for (auto it = seen.begin(); it != seen.end(); ++it) { if (target == (*it).lock()) return true; } - for (AUTO_VAR(it, unseen.begin()); it != unseen.end(); ++it) { + for (auto it = unseen.begin(); it != unseen.end(); ++it) { if (target == (*it).lock()) return false; } diff --git a/Minecraft.World/AI/Goals/BreedGoal.cpp b/Minecraft.World/AI/Goals/BreedGoal.cpp index d4ce15724..de4cbfa7b 100644 --- a/Minecraft.World/AI/Goals/BreedGoal.cpp +++ b/Minecraft.World/AI/Goals/BreedGoal.cpp @@ -53,7 +53,7 @@ std::shared_ptr BreedGoal::getFreePartner() { level->getEntitiesOfClass(typeid(*animal), &grown_bb); double dist = std::numeric_limits::max(); std::shared_ptr partner = nullptr; - for (AUTO_VAR(it, others->begin()); it != others->end(); ++it) { + for (auto it = others->begin(); it != others->end(); ++it) { std::shared_ptr p = std::dynamic_pointer_cast(*it); if (animal->canMate(p) && animal->distanceToSqr(p) < dist) { partner = p; diff --git a/Minecraft.World/AI/Goals/FollowParentGoal.cpp b/Minecraft.World/AI/Goals/FollowParentGoal.cpp index 5037a6da2..ae6ff0b70 100644 --- a/Minecraft.World/AI/Goals/FollowParentGoal.cpp +++ b/Minecraft.World/AI/Goals/FollowParentGoal.cpp @@ -22,7 +22,7 @@ bool FollowParentGoal::canUse() { std::shared_ptr closest = nullptr; double closestDistSqr = std::numeric_limits::max(); - for (AUTO_VAR(it, parents->begin()); it != parents->end(); ++it) { + for (auto it = parents->begin(); it != parents->end(); ++it) { std::shared_ptr parent = std::dynamic_pointer_cast(*it); if (parent->getAge() < 0) continue; double distSqr = animal->distanceToSqr(parent); diff --git a/Minecraft.World/AI/Goals/GoalSelector.cpp b/Minecraft.World/AI/Goals/GoalSelector.cpp index ac5141b38..22facd8fd 100644 --- a/Minecraft.World/AI/Goals/GoalSelector.cpp +++ b/Minecraft.World/AI/Goals/GoalSelector.cpp @@ -15,7 +15,7 @@ GoalSelector::GoalSelector() { } GoalSelector::~GoalSelector() { - for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { + for (auto it = goals.begin(); it != goals.end(); ++it) { if ((*it)->canDeletePointer) delete (*it)->goal; delete (*it); } @@ -29,12 +29,12 @@ void GoalSelector::addGoal( } void GoalSelector::removeGoal(Goal* toRemove) { - for (AUTO_VAR(it, goals.begin()); it != goals.end();) { + for (auto it = goals.begin(); it != goals.end();) { InternalGoal* ig = *it; Goal* goal = ig->goal; if (goal == toRemove) { - AUTO_VAR(it2, find(usingGoals.begin(), usingGoals.end(), ig)); + auto it2 = find(usingGoals.begin(), usingGoals.end(), ig); if (it2 != usingGoals.end()) { goal->stop(); usingGoals.erase(it2); @@ -54,10 +54,10 @@ void GoalSelector::tick() { if (tickCount++ % newGoalRate == 0) { // for (InternalGoal ig : goals) - for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { + for (auto it = goals.begin(); it != goals.end(); ++it) { InternalGoal* ig = *it; // bool isUsing = usingGoals.contains(ig); - AUTO_VAR(usingIt, find(usingGoals.begin(), usingGoals.end(), ig)); + auto usingIt = find(usingGoals.begin(), usingGoals.end(), ig); // if (isUsing) if (usingIt != usingGoals.end()) { @@ -75,7 +75,7 @@ void GoalSelector::tick() { usingGoals.push_back(ig); } } else { - for (AUTO_VAR(it, usingGoals.begin()); it != usingGoals.end();) { + for (auto it = usingGoals.begin(); it != usingGoals.end();) { InternalGoal* ig = *it; if (!ig->goal->canContinueToUse()) { ig->goal->stop(); @@ -89,14 +89,14 @@ void GoalSelector::tick() { // bool debug = false; // if (debug && toStart.size() > 0) System.out.println("Starting: "); // for (InternalGoal ig : toStart) - for (AUTO_VAR(it, toStart.begin()); it != toStart.end(); ++it) { + for (auto it = toStart.begin(); it != toStart.end(); ++it) { // if (debug) System.out.println(ig.goal.toString() + ", "); (*it)->goal->start(); } // if (debug && usingGoals.size() > 0) System.out.println("Running: "); // for (InternalGoal ig : usingGoals) - for (AUTO_VAR(it, usingGoals.begin()); it != usingGoals.end(); ++it) { + for (auto it = usingGoals.begin(); it != usingGoals.end(); ++it) { // if (debug) System.out.println(ig.goal.toString()); (*it)->goal->tick(); } @@ -112,11 +112,11 @@ bool GoalSelector::canContinueToUse(InternalGoal* ig) { bool GoalSelector::canUseInSystem(GoalSelector::InternalGoal* goal) { // for (InternalGoal ig : goals) - for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { + for (auto it = goals.begin(); it != goals.end(); ++it) { InternalGoal* ig = *it; if (ig == goal) continue; - AUTO_VAR(usingIt, find(usingGoals.begin(), usingGoals.end(), ig)); + auto usingIt = find(usingGoals.begin(), usingGoals.end(), ig); if (goal->prio >= ig->prio) { if (usingIt != usingGoals.end() && !canCoExist(goal, ig)) @@ -139,7 +139,7 @@ void GoalSelector::setNewGoalRate(int newGoalRate) { } void GoalSelector::setLevel(Level* level) { - for (AUTO_VAR(it, goals.begin()); it != goals.end(); ++it) { + for (auto it = goals.begin(); it != goals.end(); ++it) { InternalGoal* ig = *it; ig->goal->setLevel(level); } diff --git a/Minecraft.World/AI/Goals/HurtByTargetGoal.cpp b/Minecraft.World/AI/Goals/HurtByTargetGoal.cpp index ad97f35cb..d83fc334e 100644 --- a/Minecraft.World/AI/Goals/HurtByTargetGoal.cpp +++ b/Minecraft.World/AI/Goals/HurtByTargetGoal.cpp @@ -26,7 +26,7 @@ void HurtByTargetGoal::start() { std::vector >* nearby = mob->level->getEntitiesOfClass( typeid(*mob), &mob_bb); - for (AUTO_VAR(it, nearby->begin()); it != nearby->end(); ++it) { + for (auto it = nearby->begin(); it != nearby->end(); ++it) { std::shared_ptr other = std::dynamic_pointer_cast(*it); if (this->mob->shared_from_this() == other) continue; diff --git a/Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp b/Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp index 0518d1c4c..7b4b56a14 100644 --- a/Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp +++ b/Minecraft.World/AI/Goals/MoveThroughVillageGoal.cpp @@ -91,7 +91,7 @@ std::shared_ptr MoveThroughVillageGoal::getNextDoorInfo( std::vector >* doorInfos = village->getDoorInfos(); // for (DoorInfo di : doorInfos) - for (AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it) { + for (auto it = doorInfos->begin(); it != doorInfos->end(); ++it) { std::shared_ptr di = *it; int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); @@ -106,7 +106,7 @@ std::shared_ptr MoveThroughVillageGoal::getNextDoorInfo( bool MoveThroughVillageGoal::hasVisited(std::shared_ptr di) { // for (DoorInfo di2 : visited) - for (AUTO_VAR(it, visited.begin()); it != visited.end();) { + for (auto it = visited.begin(); it != visited.end();) { std::shared_ptr di2 = (*it).lock(); if (di2 == nullptr) { it = visited.erase(it); diff --git a/Minecraft.World/AI/Goals/PlayGoal.cpp b/Minecraft.World/AI/Goals/PlayGoal.cpp index b5df3a524..95d97e835 100644 --- a/Minecraft.World/AI/Goals/PlayGoal.cpp +++ b/Minecraft.World/AI/Goals/PlayGoal.cpp @@ -28,7 +28,7 @@ bool PlayGoal::canUse() { mob->level->getEntitiesOfClass(typeid(Villager), &mob_bb); double closestDistSqr = std::numeric_limits::max(); // for (Entity c : children) - for (AUTO_VAR(it, children->begin()); it != children->end(); ++it) { + for (auto it = children->begin(); it != children->end(); ++it) { std::shared_ptr c = *it; if (c.get() == mob) continue; std::shared_ptr friendV = diff --git a/Minecraft.World/AI/Goals/TakeFlowerGoal.cpp b/Minecraft.World/AI/Goals/TakeFlowerGoal.cpp index d521b4c39..8d9b547aa 100644 --- a/Minecraft.World/AI/Goals/TakeFlowerGoal.cpp +++ b/Minecraft.World/AI/Goals/TakeFlowerGoal.cpp @@ -32,7 +32,7 @@ bool TakeFlowerGoal::canUse() { } // for (Entity e : golems) - for (AUTO_VAR(it, golems->begin()); it != golems->end(); ++it) { + for (auto it = golems->begin(); it != golems->end(); ++it) { std::shared_ptr vg = std::dynamic_pointer_cast(*it); if (vg->getOfferFlowerTick() > 0) { diff --git a/Minecraft.World/AI/Navigation/PathFinder.cpp b/Minecraft.World/AI/Navigation/PathFinder.cpp index b5727bc1d..84af25c56 100644 --- a/Minecraft.World/AI/Navigation/PathFinder.cpp +++ b/Minecraft.World/AI/Navigation/PathFinder.cpp @@ -26,8 +26,8 @@ PathFinder::~PathFinder() { // so just need to destroy their containers delete[] neighbors->data; delete neighbors; - AUTO_VAR(itEnd, nodes.end()); - for (AUTO_VAR(it, nodes.begin()); it != itEnd; it++) { + auto itEnd = nodes.end(); + for (auto it = nodes.begin(); it != itEnd; it++) { delete it->second; } } @@ -188,7 +188,7 @@ Node* PathFinder::getNode(Entity* entity, int x, int y, int z, Node* size, /*final*/ Node* PathFinder::getNode(int x, int y, int z) { int i = Node::createHash(x, y, z); Node* node; - AUTO_VAR(it, nodes.find(i)); + auto it = nodes.find(i); if (it == nodes.end()) { MemSect(54); node = new Node(x, y, z); diff --git a/Minecraft.World/Blocks/BaseRailTile.cpp b/Minecraft.World/Blocks/BaseRailTile.cpp index f5542a5e7..46f144fd3 100644 --- a/Minecraft.World/Blocks/BaseRailTile.cpp +++ b/Minecraft.World/Blocks/BaseRailTile.cpp @@ -117,8 +117,8 @@ BaseRailTile::Rail* BaseRailTile::Rail::getRail(TilePos* p) { bool BaseRailTile::Rail::connectsTo(Rail* rail) { if (m_bValidRail) { - AUTO_VAR(itEnd, connections.end()); - for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) { + auto itEnd = connections.end(); + for (auto it = connections.begin(); it != itEnd; it++) { TilePos* p = *it; // connections[i]; if (p->x == rail->x && p->z == rail->z) { return true; @@ -130,8 +130,8 @@ bool BaseRailTile::Rail::connectsTo(Rail* rail) { bool BaseRailTile::Rail::hasConnection(int x, int y, int z) { if (m_bValidRail) { - AUTO_VAR(itEnd, connections.end()); - for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) { + auto itEnd = connections.end(); + for (auto it = connections.begin(); it != itEnd; it++) { TilePos* p = *it; // connections[i]; if (p->x == x && p->z == z) { return true; @@ -278,8 +278,8 @@ void BaseRailTile::Rail::place(bool hasSignal, bool first) { if (first || level->getData(x, y, z) != data) { level->setData(x, y, z, data, Tile::UPDATE_ALL); - AUTO_VAR(itEnd, connections.end()); - for (AUTO_VAR(it, connections.begin()); it != itEnd; it++) { + auto itEnd = connections.end(); + for (auto it = connections.begin(); it != itEnd; it++) { Rail* neighbor = getRail(*it); if (neighbor == nullptr) continue; neighbor->removeSoftConnections(); diff --git a/Minecraft.World/Blocks/BedTile.cpp b/Minecraft.World/Blocks/BedTile.cpp index 1dc8fe393..186b4b02b 100644 --- a/Minecraft.World/Blocks/BedTile.cpp +++ b/Minecraft.World/Blocks/BedTile.cpp @@ -97,8 +97,8 @@ bool BedTile::use(Level* level, int x, int y, int z, if (isOccupied(data)) { std::shared_ptr sleepingPlayer = nullptr; - AUTO_VAR(itEnd, level->players.end()); - for (AUTO_VAR(it, level->players.begin()); it != itEnd; it++) { + auto itEnd = level->players.end(); + for (auto it = level->players.begin(); it != itEnd; it++) { std::shared_ptr p = *it; if (p->isSleeping()) { Pos pos = p->bedPosition; diff --git a/Minecraft.World/Blocks/ChestTile.cpp b/Minecraft.World/Blocks/ChestTile.cpp index fb87fb809..aaf41500f 100644 --- a/Minecraft.World/Blocks/ChestTile.cpp +++ b/Minecraft.World/Blocks/ChestTile.cpp @@ -348,7 +348,7 @@ bool ChestTile::isCatSittingOnChest(Level* level, int x, int y, int z) { AABB ocelot_aabb(x, y + 1, z, x + 1, y + 2, z + 1); std::vector >* entities = level->getEntitiesOfClass(typeid(Ocelot), &ocelot_aabb); - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { std::shared_ptr ocelot = std::dynamic_pointer_cast(*it); if (ocelot->isSitting()) { delete entities; diff --git a/Minecraft.World/Blocks/FallingTile.cpp b/Minecraft.World/Blocks/FallingTile.cpp index df4028903..b8ff427bf 100644 --- a/Minecraft.World/Blocks/FallingTile.cpp +++ b/Minecraft.World/Blocks/FallingTile.cpp @@ -122,7 +122,7 @@ void FallingTile::tick() { CompoundTag* swap = new CompoundTag(); tileEntity->save(swap); std::vector* allTags = tileData->getAllTags(); - for (AUTO_VAR(it, allTags->begin()); + for (auto it = allTags->begin(); it != allTags->end(); ++it) { Tag* tag = *it; if (tag->getName().compare(L"x") == 0 || @@ -173,7 +173,7 @@ void FallingTile::causeFallDamage(float distance) { ? DamageSource::anvil : DamageSource::fallingBlock; // for (Entity entity : entities) - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { (*it)->hurt(source, std::min(Mth::floor(dmg * fallDamageAmount), fallDamageMax)); } diff --git a/Minecraft.World/Blocks/MobSpawner.cpp b/Minecraft.World/Blocks/MobSpawner.cpp index 5fdcfde01..63f8de2c0 100644 --- a/Minecraft.World/Blocks/MobSpawner.cpp +++ b/Minecraft.World/Blocks/MobSpawner.cpp @@ -133,8 +133,8 @@ const int MobSpawner::tick(ServerLevel* level, bool spawnEnemies, continue; } - AUTO_VAR(itEndCTP, chunksToPoll.end()); - for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCTP; it++) { + auto itEndCTP = chunksToPoll.end(); + for (auto it = chunksToPoll.begin(); it != itEndCTP; it++) { if (it->second) { // don't add mobs to edge chunks, to prevent adding mobs // "outside" of the active playground diff --git a/Minecraft.World/Blocks/NotGateTile.cpp b/Minecraft.World/Blocks/NotGateTile.cpp index 45395fce1..efaaec30a 100644 --- a/Minecraft.World/Blocks/NotGateTile.cpp +++ b/Minecraft.World/Blocks/NotGateTile.cpp @@ -30,8 +30,8 @@ bool NotGateTile::isToggledTooFrequently(Level* level, int x, int y, int z, recentToggles[level]->push_back(Toggle(x, y, z, level->getGameTime())); int count = 0; - AUTO_VAR(itEnd, recentToggles[level]->end()); - for (AUTO_VAR(it, recentToggles[level]->begin()); it != itEnd; it++) { + auto itEnd = recentToggles[level]->end(); + for (auto it = recentToggles[level]->begin(); it != itEnd; it++) { if (it->x == x && it->y == y && it->z == z) { count++; if (count >= MAX_RECENT_TOGGLES) { @@ -207,7 +207,7 @@ void NotGateTile::levelTimeChanged(Level* level, int64_t delta, std::deque* toggles = recentToggles[level]; if (toggles != nullptr) { - for (AUTO_VAR(it, toggles->begin()); it != toggles->end(); ++it) { + for (auto it = toggles->begin(); it != toggles->end(); ++it) { (*it).when += delta; } } diff --git a/Minecraft.World/Blocks/PressurePlateTile.cpp b/Minecraft.World/Blocks/PressurePlateTile.cpp index 4aac68a96..c05ef5870 100644 --- a/Minecraft.World/Blocks/PressurePlateTile.cpp +++ b/Minecraft.World/Blocks/PressurePlateTile.cpp @@ -36,7 +36,7 @@ int PressurePlateTile::getSignalStrength(Level* level, int x, int y, int z) { // location. if (entities != nullptr && !entities->empty()) { - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { std::shared_ptr e = *it; if (!e->isIgnoringTileTriggers()) { if (sensitivity != everything) delete entities; diff --git a/Minecraft.World/Blocks/RedStoneDustTile.cpp b/Minecraft.World/Blocks/RedStoneDustTile.cpp index 3550b5edd..0301cb839 100644 --- a/Minecraft.World/Blocks/RedStoneDustTile.cpp +++ b/Minecraft.World/Blocks/RedStoneDustTile.cpp @@ -78,8 +78,8 @@ void RedStoneDustTile::updatePowerStrength(Level* level, int x, int y, int z) { std::vector(toUpdate.begin(), toUpdate.end()); toUpdate.clear(); - AUTO_VAR(itEnd, updates.end()); - for (AUTO_VAR(it, updates.begin()); it != itEnd; it++) { + auto itEnd = updates.end(); + for (auto it = updates.begin(); it != itEnd; it++) { TilePos tp = *it; level->updateNeighborsAt(tp.x, tp.y, tp.z, id); } diff --git a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp index 01b84798d..90ee61dd9 100644 --- a/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/BeaconTileEntity.cpp @@ -74,7 +74,7 @@ void BeaconTileEntity::applyEffects() { bb.y1 = level->getMaxBuildHeight(); std::vector >* players = level->getEntitiesOfClass(typeid(Player), &bb); - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); player->addEffect(new MobEffectInstance( @@ -84,7 +84,7 @@ void BeaconTileEntity::applyEffects() { if (levels >= 4 && primaryPower != secondaryPower && secondaryPower > 0) { - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); player->addEffect(new MobEffectInstance( diff --git a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp index 9bb649074..e8298ed52 100644 --- a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp @@ -246,7 +246,7 @@ void ChestTileEntity::tick() { y + 1 + range, z + 1 + range); std::vector >* players = level->getEntitiesOfClass(typeid(Player), &player_aabb); - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { std::shared_ptr player = std::dynamic_pointer_cast(*it); diff --git a/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp index a442e1773..40d9fca8f 100644 --- a/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/PistonPieceTileEntity.cpp @@ -89,11 +89,11 @@ void PistonPieceEntity::moveCollidedEntities(float progress, float amount) { level->getEntities(nullptr, &*aabb); if (!entities->empty()) { std::vector > collisionHolder; - for (AUTO_VAR(it, entities->begin()); it != entities->end(); it++) { + for (auto it = entities->begin(); it != entities->end(); it++) { collisionHolder.push_back(*it); } - for (AUTO_VAR(it, collisionHolder.begin()); + for (auto it = collisionHolder.begin(); it != collisionHolder.end(); it++) { (*it)->move(amount * Facing::STEP_X[facing], amount * Facing::STEP_Y[facing], diff --git a/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp b/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp index 62491ef36..9768fc063 100644 --- a/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp +++ b/Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp @@ -205,7 +205,7 @@ int PotionBrewing::getColorValue(std::vector* effects) { float count = 0; // for (MobEffectInstance effect : effects){ - for (AUTO_VAR(it, effects->begin()); it != effects->end(); ++it) { + for (auto it = effects->begin(); it != effects->end(); ++it) { MobEffectInstance* effect = *it; int potionColor = colourTable->getColor( MobEffect::effects[effect->getId()]->getColor()); @@ -227,7 +227,7 @@ int PotionBrewing::getColorValue(std::vector* effects) { bool PotionBrewing::areAllEffectsAmbient( std::vector* effects) { - for (AUTO_VAR(it, effects->begin()); it != effects->end(); ++it) { + for (auto it = effects->begin(); it != effects->end(); ++it) { MobEffectInstance* effect = *it; if (!effect->isAmbient()) return false; } @@ -237,14 +237,14 @@ bool PotionBrewing::areAllEffectsAmbient( int PotionBrewing::getColorValue(int brew, bool includeDisabledEffects) { if (!includeDisabledEffects) { - AUTO_VAR(colIt, cachedColors.find(brew)); + auto colIt = cachedColors.find(brew); if (colIt != cachedColors.end()) { return colIt->second; // cachedColors.get(brew); } std::vector* effects = getEffects(brew, false); int color = getColorValue(effects); if (effects != nullptr) { - for (AUTO_VAR(it, effects->begin()); it != effects->end(); ++it) { + for (auto it = effects->begin(); it != effects->end(); ++it) { MobEffectInstance* effect = *it; delete effect; } @@ -528,7 +528,7 @@ std::vector* PotionBrewing::getEffects( continue; } // wstring durationString = potionEffectDuration.get(effect->getId()); - AUTO_VAR(effIt, potionEffectDuration.find(effect->getId())); + auto effIt = potionEffectDuration.find(effect->getId()); if (effIt == potionEffectDuration.end()) { continue; } @@ -538,7 +538,7 @@ std::vector* PotionBrewing::getEffects( durationString, 0, (int)durationString.length(), brew); if (duration > 0) { int amplifier = 0; - AUTO_VAR(ampIt, potionEffectAmplifier.find(effect->getId())); + auto ampIt = potionEffectAmplifier.find(effect->getId()); if (ampIt != potionEffectAmplifier.end()) { std::wstring amplifierString = ampIt->second; amplifier = parseEffectFormulaValue( diff --git a/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp index 5fa6218a3..dc9e0ebf4 100644 --- a/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/SignTileEntity.cpp @@ -34,7 +34,7 @@ SignTileEntity::SignTileEntity() : TileEntity() { SignTileEntity::~SignTileEntity() { // TODO ORBIS_STUBBED; // 4J-PB - we don't need to verify strings anymore - - // InputManager.CancelQueuedVerifyStrings(&SignTileEntity::StringVerifyCallback,(LPVOID)this); + // InputManager.CancelQueuedVerifyStrings(&SignTileEntity::StringVerifyCallback,(void*)this); } void SignTileEntity::save(CompoundTag* tag) { @@ -125,7 +125,7 @@ void SignTileEntity::setChanged() { // at this point, we can ask the online string verifier if our sign text is ok #if 0 m_bVerified=true; #else - if(!InputManager.VerifyStrings((WCHAR**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(LPVOID)this)) + if(!InputManager.VerifyStrings((WCHAR**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(void*)this)) { // Nothing to verify m_bVerified=true; diff --git a/Minecraft.World/Blocks/TileEntities/TileEntity.cpp b/Minecraft.World/Blocks/TileEntities/TileEntity.cpp index 61c314cb8..b3f134c50 100644 --- a/Minecraft.World/Blocks/TileEntities/TileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/TileEntity.cpp @@ -83,7 +83,7 @@ void TileEntity::load(CompoundTag* tag) { } void TileEntity::save(CompoundTag* tag) { - AUTO_VAR(it, classIdMap.find(this->GetType())); + auto it = classIdMap.find(this->GetType()); if (it == classIdMap.end()) { // TODO 4J Stu - Some sort of exception handling // throw new RuntimeException(this->getClass() + " is missing a mapping! @@ -103,7 +103,7 @@ std::shared_ptr TileEntity::loadStatic(CompoundTag* tag) { // try //{ - AUTO_VAR(it, idCreateMap.find(tag->getString(L"id"))); + auto it = idCreateMap.find(tag->getString(L"id")); if (it != idCreateMap.end()) entity = std::shared_ptr(it->second()); //} diff --git a/Minecraft.World/Blocks/TripWireTile.cpp b/Minecraft.World/Blocks/TripWireTile.cpp index d44bbd885..aae4aa76c 100644 --- a/Minecraft.World/Blocks/TripWireTile.cpp +++ b/Minecraft.World/Blocks/TripWireTile.cpp @@ -138,7 +138,7 @@ void TripWireTile::checkPressed(Level* level, int x, int y, int z) { std::vector >* entities = level->getEntities(nullptr, &offs_aabb); if (!entities->empty()) { - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { std::shared_ptr e = *it; if (!e->isIgnoringTileTriggers()) { shouldBePressed = true; diff --git a/Minecraft.World/Commands/CommandDispatcher.cpp b/Minecraft.World/Commands/CommandDispatcher.cpp index 7e8d60b0a..4c6f0b4cd 100644 --- a/Minecraft.World/Commands/CommandDispatcher.cpp +++ b/Minecraft.World/Commands/CommandDispatcher.cpp @@ -5,7 +5,7 @@ int CommandDispatcher::performCommand(std::shared_ptr sender, EGameCommand command, byteArray commandData) { - AUTO_VAR(it, commandsById.find(command)); + auto it = commandsById.find(command); if (it != commandsById.end()) { Command* command = it->second; diff --git a/Minecraft.World/Containers/AbstractContainerMenu.cpp b/Minecraft.World/Containers/AbstractContainerMenu.cpp index f26ddffd7..b40fef4e2 100644 --- a/Minecraft.World/Containers/AbstractContainerMenu.cpp +++ b/Minecraft.World/Containers/AbstractContainerMenu.cpp @@ -42,24 +42,24 @@ void AbstractContainerMenu::addSlotListener(ContainerListener* listener) { } void AbstractContainerMenu::removeSlotListener(ContainerListener* listener) { - AUTO_VAR(it, find(containerListeners.begin(), containerListeners.end(), - listener)); + auto it = find(containerListeners.begin(), containerListeners.end(), + listener); if (it != containerListeners.end()) containerListeners.erase(it); } std::vector >* AbstractContainerMenu::getItems() { std::vector >* items = new std::vector >(); - AUTO_VAR(itEnd, slots.end()); - for (AUTO_VAR(it, slots.begin()); it != itEnd; it++) { + auto itEnd = slots.end(); + for (auto it = slots.begin(); it != itEnd; it++) { items->push_back((*it)->getItem()); } return items; } void AbstractContainerMenu::sendData(int id, int value) { - AUTO_VAR(itEnd, containerListeners.end()); - for (AUTO_VAR(it, containerListeners.begin()); it != itEnd; it++) { + auto itEnd = containerListeners.end(); + for (auto it = containerListeners.begin(); it != itEnd; it++) { (*it)->setContainerData(this, id, value); } } @@ -79,8 +79,8 @@ void AbstractContainerMenu::broadcastChanges() { lastSlots[i] = expected; m_bNeedsRendered = true; - AUTO_VAR(itEnd, containerListeners.end()); - for (AUTO_VAR(it, containerListeners.begin()); it != itEnd; it++) { + auto itEnd = containerListeners.end(); + for (auto it = containerListeners.begin(); it != itEnd; it++) { (*it)->slotChanged(this, i, expected); } } @@ -111,8 +111,8 @@ bool AbstractContainerMenu::clickMenuButton(std::shared_ptr player, Slot* AbstractContainerMenu::getSlotFor(std::shared_ptr c, int index) { - AUTO_VAR(itEnd, slots.end()); - for (AUTO_VAR(it, slots.begin()); it != itEnd; it++) { + auto itEnd = slots.end(); + for (auto it = slots.begin(); it != itEnd; it++) { Slot* slot = *it; // slots->at(i); if (slot->isAt(c, index)) { return slot; @@ -174,7 +174,7 @@ std::shared_ptr AbstractContainerMenu::clicked( inventory->getCarried()->copy(); int remaining = inventory->getCarried()->count; - for (AUTO_VAR(it, quickcraftSlots.begin()); + for (auto it = quickcraftSlots.begin(); it != quickcraftSlots.end(); ++it) { Slot* slot = *it; if (slot != nullptr && @@ -520,7 +520,7 @@ bool AbstractContainerMenu::isSynched(std::shared_ptr player) { void AbstractContainerMenu::setSynched(std::shared_ptr player, bool synched) { if (synched) { - AUTO_VAR(it, unSynchedPlayers.find(player)); + auto it = unSynchedPlayers.find(player); if (it != unSynchedPlayers.end()) unSynchedPlayers.erase(it); } else { diff --git a/Minecraft.World/Containers/AnvilMenu.cpp b/Minecraft.World/Containers/AnvilMenu.cpp index 692148756..0ebaa8f99 100644 --- a/Minecraft.World/Containers/AnvilMenu.cpp +++ b/Minecraft.World/Containers/AnvilMenu.cpp @@ -135,11 +135,11 @@ void AnvilMenu::createResult() { std::unordered_map* additionalEnchantments = EnchantmentHelper::getEnchantments(addition); - for (AUTO_VAR(it, additionalEnchantments->begin()); + for (auto it = additionalEnchantments->begin(); it != additionalEnchantments->end(); ++it) { int id = it->first; Enchantment* enchantment = Enchantment::enchantments[id]; - AUTO_VAR(localIt, enchantments->find(id)); + auto localIt = enchantments->find(id); int current = localIt != enchantments->end() ? localIt->second : 0; int level = it->second; @@ -152,7 +152,7 @@ void AnvilMenu::createResult() { input->id == EnchantedBookItem::enchantedBook_Id) compatible = true; - for (AUTO_VAR(it2, enchantments->begin()); + for (auto it2 = enchantments->begin(); it2 != enchantments->end(); ++it2) { int other = it2->first; if (other != id && @@ -242,7 +242,7 @@ void AnvilMenu::createResult() { } int count = 0; - for (AUTO_VAR(it, enchantments->begin()); it != enchantments->end(); + for (auto it = enchantments->begin(); it != enchantments->end(); ++it) { int id = it->first; Enchantment* enchantment = Enchantment::enchantments[id]; diff --git a/Minecraft.World/Containers/BrewingStandMenu.cpp b/Minecraft.World/Containers/BrewingStandMenu.cpp index e7013dd1e..9133fcfd8 100644 --- a/Minecraft.World/Containers/BrewingStandMenu.cpp +++ b/Minecraft.World/Containers/BrewingStandMenu.cpp @@ -44,7 +44,7 @@ void BrewingStandMenu::broadcastChanges() { AbstractContainerMenu::broadcastChanges(); // for (int i = 0; i < containerListeners->size(); i++) - for (AUTO_VAR(it, containerListeners.begin()); + for (auto it = containerListeners.begin(); it != containerListeners.end(); ++it) { ContainerListener* listener = *it; // containerListeners.at(i); if (tc != brewingStand->getBrewTime()) { diff --git a/Minecraft.World/Containers/FurnaceMenu.cpp b/Minecraft.World/Containers/FurnaceMenu.cpp index 5fa14df30..f6077079f 100644 --- a/Minecraft.World/Containers/FurnaceMenu.cpp +++ b/Minecraft.World/Containers/FurnaceMenu.cpp @@ -44,8 +44,8 @@ void FurnaceMenu::addSlotListener(ContainerListener* listener) { void FurnaceMenu::broadcastChanges() { AbstractContainerMenu::broadcastChanges(); - AUTO_VAR(itEnd, containerListeners.end()); - for (AUTO_VAR(it, containerListeners.begin()); it != itEnd; it++) { + auto itEnd = containerListeners.end(); + for (auto it = containerListeners.begin(); it != itEnd; it++) { ContainerListener* listener = *it; // containerListeners->at(i); if (tc != furnace->tickCount) { listener->setContainerData(this, 0, furnace->tickCount); diff --git a/Minecraft.World/Containers/MerchantRecipeList.cpp b/Minecraft.World/Containers/MerchantRecipeList.cpp index 9485b6dff..f1dc83185 100644 --- a/Minecraft.World/Containers/MerchantRecipeList.cpp +++ b/Minecraft.World/Containers/MerchantRecipeList.cpp @@ -7,7 +7,7 @@ MerchantRecipeList::MerchantRecipeList() {} MerchantRecipeList::MerchantRecipeList(CompoundTag* tag) { load(tag); } MerchantRecipeList::~MerchantRecipeList() { - for (AUTO_VAR(it, m_recipes.begin()); it != m_recipes.end(); ++it) { + for (auto it = m_recipes.begin(); it != m_recipes.end(); ++it) { delete (*it); } } diff --git a/Minecraft.World/Core/BehaviorRegistry.cpp b/Minecraft.World/Core/BehaviorRegistry.cpp index 1666a7053..0b9e965ab 100644 --- a/Minecraft.World/Core/BehaviorRegistry.cpp +++ b/Minecraft.World/Core/BehaviorRegistry.cpp @@ -7,7 +7,7 @@ BehaviorRegistry::BehaviorRegistry(DispenseItemBehavior* defaultValue) { } BehaviorRegistry::~BehaviorRegistry() { - for (AUTO_VAR(it, storage.begin()); it != storage.end(); ++it) { + for (auto it = storage.begin(); it != storage.end(); ++it) { delete it->second; } @@ -15,7 +15,7 @@ BehaviorRegistry::~BehaviorRegistry() { } DispenseItemBehavior* BehaviorRegistry::get(Item* key) { - AUTO_VAR(it, storage.find(key)); + auto it = storage.find(key); return (it == storage.end()) ? defaultBehavior : it->second; } diff --git a/Minecraft.World/Enchantments/EnchantmentHelper.cpp b/Minecraft.World/Enchantments/EnchantmentHelper.cpp index 88e6a3090..a573f7be5 100644 --- a/Minecraft.World/Enchantments/EnchantmentHelper.cpp +++ b/Minecraft.World/Enchantments/EnchantmentHelper.cpp @@ -60,7 +60,7 @@ void EnchantmentHelper::setEnchantments( ListTag* list = new ListTag(); // for (int id : enchantments.keySet()) - for (AUTO_VAR(it, enchantments->begin()); it != enchantments->end(); ++it) { + for (auto it = enchantments->begin(); it != enchantments->end(); ++it) { int id = it->first; CompoundTag* tag = new CompoundTag(); @@ -299,7 +299,7 @@ std::shared_ptr EnchantmentHelper::enchantItem( if (isBook) itemInstance->id = Item::enchantedBook_Id; if (newEnchantment != nullptr) { - for (AUTO_VAR(it, newEnchantment->begin()); it != newEnchantment->end(); + for (auto it = newEnchantment->begin(); it != newEnchantment->end(); ++it) { EnchantmentInstance* e = *it; if (isBook) { @@ -351,7 +351,7 @@ std::vector* EnchantmentHelper::selectEnchantment( getAvailableEnchantmentResults(realValue, itemInstance); if (availableEnchantments != nullptr && !availableEnchantments->empty()) { std::vector values; - for (AUTO_VAR(it, availableEnchantments->begin()); + for (auto it = availableEnchantments->begin(); it != availableEnchantments->end(); ++it) { values.push_back(it->second); } @@ -372,12 +372,12 @@ std::vector* EnchantmentHelper::selectEnchantment( // final Iterator mapIter = // availableEnchantments.keySet().iterator(); while // (mapIter.hasNext()) - for (AUTO_VAR(it, availableEnchantments->begin()); + for (auto it = availableEnchantments->begin(); it != availableEnchantments->end();) { int nextEnchantment = it->first; // mapIter.next(); bool valid = true; // for (EnchantmentInstance *current : results) - for (AUTO_VAR(resIt, results->begin()); + for (auto resIt = results->begin(); resIt != results->end(); ++resIt) { EnchantmentInstance* current = *resIt; if (!current->enchantment->isCompatibleWith( @@ -396,7 +396,7 @@ std::vector* EnchantmentHelper::selectEnchantment( } if (!availableEnchantments->empty()) { - for (AUTO_VAR(it, availableEnchantments->begin()); + for (auto it = availableEnchantments->begin(); it != availableEnchantments->end(); ++it) { values.push_back(it->second); } @@ -416,7 +416,7 @@ std::vector* EnchantmentHelper::selectEnchantment( } } if (availableEnchantments != nullptr) { - for (AUTO_VAR(it, availableEnchantments->begin()); + for (auto it = availableEnchantments->begin(); it != availableEnchantments->end(); ++it) { delete it->second; } @@ -453,7 +453,7 @@ EnchantmentHelper::getAvailableEnchantmentResults( results = new std::unordered_map(); } - AUTO_VAR(it, results->find(e->id)); + auto it = results->find(e->id); if (it != results->end()) { delete it->second; } diff --git a/Minecraft.World/Entities/Entity.cpp b/Minecraft.World/Entities/Entity.cpp index 6a34a9bdd..3da8a941a 100644 --- a/Minecraft.World/Entities/Entity.cpp +++ b/Minecraft.World/Entities/Entity.cpp @@ -721,7 +721,7 @@ void Entity::move(double xa, double ya, double za, level->getCubes(shared_from_this(), &expanded, noEntityCubes, true); // LAND FIRST, then x and z - AUTO_VAR(itEndAABB, aABBs->end()); + auto itEndAABB = aABBs->end(); // 4J Stu - Particles (and possibly other entities) don't have xChunk and // zChunk set, so calculate the chunk instead @@ -731,7 +731,7 @@ void Entity::move(double xa, double ya, double za, // 4J Stu - It's horrible that the client is doing any movement at all! // But if we don't have the chunk data then all the collision info will // be incorrect as well - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) ya = it->clipYCollide(bb, ya); bb = bb.move(0, ya, 0); } @@ -743,7 +743,7 @@ void Entity::move(double xa, double ya, double za, bool og = onGround || (yaOrg != ya && yaOrg < 0); itEndAABB = aABBs->end(); - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) xa = it->clipXCollide(bb, xa); bb = bb.move(xa, 0, 0); @@ -753,7 +753,7 @@ void Entity::move(double xa, double ya, double za, } itEndAABB = aABBs->end(); - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) za = it->clipZCollide(bb, za); bb = bb.move(0, 0, za); @@ -788,7 +788,7 @@ void Entity::move(double xa, double ya, double za, // 4J Stu - It's horrible that the client is doing any movement at // all! But if we don't have the chunk data then all the collision // info will be incorrect as well - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) ya = it->clipYCollide(bb, ya); bb = bb.move(0, ya, 0); } @@ -798,7 +798,7 @@ void Entity::move(double xa, double ya, double za, } itEndAABB = aABBs->end(); - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) xa = it->clipXCollide(bb, xa); bb = bb.move(xa, 0, 0); @@ -807,7 +807,7 @@ void Entity::move(double xa, double ya, double za, } itEndAABB = aABBs->end(); - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) za = it->clipZCollide(bb, za); bb = bb.move(0, 0, za); @@ -821,7 +821,7 @@ void Entity::move(double xa, double ya, double za, ya = -footSize; // LAND FIRST, then x and z itEndAABB = aABBs->end(); - for (AUTO_VAR(it, aABBs->begin()); it != itEndAABB; it++) + for (auto it = aABBs->begin(); it != itEndAABB; it++) ya = it->clipYCollide(bb, ya); bb = bb.move(0, ya, 0); } @@ -1524,8 +1524,8 @@ void Entity::lerpTo(double x, double y, double z, float yRot, float xRot, AABBList* collisions = level->getCubes(shared_from_this(), &shrunk); if (!collisions->empty()) { double yTop = 0; - AUTO_VAR(itEnd, collisions->end()); - for (AUTO_VAR(it, collisions->begin()); it != itEnd; it++) { + auto itEnd = collisions->end(); + for (auto it = collisions->begin(); it != itEnd; it++) { if (it->y1 > yTop) yTop = it->y1; } diff --git a/Minecraft.World/Entities/HangingEntity.cpp b/Minecraft.World/Entities/HangingEntity.cpp index 421f6ba26..2e4ed9359 100644 --- a/Minecraft.World/Entities/HangingEntity.cpp +++ b/Minecraft.World/Entities/HangingEntity.cpp @@ -131,8 +131,8 @@ bool HangingEntity::survives() { level->getEntities(shared_from_this(), &bb); if (entities != nullptr && entities->size() > 0) { - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = (*it); if (e->instanceof(eTYPE_HANGING_ENTITY)) { return false; diff --git a/Minecraft.World/Entities/ItemEntity.cpp b/Minecraft.World/Entities/ItemEntity.cpp index 9a03bca8d..0a04f5bfd 100644 --- a/Minecraft.World/Entities/ItemEntity.cpp +++ b/Minecraft.World/Entities/ItemEntity.cpp @@ -122,7 +122,7 @@ void ItemEntity::mergeWithNeighbours() { AABB grown = bb.grow(0.5, 0, 0.5); std::vector >* neighbours = level->getEntitiesOfClass(typeid(*this), &grown); - for (AUTO_VAR(it, neighbours->begin()); it != neighbours->end(); ++it) { + for (auto it = neighbours->begin(); it != neighbours->end(); ++it) { std::shared_ptr entity = std::dynamic_pointer_cast(*it); merge(entity); diff --git a/Minecraft.World/Entities/LeashFenceKnotEntity.cpp b/Minecraft.World/Entities/LeashFenceKnotEntity.cpp index fcb5c9f31..c5be63212 100644 --- a/Minecraft.World/Entities/LeashFenceKnotEntity.cpp +++ b/Minecraft.World/Entities/LeashFenceKnotEntity.cpp @@ -59,7 +59,7 @@ bool LeashFenceKnotEntity::interact(std::shared_ptr player) { std::vector >* mobs = level->getEntitiesOfClass(typeid(Mob), &mob_aabb); if (mobs != nullptr) { - for (AUTO_VAR(it, mobs->begin()); it != mobs->end(); ++it) { + for (auto it = mobs->begin(); it != mobs->end(); ++it) { std::shared_ptr mob = std::dynamic_pointer_cast(*it); if (mob->isLeashed() && mob->getLeashHolder() == player) { @@ -83,7 +83,7 @@ bool LeashFenceKnotEntity::interact(std::shared_ptr player) { std::vector >* mobs = level->getEntitiesOfClass(typeid(Mob), &mob_aabb); if (mobs != nullptr) { - for (AUTO_VAR(it, mobs->begin()); it != mobs->end(); ++it) { + for (auto it = mobs->begin(); it != mobs->end(); ++it) { std::shared_ptr mob = std::dynamic_pointer_cast(*it); if (mob->isLeashed() && @@ -125,7 +125,7 @@ std::shared_ptr LeashFenceKnotEntity::findKnotAt( std::vector >* knots = level->getEntitiesOfClass( typeid(LeashFenceKnotEntity), &leash_fence_knot_entity_aabb); if (knots != nullptr) { - for (AUTO_VAR(it, knots->begin()); it != knots->end(); ++it) { + for (auto it = knots->begin(); it != knots->end(); ++it) { std::shared_ptr knot = std::dynamic_pointer_cast(*it); if (knot->xTile == x && knot->yTile == y && knot->zTile == z) { diff --git a/Minecraft.World/Entities/LivingEntity.cpp b/Minecraft.World/Entities/LivingEntity.cpp index 16af9402c..4b03700cf 100644 --- a/Minecraft.World/Entities/LivingEntity.cpp +++ b/Minecraft.World/Entities/LivingEntity.cpp @@ -120,7 +120,7 @@ LivingEntity::LivingEntity(Level* level) : Entity(level) { } LivingEntity::~LivingEntity() { - for (AUTO_VAR(it, activeEffects.begin()); it != activeEffects.end(); ++it) { + for (auto it = activeEffects.begin(); it != activeEffects.end(); ++it) { delete it->second; } @@ -378,7 +378,7 @@ void LivingEntity::addAdditonalSaveData(CompoundTag* entityTag) { if (!activeEffects.empty()) { ListTag* listTag = new ListTag(); - for (AUTO_VAR(it, activeEffects.begin()); it != activeEffects.end(); + for (auto it = activeEffects.begin(); it != activeEffects.end(); ++it) { MobEffectInstance* effect = it->second; listTag->add(effect->save(new CompoundTag())); @@ -429,7 +429,7 @@ void LivingEntity::readAdditionalSaveData(CompoundTag* tag) { void LivingEntity::tickEffects() { bool removed = false; - for (AUTO_VAR(it, activeEffects.begin()); it != activeEffects.end();) { + for (auto it = activeEffects.begin(); it != activeEffects.end();) { MobEffectInstance* effect = it->second; removed = false; if (!effect->tick( @@ -460,7 +460,7 @@ void LivingEntity::tickEffects() { setWeakened(false); } else { std::vector values; - for (AUTO_VAR(it, activeEffects.begin()); + for (auto it = activeEffects.begin(); it != activeEffects.end(); ++it) { values.push_back(it->second); } @@ -516,7 +516,7 @@ void LivingEntity::removeAllEffects() { // Iterator effectIdIterator = // activeEffects.keySet().iterator(); while // (effectIdIterator.hasNext()) - for (AUTO_VAR(it, activeEffects.begin()); it != activeEffects.end();) { + for (auto it = activeEffects.begin(); it != activeEffects.end();) { // Integer effectId = effectIdIterator.next(); MobEffectInstance* effect = it->second; // activeEffects.get(effectId); @@ -535,7 +535,7 @@ std::vector* LivingEntity::getActiveEffects() { std::vector* active = new std::vector(); - for (AUTO_VAR(it, activeEffects.begin()); it != activeEffects.end(); ++it) { + for (auto it = activeEffects.begin(); it != activeEffects.end(); ++it) { active->push_back(it->second); } @@ -554,7 +554,7 @@ bool LivingEntity::hasEffect(MobEffect* effect) { MobEffectInstance* LivingEntity::getEffect(MobEffect* effect) { MobEffectInstance* effectInst = nullptr; - AUTO_VAR(it, activeEffects.find(effect->id)); + auto it = activeEffects.find(effect->id); if (it != activeEffects.end()) effectInst = it->second; return effectInst; @@ -611,7 +611,7 @@ bool LivingEntity::canBeAffected(MobEffectInstance* newEffect) { bool LivingEntity::isInvertedHealAndHarm() { return getMobType() == UNDEAD; } void LivingEntity::removeEffectNoUpdate(int effectId) { - AUTO_VAR(it, activeEffects.find(effectId)); + auto it = activeEffects.find(effectId); if (it != activeEffects.end()) { MobEffectInstance* effect = it->second; if (effect != nullptr) { @@ -622,7 +622,7 @@ void LivingEntity::removeEffectNoUpdate(int effectId) { } void LivingEntity::removeEffect(int effectId) { - AUTO_VAR(it, activeEffects.find(effectId)); + auto it = activeEffects.find(effectId); if (it != activeEffects.end()) { MobEffectInstance* effect = it->second; if (effect != nullptr) { @@ -1508,8 +1508,8 @@ void LivingEntity::aiStep() { AABBList* collisions = level->getCubes(shared_from_this(), &shrinkbb); if (collisions->size() > 0) { double yTop = 0; - AUTO_VAR(itEnd, collisions->end()); - for (AUTO_VAR(it, collisions->begin()); it != itEnd; it++) { + auto itEnd = collisions->end(); + for (auto it = collisions->begin(); it != itEnd; it++) { if (it->y1 > yTop) yTop = it->y1; } @@ -1577,8 +1577,8 @@ void LivingEntity::pushEntities() { std::vector >* entities = level->getEntities(shared_from_this(), &grown); if (entities != nullptr && !entities->empty()) { - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities->at(i); if (e->isPushable()) e->push(shared_from_this()); } diff --git a/Minecraft.World/Entities/Mob.cpp b/Minecraft.World/Entities/Mob.cpp index 7fa3dfa74..8c7caa2b0 100644 --- a/Minecraft.World/Entities/Mob.cpp +++ b/Minecraft.World/Entities/Mob.cpp @@ -304,7 +304,7 @@ void Mob::aiStep() { AABB grown = bb.grow(1, 0, 1); std::vector >* entities = level->getEntitiesOfClass(typeid(ItemEntity), &grown); - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { std::shared_ptr entity = std::dynamic_pointer_cast(*it); if (entity->removed || entity->getItem() == nullptr) continue; @@ -852,7 +852,7 @@ void Mob::restoreLeashFromSave() { std::vector >* livingEnts = level->getEntitiesOfClass(typeid(LivingEntity), &grown); - for (AUTO_VAR(it, livingEnts->begin()); it != livingEnts->end(); + for (auto it = livingEnts->begin(); it != livingEnts->end(); ++it) { std::shared_ptr le = std::dynamic_pointer_cast(*it); diff --git a/Minecraft.World/Entities/MobEffect.cpp b/Minecraft.World/Entities/MobEffect.cpp index d38d72361..fb61e406e 100644 --- a/Minecraft.World/Entities/MobEffect.cpp +++ b/Minecraft.World/Entities/MobEffect.cpp @@ -412,7 +412,7 @@ MobEffect::getAttributeModifiers() { void MobEffect::removeAttributeModifiers(std::shared_ptr entity, BaseAttributeMap* attributes, int amplifier) { - for (AUTO_VAR(it, attributeModifiers.begin()); + for (auto it = attributeModifiers.begin(); it != attributeModifiers.end(); ++it) { AttributeInstance* attribute = attributes->getInstance(it->first); @@ -425,7 +425,7 @@ void MobEffect::removeAttributeModifiers(std::shared_ptr entity, void MobEffect::addAttributeModifiers(std::shared_ptr entity, BaseAttributeMap* attributes, int amplifier) { - for (AUTO_VAR(it, attributeModifiers.begin()); + for (auto it = attributeModifiers.begin(); it != attributeModifiers.end(); ++it) { AttributeInstance* attribute = attributes->getInstance(it->first); diff --git a/Minecraft.World/Entities/Mobs/Animal.cpp b/Minecraft.World/Entities/Mobs/Animal.cpp index 09ec08def..822f5106d 100644 --- a/Minecraft.World/Entities/Mobs/Animal.cpp +++ b/Minecraft.World/Entities/Mobs/Animal.cpp @@ -220,7 +220,7 @@ std::shared_ptr Animal::findAttackTarget() { std::vector >* others = level->getEntitiesOfClass(typeid(*this), &grown); // for (int i = 0; i < others->size(); i++) - for (AUTO_VAR(it, others->begin()); it != others->end(); ++it) { + for (auto it = others->begin(); it != others->end(); ++it) { std::shared_ptr p = std::dynamic_pointer_cast(*it); if (p != shared_from_this() && p->getInLoveValue() > 0) { delete others; @@ -234,7 +234,7 @@ std::shared_ptr Animal::findAttackTarget() { std::vector >* players = level->getEntitiesOfClass(typeid(Player), &grown); // for (int i = 0; i < players.size(); i++) - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { setDespawnProtected(); std::shared_ptr p = @@ -251,7 +251,7 @@ std::shared_ptr Animal::findAttackTarget() { std::vector >* others = level->getEntitiesOfClass(typeid(*this), &grown); // for (int i = 0; i < others.size(); i++) - for (AUTO_VAR(it, others->begin()); it != others->end(); ++it) { + for (auto it = others->begin(); it != others->end(); ++it) { std::shared_ptr p = std::dynamic_pointer_cast(*it); if (p != shared_from_this() && p->getAge() < 0) { diff --git a/Minecraft.World/Entities/Mobs/Arrow.cpp b/Minecraft.World/Entities/Mobs/Arrow.cpp index 28a8425a9..26da380fd 100644 --- a/Minecraft.World/Entities/Mobs/Arrow.cpp +++ b/Minecraft.World/Entities/Mobs/Arrow.cpp @@ -234,8 +234,8 @@ void Arrow::tick() { std::vector >* objects = level->getEntities(shared_from_this(), &grown); double nearest = 0; - AUTO_VAR(itEnd, objects->end()); - for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { + auto itEnd = objects->end(); + for (auto it = objects->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // objects->at(i); if (!e->isPickable() || (e == owner && flightTime < 5)) continue; diff --git a/Minecraft.World/Entities/Mobs/Boat.cpp b/Minecraft.World/Entities/Mobs/Boat.cpp index a674f1e07..2d186dd2c 100644 --- a/Minecraft.World/Entities/Mobs/Boat.cpp +++ b/Minecraft.World/Entities/Mobs/Boat.cpp @@ -317,8 +317,8 @@ void Boat::tick() { std::vector >* entities = level->getEntities(shared_from_this(), &grown); if (entities != nullptr && !entities->empty()) { - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = (*it); // entities->at(i); if (e != rider.lock() && e->isPushable() && e->GetType() == eTYPE_BOAT) { diff --git a/Minecraft.World/Entities/Mobs/DragonFireball.cpp b/Minecraft.World/Entities/Mobs/DragonFireball.cpp index b5baf730a..2ccac22f1 100644 --- a/Minecraft.World/Entities/Mobs/DragonFireball.cpp +++ b/Minecraft.World/Entities/Mobs/DragonFireball.cpp @@ -35,7 +35,7 @@ void DragonFireball::onHit(HitResult* res) { if (entitiesOfClass != nullptr && !entitiesOfClass->empty()) { // for (Entity e : entitiesOfClass) - for (AUTO_VAR(it, entitiesOfClass->begin()); + for (auto it = entitiesOfClass->begin(); it != entitiesOfClass->end(); ++it) { // shared_ptr e = *it; std::shared_ptr e = diff --git a/Minecraft.World/Entities/Mobs/EnderCrystal.cpp b/Minecraft.World/Entities/Mobs/EnderCrystal.cpp index 4802dcbc1..8c7c94c78 100644 --- a/Minecraft.World/Entities/Mobs/EnderCrystal.cpp +++ b/Minecraft.World/Entities/Mobs/EnderCrystal.cpp @@ -83,8 +83,8 @@ bool EnderCrystal::hurt(DamageSource* source, float damage) { std::vector > entities = level->getAllEntities(); std::shared_ptr dragon = nullptr; - AUTO_VAR(itEnd, entities.end()); - for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { + auto itEnd = entities.end(); + for (auto it = entities.begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities->at(i); dragon = std::dynamic_pointer_cast(e); if (dragon != nullptr) { diff --git a/Minecraft.World/Entities/Mobs/EnderDragon.cpp b/Minecraft.World/Entities/Mobs/EnderDragon.cpp index fa5b27936..7254b718a 100644 --- a/Minecraft.World/Entities/Mobs/EnderDragon.cpp +++ b/Minecraft.World/Entities/Mobs/EnderDragon.cpp @@ -464,7 +464,7 @@ void EnderDragon::aiStep() { std::vector >* targets = level->getEntities(shared_from_this(), &m_acidArea); - for (AUTO_VAR(it, targets->begin()); it != targets->end(); + for (auto it = targets->begin(); it != targets->end(); ++it) { if ((*it)->instanceof(eTYPE_LIVINGENTITY)) { // app.DebugPrintf("Attacking entity with acid\n"); @@ -821,7 +821,7 @@ void EnderDragon::checkCrystals() { std::shared_ptr crystal = nullptr; double nearest = std::numeric_limits::max(); // for (Entity ec : crystals) - for (AUTO_VAR(it, crystals->begin()); it != crystals->end(); ++it) { + for (auto it = crystals->begin(); it != crystals->end(); ++it) { std::shared_ptr ec = std::dynamic_pointer_cast(*it); double dist = ec->distanceToSqr(shared_from_this()); @@ -856,7 +856,7 @@ void EnderDragon::knockBack(std::vector >* entities) { double zm = (body->bb.z0 + body->bb.z1) / 2; // for (Entity e : entities) - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { if ((*it)->instanceof(eTYPE_LIVINGENTITY)) //(e instanceof Mob) { std::shared_ptr e = @@ -871,7 +871,7 @@ void EnderDragon::knockBack(std::vector >* entities) { void EnderDragon::hurt(std::vector >* entities) { // for (int i = 0; i < entities->size(); i++) - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { if ((*it)->instanceof(eTYPE_LIVINGENTITY)) //(e instanceof Mob) { std::shared_ptr e = diff --git a/Minecraft.World/Entities/Mobs/EntityHorse.cpp b/Minecraft.World/Entities/Mobs/EntityHorse.cpp index 622b84f6d..e797f3319 100644 --- a/Minecraft.World/Entities/Mobs/EntityHorse.cpp +++ b/Minecraft.World/Entities/Mobs/EntityHorse.cpp @@ -424,7 +424,7 @@ std::shared_ptr EntityHorse::getClosestMommy( std::vector >* list = level->getEntities(baby, &expanded, PARENT_HORSE_SELECTOR); - for (AUTO_VAR(it, list->begin()); it != list->end(); ++it) { + for (auto it = list->begin(); it != list->end(); ++it) { std::shared_ptr horse = *it; double distanceSquared = horse->distanceToSqr(baby->x, baby->y, baby->z); diff --git a/Minecraft.World/Entities/Mobs/Fireball.cpp b/Minecraft.World/Entities/Mobs/Fireball.cpp index ee658d163..5128b6877 100644 --- a/Minecraft.World/Entities/Mobs/Fireball.cpp +++ b/Minecraft.World/Entities/Mobs/Fireball.cpp @@ -180,8 +180,8 @@ void Fireball::tick() { std::vector >* objects = level->getEntities(shared_from_this(), &grown); double nearest = 0; - AUTO_VAR(itEnd, objects->end()); - for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { + auto itEnd = objects->end(); + for (auto it = objects->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // objects->at(i); if (!e->isPickable() || (e->is(owner))) continue; // 4J Stu - Never collide with the owner (Enderdragon) // diff --git a/Minecraft.World/Entities/Mobs/FishingHook.cpp b/Minecraft.World/Entities/Mobs/FishingHook.cpp index 63d6f3c88..9b755a07b 100644 --- a/Minecraft.World/Entities/Mobs/FishingHook.cpp +++ b/Minecraft.World/Entities/Mobs/FishingHook.cpp @@ -217,8 +217,8 @@ void FishingHook::tick() { std::vector >* objects = level->getEntities(shared_from_this(), &grown); double nearest = 0; - AUTO_VAR(itEnd, objects->end()); - for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { + auto itEnd = objects->end(); + for (auto it = objects->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // objects->at(i); if (!e->isPickable() || (e == owner && flightTime < 5)) continue; diff --git a/Minecraft.World/Entities/Mobs/LightningBolt.cpp b/Minecraft.World/Entities/Mobs/LightningBolt.cpp index 24bd495dd..6aa5a5f79 100644 --- a/Minecraft.World/Entities/Mobs/LightningBolt.cpp +++ b/Minecraft.World/Entities/Mobs/LightningBolt.cpp @@ -108,8 +108,8 @@ void LightningBolt::tick() { AABB aoe_bb = AABB(x, y, z, x, y + 6, z).grow(r, r, r); std::vector >* entities = level->getEntities(shared_from_this(), &aoe_bb); - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = (*it); // entities->at(i); e->thunderHit(this); } diff --git a/Minecraft.World/Entities/Mobs/Minecart.cpp b/Minecraft.World/Entities/Mobs/Minecart.cpp index 24c01246e..17916a72e 100644 --- a/Minecraft.World/Entities/Mobs/Minecart.cpp +++ b/Minecraft.World/Entities/Mobs/Minecart.cpp @@ -309,8 +309,8 @@ void Minecart::tick() { std::vector >* entities = level->getEntities(shared_from_this(), &grown); if (entities != nullptr && !entities->empty()) { - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = (*it); // entities->at(i); if (e != rider.lock() && e->isPushable() && e->instanceof(eTYPE_MINECART)) { diff --git a/Minecraft.World/Entities/Mobs/PigZombie.cpp b/Minecraft.World/Entities/Mobs/PigZombie.cpp index 4b6b8c59e..826d1e928 100644 --- a/Minecraft.World/Entities/Mobs/PigZombie.cpp +++ b/Minecraft.World/Entities/Mobs/PigZombie.cpp @@ -103,8 +103,8 @@ bool PigZombie::hurt(DamageSource* source, float dmg) { AABB grown = bb.grow(32, 32, 32); std::vector >* nearby = level->getEntities(shared_from_this(), &grown); - AUTO_VAR(itEnd, nearby->end()); - for (AUTO_VAR(it, nearby->begin()); it != itEnd; it++) { + auto itEnd = nearby->end(); + for (auto it = nearby->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // nearby->at(i); if (e->instanceof(eTYPE_PIGZOMBIE)) { std::shared_ptr pigZombie = diff --git a/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp b/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp index 8e6357319..51e69bd54 100644 --- a/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp +++ b/Minecraft.World/Entities/Mobs/SharedMonsterAttributes.cpp @@ -25,7 +25,7 @@ ListTag* SharedMonsterAttributes::saveAttributes( std::vector atts; attributes->getAttributes(atts); - for (AUTO_VAR(it, atts.begin()); it != atts.end(); ++it) { + for (auto it = atts.begin(); it != atts.end(); ++it) { AttributeInstance* attribute = *it; list->add(saveAttribute(attribute)); } @@ -47,7 +47,7 @@ CompoundTag* SharedMonsterAttributes::saveAttribute( if (!modifiers.empty()) { ListTag* list = new ListTag(); - for (AUTO_VAR(it, modifiers.begin()); it != modifiers.end(); ++it) { + for (auto it = modifiers.begin(); it != modifiers.end(); ++it) { AttributeModifier* modifier = *it; if (modifier->isSerializable()) { list->add(saveAttributeModifier(modifier)); diff --git a/Minecraft.World/Entities/Mobs/ThrownPotion.cpp b/Minecraft.World/Entities/Mobs/ThrownPotion.cpp index 0cd3086dc..cdf8df7d4 100644 --- a/Minecraft.World/Entities/Mobs/ThrownPotion.cpp +++ b/Minecraft.World/Entities/Mobs/ThrownPotion.cpp @@ -88,7 +88,7 @@ void ThrownPotion::onHit(HitResult* res) { if (entitiesOfClass != nullptr && !entitiesOfClass->empty()) { // for (Entity e : entitiesOfClass) - for (AUTO_VAR(it, entitiesOfClass->begin()); + for (auto it = entitiesOfClass->begin(); it != entitiesOfClass->end(); ++it) { // shared_ptr e = *it; std::shared_ptr e = @@ -101,7 +101,7 @@ void ThrownPotion::onHit(HitResult* res) { } // for (MobEffectInstance effect : mobEffects) - for (AUTO_VAR(itMEI, mobEffects->begin()); + for (auto itMEI = mobEffects->begin(); itMEI != mobEffects->end(); ++itMEI) { MobEffectInstance* effect = *itMEI; int id = effect->getId(); diff --git a/Minecraft.World/Entities/Mobs/Villager.cpp b/Minecraft.World/Entities/Mobs/Villager.cpp index 352212cdd..121e56cbc 100644 --- a/Minecraft.World/Entities/Mobs/Villager.cpp +++ b/Minecraft.World/Entities/Mobs/Villager.cpp @@ -127,7 +127,7 @@ void Villager::serverAiMobStep() { // improve max uses for all obsolete recipes if (offers->size() > 0) { // for (MerchantRecipe recipe : offers) - for (AUTO_VAR(it, offers->begin()); it != offers->end(); + for (auto it = offers->begin(); it != offers->end(); ++it) { MerchantRecipe* recipe = *it; if (recipe->isDeprecated()) { @@ -633,7 +633,7 @@ std::shared_ptr Villager::getItemTradeInValue(int itemId, } int Villager::getTradeInValue(int itemId, Random* random) { - AUTO_VAR(it, MIN_MAX_VALUES.find(itemId)); + auto it = MIN_MAX_VALUES.find(itemId); if (it == MIN_MAX_VALUES.end()) { return 1; } @@ -675,7 +675,7 @@ void Villager::addItemForPurchase(MerchantRecipeList* list, int itemId, } int Villager::getPurchaseCost(int itemId, Random* random) { - AUTO_VAR(it, MIN_MAX_PRICES.find(itemId)); + auto it = MIN_MAX_PRICES.find(itemId); if (it == MIN_MAX_PRICES.end()) { return 1; } diff --git a/Minecraft.World/Entities/Mobs/Witch.cpp b/Minecraft.World/Entities/Mobs/Witch.cpp index 9840bdfbb..e329c81be 100644 --- a/Minecraft.World/Entities/Mobs/Witch.cpp +++ b/Minecraft.World/Entities/Mobs/Witch.cpp @@ -93,7 +93,7 @@ void Witch::aiStep() { std::vector* effects = Item::potion->getMobEffects(item); if (effects != nullptr) { - for (AUTO_VAR(it, effects->begin()); + for (auto it = effects->begin(); it != effects->end(); ++it) { addEffect(new MobEffectInstance(*it)); } diff --git a/Minecraft.World/Entities/SyncedEntityData.cpp b/Minecraft.World/Entities/SyncedEntityData.cpp index ed94187dd..ba57c5649 100644 --- a/Minecraft.World/Entities/SyncedEntityData.cpp +++ b/Minecraft.World/Entities/SyncedEntityData.cpp @@ -188,8 +188,8 @@ void SynchedEntityData::pack( DataOutputStream* output) // TODO throws IOException { if (items != nullptr) { - AUTO_VAR(itEnd, items->end()); - for (AUTO_VAR(it, items->begin()); it != itEnd; it++) { + auto itEnd = items->end(); + for (auto it = items->begin(); it != itEnd; it++) { std::shared_ptr dataItem = *it; writeDataItem(output, dataItem); } @@ -363,8 +363,8 @@ SynchedEntityData::unpack(DataInputStream* input) // throws IOException void SynchedEntityData::assignValues( std::vector >* items) { - AUTO_VAR(itEnd, items->end()); - for (AUTO_VAR(it, items->begin()); it != itEnd; it++) { + auto itEnd = items->end(); + for (auto it = items->begin(); it != itEnd; it++) { std::shared_ptr item = *it; std::shared_ptr itemFromId = itemsById[item->getId()]; diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp index dc65fe8f9..9041f3bdc 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp @@ -267,7 +267,7 @@ void ConsoleSaveFileConverter::ConvertSave(ConsoleSaveFile* sourceSave, // region files std::vector* allFilesInSave = sourceSave->getFilesWithPrefix(std::wstring(L"")); - for (AUTO_VAR(it, allFilesInSave->begin()); it < allFilesInSave->end(); + for (auto it = allFilesInSave->begin(); it < allFilesInSave->end(); ++it) { FileEntry* fe = *it; if (fe != sourceLdatFe) { diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp index 367f5a08a..67c8f928e 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp @@ -640,7 +640,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) { std::uint8_t bTextMetadata[88] = {}; - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if (MinecraftServer::getInstance() != nullptr && MinecraftServer::getInstance()->levels[0] != nullptr) { @@ -857,7 +857,7 @@ void ConsoleSaveFileOriginal::ConvertToLocalPlatform() { // convert each of the region files to the local platform std::vector* allFilesInSave = getFilesWithPrefix(std::wstring(L"")); - for (AUTO_VAR(it, allFilesInSave->begin()); it < allFilesInSave->end(); + for (auto it = allFilesInSave->begin(); it < allFilesInSave->end(); ++it) { FileEntry* fe = *it; std::wstring fName(fe->data.filename); diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp index 34382baa0..62e039669 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp @@ -323,7 +323,7 @@ void ConsoleSaveFileSplit::RegionFileReference::ReleaseCompressed() { FileEntry* ConsoleSaveFileSplit::GetRegionFileEntry(unsigned int regionIndex) { // Is a region file - determine if we've got it as a separate file - AUTO_VAR(it, regionFiles.find(regionIndex)); + auto it = regionFiles.find(regionIndex); if (it != regionFiles.end()) { // Already got it return it->second->fileEntry; @@ -376,7 +376,7 @@ ConsoleSaveFileSplit::ConsoleSaveFileSplit(ConsoleSaveFile* sourceSave, sourceSave->getFilesWithPrefix(L""); unsigned int bytesWritten = 0; - for (AUTO_VAR(it, sourceFiles->begin()); it != sourceFiles->end(); + for (auto it = sourceFiles->begin(); it != sourceFiles->end(); ++it) { FileEntry* sourceEntry = *it; sourceSave->setFilePointer(sourceEntry, 0, @@ -545,7 +545,7 @@ ConsoleSaveFileSplit::~ConsoleSaveFileSplit() { // 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 - for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) { + for (auto it = regionFiles.begin(); it != regionFiles.end(); it++) { delete it->second; } @@ -895,7 +895,7 @@ void ConsoleSaveFileSplit::tick() { // Get total amount of data written over the time period we are interested // in averaging over. Remove any older data. unsigned int bytesWritten = 0; - for (AUTO_VAR(it, writeHistory.begin()); it != writeHistory.end();) { + for (auto it = writeHistory.begin(); it != writeHistory.end();) { if ((currentTime - it->writeTime) > (WRITE_BANDWIDTH_MEASUREMENT_PERIOD_SECONDS * 1000)) { it = writeHistory.erase(it); @@ -907,7 +907,7 @@ void ConsoleSaveFileSplit::tick() { // Compile a vector of dirty regions. std::vector dirtyRegions; - for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) { + for (auto it = regionFiles.begin(); it != regionFiles.end(); it++) { DirtyRegionFile dirtyRegion; if (it->second->dirty) { @@ -965,7 +965,7 @@ void ConsoleSaveFileSplit::tick() { unsigned int totalDirty = 0; unsigned int totalDirtyBytes = 0; int64_t oldestDirty = currentTime; - for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) { + for (auto it = regionFiles.begin(); it != regionFiles.end(); it++) { if (it->second->dirty) { if (it->second->lastWritten < oldestDirty) { oldestDirty = it->second->lastWritten; @@ -1219,7 +1219,7 @@ std::wstring ConsoleSaveFileSplit::GetNameFromNumericIdentifier( // Compress any dirty region files, and tell the storage manager about them so // that it will process them when we ask it to save sub files void ConsoleSaveFileSplit::processSubfilesForWrite() { - for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) { + for (auto it = regionFiles.begin(); it != regionFiles.end(); it++) { RegionFileReference* region = it->second; if (region->dirty) { region->Compress(); @@ -1236,7 +1236,7 @@ void ConsoleSaveFileSplit::processSubfilesForWrite() { void ConsoleSaveFileSplit::processSubfilesAfterWrite() { // This is called from the StorageManager.Tick() which should always be on // the main thread - for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) { + for (auto it = regionFiles.begin(); it != regionFiles.end(); it++) { RegionFileReference* region = it->second; region->ReleaseCompressed(); } @@ -1486,7 +1486,7 @@ std::vector* ConsoleSaveFileSplit::getRegionFilesByDimension( unsigned int dimensionIndex) { std::vector* files = nullptr; - for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); ++it) { + for (auto it = regionFiles.begin(); it != regionFiles.end(); ++it) { unsigned int entryDimension = ((it->first) >> 16) & 0xFF; if (entryDimension == dimensionIndex) { @@ -1583,7 +1583,7 @@ void ConsoleSaveFileSplit::ConvertToLocalPlatform() { // convert each of the region files to the local platform std::vector* allFilesInSave = getFilesWithPrefix(std::wstring(L"")); - for (AUTO_VAR(it, allFilesInSave->begin()); it < allFilesInSave->end(); + for (auto it = allFilesInSave->begin(); it < allFilesInSave->end(); ++it) { FileEntry* fe = *it; std::wstring fName(fe->data.filename); diff --git a/Minecraft.World/IO/Files/File.cpp b/Minecraft.World/IO/Files/File.cpp index d0b4ce2eb..be3926eef 100644 --- a/Minecraft.World/IO/Files/File.cpp +++ b/Minecraft.World/IO/Files/File.cpp @@ -25,12 +25,12 @@ std::wstring ToFilename(const fs::path& path) { return filenametowstring(filename.c_str()); } -__int64 ToEpochMilliseconds(const fs::file_time_type& fileTime) { +int64_t ToEpochMilliseconds(const fs::file_time_type& fileTime) { using namespace std::chrono; const auto systemTime = time_point_cast( fileTime - fs::file_time_type::clock::now() + system_clock::now()); - return static_cast<__int64>(systemTime.time_since_epoch().count()); + return static_cast(systemTime.time_since_epoch().count()); } } // namespace @@ -326,14 +326,14 @@ bool File::isDirectory() const { // value is unspecified if this pathname denotes a directory. Returns: The // length, in bytes, of the file denoted by this abstract pathname, or 0L if the // file does not exist -__int64 File::length() { +int64_t File::length() { std::error_code error; const fs::path path = ToFilesystemPath(getPath()); if (fs::is_regular_file(path, error)) { const auto size = fs::file_size(path, error); if (!error) { - return static_cast<__int64>(size); + return static_cast(size); } } @@ -344,7 +344,7 @@ __int64 File::length() { // modified. Returns: A long value representing the time the file was last // modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, // 1970), or 0L if the file does not exist or if an I/O error occurs -__int64 File::lastModified() { +int64_t File::lastModified() { std::error_code error; const fs::path path = ToFilesystemPath(getPath()); diff --git a/Minecraft.World/IO/Files/FileHeader.cpp b/Minecraft.World/IO/Files/FileHeader.cpp index 2a26e0bdf..feb3a20de 100644 --- a/Minecraft.World/IO/Files/FileHeader.cpp +++ b/Minecraft.World/IO/Files/FileHeader.cpp @@ -51,7 +51,7 @@ void FileHeader::RemoveFile(FileEntry* file) { AdjustStartOffsets(file, file->getFileSize(), true); - AUTO_VAR(it, find(fileTable.begin(), fileTable.end(), file)); + auto it = find(fileTable.begin(), fileTable.end(), file); if (it < fileTable.end()) { fileTable.erase(it); diff --git a/Minecraft.World/IO/NBT/CompoundTag.h b/Minecraft.World/IO/NBT/CompoundTag.h index 2a819de6d..2629ebd16 100644 --- a/Minecraft.World/IO/NBT/CompoundTag.h +++ b/Minecraft.World/IO/NBT/CompoundTag.h @@ -20,7 +20,7 @@ public: CompoundTag(const std::wstring& name) : Tag(name) {} void write(DataOutput* dos) { - AUTO_VAR(itEnd, tags.end()); + auto itEnd = tags.end(); for (std::unordered_map::iterator it = tags.begin(); it != itEnd; it++) { Tag::writeNamedTag(it->second, dos); @@ -50,7 +50,7 @@ public: // 4J - was return tags.values(); std::vector* ret = new std::vector; - AUTO_VAR(itEnd, tags.end()); + auto itEnd = tags.end(); for (std::unordered_map::iterator it = tags.begin(); it != itEnd; it++) { ret->push_back(it->second); @@ -109,7 +109,7 @@ public: } Tag* get(const std::wstring& name) { - AUTO_VAR(it, tags.find(name)); + auto it = tags.find(name); if (it != tags.end()) return it->second; return nullptr; } @@ -178,7 +178,7 @@ public: } void remove(const std::wstring& name) { - AUTO_VAR(it, tags.find(name)); + auto it = tags.find(name); if (it != tags.end()) tags.erase(it); // tags.remove(name); } @@ -199,7 +199,7 @@ public: strcpy( newPrefix, prefix); strcat( newPrefix, " "); - AUTO_VAR(itEnd, tags.end()); + auto itEnd = tags.end(); for( unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) { @@ -213,8 +213,8 @@ public: bool isEmpty() { return tags.empty(); } virtual ~CompoundTag() { - AUTO_VAR(itEnd, tags.end()); - for (AUTO_VAR(it, tags.begin()); it != itEnd; it++) { + auto itEnd = tags.end(); + for (auto it = tags.begin(); it != itEnd; it++) { delete it->second; } } @@ -222,8 +222,8 @@ public: Tag* copy() { CompoundTag* tag = new CompoundTag(getName()); - AUTO_VAR(itEnd, tags.end()); - for (AUTO_VAR(it, tags.begin()); it != itEnd; it++) { + auto itEnd = tags.end(); + for (auto it = tags.begin(); it != itEnd; it++) { tag->put((wchar_t*)it->first.c_str(), it->second->copy()); } return tag; @@ -235,9 +235,9 @@ public: if (tags.size() == o->tags.size()) { bool equal = true; - AUTO_VAR(itEnd, tags.end()); - for (AUTO_VAR(it, tags.begin()); it != itEnd; it++) { - AUTO_VAR(itFind, o->tags.find(it->first)); + auto itEnd = tags.end(); + for (auto it = tags.begin(); it != itEnd; it++) { + auto itFind = o->tags.find(it->first); if (itFind == o->tags.end() || !it->second->equals(itFind->second)) { equal = false; diff --git a/Minecraft.World/IO/NBT/ListTag.h b/Minecraft.World/IO/NBT/ListTag.h index d528b12da..7df99ae4a 100644 --- a/Minecraft.World/IO/NBT/ListTag.h +++ b/Minecraft.World/IO/NBT/ListTag.h @@ -20,8 +20,8 @@ public: dos->writeByte(type); dos->writeInt((int)list.size()); - AUTO_VAR(itEnd, list.end()); - for (AUTO_VAR(it, list.begin()); it != itEnd; it++) (*it)->write(dos); + auto itEnd = list.end(); + for (auto it = list.begin(); it != itEnd; it++) (*it)->write(dos); } void load(DataInput* dis, int tagDepth) { @@ -61,8 +61,8 @@ public: char* newPrefix = new char[strlen(prefix) + 4]; strcpy(newPrefix, prefix); strcat(newPrefix, " "); - AUTO_VAR(itEnd, list.end()); - for (AUTO_VAR(it, list.begin()); it != itEnd; it++) { + auto itEnd = list.end(); + for (auto it = list.begin(); it != itEnd; it++) { (*it)->print(newPrefix, out); } delete[] newPrefix; @@ -85,8 +85,8 @@ public: int size() { return (int)list.size(); } virtual ~ListTag() { - AUTO_VAR(itEnd, list.end()); - for (AUTO_VAR(it, list.begin()); it != itEnd; it++) { + auto itEnd = list.end(); + for (auto it = list.begin(); it != itEnd; it++) { delete *it; } } @@ -94,8 +94,8 @@ public: virtual Tag* copy() { ListTag* res = new ListTag(getName()); res->type = type; - AUTO_VAR(itEnd, list.end()); - for (AUTO_VAR(it, list.begin()); it != itEnd; it++) { + auto itEnd = list.end(); + for (auto it = list.begin(); it != itEnd; it++) { T* copy = (T*)(*it)->copy(); res->list.push_back(copy); } @@ -109,13 +109,13 @@ public: bool equal = false; if (list.size() == o->list.size()) { equal = true; - AUTO_VAR(itEnd, list.end()); + auto itEnd = list.end(); // 4J Stu - Pretty inefficient method, but I think we can // live with it give how often it will happen, and the small // sizes of the data sets - for (AUTO_VAR(it, list.begin()); it != itEnd; ++it) { + for (auto it = list.begin(); it != itEnd; ++it) { bool thisMatches = false; - for (AUTO_VAR(it2, o->list.begin()); + for (auto it2 = o->list.begin(); it2 != o->list.end(); ++it2) { if ((*it)->equals(*it2)) { thisMatches = true; diff --git a/Minecraft.World/IO/NBT/NbtSlotFile.cpp b/Minecraft.World/IO/NBT/NbtSlotFile.cpp index 6fde82fad..07eaf0307 100644 --- a/Minecraft.World/IO/NBT/NbtSlotFile.cpp +++ b/Minecraft.World/IO/NBT/NbtSlotFile.cpp @@ -110,8 +110,8 @@ std::vector* NbtSlotFile::readAll(int slot) { std::vector* fileSlots = fileSlotMap[slot]; int skipped = 0; - AUTO_VAR(itEnd, fileSlots->end()); - for (AUTO_VAR(it, fileSlots->begin()); it != itEnd; it++) { + auto itEnd = fileSlots->end(); + for (auto it = fileSlots->begin(); it != itEnd; it++) { int c = *it; // fileSlots->at(i); int pos = 0; @@ -179,8 +179,8 @@ void NbtSlotFile::replaceSlot(int slot, std::vector* tags) { toReplace = fileSlotMap[slot]; fileSlotMap[slot] = new std::vector(); - AUTO_VAR(itEndTags, tags->end()); - for (AUTO_VAR(it, tags->begin()); it != itEndTags; it++) { + auto itEndTags = tags->end(); + for (auto it = tags->begin(); it != itEndTags; it++) { CompoundTag* tag = *it; // tags->at(i); byteArray compressed = NbtIo::compress(tag); if (compressed.length > largest) { @@ -235,8 +235,8 @@ void NbtSlotFile::replaceSlot(int slot, std::vector* tags) { delete[] compressed.data; } - AUTO_VAR(itEndToRep, toReplace->end()); - for (AUTO_VAR(it, toReplace->begin()); it != itEndToRep; it++) { + auto itEndToRep = toReplace->end(); + for (auto it = toReplace->begin(); it != itEndToRep; it++) { int c = *it; // toReplace->at(i); freeFileSlots.push_back(c); diff --git a/Minecraft.World/IO/Streams/Compression.cpp b/Minecraft.World/IO/Streams/Compression.cpp index 2778f995c..ceb5447fa 100644 --- a/Minecraft.World/IO/Streams/Compression.cpp +++ b/Minecraft.World/IO/Streams/Compression.cpp @@ -293,7 +293,7 @@ HRESULT Compression::Decompress(void* pDestination, unsigned int* pDestSize, // platforms (so no virtual mem stuff) void Compression::VitaVirtualDecompress( void* pDestination, unsigned int* pDestSize, void* pSource, - unsigned int SrcSize) // (LPVOID buf, SIZE_T dwSize, LPVOID dst) + unsigned int SrcSize) // (void* buf, SIZE_T dwSize, void* dst) { std::uint8_t* pSrc = (std::uint8_t*)pSource; int Offset = 0; diff --git a/Minecraft.World/IO/Streams/DataInputStream.h b/Minecraft.World/IO/Streams/DataInputStream.h index c4cdd8901..ff4c8ba42 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.h +++ b/Minecraft.World/IO/Streams/DataInputStream.h @@ -24,13 +24,13 @@ public: virtual double readDouble(); virtual float readFloat(); virtual int readInt(); - virtual __int64 readLong(); + virtual int64_t readLong(); virtual short readShort(); virtual unsigned short readUnsignedShort(); virtual std::wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/Minecraft.World/Items/BoatItem.cpp b/Minecraft.World/Items/BoatItem.cpp index a7aa1b274..883bda4b9 100644 --- a/Minecraft.World/Items/BoatItem.cpp +++ b/Minecraft.World/Items/BoatItem.cpp @@ -88,7 +88,7 @@ std::shared_ptr BoatItem::use( std::vector >* objects = level->getEntities(player, &grown); // for (int i = 0; i < objects.size(); i++) { - for (AUTO_VAR(it, objects->begin()); it != objects->end(); ++it) { + for (auto it = objects->begin(); it != objects->end(); ++it) { std::shared_ptr e = *it; // objects.get(i); if (!e->isPickable()) continue; diff --git a/Minecraft.World/Items/ItemInstance.cpp b/Minecraft.World/Items/ItemInstance.cpp index 43e2e29e3..940640bf2 100644 --- a/Minecraft.World/Items/ItemInstance.cpp +++ b/Minecraft.World/Items/ItemInstance.cpp @@ -624,14 +624,14 @@ std::vector* ItemInstance::getHoverText( lines->push_back(HtmlString(L"")); // Modifier descriptions - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { // 4J: Moved modifier string building to AttributeModifier lines->push_back(it->second->getHoverText(it->first)); } } // Delete modifiers map - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { AttributeModifier* modifier = it->second; delete modifier; } diff --git a/Minecraft.World/Items/LeashItem.cpp b/Minecraft.World/Items/LeashItem.cpp index e36ddf2ce..17d08f85d 100644 --- a/Minecraft.World/Items/LeashItem.cpp +++ b/Minecraft.World/Items/LeashItem.cpp @@ -40,7 +40,7 @@ bool LeashItem::bindPlayerMobs(std::shared_ptr player, Level* level, std::vector >* mobs = level->getEntitiesOfClass(typeid(Mob), &mob_bb); if (mobs != nullptr) { - for (AUTO_VAR(it, mobs->begin()); it != mobs->end(); ++it) { + for (auto it = mobs->begin(); it != mobs->end(); ++it) { std::shared_ptr mob = std::dynamic_pointer_cast(*it); if (mob->isLeashed() && mob->getLeashHolder() == player) { if (activeKnot == nullptr) { @@ -65,7 +65,7 @@ bool LeashItem::bindPlayerMobsTest(std::shared_ptr player, Level* level, level->getEntitiesOfClass(typeid(Mob), &mob_bb); if (mobs != nullptr) { - for (AUTO_VAR(it, mobs->begin()); it != mobs->end(); ++it) { + for (auto it = mobs->begin(); it != mobs->end(); ++it) { std::shared_ptr mob = std::dynamic_pointer_cast(*it); if (mob->isLeashed() && mob->getLeashHolder() == player) return true; diff --git a/Minecraft.World/Items/PotionItem.cpp b/Minecraft.World/Items/PotionItem.cpp index be2552ddb..79d314a30 100644 --- a/Minecraft.World/Items/PotionItem.cpp +++ b/Minecraft.World/Items/PotionItem.cpp @@ -35,7 +35,7 @@ std::vector* PotionItem::getMobEffects( if (!potion->hasTag() || !potion->getTag()->contains(L"CustomPotionEffects")) { std::vector* effects = nullptr; - AUTO_VAR(it, cachedMobEffects.find(potion->getAuxValue())); + auto it = cachedMobEffects.find(potion->getAuxValue()); if (it != cachedMobEffects.end()) effects = it->second; if (effects == nullptr) { effects = PotionBrewing::getEffects(potion->getAuxValue(), false); @@ -63,7 +63,7 @@ std::vector* PotionItem::getMobEffects( std::vector* PotionItem::getMobEffects(int auxValue) { std::vector* effects = nullptr; - AUTO_VAR(it, cachedMobEffects.find(auxValue)); + auto it = cachedMobEffects.find(auxValue); if (it != cachedMobEffects.end()) effects = it->second; if (effects == nullptr) { effects = PotionBrewing::getEffects(auxValue, false); @@ -84,7 +84,7 @@ std::shared_ptr PotionItem::useTimeDepleted( std::vector* effects = getMobEffects(instance); if (effects != nullptr) { // for (MobEffectInstance effect : effects) - for (AUTO_VAR(it, effects->begin()); it != effects->end(); ++it) { + for (auto it = effects->begin(); it != effects->end(); ++it) { player->addEffect(new MobEffectInstance(*it)); } } @@ -176,7 +176,7 @@ bool PotionItem::hasInstantenousEffects(int itemAuxValue) { return false; } // for (MobEffectInstance effect : mobEffects) { - for (AUTO_VAR(it, mobEffects->begin()); it != mobEffects->end(); ++it) { + for (auto it = mobEffects->begin(); it != mobEffects->end(); ++it) { MobEffectInstance* effect = *it; if (MobEffect::effects[effect->getId()]->isInstantenous()) { return true; @@ -238,7 +238,7 @@ void PotionItem::appendHoverText(std::shared_ptr itemInstance, attrAttrModMap modifiers; if (effects != nullptr && !effects->empty()) { // for (MobEffectInstance effect : effects) - for (AUTO_VAR(it, effects->begin()); it != effects->end(); ++it) { + for (auto it = effects->begin(); it != effects->end(); ++it) { MobEffectInstance* effect = *it; std::wstring effectString = app.GetString(effect->getDescriptionId()); @@ -248,7 +248,7 @@ void PotionItem::appendHoverText(std::shared_ptr itemInstance, effectModifiers = mobEffect->getAttributeModifiers(); if (effectModifiers != nullptr && effectModifiers->size() > 0) { - for (AUTO_VAR(it, effectModifiers->begin()); + for (auto it = effectModifiers->begin(); it != effectModifiers->end(); ++it) { // 4J - anonymous modifiers added here are destroyed // shortly? @@ -318,7 +318,7 @@ void PotionItem::appendHoverText(std::shared_ptr itemInstance, eHTMLColor_5)); // Add modifier descriptions - for (AUTO_VAR(it, modifiers.begin()); it != modifiers.end(); ++it) { + for (auto it = modifiers.begin(); it != modifiers.end(); ++it) { // 4J: Moved modifier string building to AttributeModifier lines->push_back(it->second->getHoverText(it->first)); } @@ -388,7 +388,7 @@ std::vector >* PotionItem::getUniquePotionValues() { // http://docs.oracle.com/javase/6/docs/api/java/util/List.html#hashCode() // and adding deleting to clear up as we go int effectsHashCode = 1; - for (AUTO_VAR(it, effects->begin()); it != effects->end(); + for (auto it = effects->begin(); it != effects->end(); ++it) { MobEffectInstance* mei = *it; effectsHashCode = 31 * effectsHashCode + @@ -397,7 +397,7 @@ std::vector >* PotionItem::getUniquePotionValues() { } bool toAdd = true; - for (AUTO_VAR(it, s_uniquePotionValues.begin()); + for (auto it = s_uniquePotionValues.begin(); it != s_uniquePotionValues.end(); ++it) { // Some potions hash the same (identical effects) but // are throwable so account for that diff --git a/Minecraft.World/Items/RecordingItem.cpp b/Minecraft.World/Items/RecordingItem.cpp index 0b0998ec7..1b8413a6d 100644 --- a/Minecraft.World/Items/RecordingItem.cpp +++ b/Minecraft.World/Items/RecordingItem.cpp @@ -64,7 +64,7 @@ void RecordingItem::registerIcons(IconRegister* iconRegister) { } RecordingItem* RecordingItem::getByName(const std::wstring& name) { - AUTO_VAR(it, BY_NAME.find(name)); + auto it = BY_NAME.find(name); if (it != BY_NAME.end()) { return it->second; } else { diff --git a/Minecraft.World/Items/SpawnEggItem.cpp b/Minecraft.World/Items/SpawnEggItem.cpp index f9c5f4b22..ac2ba878d 100644 --- a/Minecraft.World/Items/SpawnEggItem.cpp +++ b/Minecraft.World/Items/SpawnEggItem.cpp @@ -36,7 +36,7 @@ std::wstring SpawnEggItem::getHoverName( int SpawnEggItem::getColor(std::shared_ptr item, int spriteLayer) { - AUTO_VAR(it, EntityIO::idsSpawnableInCreative.find(item->getAuxValue())); + auto it = EntityIO::idsSpawnableInCreative.find(item->getAuxValue()); if (it != EntityIO::idsSpawnableInCreative.end()) { EntityIO::SpawnableMobInfo* spawnableMobInfo = it->second; if (spriteLayer == 0) { diff --git a/Minecraft.World/Level/BaseMobSpawner.cpp b/Minecraft.World/Level/BaseMobSpawner.cpp index 53835dcaa..b2ee3b0cb 100644 --- a/Minecraft.World/Level/BaseMobSpawner.cpp +++ b/Minecraft.World/Level/BaseMobSpawner.cpp @@ -24,7 +24,7 @@ BaseMobSpawner::BaseMobSpawner() { BaseMobSpawner::~BaseMobSpawner() { if (spawnPotentials) { - for (AUTO_VAR(it, spawnPotentials->begin()); + for (auto it = spawnPotentials->begin(); it != spawnPotentials->end(); ++it) { delete *it; } @@ -134,7 +134,7 @@ std::shared_ptr BaseMobSpawner::loadDataAndAddEntity( entity->save(data); std::vector* tags = getNextSpawnData()->tag->getAllTags(); - for (AUTO_VAR(it, tags->begin()); it != tags->end(); ++it) { + for (auto it = tags->begin(); it != tags->end(); ++it) { Tag* tag = *it; data->put(tag->getName(), tag->copy()); } @@ -154,7 +154,7 @@ std::shared_ptr BaseMobSpawner::loadDataAndAddEntity( mount->save(mountData); std::vector* ridingTags = ridingTag->getAllTags(); - for (AUTO_VAR(it, ridingTags->begin()); it != ridingTags->end(); + for (auto it = ridingTags->begin(); it != ridingTags->end(); ++it) { Tag* tag = *it; mountData->put(tag->getName(), tag->copy()); @@ -258,7 +258,7 @@ void BaseMobSpawner::save(CompoundTag* tag) { ListTag* list = new ListTag(); if (spawnPotentials != nullptr && spawnPotentials->size() > 0) { - for (AUTO_VAR(it, spawnPotentials->begin()); + for (auto it = spawnPotentials->begin(); it != spawnPotentials->end(); ++it) { SpawnData* data = *it; list->add(data->save()); diff --git a/Minecraft.World/Level/CustomLevelSource.cpp b/Minecraft.World/Level/CustomLevelSource.cpp index c4becd6e7..fed0ef83e 100644 --- a/Minecraft.World/Level/CustomLevelSource.cpp +++ b/Minecraft.World/Level/CustomLevelSource.cpp @@ -43,7 +43,7 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed, app.DebugPrintf("Heightmap binary is too large!!\n"); __debugbreak(); } - BOOL bSuccess = ReadFile(file, m_heightmapOverride.data, dwFileSize, + bool bSuccess = ReadFile(file, m_heightmapOverride.data, dwFileSize, &bytesRead, nullptr); if (bSuccess == FALSE) { @@ -77,7 +77,7 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed, app.DebugPrintf("waterheight binary is too large!!\n"); __debugbreak(); } - BOOL bSuccess = ReadFile(file, m_waterheightOverride.data, dwFileSize, + bool bSuccess = ReadFile(file, m_waterheightOverride.data, dwFileSize, &bytesRead, nullptr); if (bSuccess == FALSE) { diff --git a/Minecraft.World/Level/Events/VillageSiege.cpp b/Minecraft.World/Level/Events/VillageSiege.cpp index ed1f597fd..aa5e7d554 100644 --- a/Minecraft.World/Level/Events/VillageSiege.cpp +++ b/Minecraft.World/Level/Events/VillageSiege.cpp @@ -68,7 +68,7 @@ void VillageSiege::tick() { bool VillageSiege::tryToSetupSiege() { std::vector >* players = &level->players; // for (Player player : players) - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { std::shared_ptr player = *it; std::shared_ptr _village = level->villages->getClosestVillage( (int)player->x, (int)player->y, (int)player->z, 1); @@ -96,7 +96,7 @@ bool VillageSiege::tryToSetupSiege() { std::vector >* villages = level->villages->getVillages(); // for (Village v : level.villages.getVillages()) - for (AUTO_VAR(itV, villages->begin()); itV != villages->end(); + for (auto itV = villages->begin(); itV != villages->end(); ++itV) { std::shared_ptr v = *itV; if (v == _village) continue; diff --git a/Minecraft.World/Level/Explosion.cpp b/Minecraft.World/Level/Explosion.cpp index 3624f6e12..eb14bee9f 100644 --- a/Minecraft.World/Level/Explosion.cpp +++ b/Minecraft.World/Level/Explosion.cpp @@ -108,8 +108,8 @@ void Explosion::explode() { levelEntities->end()); Vec3 center(x, y, z); - AUTO_VAR(itEnd, entities.end()); - for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { + auto itEnd = entities.end(); + for (auto it = entities.begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities->at(i); // 4J Stu - If the entity is not in a block that would be blown up, then @@ -117,7 +117,7 @@ void Explosion::explode() { // The player can be damaged and killed by explosions behind obsidian // walls bool canDamage = false; - for (AUTO_VAR(it2, toBlow.begin()); it2 != toBlow.end(); ++it2) { + for (auto it2 = toBlow.begin(); it2 != toBlow.end(); ++it2) { if (e->bb.intersects(it2->x, it2->y, it2->z, it2->x + 1, it2->y + 1, it2->z + 1)) { canDamage = true; @@ -201,7 +201,7 @@ void Explosion::finalizeExplosion( if (fraction == 0) fraction = 1; size_t j = toBlowArray->size() - 1; // for (size_t j = toBlowArray->size() - 1; j >= 0; j--) - for (AUTO_VAR(it, toBlowArray->rbegin()); it != toBlowArray->rend(); + for (auto it = toBlowArray->rbegin(); it != toBlowArray->rend(); ++it) { TilePos* tp = &(*it); //&toBlowArray->at(j); int xt = tp->x; @@ -261,7 +261,7 @@ void Explosion::finalizeExplosion( if (fire) { // for (size_t j = toBlowArray->size() - 1; j >= 0; j--) - for (AUTO_VAR(it, toBlowArray->rbegin()); it != toBlowArray->rend(); + for (auto it = toBlowArray->rbegin(); it != toBlowArray->rend(); ++it) { TilePos* tp = &(*it); //&toBlowArray->at(j); int xt = tp->x; @@ -282,7 +282,7 @@ void Explosion::finalizeExplosion( Explosion::playerVec3Map* Explosion::getHitPlayers() { return &hitPlayers; } Vec3 Explosion::getHitPlayerKnockback(std::shared_ptr player) { - AUTO_VAR(it, hitPlayers.find(player)); + auto it = hitPlayers.find(player); if (it == hitPlayers.end()) return Vec3(0.0, 0.0, 0.0); diff --git a/Minecraft.World/Level/GameRules.cpp b/Minecraft.World/Level/GameRules.cpp index 08436a330..fef5c9c6d 100644 --- a/Minecraft.World/Level/GameRules.cpp +++ b/Minecraft.World/Level/GameRules.cpp @@ -28,7 +28,7 @@ GameRules::GameRules() { } GameRules::~GameRules() { - /*for(AUTO_VAR(it,rules.begin()); it != rules.end(); ++it) + /*for(auto it = rules.begin(); it != rules.end(); ++it) { delete it->second; }*/ @@ -67,7 +67,7 @@ void GameRules::registerRule(const std::wstring &name, const std::wstring void GameRules::set(const std::wstring &ruleName, const std::wstring &newValue) { - AUTO_VAR(it, rules.find(ruleName)); + auto it = rules.find(ruleName); if(it != rules.end() ) { GameRule *gameRule = it->second; @@ -81,7 +81,7 @@ void GameRules::set(const std::wstring &ruleName, const std::wstring &newValue) std::wstring GameRules::get(const std::wstring &ruleName) { - AUTO_VAR(it, rules.find(ruleName)); + auto it = rules.find(ruleName); if(it != rules.end() ) { GameRule *gameRule = it->second; @@ -92,7 +92,7 @@ std::wstring GameRules::get(const std::wstring &ruleName) int GameRules::getInt(const std::wstring &ruleName) { - AUTO_VAR(it, rules.find(ruleName)); + auto it = rules.find(ruleName); if(it != rules.end() ) { GameRule *gameRule = it->second; @@ -103,7 +103,7 @@ int GameRules::getInt(const std::wstring &ruleName) double GameRules::getDouble(const std::wstring &ruleName) { - AUTO_VAR(it, rules.find(ruleName)); + auto it = rules.find(ruleName); if(it != rules.end() ) { GameRule *gameRule = it->second; @@ -116,7 +116,7 @@ CompoundTag *GameRules::createTag() { CompoundTag *result = new CompoundTag(L"GameRules"); - for(AUTO_VAR(it,rules.begin()); it != rules.end(); ++it) + for(auto it = rules.begin(); it != rules.end(); ++it) { GameRule *gameRule = it->second; result->putString(it->first, gameRule->get()); @@ -128,7 +128,7 @@ CompoundTag *GameRules::createTag() void GameRules::loadFromTag(CompoundTag *tag) { vector *allTags = tag->getAllTags(); - for (AUTO_VAR(it, allTags->begin()); it != allTags->end(); ++it) + for (auto it = allTags->begin(); it != allTags->end(); ++it) { Tag *ruleTag = *it; std::wstring ruleName = ruleTag->getName(); @@ -143,13 +143,13 @@ void GameRules::loadFromTag(CompoundTag *tag) vector *GameRules::getRuleNames() { vector *out = new vector(); - for (AUTO_VAR(it, rules.begin()); it != rules.end(); it++) + for (auto it = rules.begin(); it != rules.end(); it++) out->push_back(it->first); return out; } bool GameRules::contains(const std::wstring &rule) { - AUTO_VAR(it, rules.find(rule)); + auto it = rules.find(rule); return it != rules.end(); } diff --git a/Minecraft.World/Level/Level.cpp b/Minecraft.World/Level/Level.cpp index 4beb65038..2a1870696 100644 --- a/Minecraft.World/Level/Level.cpp +++ b/Minecraft.World/Level/Level.cpp @@ -995,8 +995,8 @@ bool Level::setTileAndUpdate(int x, int y, int z, int tile) { } void Level::sendTileUpdated(int x, int y, int z) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->tileChanged(x, y, z); } } @@ -1029,15 +1029,15 @@ void Level::lightColumnChanged(int x, int z, int y0, int y1) { } void Level::setTileDirty(int x, int y, int z) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->setTilesDirty(x, y, z, x, y, z, this); } } void Level::setTilesDirty(int x0, int y0, int z0, int x1, int y1, int z1) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->setTilesDirty(x0, y0, z0, x1, y1, z1, this); } } @@ -1337,16 +1337,16 @@ void Level::setBrightness( cachemaxz = z; } } else { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->tileLightChanged(x, y, z); } } } void Level::setTileBrightnessChanged(int x, int y, int z) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->tileLightChanged(x, y, z); } } @@ -1515,8 +1515,8 @@ HitResult* Level::clip(Vec3* a, Vec3* b, bool liquid, bool solidOnly) { void Level::playEntitySound(std::shared_ptr entity, int iSound, float volume, float pitch) { if (entity == nullptr) return; - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { // 4J-PB - if the entity is a local player, don't play the sound if (entity->GetType() == eTYPE_SERVERPLAYER) { // app.DebugPrintf("ENTITY is serverplayer\n"); @@ -1535,8 +1535,8 @@ void Level::playEntitySound(std::shared_ptr entity, int iSound, void Level::playPlayerSound(std::shared_ptr entity, int iSound, float volume, float pitch) { if (entity == nullptr) return; - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->playSoundExceptPlayer(entity, iSound, entity->x, entity->y - entity->heightOffset, entity->z, volume, pitch); @@ -1547,8 +1547,8 @@ void Level::playPlayerSound(std::shared_ptr entity, int iSound, // float volume, float pitch) void Level::playSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->playSound(iSound, x, y, z, volume, pitch, fClipSoundDist); } } @@ -1558,8 +1558,8 @@ void Level::playLocalSound(double x, double y, double z, int iSound, float fClipSoundDist) {} void Level::playStreamingMusic(const std::wstring& name, int x, int y, int z) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->playStreamingMusic(name, x, y, z); } } @@ -1572,8 +1572,8 @@ void Level::playMusic(double x, double y, double z, const std::wstring& string, void Level::addParticle(const wstring& id, double x, double y, double z, double xd, double yd, double zd) { -AUTO_VAR(itEnd, listeners.end()); -for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) +auto itEnd = listeners.end(); +for (auto it = listeners.begin(); it != itEnd; it++) (*it)->addParticle(id, x, y, z, xd, yd, zd); } */ @@ -1581,8 +1581,8 @@ for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) // 4J-PB added void Level::addParticle(ePARTICLE_TYPE id, double x, double y, double z, double xd, double yd, double zd) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) (*it)->addParticle(id, x, y, z, xd, yd, zd); } @@ -1638,23 +1638,23 @@ bool Level::addEntity(std::shared_ptr e) { #pragma optimize("", on) void Level::entityAdded(std::shared_ptr e) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->entityAdded(e); } } void Level::entityRemoved(std::shared_ptr e) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->entityRemoved(e); } } // 4J added void Level::playerRemoved(std::shared_ptr e) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->playerRemoved(e); } } @@ -1804,7 +1804,7 @@ AABBList* Level::getCubes(std::shared_ptr source, AABB* box, std::vector >* ee = getEntities(source, &grown); std::vector >::iterator itEnd = ee->end(); - for (AUTO_VAR(it, ee->begin()); it != itEnd; it++) { + for (auto it = ee->begin(); it != itEnd; it++) { AABB* collideBox = (*it)->getCollideBox(); if (collideBox != nullptr && collideBox->intersects(*box)) { boxes.push_back(*collideBox); @@ -2086,9 +2086,9 @@ void Level::tickEntities() { EnterCriticalSection(&m_entitiesCS); - for (AUTO_VAR(it, entities.begin()); it != entities.end();) { + for (auto it = entities.begin(); it != entities.end();) { bool found = false; - for (AUTO_VAR(it2, entitiesToRemove.begin()); + for (auto it2 = entitiesToRemove.begin(); it2 != entitiesToRemove.end(); it2++) { if ((*it) == (*it2)) { found = true; @@ -2103,8 +2103,8 @@ void Level::tickEntities() { } LeaveCriticalSection(&m_entitiesCS); - AUTO_VAR(itETREnd, entitiesToRemove.end()); - for (AUTO_VAR(it, entitiesToRemove.begin()); it != itETREnd; it++) { + auto itETREnd = entitiesToRemove.end(); + for (auto it = entitiesToRemove.begin(); it != itETREnd; it++) { std::shared_ptr e = *it; // entitiesToRemove.at(j); int xc = e->xChunk; int zc = e->zChunk; @@ -2114,7 +2114,7 @@ void Level::tickEntities() { } itETREnd = entitiesToRemove.end(); - for (AUTO_VAR(it, entitiesToRemove.begin()); it != itETREnd; it++) { + for (auto it = entitiesToRemove.begin(); it != itETREnd; it++) { entityRemoved(*it); } // @@ -2161,7 +2161,7 @@ void Level::tickEntities() { // 4J Find the entity again before deleting, as things might have // moved in the entity array eg from the explosion created by tnt - AUTO_VAR(it, find(entities.begin(), entities.end(), e)); + auto it = find(entities.begin(), entities.end(), e); if (it != entities.end()) { entities.erase(it); } @@ -2176,7 +2176,7 @@ void Level::tickEntities() { EnterCriticalSection(&m_tileEntityListCS); updatingTileEntities = true; - for (AUTO_VAR(it, tileEntityList.begin()); it != tileEntityList.end();) { + for (auto it = tileEntityList.begin(); it != tileEntityList.end();) { std::shared_ptr te = *it; // tilevector >.at(i); if (!te->isRemoved() && te->hasLevel()) { @@ -2209,7 +2209,7 @@ void Level::tickEntities() { if (!tileEntitiesToUnload.empty()) { FRAME_PROFILE_SCOPE(TileEntityUnloadCleanup); - for (AUTO_VAR(it, tileEntityList.begin()); + for (auto it = tileEntityList.begin(); it != tileEntityList.end();) { if (tileEntitiesToUnload.find(*it) != tileEntitiesToUnload.end()) { if (isClientSide) { @@ -2224,7 +2224,7 @@ void Level::tickEntities() { } if (!pendingTileEntities.empty()) { - for (AUTO_VAR(it, pendingTileEntities.begin()); + for (auto it = pendingTileEntities.begin(); it != pendingTileEntities.end(); it++) { std::shared_ptr e = *it; if (!e->isRemoved()) { @@ -2250,11 +2250,11 @@ void Level::addAllPendingTileEntities( std::vector >& entities) { EnterCriticalSection(&m_tileEntityListCS); if (updatingTileEntities) { - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { pendingTileEntities.push_back(*it); } } else { - for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) { + for (auto it = entities.begin(); it != entities.end(); it++) { tileEntityList.push_back(*it); } } @@ -2333,8 +2333,8 @@ bool Level::isUnobstructed(AABB* aabb) { return isUnobstructed(aabb, nullptr); } bool Level::isUnobstructed(AABB* aabb, std::shared_ptr ignore) { std::vector >* ents = getEntities(nullptr, aabb); - AUTO_VAR(itEnd, ents->end()); - for (AUTO_VAR(it, ents->begin()); it != itEnd; it++) { + auto itEnd = ents->end(); + for (auto it = ents->begin(); it != itEnd; it++) { std::shared_ptr e = *it; if (!e->removed && e->blocksBuilding && e != ignore) return false; } @@ -2635,7 +2635,7 @@ std::shared_ptr Level::getTileEntity(int x, int y, int z) { if (tileEntity == nullptr) { EnterCriticalSection(&m_tileEntityListCS); - for (AUTO_VAR(it, pendingTileEntities.begin()); + for (auto it = pendingTileEntities.begin(); it != pendingTileEntities.end(); it++) { std::shared_ptr e = *it; @@ -2659,7 +2659,7 @@ void Level::setTileEntity(int x, int y, int z, tileEntity->z = z; // avoid adding duplicates - for (AUTO_VAR(it, pendingTileEntities.begin()); + for (auto it = pendingTileEntities.begin(); it != pendingTileEntities.end();) { std::shared_ptr next = *it; if (next->x == x && next->y == y && next->z == z) { @@ -2686,20 +2686,20 @@ void Level::removeTileEntity(int x, int y, int z) { std::shared_ptr te = getTileEntity(x, y, z); if (te != nullptr && updatingTileEntities) { te->setRemoved(); - AUTO_VAR(it, find(pendingTileEntities.begin(), - pendingTileEntities.end(), te)); + auto it = find(pendingTileEntities.begin(), + pendingTileEntities.end(), te); if (it != pendingTileEntities.end()) { pendingTileEntities.erase(it); } } else { if (te != nullptr) { - AUTO_VAR(it, find(pendingTileEntities.begin(), - pendingTileEntities.end(), te)); + auto it = find(pendingTileEntities.begin(), + pendingTileEntities.end(), te); if (it != pendingTileEntities.end()) { pendingTileEntities.erase(it); } - AUTO_VAR(it2, - find(tileEntityList.begin(), tileEntityList.end(), te)); + auto it2 = + find(tileEntityList.begin(), tileEntityList.end(), te); if (it2 != tileEntityList.end()) { tileEntityList.erase(it2); } @@ -3410,7 +3410,7 @@ std::shared_ptr Level::getClosestEntityOfClass( std::shared_ptr closest = nullptr; double closestDistSqr = std::numeric_limits::max(); // for (Entity entity : entities) - for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { + for (auto it = entities->begin(); it != entities->end(); ++it) { std::shared_ptr entity = *it; if (entity == source) continue; double distSqr = source->distanceToSqr(entity); @@ -3448,8 +3448,8 @@ unsigned int Level::countInstanceOf( if (protectedCount) *protectedCount = 0; if (couldWanderCount) *couldWanderCount = 0; EnterCriticalSection(&m_entitiesCS); - AUTO_VAR(itEnd, entities.end()); - for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { + auto itEnd = entities.end(); + for (auto it = entities.begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities.at(i); if (singleType) { if (e->GetType() == clas) { @@ -3476,8 +3476,8 @@ unsigned int Level::countInstanceOfInRange(eINSTANCEOF clas, bool singleType, int range, int x, int y, int z) { unsigned int count = 0; EnterCriticalSection(&m_entitiesCS); - AUTO_VAR(itEnd, entities.end()); - for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { + auto itEnd = entities.end(); + for (auto it = entities.begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities.at(i); float sd = e->distanceTo(x, y, z); @@ -3502,9 +3502,9 @@ void Level::addEntities(std::vector >* list) { // entities.addAll(list); EnterCriticalSection(&m_entitiesCS); entities.insert(entities.end(), list->begin(), list->end()); - AUTO_VAR(itEnd, list->end()); + auto itEnd = list->end(); bool deleteDragons = false; - for (AUTO_VAR(it, list->begin()); it != itEnd; it++) { + for (auto it = list->begin(); it != itEnd; it++) { entityAdded(*it); // 4J Stu - Special change to remove duplicate enderdragons that a @@ -3516,7 +3516,7 @@ void Level::addEntities(std::vector >* list) { if (deleteDragons) { deleteDragons = false; - for (AUTO_VAR(it, entities.begin()); it != entities.end(); ++it) { + for (auto it = entities.begin(); it != entities.end(); ++it) { // 4J Stu - Special change to remove duplicate enderdragons that a // previous bug might have produced if ((*it)->GetType() == eTYPE_ENDERDRAGON) { @@ -3682,8 +3682,8 @@ std::shared_ptr Level::getNearestPlayer(double x, double y, double z, MemSect(21); double best = -1; std::shared_ptr result = nullptr; - AUTO_VAR(itEnd, players.end()); - for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { + auto itEnd = players.end(); + for (auto it = players.begin(); it != itEnd; it++) { std::shared_ptr p = *it; // players.at(i); double dist = p->distanceToSqr(x, y, z); @@ -3705,8 +3705,8 @@ std::shared_ptr Level::getNearestPlayer(double x, double z, double maxDist) { double best = -1; std::shared_ptr result = nullptr; - AUTO_VAR(itEnd, players.end()); - for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { + auto itEnd = players.end(); + for (auto it = players.begin(); it != itEnd; it++) { std::shared_ptr p = *it; double dist = p->distanceToSqr(x, p->y, z); if ((maxDist < 0 || dist < maxDist * maxDist) && @@ -3729,8 +3729,8 @@ std::shared_ptr Level::getNearestAttackablePlayer(double x, double y, double best = -1; std::shared_ptr result = nullptr; - AUTO_VAR(itEnd, players.end()); - for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { + auto itEnd = players.end(); + for (auto it = players.begin(); it != itEnd; it++) { std::shared_ptr p = *it; // 4J Stu - Added privilege check @@ -3765,8 +3765,8 @@ std::shared_ptr Level::getNearestAttackablePlayer(double x, double y, } std::shared_ptr Level::getPlayerByName(const std::wstring& name) { - AUTO_VAR(itEnd, players.end()); - for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { + auto itEnd = players.end(); + for (auto it = players.begin(); it != itEnd; it++) { if (name.compare((*it)->getName()) == 0) { return *it; // players.at(i); } @@ -3775,8 +3775,8 @@ std::shared_ptr Level::getPlayerByName(const std::wstring& name) { } std::shared_ptr Level::getPlayerByUUID(const std::wstring& name) { - AUTO_VAR(itEnd, players.end()); - for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { + auto itEnd = players.end(); + for (auto it = players.begin(); it != itEnd; it++) { if (name.compare((*it)->getUUID()) == 0) { return *it; // players.at(i); } @@ -3900,7 +3900,7 @@ void Level::setGameTime(int64_t time) { // Apply stat to each player. if (timeDiff > 0 && levelData->getGameTime() != -1) { - AUTO_VAR(itEnd, players.end()); + auto itEnd = players.end(); for (std::vector >::iterator it = players.begin(); it != itEnd; it++) { @@ -4028,8 +4028,8 @@ int Level::getAuxValueForMap(PlayerUID xuid, int dimension, int centreXC, void Level::globalLevelEvent(int type, int sourceX, int sourceY, int sourceZ, int data) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->globalLevelEvent(type, sourceX, sourceY, sourceZ, data); } } @@ -4040,8 +4040,8 @@ void Level::levelEvent(int type, int x, int y, int z, int data) { void Level::levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->levelEvent(source, type, x, y, z, data); } } @@ -4078,8 +4078,8 @@ double Level::getHorizonHeight() { } void Level::destroyTileProgress(int id, int x, int y, int z, int progress) { - AUTO_VAR(itEnd, listeners.end()); - for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) { + auto itEnd = listeners.end(); + for (auto it = listeners.begin(); it != itEnd; it++) { (*it)->destroyTileProgress(id, x, y, z, progress); } } diff --git a/Minecraft.World/Level/LevelChunk.cpp b/Minecraft.World/Level/LevelChunk.cpp index 4c2f6f542..dc8df54fc 100644 --- a/Minecraft.World/Level/LevelChunk.cpp +++ b/Minecraft.World/Level/LevelChunk.cpp @@ -1218,7 +1218,7 @@ void LevelChunk::removeEntity(std::shared_ptr e, int yc) { #endif // 4J - was entityBlocks[yc]->remove(e); - AUTO_VAR(it, find(entityBlocks[yc]->begin(), entityBlocks[yc]->end(), e)); + auto it = find(entityBlocks[yc]->begin(), entityBlocks[yc]->end(), e); if (it != entityBlocks[yc]->end()) { entityBlocks[yc]->erase(it); // 4J - we don't want storage creeping up here as thinkgs move round the @@ -1258,7 +1258,7 @@ std::shared_ptr LevelChunk::getTileEntity(int x, int y, int z) { // shared_ptr tileEntity = tileEntities[pos]; EnterCriticalSection(&m_csTileEntities); std::shared_ptr tileEntity = nullptr; - AUTO_VAR(it, tileEntities.find(pos)); + auto it = tileEntities.find(pos); if (it == tileEntities.end()) { LeaveCriticalSection( @@ -1290,7 +1290,7 @@ std::shared_ptr LevelChunk::getTileEntity(int x, int y, int z) { // 4J Stu - It should have been inserted by now, but check to be sure EnterCriticalSection(&m_csTileEntities); - AUTO_VAR(newIt, tileEntities.find(pos)); + auto newIt = tileEntities.find(pos); if (newIt != tileEntities.end()) { tileEntity = newIt->second; } @@ -1340,7 +1340,7 @@ void LevelChunk::setTileEntity(int x, int y, int z, "tile!\n"); return; } - AUTO_VAR(it, tileEntities.find(pos)); + auto it = tileEntities.find(pos); if (it != tileEntities.end()) it->second->setRemoved(); tileEntity->clearRemoved(); @@ -1360,7 +1360,7 @@ void LevelChunk::removeTileEntity(int x, int y, int z) { // removeThis.setRemoved(); // } EnterCriticalSection(&m_csTileEntities); - AUTO_VAR(it, tileEntities.find(pos)); + auto it = tileEntities.find(pos); if (it != tileEntities.end()) { std::shared_ptr te = tileEntities[pos]; tileEntities.erase(pos); @@ -1418,7 +1418,7 @@ void LevelChunk::load() { std::vector > values; EnterCriticalSection(&m_csTileEntities); - for (AUTO_VAR(it, tileEntities.begin()); it != tileEntities.end(); + for (auto it = tileEntities.begin(); it != tileEntities.end(); it++) { values.push_back(it->second); } @@ -1451,14 +1451,14 @@ void LevelChunk::unload(bool unloadTileEntities) // 4J - added parameter if (unloadTileEntities) { std::vector > tileEntitiesToRemove; EnterCriticalSection(&m_csTileEntities); - for (AUTO_VAR(it, tileEntities.begin()); it != tileEntities.end(); + for (auto it = tileEntities.begin(); it != tileEntities.end(); it++) { tileEntitiesToRemove.push_back(it->second); } LeaveCriticalSection(&m_csTileEntities); - AUTO_VAR(itEnd, tileEntitiesToRemove.end()); - for (AUTO_VAR(it, tileEntitiesToRemove.begin()); it != itEnd; it++) { + auto itEnd = tileEntitiesToRemove.end(); + for (auto it = tileEntitiesToRemove.begin(); it != itEnd; it++) { // 4J-PB -m 1.7.3 was it->second->setRemoved(); level->markForRemoval(*it); } @@ -1494,7 +1494,7 @@ void LevelChunk::unload(bool unloadTileEntities) // 4J - added parameter EnterCriticalSection(&m_csEntities); for (int i = 0; i < ENTITY_BLOCKS_LENGTH; i++) { - AUTO_VAR(itEnd, entityBlocks[i]->end()); + auto itEnd = entityBlocks[i]->end(); for (std::vector >::iterator it = entityBlocks[i]->begin(); it != itEnd; it++) { @@ -1516,7 +1516,7 @@ void LevelChunk::unload(bool unloadTileEntities) // 4J - added parameter PIXBeginNamedEvent(0, "Saving tile entities"); ListTag* tileEntityTags = new ListTag(); - AUTO_VAR(itEnd, tileEntities.end()); + auto itEnd = tileEntities.end(); for (std::unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = tileEntities.begin(); @@ -1583,8 +1583,8 @@ void LevelChunk::getEntities(std::shared_ptr except, AABB* bb, for (int yc = yc0; yc <= yc1; yc++) { std::vector >* entities = entityBlocks[yc]; - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities->at(i); if (e != except && e->bb.intersects(*bb) && (selector == nullptr || selector->matches(e))) { @@ -1629,8 +1629,8 @@ void LevelChunk::getEntitiesOfClass(const std::type_info& ec, AABB* bb, for (int yc = yc0; yc <= yc1; yc++) { std::vector >* entities = entityBlocks[yc]; - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities->at(i); bool isAssignableFrom = false; @@ -1929,7 +1929,7 @@ int LevelChunk::setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, } */ - for (AUTO_VAR(it, tileEntities.begin()); it != tileEntities.end(); ++it) { + for (auto it = tileEntities.begin(); it != tileEntities.end(); ++it) { it->second->clearCache(); } // recalcHeightmap(); diff --git a/Minecraft.World/Level/LevelConflictException.h b/Minecraft.World/Level/LevelConflictException.h index 43697842c..f2153e2af 100644 --- a/Minecraft.World/Level/LevelConflictException.h +++ b/Minecraft.World/Level/LevelConflictException.h @@ -4,7 +4,7 @@ class LevelConflictException : public RuntimeException { private: - static const __int32 serialVersionUID = 1L; + static const int32_t serialVersionUID = 1L; public: LevelConflictException(const std::wstring& msg); diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp index 29f1cc3b5..cededb290 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp @@ -117,7 +117,7 @@ bool DirectoryLevelStorage::PlayerMappings::getMapping(int& id, int centreX, int64_t index = (((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | (((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ((scale & 0x7) << 2) | (dimension & 0x3); - AUTO_VAR(it, m_mappings.find(index)); + auto it = m_mappings.find(index); if (it != m_mappings.end()) { id = it->second; // app.DebugPrintf("Found mapping: %d - (%d,%d)/%d/%d [%I64d - @@ -133,7 +133,7 @@ bool DirectoryLevelStorage::PlayerMappings::getMapping(int& id, int centreX, void DirectoryLevelStorage::PlayerMappings::writeMappings( DataOutputStream* dos) { dos->writeInt(m_mappings.size()); - for (AUTO_VAR(it, m_mappings.begin()); it != m_mappings.end(); ++it) { + for (auto it = m_mappings.begin(); it != m_mappings.end(); ++it) { app.DebugPrintf(" -- %lld (0x%016llx) = %d\n", it->first, it->first, it->second); dos->writeLong(it->first); @@ -172,7 +172,7 @@ DirectoryLevelStorage::DirectoryLevelStorage(ConsoleSaveFile* saveFile, DirectoryLevelStorage::~DirectoryLevelStorage() { delete m_saveFile; - for (AUTO_VAR(it, m_cachedSaveData.begin()); it != m_cachedSaveData.end(); + for (auto it = m_cachedSaveData.begin(); it != m_cachedSaveData.end(); ++it) { delete it->second; } @@ -371,7 +371,7 @@ void DirectoryLevelStorage::save(std::shared_ptr player) { ByteArrayOutputStream* bos = new ByteArrayOutputStream(); NbtIo::writeCompressed(tag, bos); - AUTO_VAR(it, m_cachedSaveData.find(realFile.getName())); + auto it = m_cachedSaveData.find(realFile.getName()); if (it != m_cachedSaveData.end()) { delete it->second; } @@ -404,7 +404,7 @@ CompoundTag* DirectoryLevelStorage::loadPlayerDataTag(PlayerUID xuid) { // 4J Jev, removed try/catch. ConsoleSavePath realFile = ConsoleSavePath(playerDir.getName() + _toString(xuid) + L".dat"); - AUTO_VAR(it, m_cachedSaveData.find(realFile.getName())); + auto it = m_cachedSaveData.find(realFile.getName()); if (it != m_cachedSaveData.end()) { ByteArrayOutputStream* bos = it->second; ByteArrayInputStream bis(bos->buf, 0, bos->size()); @@ -497,7 +497,7 @@ void DirectoryLevelStorage::resetNetherPlayerPositions() { m_saveFile->getFilesWithPrefix(playerDir.getName()); if (playerFiles != nullptr) { - for (AUTO_VAR(it, playerFiles->begin()); it != playerFiles->end(); + for (auto it = playerFiles->begin(); it != playerFiles->end(); ++it) { FileEntry* realFile = *it; ConsoleSaveFileInputStream fis = @@ -535,7 +535,7 @@ int DirectoryLevelStorage::getAuxValueForMap(PlayerUID xuid, int dimension, bool foundMapping = false; #if defined(_LARGE_WORLDS) - AUTO_VAR(it, m_playerMappings.find(xuid)); + auto it = m_playerMappings.find(xuid); if (it != m_playerMappings.end()) { foundMapping = it->second.getMapping(mapId, centreXC, centreZC, dimension, scale); @@ -580,8 +580,8 @@ int DirectoryLevelStorage::getAuxValueForMap(PlayerUID xuid, int dimension, ConsoleSavePath file = getDataFile(id); if (m_saveFile->doesFileExist(file)) { - AUTO_VAR(it, find(m_mapFilesToDelete.begin(), - m_mapFilesToDelete.end(), mapId)); + auto it = find(m_mapFilesToDelete.begin(), + m_mapFilesToDelete.end(), mapId); if (it != m_mapFilesToDelete.end()) m_mapFilesToDelete.erase(it); m_saveFile->deleteFile(m_saveFile->createFile(file)); @@ -610,7 +610,7 @@ void DirectoryLevelStorage::saveMapIdLookup() { DataOutputStream dos(&baos); dos.writeInt(m_playerMappings.size()); app.DebugPrintf("Saving %d mappings\n", m_playerMappings.size()); - for (AUTO_VAR(it, m_playerMappings.begin()); + for (auto it = m_playerMappings.begin(); it != m_playerMappings.end(); ++it) { #if defined(_WINDOWS64) || defined(__linux__) app.DebugPrintf(" -- %d\n", it->first); @@ -644,9 +644,9 @@ void DirectoryLevelStorage::saveMapIdLookup() { void DirectoryLevelStorage::dontSaveMapMappingForPlayer(PlayerUID xuid) { #if defined(_LARGE_WORLDS) - AUTO_VAR(it, m_playerMappings.find(xuid)); + auto it = m_playerMappings.find(xuid); if (it != m_playerMappings.end()) { - for (AUTO_VAR(itMap, it->second.m_mappings.begin()); + for (auto itMap = it->second.m_mappings.begin(); itMap != it->second.m_mappings.end(); ++itMap) { int index = itMap->second / 8; int offset = itMap->second % 8; @@ -671,9 +671,9 @@ void DirectoryLevelStorage::deleteMapFilesForPlayer( void DirectoryLevelStorage::deleteMapFilesForPlayer(PlayerUID xuid) { #if defined(_LARGE_WORLDS) - AUTO_VAR(it, m_playerMappings.find(xuid)); + auto it = m_playerMappings.find(xuid); if (it != m_playerMappings.end()) { - for (AUTO_VAR(itMap, it->second.m_mappings.begin()); + for (auto itMap = it->second.m_mappings.begin(); itMap != it->second.m_mappings.end(); ++itMap) { std::wstring id = std::wstring(L"map_") + _toString(itMap->second); ConsoleSavePath file = getDataFile(id); @@ -722,7 +722,7 @@ void DirectoryLevelStorage::saveAllCachedData() { if (StorageManager.GetSaveDisabled()) return; // Save any files that were saved while saving was disabled - for (AUTO_VAR(it, m_cachedSaveData.begin()); it != m_cachedSaveData.end(); + for (auto it = m_cachedSaveData.begin(); it != m_cachedSaveData.end(); ++it) { ByteArrayOutputStream* bos = it->second; @@ -737,7 +737,7 @@ void DirectoryLevelStorage::saveAllCachedData() { } m_cachedSaveData.clear(); - for (AUTO_VAR(it, m_mapFilesToDelete.begin()); + for (auto it = m_mapFilesToDelete.begin(); it != m_mapFilesToDelete.end(); ++it) { std::wstring id = std::wstring(L"map_") + _toString(*it); ConsoleSavePath file = getDataFile(id); diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp b/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp index e1329eef2..32294eb7d 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorageSource.cpp @@ -86,8 +86,8 @@ void DirectoryLevelStorageSource::deleteLevel(const std::wstring& levelId) { } void DirectoryLevelStorageSource::deleteRecursive(std::vector* files) { - AUTO_VAR(itEnd, files->end()); - for (AUTO_VAR(it, files->begin()); it != itEnd; it++) { + auto itEnd = files->end(); + for (auto it = files->begin(); it != itEnd; it++) { File* file = *it; if (file->isDirectory()) { deleteRecursive(file->listFiles()); diff --git a/Minecraft.World/Level/Storage/EntityIO.cpp b/Minecraft.World/Level/Storage/EntityIO.cpp index 6ac077070..85f0a9e09 100644 --- a/Minecraft.World/Level/Storage/EntityIO.cpp +++ b/Minecraft.World/Level/Storage/EntityIO.cpp @@ -231,7 +231,7 @@ std::shared_ptr EntityIO::newEntity(const std::wstring& id, Level* level) { std::shared_ptr entity; - AUTO_VAR(it, idCreateMap->find(id)); + auto it = idCreateMap->find(id); if (it != idCreateMap->end()) { entityCreateFn create = it->second; if (create != nullptr) entity = std::shared_ptr(create(level)); @@ -265,7 +265,7 @@ std::shared_ptr EntityIO::loadStatic(CompoundTag* tag, Level* level) { tag->remove(L"Type"); } - AUTO_VAR(it, idCreateMap->find(tag->getString(L"id"))); + auto it = idCreateMap->find(tag->getString(L"id")); if (it != idCreateMap->end()) { entityCreateFn create = it->second; if (create != nullptr) entity = std::shared_ptr(create(level)); @@ -289,7 +289,7 @@ std::shared_ptr EntityIO::loadStatic(CompoundTag* tag, Level* level) { std::shared_ptr EntityIO::newById(int id, Level* level) { std::shared_ptr entity; - AUTO_VAR(it, numCreateMap->find(id)); + auto it = numCreateMap->find(id); if (it != numCreateMap->end()) { entityCreateFn create = it->second; if (create != nullptr) entity = std::shared_ptr(create(level)); @@ -314,7 +314,7 @@ std::shared_ptr EntityIO::newByEnumType(eINSTANCEOF eType, eINSTANCEOFKeyEq>::iterator it = classNumMap->find(eType); if (it != classNumMap->end()) { - AUTO_VAR(it2, numCreateMap->find(it->second)); + auto it2 = numCreateMap->find(it->second); if (it2 != numCreateMap->end()) { entityCreateFn create = it2->second; if (create != nullptr) entity = std::shared_ptr(create(level)); @@ -346,7 +346,7 @@ std::wstring EntityIO::getEncodeId(std::shared_ptr entity) { } int EntityIO::getId(const std::wstring& encodeId) { - AUTO_VAR(it, idNumMap->find(encodeId)); + auto it = idNumMap->find(encodeId); if (it == idNumMap->end()) { // defaults to pig... return 90; @@ -361,7 +361,7 @@ std::wstring EntityIO::getEncodeId(int entityIoValue) { // return classIdMap.get(class1); // } - AUTO_VAR(it, numClassMap->find(entityIoValue)); + auto it = numClassMap->find(entityIoValue); if (it != numClassMap->end()) { std::unordered_map::iterator classIdIt = @@ -378,7 +378,7 @@ std::wstring EntityIO::getEncodeId(int entityIoValue) { int EntityIO::getNameId(int entityIoValue) { int id = -1; - AUTO_VAR(it, idsSpawnableInCreative.find(entityIoValue)); + auto it = idsSpawnableInCreative.find(entityIoValue); if (it != idsSpawnableInCreative.end()) { id = it->second->nameId; } @@ -387,7 +387,7 @@ int EntityIO::getNameId(int entityIoValue) { } eINSTANCEOF EntityIO::getType(const std::wstring& idString) { - AUTO_VAR(it, numClassMap->find(getId(idString))); + auto it = numClassMap->find(getId(idString)); if (it != numClassMap->end()) { return it->second; } @@ -395,7 +395,7 @@ eINSTANCEOF EntityIO::getType(const std::wstring& idString) { } eINSTANCEOF EntityIO::getClass(int id) { - AUTO_VAR(it, numClassMap->find(id)); + auto it = numClassMap->find(id); if (it != numClassMap->end()) { return it->second; } diff --git a/Minecraft.World/Level/Storage/MapItemSavedData.cpp b/Minecraft.World/Level/Storage/MapItemSavedData.cpp index 676a1e9db..7e38466fb 100644 --- a/Minecraft.World/Level/Storage/MapItemSavedData.cpp +++ b/Minecraft.World/Level/Storage/MapItemSavedData.cpp @@ -89,7 +89,7 @@ charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket( data[i * DEC_PACKET_BYTES + 7] |= md->visible ? 0x80 : 0x0; } unsigned int dataIndex = playerDecorationsSize; - for (AUTO_VAR(it, parent->nonPlayerDecorations.begin()); + for (auto it = parent->nonPlayerDecorations.begin(); it != parent->nonPlayerDecorations.end(); ++it) { MapDecoration* md = it->second; #if defined(_LARGE_WORLDS) @@ -238,7 +238,7 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, // 4J Stu - Put this block back in if you want to display entity positions // on a map (see below) bool addedPlayers = false; - for (AUTO_VAR(it, carriedBy.begin()); it != carriedBy.end();) { + for (auto it = carriedBy.begin(); it != carriedBy.end();) { std::shared_ptr hp = *it; // 4J Stu - Players in the same dimension as an item frame with a map @@ -246,8 +246,8 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, if (hp->player->removed) //|| (!hp->player->inventory->contains(item) //&& !item->isFramed() )) { - AUTO_VAR(it2, carriedByPlayers.find( - (std::shared_ptr)hp->player)); + auto it2 = carriedByPlayers.find( + (std::shared_ptr)hp->player); if (it2 != carriedByPlayers.end()) { carriedByPlayers.erase(it2); } @@ -262,7 +262,7 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, bool atLeastOnePlayerInTheEnd = false; PlayerList* players = MinecraftServer::getInstance()->getPlayerList(); - for (AUTO_VAR(it3, players->players.begin()); + for (auto it3 = players->players.begin(); it3 != players->players.end(); ++it3) { std::shared_ptr serverPlayer = *it3; if (serverPlayer->dimension == 1) { @@ -271,8 +271,8 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, } } - AUTO_VAR(currentPortalDecoration, - nonPlayerDecorations.find(END_PORTAL_DECORATION_KEY)); + auto currentPortalDecoration = + nonPlayerDecorations.find(END_PORTAL_DECORATION_KEY); if (currentPortalDecoration == nonPlayerDecorations.end() && atLeastOnePlayerInTheEnd) { float origX = 0.0f; @@ -367,7 +367,7 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, PlayerList* players = MinecraftServer::getInstance()->getPlayerList(); - for (AUTO_VAR(it3, players->players.begin()); + for (auto it3 = players->players.begin(); it3 != players->players.end(); ++it3) { std::shared_ptr decorationPlayer = *it3; if (decorationPlayer != nullptr && @@ -465,7 +465,7 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, charArray MapItemSavedData::getUpdatePacket( std::shared_ptr itemInstance, Level* level, std::shared_ptr player) { - AUTO_VAR(it, carriedByPlayers.find(player)); + auto it = carriedByPlayers.find(player); if (it == carriedByPlayers.end()) return charArray(); std::shared_ptr hp = it->second; @@ -475,8 +475,8 @@ charArray MapItemSavedData::getUpdatePacket( void MapItemSavedData::setDirty(int x, int y0, int y1) { SavedData::setDirty(); - AUTO_VAR(itEnd, carriedBy.end()); - for (AUTO_VAR(it, carriedBy.begin()); it != itEnd; it++) { + auto itEnd = carriedBy.end(); + for (auto it = carriedBy.begin(); it != itEnd; it++) { std::shared_ptr hp = *it; // carriedBy.at(i); if (hp->rowsDirtyMin[x] < 0 || hp->rowsDirtyMin[x] > y0) hp->rowsDirtyMin[x] = y0; @@ -529,7 +529,7 @@ void MapItemSavedData::handleComplexItemData(charArray& data) { std::shared_ptr MapItemSavedData::getHoldingPlayer(std::shared_ptr player) { std::shared_ptr hp = nullptr; - AUTO_VAR(it, carriedByPlayers.find(player)); + auto it = carriedByPlayers.find(player); if (it == carriedByPlayers.end()) { hp = std::shared_ptr(new HoldingPlayer(player, this)); @@ -572,8 +572,8 @@ void MapItemSavedData::mergeInMapData( void MapItemSavedData::removeItemFrameDecoration( std::shared_ptr item) { - AUTO_VAR(frameDecoration, - nonPlayerDecorations.find(item->getFrame()->entityId)); + auto frameDecoration = + nonPlayerDecorations.find(item->getFrame()->entityId); if (frameDecoration != nonPlayerDecorations.end()) { delete frameDecoration->second; nonPlayerDecorations.erase(frameDecoration); diff --git a/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp b/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp index 869a73ca6..041b69782 100644 --- a/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/McRegionChunkStorage.cpp @@ -67,7 +67,7 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile* saveFile, } McRegionChunkStorage::~McRegionChunkStorage() { - for (AUTO_VAR(it, m_entityData.begin()); it != m_entityData.end(); ++it) { + for (auto it = m_entityData.begin(); it != m_entityData.end(); ++it) { delete it->second.data; } } @@ -85,7 +85,7 @@ LevelChunk* McRegionChunkStorage::load(Level* level, int x, int z) { uint64_t index = ((uint64_t)(uint32_t)(x) << 32) | (((uint64_t)(uint32_t)(z))); - AUTO_VAR(it, m_entityData.find(index)); + auto it = m_entityData.find(index); if (it != m_entityData.end()) { delete it->second.data; m_entityData.erase(it); @@ -268,7 +268,7 @@ void McRegionChunkStorage::saveEntities(Level* level, LevelChunk* levelChunk) { m_entityData[index] = savedData; } else { - AUTO_VAR(it, m_entityData.find(index)); + auto it = m_entityData.find(index); if (it != m_entityData.end()) { m_entityData.erase(it); } @@ -283,7 +283,7 @@ void McRegionChunkStorage::loadEntities(Level* level, LevelChunk* levelChunk) { int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z)) & 0x00000000FFFFFFFF); - AUTO_VAR(it, m_entityData.find(index)); + auto it = m_entityData.find(index); if (it != m_entityData.end()) { ByteArrayInputStream bais(it->second); DataInputStream dis(&bais); @@ -310,7 +310,7 @@ void McRegionChunkStorage::flush() { PIXBeginNamedEvent(0, "Writing to stream"); dos.writeInt(m_entityData.size()); - for (AUTO_VAR(it, m_entityData.begin()); it != m_entityData.end(); ++it) { + for (auto it = m_entityData.begin(); it != m_entityData.end(); ++it) { dos.writeLong(it->first); dos.write(it->second, 0, it->second.length); } diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp b/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp index 2fb1981b9..faa4f9f15 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/McRegionLevelStorage.cpp @@ -31,7 +31,7 @@ ChunkStorage* McRegionLevelStorage::createChunkStorage(Dimension* dimension) { m_saveFile->getRegionFilesByDimension(1); if (netherFiles != nullptr) { DWORD bytesWritten = 0; - for (AUTO_VAR(it, netherFiles->begin()); + for (auto it = netherFiles->begin(); it != netherFiles->end(); ++it) { m_saveFile->zeroFile(*it, (*it)->getFileSize(), &bytesWritten); @@ -42,7 +42,7 @@ ChunkStorage* McRegionLevelStorage::createChunkStorage(Dimension* dimension) { std::vector* netherFiles = m_saveFile->getFilesWithPrefix(LevelStorage::NETHER_FOLDER); if (netherFiles != nullptr) { - for (AUTO_VAR(it, netherFiles->begin()); + for (auto it = netherFiles->begin(); it != netherFiles->end(); ++it) { m_saveFile->deleteFile(*it); } @@ -78,7 +78,7 @@ ChunkStorage* McRegionLevelStorage::createChunkStorage(Dimension* dimension) { // 4J-PB - There will be no End in early saves if (endFiles != nullptr) { - for (AUTO_VAR(it, endFiles->begin()); it != endFiles->end(); + for (auto it = endFiles->begin(); it != endFiles->end(); ++it) { m_saveFile->deleteFile(*it); } diff --git a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp b/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp index b4ae46969..e7861e446 100644 --- a/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp +++ b/Minecraft.World/Level/Storage/McRegionLevelStorageSource.cpp @@ -85,8 +85,8 @@ void McRegionLevelStorageSource::eraseFolders(std::vector* folders, int currentCount, int totalCount, ProgressListener* progress) { File* folder; - AUTO_VAR(itEnd, folders->end()); - for (AUTO_VAR(it, folders->begin()); it != itEnd; it++) { + auto itEnd = folders->end(); + for (auto it = folders->begin(); it != itEnd; it++) { folder = *it; // folders->at(i); std::vector* files = folder->listFiles(); diff --git a/Minecraft.World/Level/Storage/OldChunkStorage.cpp b/Minecraft.World/Level/Storage/OldChunkStorage.cpp index b00a8e85e..f4b2fa155 100644 --- a/Minecraft.World/Level/Storage/OldChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/OldChunkStorage.cpp @@ -202,7 +202,7 @@ bool OldChunkStorage::saveEntities(LevelChunk* lc, Level* level, EnterCriticalSection(&lc->m_csEntities); #endif for (int i = 0; i < lc->ENTITY_BLOCKS_LENGTH; i++) { - AUTO_VAR(itEnd, lc->entityBlocks[i]->end()); + auto itEnd = lc->entityBlocks[i]->end(); for (std::vector >::iterator it = lc->entityBlocks[i]->begin(); it != itEnd; it++) { @@ -259,7 +259,7 @@ void OldChunkStorage::save(LevelChunk* lc, Level* level, PIXBeginNamedEvent(0, "Saving tile entities"); ListTag* tileEntityTags = new ListTag(); - AUTO_VAR(itEnd, lc->tileEntities.end()); + auto itEnd = lc->tileEntities.end(); for (std::unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); @@ -357,7 +357,7 @@ void OldChunkStorage::save(LevelChunk* lc, Level* level, CompoundTag* tag) { PIXBeginNamedEvent(0, "Saving tile entities"); ListTag* tileEntityTags = new ListTag(); - AUTO_VAR(itEnd, lc->tileEntities.end()); + auto itEnd = lc->tileEntities.end(); for (std::unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); diff --git a/Minecraft.World/Level/Storage/PortalForcer.cpp b/Minecraft.World/Level/Storage/PortalForcer.cpp index b7f877007..19e93c033 100644 --- a/Minecraft.World/Level/Storage/PortalForcer.cpp +++ b/Minecraft.World/Level/Storage/PortalForcer.cpp @@ -17,7 +17,7 @@ PortalForcer::PortalForcer(ServerLevel* level) { } PortalForcer::~PortalForcer() { - for (AUTO_VAR(it, cachedPortals.begin()); it != cachedPortals.end(); ++it) { + for (auto it = cachedPortals.begin(); it != cachedPortals.end(); ++it) { delete it->second; } } @@ -83,7 +83,7 @@ bool PortalForcer::findPortal(std::shared_ptr e, double xOriginal, long hash = ChunkPos::hashCode(xc, zc); bool updateCache = true; - AUTO_VAR(it, cachedPortals.find(hash)); + auto it = cachedPortals.find(hash); if (it != cachedPortals.end()) { PortalPosition* pos = it->second; @@ -478,7 +478,7 @@ void PortalForcer::tick(int64_t time) { if (time % (SharedConstants::TICKS_PER_SECOND * 5) == 0) { int64_t cutoff = time - SharedConstants::TICKS_PER_SECOND * 30; - for (AUTO_VAR(it, cachedPortalKeys.begin()); + for (auto it = cachedPortalKeys.begin(); it != cachedPortalKeys.end();) { int64_t key = *it; PortalPosition* pos = cachedPortals[key]; diff --git a/Minecraft.World/Level/Storage/RegionFileCache.cpp b/Minecraft.World/Level/Storage/RegionFileCache.cpp index 5d7da2a24..710302033 100644 --- a/Minecraft.World/Level/Storage/RegionFileCache.cpp +++ b/Minecraft.World/Level/Storage/RegionFileCache.cpp @@ -39,7 +39,7 @@ RegionFile* RegionFileCache::_getRegionFile( MemSect(0); RegionFile* ref = nullptr; - AUTO_VAR(it, cache.find(file)); + auto it = cache.find(file); if (it != cache.end()) ref = it->second; // 4J Jev, put back in. @@ -65,8 +65,8 @@ if (!regionDir.exists()) void RegionFileCache::_clear() // 4J - TODO was synchronized { - AUTO_VAR(itEnd, cache.end()); - for (AUTO_VAR(it, cache.begin()); it != itEnd; it++) { + auto itEnd = cache.end(); + for (auto it = cache.begin(); it != itEnd; it++) { // 4J - removed try/catch // try { RegionFile* regionFile = it->second; diff --git a/Minecraft.World/Level/Storage/SavedDataStorage.cpp b/Minecraft.World/Level/Storage/SavedDataStorage.cpp index ebfa9efaf..47f47d4ff 100644 --- a/Minecraft.World/Level/Storage/SavedDataStorage.cpp +++ b/Minecraft.World/Level/Storage/SavedDataStorage.cpp @@ -21,7 +21,7 @@ SavedDataStorage::SavedDataStorage(LevelStorage* levelStorage) { std::shared_ptr SavedDataStorage::get(const std::type_info& clazz, const std::wstring& id) { - AUTO_VAR(it, cache.find(id)); + auto it = cache.find(id); if (it != cache.end()) return (*it).second; std::shared_ptr data = nullptr; @@ -76,9 +76,9 @@ void SavedDataStorage::set(const std::wstring& id, // TODO 4J Stu - throw new RuntimeException("Can't set null data"); assert(false); } - AUTO_VAR(it, cache.find(id)); + auto it = cache.find(id); if (it != cache.end()) { - AUTO_VAR(it2, find(savedDatas.begin(), savedDatas.end(), it->second)); + auto it2 = find(savedDatas.begin(), savedDatas.end(), it->second); if (it2 != savedDatas.end()) { savedDatas.erase(it2); } @@ -89,8 +89,8 @@ void SavedDataStorage::set(const std::wstring& id, } void SavedDataStorage::save() { - AUTO_VAR(itEnd, savedDatas.end()); - for (AUTO_VAR(it, savedDatas.begin()); it != itEnd; it++) { + auto itEnd = savedDatas.end(); + for (auto it = savedDatas.begin(); it != itEnd; it++) { std::shared_ptr data = *it; // savedDatas->at(i); if (data->isDirty()) { save(data); @@ -135,8 +135,8 @@ void SavedDataStorage::loadAuxValues() { Tag* tag; std::vector* allTags = tags->getAllTags(); - AUTO_VAR(itEnd, allTags->end()); - for (AUTO_VAR(it, allTags->begin()); it != itEnd; it++) { + auto itEnd = allTags->end(); + for (auto it = allTags->begin(); it != itEnd; it++) { tag = *it; // tags->getAllTags()->at(i); if (dynamic_cast(tag) != nullptr) { @@ -151,7 +151,7 @@ void SavedDataStorage::loadAuxValues() { } int SavedDataStorage::getFreeAuxValueFor(const std::wstring& id) { - AUTO_VAR(it, usedAuxIds.find(id)); + auto it = usedAuxIds.find(id); short val = 0; if (it != usedAuxIds.end()) { val = (*it).second; @@ -167,7 +167,7 @@ int SavedDataStorage::getFreeAuxValueFor(const std::wstring& id) { // TODO 4J Stu - This was iterating over the keySet in Java, so // potentially we are looking at more items? - AUTO_VAR(itEndAuxIds, usedAuxIds.end()); + auto itEndAuxIds = usedAuxIds.end(); for (uaiMapType::iterator it2 = usedAuxIds.begin(); it2 != itEndAuxIds; it2++) { short value = it2->second; diff --git a/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp b/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp index 4cc0157ca..c0783300a 100644 --- a/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp +++ b/Minecraft.World/Level/Storage/ZonedChunkStorage.cpp @@ -146,7 +146,7 @@ void ZonedChunkStorage::tick() { if (tickCount % (20 * 10) == 4) { std::vector toClose; - AUTO_VAR(itEndZF, zoneFiles.end()); + auto itEndZF = zoneFiles.end(); for (std::unordered_map::iterator it = zoneFiles.begin(); it != itEndZF; it++) { @@ -156,8 +156,8 @@ void ZonedChunkStorage::tick() { } } - AUTO_VAR(itEndTC, toClose.end()); - for (AUTO_VAR(it, toClose.begin()); it != itEndTC; it++) { + auto itEndTC = toClose.end(); + for (auto it = toClose.begin(); it != itEndTC; it++) { int64_t key = *it; // toClose[i]; // 4J - removed try/catch // try { @@ -174,7 +174,7 @@ void ZonedChunkStorage::tick() { } void ZonedChunkStorage::flush() { - AUTO_VAR(itEnd, zoneFiles.end()); + auto itEnd = zoneFiles.end(); for (std::unordered_map::iterator it = zoneFiles.begin(); it != itEnd; it++) { @@ -194,8 +194,8 @@ void ZonedChunkStorage::loadEntities(Level* level, LevelChunk* lc) { ZoneFile* zoneFile = getZoneFile(lc->x, lc->z, true); std::vector* tags = zoneFile->entityFile->readAll(slot); - AUTO_VAR(itEnd, tags->end()); - for (AUTO_VAR(it, tags->begin()); it != itEnd; it++) { + auto itEnd = tags->end(); + for (auto it = tags->begin(); it != itEnd; it++) { CompoundTag* tag = *it; // tags->at(i); int type = tag->getInt(L"_TYPE"); if (type == 0) { @@ -222,8 +222,8 @@ void ZonedChunkStorage::saveEntities(Level* level, LevelChunk* lc) { for (int i = 0; i < LevelChunk::ENTITY_BLOCKS_LENGTH; i++) { std::vector >* entities = lc->entityBlocks[i]; - AUTO_VAR(itEndTags, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEndTags; it++) { + auto itEndTags = entities->end(); + for (auto it = entities->begin(); it != itEndTags; it++) { std::shared_ptr e = *it; // entities->at(j); CompoundTag* cp = new CompoundTag(); cp->putInt(L"_TYPE", 0); diff --git a/Minecraft.World/Network/Connection.h b/Minecraft.World/Network/Connection.h index 8930cfb69..d949ac2b2 100644 --- a/Minecraft.World/Network/Connection.h +++ b/Minecraft.World/Network/Connection.h @@ -17,10 +17,10 @@ class ByteArrayOutputStream; class Connection { - friend DWORD WINAPI runRead(LPVOID lpParam); - friend DWORD WINAPI runWrite(LPVOID lpParam); - friend DWORD WINAPI runSendAndQuit(LPVOID lpParam); - friend DWORD WINAPI runClose(LPVOID lpParam); + friend DWORD WINAPI runRead(void* lpParam); + friend DWORD WINAPI runWrite(void* lpParam); + friend DWORD WINAPI runSendAndQuit(void* lpParam); + friend DWORD WINAPI runClose(void* lpParam); private: static const int SEND_BUFFER_SIZE = 1024 * 5; diff --git a/Minecraft.World/Network/Packets/ExplodePacket.cpp b/Minecraft.World/Network/Packets/ExplodePacket.cpp index 99419040c..97650af0d 100644 --- a/Minecraft.World/Network/Packets/ExplodePacket.cpp +++ b/Minecraft.World/Network/Packets/ExplodePacket.cpp @@ -28,7 +28,7 @@ ExplodePacket::ExplodePacket( if (toBlow != nullptr) { this->toBlow.assign(toBlow->begin(), toBlow->end()); - // for( AUTO_VAR(it, toBlow->begin()); it != toBlow->end(); it++ ) + // for( auto it = toBlow->begin(); it != toBlow->end(); it++ ) //{ // this->toBlow.push_back(*it); // } @@ -86,7 +86,7 @@ void ExplodePacket::write(DataOutputStream* dos) // throws IOException //(Myset::const_iterator it = c1.begin(); // it != c1.end(); ++it) - for (AUTO_VAR(it, toBlow.begin()); it != toBlow.end(); it++) { + for (auto it = toBlow.begin(); it != toBlow.end(); it++) { TilePos tp = *it; int xx = tp.x - xp; diff --git a/Minecraft.World/Network/Packets/Packet.cpp b/Minecraft.World/Network/Packets/Packet.cpp index f1562112e..7c85036ee 100644 --- a/Minecraft.World/Network/Packets/Packet.cpp +++ b/Minecraft.World/Network/Packets/Packet.cpp @@ -320,7 +320,7 @@ void Packet::recordOutgoingPacket(std::shared_ptr packet, if (packet->getId() != 51) { idx = 100; } - AUTO_VAR(it, outgoingStatistics.find(idx)); + auto it = outgoingStatistics.find(idx); if (it == outgoingStatistics.end()) { Packet::PacketStatistics* packetStatistics = new PacketStatistics(idx); @@ -337,7 +337,7 @@ void Packet::updatePacketStatsPIX() { #if !defined(_CONTENT_PACKAGE) #if PACKET_ENABLE_STAT_TRACKING - for (AUTO_VAR(it, outgoingStatistics.begin()); + for (auto it = outgoingStatistics.begin(); it != outgoingStatistics.end(); it++) { Packet::PacketStatistics* stat = it->second; int64_t count = stat->getRunningCount(); @@ -444,7 +444,7 @@ std::shared_ptr Packet::readPacket( // with what we have #if !defined(_CONTENT_PACKAGE) #if PACKET_ENABLE_STAT_TRACKING - AUTO_VAR(it, statistics.find(id)); + auto it = statistics.find(id); if (it == statistics.end()) { Packet::PacketStatistics* packetStatistics = new PacketStatistics(id); diff --git a/Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp b/Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp index e0e77c0db..d20c639f3 100644 --- a/Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp +++ b/Minecraft.World/Network/Packets/SetPlayerTeamPacket.cpp @@ -87,7 +87,7 @@ void SetPlayerTeamPacket::write(DataOutputStream* dos) { method == METHOD_LEAVE) { dos->writeShort(players.size()); - for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) { + for (auto it = players.begin(); it != players.end(); ++it) { writeUtf(*it, dos); } } diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp index 03638e8e5..e2c2aafae 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp +++ b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp @@ -65,7 +65,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket( std::vector* pSkinBoxes = pDLCSkinFile->getAdditionalBoxes(); int iCount = 0; - for (AUTO_VAR(it, pSkinBoxes->begin()); it != pSkinBoxes->end(); ++it) { + for (auto it = pSkinBoxes->begin(); it != pSkinBoxes->end(); ++it) { SKIN_BOX* pSkinBox = *it; this->BoxDataA[iCount++] = *pSkinBox; } @@ -98,7 +98,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket( this->BoxDataA = new SKIN_BOX[this->dwBoxC]; int iCount = 0; - for (AUTO_VAR(it, pvSkinBoxes->begin()); it != pvSkinBoxes->end(); + for (auto it = pvSkinBoxes->begin(); it != pvSkinBoxes->end(); ++it) { SKIN_BOX* pSkinBox = *it; this->BoxDataA[iCount++] = *pSkinBox; diff --git a/Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp b/Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp index ce74bc798..8d99bc087 100644 --- a/Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp +++ b/Minecraft.World/Network/Packets/UpdateAttributesPacket.cpp @@ -10,7 +10,7 @@ UpdateAttributesPacket::UpdateAttributesPacket( int entityId, std::unordered_set* values) { this->entityId = entityId; - for (AUTO_VAR(it, values->begin()); it != values->end(); ++it) { + for (auto it = values->begin(); it != values->end(); ++it) { AttributeInstance* value = *it; std::unordered_set mods; value->getModifiers(mods); @@ -22,7 +22,7 @@ UpdateAttributesPacket::UpdateAttributesPacket( UpdateAttributesPacket::~UpdateAttributesPacket() { // Delete modifiers - these are always copies, either on construction or on // read - for (AUTO_VAR(it, attributes.begin()); it != attributes.end(); ++it) { + for (auto it = attributes.begin(); it != attributes.end(); ++it) { delete (*it); } } @@ -50,7 +50,7 @@ void UpdateAttributesPacket::read(DataInputStream* dis) { attributes.insert(new AttributeSnapshot(id, base, &modifiers)); // modifiers is copied in AttributeSnapshot ctor so delete contents - for (AUTO_VAR(it, modifiers.begin()); it != modifiers.end(); ++it) { + for (auto it = modifiers.begin(); it != modifiers.end(); ++it) { delete *it; } } @@ -60,7 +60,7 @@ void UpdateAttributesPacket::write(DataOutputStream* dos) { dos->writeInt(entityId); dos->writeInt(attributes.size()); - for (AUTO_VAR(it, attributes.begin()); it != attributes.end(); ++it) { + for (auto it = attributes.begin(); it != attributes.end(); ++it) { AttributeSnapshot* attribute = (*it); std::unordered_set* modifiers = @@ -70,7 +70,7 @@ void UpdateAttributesPacket::write(DataOutputStream* dos) { dos->writeDouble(attribute->getBase()); dos->writeShort(modifiers->size()); - for (AUTO_VAR(it2, modifiers->begin()); it2 != modifiers->end(); + for (auto it2 = modifiers->begin(); it2 != modifiers->end(); ++it2) { AttributeModifier* modifier = (*it2); dos->writeInt(modifier->getId()); @@ -101,14 +101,14 @@ UpdateAttributesPacket::AttributeSnapshot::AttributeSnapshot( this->id = id; this->base = base; - for (AUTO_VAR(it, modifiers->begin()); it != modifiers->end(); ++it) { + for (auto it = modifiers->begin(); it != modifiers->end(); ++it) { this->modifiers.insert(new AttributeModifier( (*it)->getId(), (*it)->getAmount(), (*it)->getOperation())); } } UpdateAttributesPacket::AttributeSnapshot::~AttributeSnapshot() { - for (AUTO_VAR(it, modifiers.begin()); it != modifiers.end(); ++it) { + for (auto it = modifiers.begin(); it != modifiers.end(); ++it) { delete (*it); } } diff --git a/Minecraft.World/Platform/stdafx.h b/Minecraft.World/Platform/stdafx.h index 254beb01f..5f03e70a1 100644 --- a/Minecraft.World/Platform/stdafx.h +++ b/Minecraft.World/Platform/stdafx.h @@ -4,12 +4,6 @@ // #pragma once -#define AUTO_VAR(_var, _val) auto _var = _val - -#ifdef _WINDOWS64 -typedef unsigned __int64 __uint64; -#endif - #ifdef _WINDOWS64 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include diff --git a/Minecraft.World/Platform/x64headers/extraX64.h b/Minecraft.World/Platform/x64headers/extraX64.h index 70714f24b..4d3402f43 100644 --- a/Minecraft.World/Platform/x64headers/extraX64.h +++ b/Minecraft.World/Platform/x64headers/extraX64.h @@ -397,7 +397,7 @@ const int XC_LOCALE_LATIN_AMERICA = 240; DWORD XGetLanguage(); DWORD XGetLocale(); -DWORD XEnableGuestSignin(BOOL fEnable); +DWORD XEnableGuestSignin(bool fEnable); class D3DXVECTOR3 { public: diff --git a/Minecraft.World/Player/Player.cpp b/Minecraft.World/Player/Player.cpp index dec45701a..719a96a08 100644 --- a/Minecraft.World/Player/Player.cpp +++ b/Minecraft.World/Player/Player.cpp @@ -861,8 +861,8 @@ void Player::aiStep() { std::vector >* entities = level->getEntities(shared_from_this(), &pickupArea); if (entities != nullptr) { - AUTO_VAR(itEnd, entities->end()); - for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { + auto itEnd = entities->end(); + for (auto it = entities->begin(); it != itEnd; it++) { std::shared_ptr e = *it; // entities->at(i); if (!e->removed) { touch(e); @@ -925,7 +925,7 @@ void Player::awardKillScore(std::shared_ptr victim, int awardPoints) { // } if (objectives) { - for (AUTO_VAR(it, objectives->begin()); it != objectives->end(); ++it) { + for (auto it = objectives->begin(); it != objectives->end(); ++it) { Objective* objective = *it; Score* score = getScoreboard()->getPlayerScore(getAName(), objective); diff --git a/Minecraft.World/Recipes/FurnaceRecipes.cpp b/Minecraft.World/Recipes/FurnaceRecipes.cpp index b95b2f7de..df477fb49 100644 --- a/Minecraft.World/Recipes/FurnaceRecipes.cpp +++ b/Minecraft.World/Recipes/FurnaceRecipes.cpp @@ -58,12 +58,12 @@ void FurnaceRecipes::addFurnaceRecipy(int itemId, ItemInstance* result, } bool FurnaceRecipes::isFurnaceItem(int itemId) { - AUTO_VAR(it, recipies.find(itemId)); + auto it = recipies.find(itemId); return it != recipies.end(); } ItemInstance* FurnaceRecipes::getResult(int itemId) { - AUTO_VAR(it, recipies.find(itemId)); + auto it = recipies.find(itemId); if (it != recipies.end()) { return it->second; } @@ -75,7 +75,7 @@ std::unordered_map* FurnaceRecipes::getRecipies() { } float FurnaceRecipes::getRecipeValue(int itemId) { - AUTO_VAR(it, recipeValue.find(itemId)); + auto it = recipeValue.find(itemId); if (it != recipeValue.end()) { return it->second; } diff --git a/Minecraft.World/Recipes/Recipes.cpp b/Minecraft.World/Recipes/Recipes.cpp index fb6b56b7a..8c683a85b 100644 --- a/Minecraft.World/Recipes/Recipes.cpp +++ b/Minecraft.World/Recipes/Recipes.cpp @@ -1160,8 +1160,8 @@ std::shared_ptr Recipes::getItemFor( if (recipesClass->matches(craftSlots, level)) return recipesClass->assemble(craftSlots); } else { - AUTO_VAR(itEnd, recipies->end()); - for (AUTO_VAR(it, recipies->begin()); it != itEnd; it++) { + auto itEnd = recipies->end(); + for (auto it = recipies->begin(); it != itEnd; it++) { Recipy* r = *it; // recipies->at(i); if (r->matches(craftSlots, level)) return r->assemble(craftSlots); } @@ -1185,8 +1185,8 @@ void Recipes::buildRecipeIngredientsArray(void) { m_pRecipeIngredientsRequired = new Recipy::INGREDIENTS_REQUIRED[iRecipeC]; int iCount = 0; - AUTO_VAR(itEndRec, recipies->end()); - for (AUTO_VAR(it, recipies->begin()); it != itEndRec; it++) { + auto itEndRec = recipies->end(); + for (auto it = recipies->begin(); it != itEndRec; it++) { Recipy* recipe = *it; // wprintf(L"RECIPE - [%d] is // %w\n",iCount,recipe->getResultItem()->getItem()->getName()); diff --git a/Minecraft.World/Recipes/ShapelessRecipy.cpp b/Minecraft.World/Recipes/ShapelessRecipy.cpp index 150c00943..ce11e8a6d 100644 --- a/Minecraft.World/Recipes/ShapelessRecipy.cpp +++ b/Minecraft.World/Recipes/ShapelessRecipy.cpp @@ -32,16 +32,16 @@ bool ShapelessRecipy::matches(std::shared_ptr craftSlots, if (item != nullptr) { bool found = false; - AUTO_VAR(citEnd, ingredients->end()); - for (AUTO_VAR(cit, ingredients->begin()); cit != citEnd; + auto citEnd = ingredients->end(); + for (auto cit = ingredients->begin(); cit != citEnd; ++cit) { ItemInstance* ingredient = *cit; if (item->id == ingredient->id && (ingredient->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == ingredient->getAuxValue())) { found = true; - AUTO_VAR(it, find(tempList.begin(), tempList.end(), - ingredient)); + auto it = find(tempList.begin(), tempList.end(), + ingredient); if (it != tempList.end()) tempList.erase(it); break; } @@ -72,7 +72,7 @@ bool ShapelessRecipy::requiresRecipe(int iRecipe) { // printf("ShapelessRecipy %d\n",iRecipe); - AUTO_VAR(citEnd, ingredients->end()); + auto citEnd = ingredients->end(); int iCount = 0; for (std::vector::iterator ingredient = ingredients->begin(); ingredient != citEnd; ingredient++) { @@ -107,7 +107,7 @@ void ShapelessRecipy::collectRequirements(INGREDIENTS_REQUIRED* pIngReq) { memset(TempIngReq.iIngAuxValA, Recipes::ANY_AUX_VALUE, sizeof(int) * 9); ZeroMemory(TempIngReq.uiGridA, sizeof(unsigned int) * 9); - AUTO_VAR(citEnd, ingredients->end()); + auto citEnd = ingredients->end(); for (std::vector::const_iterator ingredient = ingredients->begin(); diff --git a/Minecraft.World/Scores/Criteria/HealthCriteria.cpp b/Minecraft.World/Scores/Criteria/HealthCriteria.cpp index 3b5fa6120..e8791fd30 100644 --- a/Minecraft.World/Scores/Criteria/HealthCriteria.cpp +++ b/Minecraft.World/Scores/Criteria/HealthCriteria.cpp @@ -8,7 +8,7 @@ int HealthCriteria::getScoreModifier( std::vector >* players) { float health = 0; - for (AUTO_VAR(it, players->begin()); it != players->end(); ++it) { + for (auto it = players->begin(); it != players->end(); ++it) { std::shared_ptr player = *it; health += player->getHealth() + player->getAbsorptionAmount(); } diff --git a/Minecraft.World/Util/Class.h b/Minecraft.World/Util/Class.h index 072b1c4be..752050ba3 100644 --- a/Minecraft.World/Util/Class.h +++ b/Minecraft.World/Util/Class.h @@ -379,7 +379,7 @@ public: m_parents.push_back(id); - for (AUTO_VAR(itr, parent->m_parents.begin()); + for (auto itr = parent->m_parents.begin(); itr != parent->m_parents.end(); itr++) { m_parents.push_back(*itr); } diff --git a/Minecraft.World/Util/CombatTracker.cpp b/Minecraft.World/Util/CombatTracker.cpp index e6e089c76..3aae99de4 100644 --- a/Minecraft.World/Util/CombatTracker.cpp +++ b/Minecraft.World/Util/CombatTracker.cpp @@ -9,7 +9,7 @@ CombatTracker::CombatTracker(LivingEntity* mob) { this->mob = mob; } CombatTracker::~CombatTracker() { - for (AUTO_VAR(it, entries.begin()); it != entries.end(); ++it) { + for (auto it = entries.begin(); it != entries.end(); ++it) { delete (*it); } } @@ -143,7 +143,7 @@ std::shared_ptr CombatTracker::getKiller() { float bestMobDamage = 0; float bestPlayerDamage = 0; - for (AUTO_VAR(it, entries.begin()); it != entries.end(); ++it) { + for (auto it = entries.begin(); it != entries.end(); ++it) { CombatEntry* entry = *it; if (entry->getSource() != nullptr && entry->getSource()->getEntity() != nullptr && @@ -232,7 +232,7 @@ void CombatTracker::recheckStatus() { int reset = inCombat ? RESET_COMBAT_STATUS_TIME : RESET_DAMAGE_STATUS_TIME; if (takingDamage && mob->tickCount - lastDamageTime > reset) { - for (AUTO_VAR(it, entries.begin()); it != entries.end(); ++it) { + for (auto it = entries.begin(); it != entries.end(); ++it) { delete (*it); } entries.clear(); diff --git a/Minecraft.World/Util/WeighedRandom.cpp b/Minecraft.World/Util/WeighedRandom.cpp index 7a609af5a..ece44e353 100644 --- a/Minecraft.World/Util/WeighedRandom.cpp +++ b/Minecraft.World/Util/WeighedRandom.cpp @@ -3,7 +3,7 @@ int WeighedRandom::getTotalWeight(std::vector* items) { int totalWeight = 0; - for (AUTO_VAR(it, items->begin()); it != items->end(); it++) { + for (auto it = items->begin(); it != items->end(); it++) { totalWeight += (*it)->randomWeight; } return totalWeight; @@ -17,7 +17,7 @@ WeighedRandomItem* WeighedRandom::getRandomItem( int selection = random->nextInt(totalWeight); - for (AUTO_VAR(it, items->begin()); it != items->end(); it++) { + for (auto it = items->begin(); it != items->end(); it++) { selection -= (*it)->randomWeight; if (selection < 0) { return *it; diff --git a/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp b/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp index 1e8609adb..44f797141 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp +++ b/Minecraft.World/WorldGen/Biomes/BiomeCache.cpp @@ -75,7 +75,7 @@ BiomeCache::~BiomeCache() { // 4J Stu - Delete source? // delete source; - for (AUTO_VAR(it, all.begin()); it != all.end(); ++it) { + for (auto it = all.begin(); it != all.end(); ++it) { delete (*it); } DeleteCriticalSection(&m_CS); @@ -87,7 +87,7 @@ BiomeCache::Block* BiomeCache::getBlockAt(int x, int z) { z >>= ZONE_SIZE_BITS; int64_t slot = (((int64_t)x) & 0xffffffffl) | ((((int64_t)z) & 0xffffffffl) << 32l); - AUTO_VAR(it, cached.find(slot)); + auto it = cached.find(slot); Block* block = nullptr; if (it == cached.end()) { MemSect(48); @@ -122,7 +122,7 @@ void BiomeCache::update() { if (utime > DECAY_TIME / 4 || utime < 0) { lastUpdateTime = now; - for (AUTO_VAR(it, all.begin()); it != all.end();) { + for (auto it = all.begin(); it != all.end();) { Block* block = *it; int64_t time = now - block->lastUse; if (time > DECAY_TIME || time < 0) { diff --git a/Minecraft.World/WorldGen/Features/CaveFeature.cpp b/Minecraft.World/WorldGen/Features/CaveFeature.cpp index dbaf54da8..006bc7a18 100644 --- a/Minecraft.World/WorldGen/Features/CaveFeature.cpp +++ b/Minecraft.World/WorldGen/Features/CaveFeature.cpp @@ -74,14 +74,14 @@ bool CaveFeature::place(Level* level, Random* random, int x, int y, int z) { } } - AUTO_VAR(itEnd, toRemove.end()); - for (AUTO_VAR(it, toRemove.begin()); it != itEnd; it++) { + auto itEnd = toRemove.end(); + for (auto it = toRemove.begin(); it != itEnd; it++) { TilePos* p = *it; // toRemove[i]; level->setTileAndData(p->x, p->y, p->z, 0, 0, Tile::UPDATE_CLIENTS); } itEnd = toRemove.end(); - for (AUTO_VAR(it, toRemove.begin()); it != itEnd; it++) { + for (auto it = toRemove.begin(); it != itEnd; it++) { TilePos* p = *it; // toRemove[i]; if (level->getTile(p->x, p->y - 1, p->z) == Tile::dirt_Id && level->getDaytimeRawBrightness(p->x, p->y, p->z) > 8) { diff --git a/Minecraft.World/WorldGen/Features/MineShaftFeature.cpp b/Minecraft.World/WorldGen/Features/MineShaftFeature.cpp index 796b3f1eb..74a3c9c5f 100644 --- a/Minecraft.World/WorldGen/Features/MineShaftFeature.cpp +++ b/Minecraft.World/WorldGen/Features/MineShaftFeature.cpp @@ -13,7 +13,7 @@ MineShaftFeature::MineShaftFeature( std::unordered_map options) { chance = 0.01; - for (AUTO_VAR(it, options.begin()); it != options.end(); ++it) { + for (auto it = options.begin(); it != options.end(); ++it) { if (it->first.compare(OPTION_CHANCE) == 0) { chance = Mth::getDouble(it->second, chance); } diff --git a/Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp b/Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp index 8f8980b07..ceeff64de 100644 --- a/Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp +++ b/Minecraft.World/WorldGen/Features/NetherBridgeFeature.cpp @@ -110,7 +110,7 @@ NetherBridgeFeature::NetherBridgeStart::NetherBridgeStart(Level* level, std::vector* pendingChildren = &start->pendingChildren; while (!pendingChildren->empty()) { int pos = random->nextInt((int)pendingChildren->size()); - AUTO_VAR(it, pendingChildren->begin() + pos); + auto it = pendingChildren->begin() + pos; StructurePiece* structurePiece = *it; pendingChildren->erase(it); structurePiece->addChildren(start, &pieces, random); diff --git a/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp b/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp index 48276d104..051204266 100644 --- a/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp +++ b/Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp @@ -29,7 +29,7 @@ RandomScatteredLargeFeature::RandomScatteredLargeFeature( std::unordered_map options) { _init(); - for (AUTO_VAR(it, options.begin()); it != options.end(); ++it) { + for (auto it = options.begin(); it != options.end(); ++it) { if (it->first.compare(OPTION_SPACING) == 0) { spacing = Mth::getInt(it->second, spacing, minSeparation + 1); } @@ -67,7 +67,7 @@ bool RandomScatteredLargeFeature::isFeatureChunk(int x, int z, (x == xCenterFeatureChunk && z == zCenterFeatureChunk)) { Biome* biome = level->getBiomeSource()->getBiome(x * 16 + 8, z * 16 + 8); - for (AUTO_VAR(it, allowedBiomes.begin()); it != allowedBiomes.end(); + for (auto it = allowedBiomes.begin(); it != allowedBiomes.end(); ++it) { Biome* a = *it; if (biome == a) { @@ -120,7 +120,7 @@ bool RandomScatteredLargeFeature::isSwamphut(int cellX, int cellY, int cellZ) { return false; } StructurePiece* first = nullptr; - AUTO_VAR(it, structureAt->pieces.begin()); + auto it = structureAt->pieces.begin(); if (it != structureAt->pieces.end()) first = *it; return dynamic_cast(first) != nullptr; } diff --git a/Minecraft.World/WorldGen/Features/StrongholdFeature.cpp b/Minecraft.World/WorldGen/Features/StrongholdFeature.cpp index 35d0cd537..29ec6c3a9 100644 --- a/Minecraft.World/WorldGen/Features/StrongholdFeature.cpp +++ b/Minecraft.World/WorldGen/Features/StrongholdFeature.cpp @@ -47,7 +47,7 @@ StrongholdFeature::StrongholdFeature( std::unordered_map options) { _init(); - for (AUTO_VAR(it, options.begin()); it != options.end(); ++it) { + for (auto it = options.begin(); it != options.end(); ++it) { if (it->first.compare(OPTION_DISTANCE) == 0) { distance = Mth::getDouble(it->second, distance, 1); } else if (it->first.compare(OPTION_COUNT) == 0) { @@ -248,7 +248,7 @@ StrongholdFeature::StrongholdStart::StrongholdStart(Level* level, std::vector* pendingChildren = &startRoom->pendingChildren; while (!pendingChildren->empty()) { int pos = random->nextInt((int)pendingChildren->size()); - AUTO_VAR(it, pendingChildren->begin() + pos); + auto it = pendingChildren->begin() + pos; StructurePiece* structurePiece = *it; pendingChildren->erase(it); structurePiece->addChildren(startRoom, &pieces, random); diff --git a/Minecraft.World/WorldGen/Features/StructureFeature.cpp b/Minecraft.World/WorldGen/Features/StructureFeature.cpp index 4c71d642e..2cad49ffc 100644 --- a/Minecraft.World/WorldGen/Features/StructureFeature.cpp +++ b/Minecraft.World/WorldGen/Features/StructureFeature.cpp @@ -14,7 +14,7 @@ StructureFeature::StructureFeature() { } StructureFeature::~StructureFeature() { - for (AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); + for (auto it = cachedStructures.begin(); it != cachedStructures.end(); it++) { delete it->second; } @@ -62,7 +62,7 @@ bool StructureFeature::postProcess(Level* level, Random* random, int chunkX, int cz = ((unsigned)chunkZ << 4); // + 8; bool intersection = false; - for (AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); + for (auto it = cachedStructures.begin(); it != cachedStructures.end(); it++) { StructureStart* structureStart = it->second; @@ -88,13 +88,13 @@ bool StructureFeature::postProcess(Level* level, Random* random, int chunkX, bool StructureFeature::isIntersection(int cellX, int cellZ) { restoreSavedData(level); - for (AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); + for (auto it = cachedStructures.begin(); it != cachedStructures.end(); it++) { StructureStart* structureStart = it->second; if (structureStart->isValid()) { if (structureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ)) { - AUTO_VAR(it2, structureStart->getPieces()->begin()); + auto it2 = structureStart->getPieces()->begin(); while (it2 != structureStart->getPieces()->end()) { StructurePiece* next = *it2++; if (next->getBoundingBox()->intersects(cellX, cellZ, cellX, @@ -116,7 +116,7 @@ bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ) { StructureStart* StructureFeature::getStructureAt(int cellX, int cellY, int cellZ) { // for (StructureStart structureStart : cachedStructures.values()) - for (AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); + for (auto it = cachedStructures.begin(); it != cachedStructures.end(); ++it) { StructureStart* pStructureStart = it->second; @@ -134,7 +134,7 @@ StructureStart* StructureFeature::getStructureAt(int cellX, int cellY, std::list* pieces = pStructureStart->getPieces(); - for (AUTO_VAR(it2, pieces->begin()); it2 != pieces->end(); + for (auto it2 = pieces->begin(); it2 != pieces->end(); it2++) { StructurePiece* piece = *it2; if (piece->getBoundingBox()->isInside(cellX, cellY, @@ -152,7 +152,7 @@ bool StructureFeature::isInsideBoundingFeature(int cellX, int cellY, int cellZ) { restoreSavedData(level); - for (AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); + for (auto it = cachedStructures.begin(); it != cachedStructures.end(); ++it) { StructureStart* structureStart = it->second; if (structureStart->isValid()) { @@ -183,7 +183,7 @@ TilePos* StructureFeature::getNearestGeneratedFeature(Level* level, int cellX, double minDistance = DBL_MAX; TilePos* selected = nullptr; - for (AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); + for (auto it = cachedStructures.begin(); it != cachedStructures.end(); ++it) { StructureStart* pStructureStart = it->second; @@ -213,7 +213,7 @@ TilePos* StructureFeature::getNearestGeneratedFeature(Level* level, int cellX, if (guesstimatedFeaturePositions != nullptr) { TilePos* pSelectedPos = new TilePos(0, 0, 0); - for (AUTO_VAR(it, guesstimatedFeaturePositions->begin()); + for (auto it = guesstimatedFeaturePositions->begin(); it != guesstimatedFeaturePositions->end(); ++it) { int dx = (*it).x - cellX; int dy = (*it).y - cellY; @@ -253,7 +253,7 @@ void StructureFeature::restoreSavedData(Level* level) { CompoundTag* fullTag = savedData->getFullTag(); std::vector* allTags = fullTag->getAllTags(); - for (AUTO_VAR(it, allTags->begin()); it != allTags->end(); ++it) { + for (auto it = allTags->begin(); it != allTags->end(); ++it) { Tag* featureTag = *it; if (featureTag->getId() == Tag::TAG_Compound) { CompoundTag* ct = (CompoundTag*)featureTag; diff --git a/Minecraft.World/WorldGen/Features/VillageFeature.cpp b/Minecraft.World/WorldGen/Features/VillageFeature.cpp index 986e68997..1bb95f735 100644 --- a/Minecraft.World/WorldGen/Features/VillageFeature.cpp +++ b/Minecraft.World/WorldGen/Features/VillageFeature.cpp @@ -29,7 +29,7 @@ VillageFeature::VillageFeature( std::unordered_map options, int iXZSize) { _init(iXZSize); - for (AUTO_VAR(it, options.begin()); it != options.end(); ++it) { + for (auto it = options.begin(); it != options.end(); ++it) { if (it->first.compare(OPTION_SIZE_MODIFIER) == 0) { villageSizeModifier = Mth::getInt(it->second, villageSizeModifier, 0); @@ -126,13 +126,13 @@ VillageFeature::VillageStart::VillageStart(Level* level, Random* random, // prioritize roads if (pendingRoads->empty()) { int pos = random->nextInt((int)pendingHouses->size()); - AUTO_VAR(it, pendingHouses->begin() + pos); + auto it = pendingHouses->begin() + pos; StructurePiece* structurePiece = *it; pendingHouses->erase(it); structurePiece->addChildren(startRoom, &pieces, random); } else { int pos = random->nextInt((int)pendingRoads->size()); - AUTO_VAR(it, pendingRoads->begin() + pos); + auto it = pendingRoads->begin() + pos; StructurePiece* structurePiece = *it; pendingRoads->erase(it); structurePiece->addChildren(startRoom, &pieces, random); @@ -142,7 +142,7 @@ VillageFeature::VillageStart::VillageStart(Level* level, Random* random, calculateBoundingBox(); int count = 0; - for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) { + for (auto it = pieces.begin(); it != pieces.end(); it++) { StructurePiece* piece = *it; if (dynamic_cast(piece) == nullptr) { count++; diff --git a/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp b/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp index 22ed5fcc3..66a42933f 100644 --- a/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp +++ b/Minecraft.World/WorldGen/Flat/FlatGeneratorInfo.cpp @@ -17,7 +17,7 @@ const std::wstring FlatGeneratorInfo::STRUCTURE_DUNGEON = L"dungeon"; FlatGeneratorInfo::FlatGeneratorInfo() { biome = 0; } FlatGeneratorInfo::~FlatGeneratorInfo() { - for (AUTO_VAR(it, layers.begin()); it != layers.end(); ++it) { + for (auto it = layers.begin(); it != layers.end(); ++it) { delete *it; } } @@ -37,7 +37,7 @@ std::vector* FlatGeneratorInfo::getLayers() { return &layers; } void FlatGeneratorInfo::updateLayers() { int y = 0; - for (AUTO_VAR(it, layers.begin()); it != layers.end(); ++it) { + for (auto it = layers.begin(); it != layers.end(); ++it) { FlatLayerInfo* layer = *it; layer->setStart(y); y += layer->getHeight(); @@ -62,7 +62,7 @@ std::vector* FlatGeneratorInfo::getLayersFromString( int yOffset = 0; - for (AUTO_VAR(it, depths.begin()); it != depths.end(); ++it) { + for (auto it = depths.begin(); it != depths.end(); ++it) { FlatLayerInfo* layer = getLayerFromString(*it, yOffset); if (layer == nullptr) return nullptr; result->push_back(layer); diff --git a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp b/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp index 89735789a..b8b0c714b 100644 --- a/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp +++ b/Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp @@ -32,7 +32,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) { app.DebugPrintf("Biomemap binary is too large!!\n"); __debugbreak(); } - BOOL bSuccess = + bool bSuccess = ReadFile(file, m_biomeOverride.data, dwFileSize, &bytesRead, nullptr); if (bSuccess == FALSE) { diff --git a/Minecraft.World/WorldGen/StructureFeatureIO.cpp b/Minecraft.World/WorldGen/StructureFeatureIO.cpp index d89397969..7a35abb98 100644 --- a/Minecraft.World/WorldGen/StructureFeatureIO.cpp +++ b/Minecraft.World/WorldGen/StructureFeatureIO.cpp @@ -47,7 +47,7 @@ void StructureFeatureIO::staticCtor() { } std::wstring StructureFeatureIO::getEncodeId(StructureStart* start) { - AUTO_VAR(it, startClassIdMap.find(start->GetType())); + auto it = startClassIdMap.find(start->GetType()); if (it != startClassIdMap.end()) { return it->second; } else { @@ -56,7 +56,7 @@ std::wstring StructureFeatureIO::getEncodeId(StructureStart* start) { } std::wstring StructureFeatureIO::getEncodeId(StructurePiece* piece) { - AUTO_VAR(it, pieceClassIdMap.find(piece->GetType())); + auto it = pieceClassIdMap.find(piece->GetType()); if (it != pieceClassIdMap.end()) { return it->second; } else { @@ -68,7 +68,7 @@ StructureStart* StructureFeatureIO::loadStaticStart(CompoundTag* tag, Level* level) { StructureStart* start = nullptr; - AUTO_VAR(it, startIdClassMap.find(tag->getString(L"id"))); + auto it = startIdClassMap.find(tag->getString(L"id")); if (it != startIdClassMap.end()) { start = (it->second)(); } @@ -86,7 +86,7 @@ StructurePiece* StructureFeatureIO::loadStaticPiece(CompoundTag* tag, Level* level) { StructurePiece* piece = nullptr; - AUTO_VAR(it, pieceIdClassMap.find(tag->getString(L"id"))); + auto it = pieceIdClassMap.find(tag->getString(L"id")); if (it != pieceIdClassMap.end()) { piece = (it->second)(); } diff --git a/Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp b/Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp index dc93026c8..090b4999e 100644 --- a/Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp +++ b/Minecraft.World/WorldGen/Structures/MineShaftPieces.cpp @@ -113,7 +113,7 @@ MineShaftPieces::MineShaftRoom::MineShaftRoom(int genDepth, Random* random, } MineShaftPieces::MineShaftRoom::~MineShaftRoom() { - for (AUTO_VAR(it, childEntranceBoxes.begin()); + for (auto it = childEntranceBoxes.begin(); it != childEntranceBoxes.end(); ++it) { delete (*it); } @@ -225,7 +225,7 @@ bool MineShaftPieces::MineShaftRoom::postProcess(Level* level, Random* random, boundingBox->z0, boundingBox->x1, std::min(boundingBox->y0 + 3, boundingBox->y1), boundingBox->z1, 0, 0, false); - for (AUTO_VAR(it, childEntranceBoxes.begin()); + for (auto it = childEntranceBoxes.begin(); it != childEntranceBoxes.end(); ++it) { BoundingBox* entranceBox = *it; generateBox(level, chunkBB, entranceBox->x0, @@ -242,7 +242,7 @@ bool MineShaftPieces::MineShaftRoom::postProcess(Level* level, Random* random, void MineShaftPieces::MineShaftRoom::addAdditonalSaveData(CompoundTag* tag) { ListTag* entrances = new ListTag(L"Entrances"); - for (AUTO_VAR(it, childEntranceBoxes.begin()); + for (auto it = childEntranceBoxes.begin(); it != childEntranceBoxes.end(); ++it) { BoundingBox* bb = *it; entrances->add(bb->createTag(L"")); diff --git a/Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp b/Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp index ee6182298..ab3e77695 100644 --- a/Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp +++ b/Minecraft.World/WorldGen/Structures/NetherBridgePieces.cpp @@ -185,7 +185,7 @@ int NetherBridgePieces::NetherBridgePiece::updatePieceWeight( std::list* currentPieces) { bool hasAnyPieces = false; int totalWeight = 0; - for (AUTO_VAR(it, currentPieces->begin()); it != currentPieces->end(); + for (auto it = currentPieces->begin(); it != currentPieces->end(); it++) { PieceWeight* piece = *it; @@ -212,7 +212,7 @@ NetherBridgePieces::NetherBridgePiece::generatePiece( numAttempts++; int weightSelection = random->nextInt(totalWeight); - for (AUTO_VAR(it, currentPieces->begin()); it != currentPieces->end(); + for (auto it = currentPieces->begin(); it != currentPieces->end(); it++) { PieceWeight* piece = *it; weightSelection -= piece->weight; diff --git a/Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp b/Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp index 1a1f4f41a..4c8a4c805 100644 --- a/Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp +++ b/Minecraft.World/WorldGen/Structures/StrongholdPieces.cpp @@ -62,7 +62,7 @@ bool StrongholdPieces::PieceWeight::isValid() { } void StrongholdPieces::resetPieces() { - for (AUTO_VAR(it, currentPieces.begin()); it != currentPieces.end(); it++) { + for (auto it = currentPieces.begin(); it != currentPieces.end(); it++) { delete (*it); } currentPieces.clear(); @@ -88,7 +88,7 @@ void StrongholdPieces::resetPieces() { bool StrongholdPieces::updatePieceWeight() { bool hasAnyPieces = false; totalWeight = 0; - for (AUTO_VAR(it, currentPieces.begin()); it != currentPieces.end(); it++) { + for (auto it = currentPieces.begin(); it != currentPieces.end(); it++) { PieceWeight* piece = *it; if (piece->maxPlaceCount > 0 && piece->placeCount < piece->maxPlaceCount) { @@ -165,7 +165,7 @@ StrongholdPieces::StrongholdPiece* StrongholdPieces::generatePieceFromSmallDoor( numAttempts++; int weightSelection = random->nextInt(totalWeight); - for (AUTO_VAR(it, currentPieces.begin()); it != currentPieces.end(); + for (auto it = currentPieces.begin(); it != currentPieces.end(); it++) { PieceWeight* piece = *it; weightSelection -= piece->weight; @@ -214,7 +214,7 @@ StructurePiece* StrongholdPieces::generateAndAddPiece( if (startPiece->m_level->getOriginalSaveVersion() >= SAVE_FILE_VERSION_MOVED_STRONGHOLD && !startPiece->m_level->getLevelData()->getHasStrongholdEndPortal()) { - for (AUTO_VAR(it, currentPieces.begin()); it != currentPieces.end(); + for (auto it = currentPieces.begin(); it != currentPieces.end(); it++) { PieceWeight* piece = *it; diff --git a/Minecraft.World/WorldGen/Structures/StructurePiece.cpp b/Minecraft.World/WorldGen/Structures/StructurePiece.cpp index 73452b9fe..e8bc97499 100644 --- a/Minecraft.World/WorldGen/Structures/StructurePiece.cpp +++ b/Minecraft.World/WorldGen/Structures/StructurePiece.cpp @@ -99,7 +99,7 @@ bool StructurePiece::isInChunk(ChunkPos* pos) { StructurePiece* StructurePiece::findCollisionPiece( std::list* pieces, BoundingBox* box) { - for (AUTO_VAR(it, pieces->begin()); it != pieces->end(); it++) { + for (auto it = pieces->begin(); it != pieces->end(); it++) { StructurePiece* piece = *it; if (piece->getBoundingBox() != nullptr && piece->getBoundingBox()->intersects(box)) { diff --git a/Minecraft.World/WorldGen/Structures/StructureStart.cpp b/Minecraft.World/WorldGen/Structures/StructureStart.cpp index 8127cf027..17457f0e7 100644 --- a/Minecraft.World/WorldGen/Structures/StructureStart.cpp +++ b/Minecraft.World/WorldGen/Structures/StructureStart.cpp @@ -17,7 +17,7 @@ StructureStart::StructureStart(int x, int z) { } StructureStart::~StructureStart() { - for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) { + for (auto it = pieces.begin(); it != pieces.end(); it++) { delete (*it); } delete boundingBox; @@ -29,7 +29,7 @@ std::list* StructureStart::getPieces() { return &pieces; } void StructureStart::postProcess(Level* level, Random* random, BoundingBox* chunkBB) { - AUTO_VAR(it, pieces.begin()); + auto it = pieces.begin(); while (it != pieces.end()) { if ((*it)->getBoundingBox()->intersects(chunkBB) && @@ -46,7 +46,7 @@ void StructureStart::postProcess(Level* level, Random* random, void StructureStart::calculateBoundingBox() { boundingBox = BoundingBox::getUnknownBox(); - for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) { + for (auto it = pieces.begin(); it != pieces.end(); it++) { StructurePiece* piece = *it; boundingBox->expand(piece->getBoundingBox()); } @@ -61,7 +61,7 @@ CompoundTag* StructureStart::createTag(int chunkX, int chunkZ) { tag->put(L"BB", boundingBox->createTag(L"BB")); ListTag* childrenTags = new ListTag(L"Children"); - for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); ++it) { + for (auto it = pieces.begin(); it != pieces.end(); ++it) { StructurePiece* piece = *it; childrenTags->add(piece->createTag()); } @@ -107,7 +107,7 @@ void StructureStart::moveBelowSeaLevel(Level* level, Random* random, // move all bounding boxes int dy = y1Pos - boundingBox->y1; boundingBox->move(0, dy, 0); - for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) { + for (auto it = pieces.begin(); it != pieces.end(); it++) { StructurePiece* piece = *it; piece->getBoundingBox()->move(0, dy, 0); } @@ -128,7 +128,7 @@ void StructureStart::moveInsideHeights(Level* level, Random* random, // move all bounding boxes int dy = y0Pos - boundingBox->y0; boundingBox->move(0, dy, 0); - for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) { + for (auto it = pieces.begin(); it != pieces.end(); it++) { StructurePiece* piece = *it; piece->getBoundingBox()->move(0, dy, 0); } diff --git a/Minecraft.World/WorldGen/Structures/Village.cpp b/Minecraft.World/WorldGen/Structures/Village.cpp index ae1f28dfa..fcd8ebf60 100644 --- a/Minecraft.World/WorldGen/Structures/Village.cpp +++ b/Minecraft.World/WorldGen/Structures/Village.cpp @@ -44,7 +44,7 @@ Village::Village(Level* level) { Village::~Village() { delete accCenter; delete center; - for (AUTO_VAR(it, aggressors.begin()); it != aggressors.end(); ++it) { + for (auto it = aggressors.begin(); it != aggressors.end(); ++it) { delete *it; } } @@ -164,7 +164,7 @@ std::shared_ptr Village::getClosestDoorInfo(int x, int y, int z) { std::shared_ptr closest = nullptr; int closestDistSqr = std::numeric_limits::max(); // for (DoorInfo dm : doorInfos) - for (AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { + for (auto it = doorInfos.begin(); it != doorInfos.end(); ++it) { std::shared_ptr dm = *it; int distSqr = dm->distanceToSqr(x, y, z); if (distSqr < closestDistSqr) { @@ -179,7 +179,7 @@ std::shared_ptr Village::getBestDoorInfo(int x, int y, int z) { std::shared_ptr closest = nullptr; int closestDist = std::numeric_limits::max(); // for (DoorInfo dm : doorInfos) - for (AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { + for (auto it = doorInfos.begin(); it != doorInfos.end(); ++it) { std::shared_ptr dm = *it; int distSqr = dm->distanceToSqr(x, y, z); @@ -203,7 +203,7 @@ bool Village::hasDoorInfo(int x, int y, int z) { std::shared_ptr Village::getDoorInfo(int x, int y, int z) { if (center->distSqr(x, y, z) > radius * radius) return nullptr; // for (DoorInfo di : doorInfos) - for (AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { + for (auto it = doorInfos.begin(); it != doorInfos.end(); ++it) { std::shared_ptr di = *it; if (di->x == x && di->z == z && abs(di->y - y) <= 1) return di; } @@ -223,7 +223,7 @@ bool Village::canRemove() { return doorInfos.empty(); } void Village::addAggressor(std::shared_ptr mob) { // for (Aggressor a : aggressors) - for (AUTO_VAR(it, aggressors.begin()); it != aggressors.end(); ++it) { + for (auto it = aggressors.begin(); it != aggressors.end(); ++it) { Aggressor* a = *it; if (a->mob == mob) { a->timeStamp = _tick; @@ -238,7 +238,7 @@ std::shared_ptr Village::getClosestAggressor( double closestSqr = std::numeric_limits::max(); Aggressor* closest = nullptr; // for (int i = 0; i < aggressors.size(); ++i) - for (AUTO_VAR(it, aggressors.begin()); it != aggressors.end(); ++it) { + for (auto it = aggressors.begin(); it != aggressors.end(); ++it) { Aggressor* a = *it; // aggressors.get(i); double distSqr = a->mob->distanceToSqr(from); if (distSqr > closestSqr) continue; @@ -254,7 +254,7 @@ std::shared_ptr Village::getClosestBadStandingPlayer( std::shared_ptr closest = nullptr; // for (String player : playerStanding.keySet()) - for (AUTO_VAR(it, playerStanding.begin()); it != playerStanding.end(); + for (auto it = playerStanding.begin(); it != playerStanding.end(); ++it) { std::wstring player = it->first; if (isVeryBadStanding(player)) { @@ -273,7 +273,7 @@ std::shared_ptr Village::getClosestBadStandingPlayer( void Village::updateAggressors() { // for (Iterator it = aggressors.iterator(); it.hasNext();) - for (AUTO_VAR(it, aggressors.begin()); it != aggressors.end();) { + for (auto it = aggressors.begin(); it != aggressors.end();) { Aggressor* a = *it; // it.next(); if (!a->mob->isAlive() || abs(_tick - a->timeStamp) > 300) { delete *it; @@ -289,7 +289,7 @@ void Village::updateDoors() { bool removed = false; bool resetBookings = level->random->nextInt(50) == 0; // for (Iterator it = doorInfos.iterator(); it.hasNext();) - for (AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end();) { + for (auto it = doorInfos.begin(); it != doorInfos.end();) { std::shared_ptr dm = *it; // it.next(); if (resetBookings) dm->resetBookingCount(); if (!isDoor(dm->x, dm->y, dm->z) || abs(_tick - dm->timeStamp) > 1200) { @@ -325,7 +325,7 @@ void Village::calcInfo() { center->set(accCenter->x / s, accCenter->y / s, accCenter->z / s); int maxRadiusSqr = 0; // for (DoorInfo dm : doorInfos) - for (AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { + for (auto it = doorInfos.begin(); it != doorInfos.end(); ++it) { std::shared_ptr dm = *it; maxRadiusSqr = std::max( dm->distanceToSqr(center->x, center->y, center->z), maxRadiusSqr); @@ -338,7 +338,7 @@ void Village::calcInfo() { } int Village::getStanding(const std::wstring& playerName) { - AUTO_VAR(it, playerStanding.find(playerName)); + auto it = playerStanding.find(playerName); if (it != playerStanding.end()) { return it->second; } @@ -414,7 +414,7 @@ void Village::addAdditonalSaveData(CompoundTag* tag) { ListTag* doorTags = new ListTag(L"Doors"); // for (DoorInfo dm : doorInfos) - for (AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { + for (auto it = doorInfos.begin(); it != doorInfos.end(); ++it) { std::shared_ptr dm = *it; CompoundTag* doorTag = new CompoundTag(L"Door"); doorTag->putInt(L"X", dm->x); @@ -429,7 +429,7 @@ void Village::addAdditonalSaveData(CompoundTag* tag) { ListTag* playerTags = new ListTag(L"Players"); // for (String player : playerStanding.keySet()) - for (AUTO_VAR(it, playerStanding.begin()); it != playerStanding.end(); + for (auto it = playerStanding.begin(); it != playerStanding.end(); ++it) { std::wstring player = it->first; CompoundTag* playerTag = new CompoundTag(player); @@ -452,7 +452,7 @@ bool Village::isBreedTimerOk() { void Village::rewardAllPlayers(int amount) { // for (String player : playerStanding.keySet()) - for (AUTO_VAR(it, playerStanding.begin()); it != playerStanding.end(); + for (auto it = playerStanding.begin(); it != playerStanding.end(); ++it) { modifyStanding(it->first, amount); } diff --git a/Minecraft.World/WorldGen/Structures/VillagePieces.cpp b/Minecraft.World/WorldGen/Structures/VillagePieces.cpp index bf442ae38..53f0e2f2e 100644 --- a/Minecraft.World/WorldGen/Structures/VillagePieces.cpp +++ b/Minecraft.World/WorldGen/Structures/VillagePieces.cpp @@ -94,7 +94,7 @@ std::list* VillagePieces::createPieceSet( Mth::nextInt(random, 0 + villageSize, 3 + villageSize * 2))); // silly way of filtering "infinite" buildings - AUTO_VAR(it, newPieces->begin()); + auto it = newPieces->begin(); while (it != newPieces->end()) { if ((*it)->maxPlaceCount == 0) { delete (*it); @@ -110,7 +110,7 @@ std::list* VillagePieces::createPieceSet( int VillagePieces::updatePieceWeight(std::list* currentPieces) { bool hasAnyPieces = false; int totalWeight = 0; - for (AUTO_VAR(it, currentPieces->begin()); it != currentPieces->end(); + for (auto it = currentPieces->begin(); it != currentPieces->end(); it++) { PieceWeight* piece = *it; if (piece->maxPlaceCount > 0 && @@ -174,7 +174,7 @@ VillagePieces::VillagePiece* VillagePieces::generatePieceFromSmallDoor( numAttempts++; int weightSelection = random->nextInt(totalWeight); - for (AUTO_VAR(it, startPiece->pieceSet->begin()); + for (auto it = startPiece->pieceSet->begin(); it != startPiece->pieceSet->end(); it++) { PieceWeight* piece = *it; weightSelection -= piece->weight; @@ -611,7 +611,7 @@ VillagePieces::StartPiece::StartPiece(BiomeSource* biomeSource, int genDepth, } VillagePieces::StartPiece::~StartPiece() { - for (AUTO_VAR(it, pieceSet->begin()); it != pieceSet->end(); it++) { + for (auto it = pieceSet->begin(); it != pieceSet->end(); it++) { delete (*it); } delete pieceSet; diff --git a/Minecraft.World/WorldGen/Structures/Villages.cpp b/Minecraft.World/WorldGen/Structures/Villages.cpp index 55735f397..dc964b5b8 100644 --- a/Minecraft.World/WorldGen/Structures/Villages.cpp +++ b/Minecraft.World/WorldGen/Structures/Villages.cpp @@ -19,14 +19,14 @@ Villages::Villages(Level* level) : SavedData(VILLAGE_FILE_ID) { } Villages::~Villages() { - for (AUTO_VAR(it, queries.begin()); it != queries.end(); ++it) delete *it; + for (auto it = queries.begin(); it != queries.end(); ++it) delete *it; } void Villages::setLevel(Level* level) { this->level = level; // for (Village village : villages) - for (AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { + for (auto it = villages.begin(); it != villages.end(); ++it) { std::shared_ptr village = *it; village->setLevel(level); } @@ -40,7 +40,7 @@ void Villages::queryUpdateAround(int x, int y, int z) { void Villages::tick() { ++_tick; // for (Village village : villages) - for (AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { + for (auto it = villages.begin(); it != villages.end(); ++it) { std::shared_ptr village = *it; village->tick(_tick); } @@ -55,7 +55,7 @@ void Villages::tick() { void Villages::removeVillages() { // for (Iterator it = villages.iterator(); it.hasNext();) - for (AUTO_VAR(it, villages.begin()); it != villages.end();) { + for (auto it = villages.begin(); it != villages.end();) { std::shared_ptr village = *it; // it.next(); if (village->canRemove()) { it = villages.erase(it); @@ -76,7 +76,7 @@ std::shared_ptr Villages::getClosestVillage(int x, int y, int z, std::shared_ptr closest = nullptr; float closestDistSqr = std::numeric_limits::max(); // for (Village village : villages) - for (AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { + for (auto it = villages.begin(); it != villages.end(); ++it) { std::shared_ptr village = *it; float distSqr = village->getCenter()->distSqr(x, y, z); if (distSqr >= closestDistSqr) continue; @@ -101,12 +101,12 @@ void Villages::processNextQuery() { void Villages::cluster() { // note doesn't merge or split existing villages // for (int i = 0; i < unclustered.size(); ++i) - for (AUTO_VAR(it, unclustered.begin()); it != unclustered.end(); ++it) { + for (auto it = unclustered.begin(); it != unclustered.end(); ++it) { std::shared_ptr di = *it; // unclustered.get(i); bool found = false; // for (Village village : villages) - for (AUTO_VAR(itV, villages.begin()); itV != villages.end(); ++itV) { + for (auto itV = villages.begin(); itV != villages.end(); ++itV) { std::shared_ptr village = *itV; int dist = (int)village->getCenter()->distSqr(di->x, di->y, di->z); int radius = MaxDoorDist + village->getRadius(); @@ -147,12 +147,12 @@ void Villages::addDoorInfos(Pos* pos) { std::shared_ptr Villages::getDoorInfo(int x, int y, int z) { // for (DoorInfo di : unclustered) - for (AUTO_VAR(it, unclustered.begin()); it != unclustered.end(); ++it) { + for (auto it = unclustered.begin(); it != unclustered.end(); ++it) { std::shared_ptr di = *it; if (di->x == x && di->z == z && abs(di->y - y) <= 1) return di; } // for (Village v : villages) - for (AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { + for (auto it = villages.begin(); it != villages.end(); ++it) { std::shared_ptr v = *it; std::shared_ptr di = v->getDoorInfo(x, y, z); if (di != nullptr) return di; @@ -185,7 +185,7 @@ void Villages::createDoorInfo(int x, int y, int z) { bool Villages::hasQuery(int x, int y, int z) { // for (Pos pos : queries) - for (AUTO_VAR(it, queries.begin()); it != queries.end(); ++it) { + for (auto it = queries.begin(); it != queries.end(); ++it) { Pos* pos = *it; if (pos->x == x && pos->y == y && pos->z == z) return true; } @@ -214,7 +214,7 @@ void Villages::save(CompoundTag* tag) { tag->putInt(L"Tick", _tick); ListTag* villageTags = new ListTag(L"Villages"); // for (Village village : villages) - for (AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { + for (auto it = villages.begin(); it != villages.end(); ++it) { std::shared_ptr village = *it; CompoundTag* villageTag = new CompoundTag(L"Village"); village->addAdditonalSaveData(villageTag);