mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
Merge branch 'upstream-dev' into cleanup/nullptr-replacement
# Conflicts: # Minecraft.Client/Network/PlayerChunkMap.cpp # Minecraft.Client/Network/PlayerList.cpp # Minecraft.Client/Network/ServerChunkCache.cpp # Minecraft.Client/Platform/Common/Consoles_App.cpp # Minecraft.Client/Platform/Common/DLC/DLCManager.cpp # Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp # Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp # Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp # Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp # Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp # Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp # Minecraft.Client/Platform/Common/UI/UIController.cpp # Minecraft.Client/Platform/Common/UI/UIController.h # Minecraft.Client/Platform/Extrax64Stubs.cpp # Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h # Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h # Minecraft.Client/Player/EntityTracker.cpp # Minecraft.Client/Player/ServerPlayer.cpp # Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp # Minecraft.Client/Textures/Packs/DLCTexturePack.cpp # Minecraft.Client/Textures/Stitching/StitchedTexture.cpp # Minecraft.Client/Textures/Stitching/TextureMap.cpp # Minecraft.Client/Textures/Textures.cpp # Minecraft.World/Blocks/NotGateTile.cpp # Minecraft.World/Blocks/PressurePlateTile.cpp # Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp # Minecraft.World/Enchantments/EnchantmentHelper.cpp # Minecraft.World/Entities/HangingEntity.cpp # Minecraft.World/Entities/LeashFenceKnotEntity.cpp # Minecraft.World/Entities/LivingEntity.cpp # Minecraft.World/Entities/Mobs/Boat.cpp # Minecraft.World/Entities/Mobs/Minecart.cpp # Minecraft.World/Entities/Mobs/Witch.cpp # Minecraft.World/Entities/SyncedEntityData.cpp # Minecraft.World/Items/LeashItem.cpp # Minecraft.World/Items/PotionItem.cpp # Minecraft.World/Level/BaseMobSpawner.cpp # Minecraft.World/Level/CustomLevelSource.cpp # Minecraft.World/Level/Level.cpp # Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp # Minecraft.World/Level/Storage/McRegionLevelStorage.cpp # Minecraft.World/Level/Storage/RegionFileCache.cpp # Minecraft.World/Player/Player.cpp # Minecraft.World/WorldGen/Biomes/BiomeCache.cpp # Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp # Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp
This commit is contained in:
commit
a0fdc643d1
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
class DemoLevel : public Level {
|
class DemoLevel : public Level {
|
||||||
private:
|
private:
|
||||||
static const __int64 DEMO_LEVEL_SEED =
|
static const int64_t DEMO_LEVEL_SEED =
|
||||||
0; // 4J - TODO - was "Don't Look Back".hashCode();
|
0; // 4J - TODO - was "Don't Look Back".hashCode();
|
||||||
static const int DEMO_SPAWN_X = 796;
|
static const int DEMO_SPAWN_X = 796;
|
||||||
static const int DEMO_SPAWN_Y = 72;
|
static const int DEMO_SPAWN_Y = 72;
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ void MultiPlayerLevel::tick() {
|
||||||
// 4J HEG - Copy the connections vector to prevent crash when moving to
|
// 4J HEG - Copy the connections vector to prevent crash when moving to
|
||||||
// Nether
|
// Nether
|
||||||
std::vector<ClientConnection*> connectionsTemp = connections;
|
std::vector<ClientConnection*> connectionsTemp = connections;
|
||||||
for (AUTO_VAR(connection, connectionsTemp.begin());
|
for (auto connection = connectionsTemp.begin();
|
||||||
connection < connectionsTemp.end(); ++connection) {
|
connection < connectionsTemp.end(); ++connection) {
|
||||||
(*connection)->tick();
|
(*connection)->tick();
|
||||||
}
|
}
|
||||||
|
|
@ -391,8 +391,8 @@ void MultiPlayerLevel::tickTiles() {
|
||||||
PIXEndNamedEvent();
|
PIXEndNamedEvent();
|
||||||
|
|
||||||
PIXBeginNamedEvent(0, "Ticking client side tiles");
|
PIXBeginNamedEvent(0, "Ticking client side tiles");
|
||||||
AUTO_VAR(itEndCtp, chunksToPoll.end());
|
auto itEndCtp = chunksToPoll.end();
|
||||||
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) {
|
for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) {
|
||||||
ChunkPos cp = *it;
|
ChunkPos cp = *it;
|
||||||
int xo = cp.x * 16;
|
int xo = cp.x * 16;
|
||||||
int zo = cp.z * 16;
|
int zo = cp.z * 16;
|
||||||
|
|
@ -432,7 +432,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr<Entity> e) {
|
||||||
// 4J Stu - Add this remove from the reEntries collection to stop us
|
// 4J Stu - Add this remove from the reEntries collection to stop us
|
||||||
// continually removing and re-adding things, in particular the
|
// continually removing and re-adding things, in particular the
|
||||||
// MultiPlayerLocalPlayer when they die
|
// MultiPlayerLocalPlayer when they die
|
||||||
AUTO_VAR(it, reEntries.find(e));
|
auto it = reEntries.find(e);
|
||||||
if (it != reEntries.end()) {
|
if (it != reEntries.end()) {
|
||||||
reEntries.erase(it);
|
reEntries.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -443,7 +443,7 @@ void MultiPlayerLevel::removeEntity(std::shared_ptr<Entity> e) {
|
||||||
|
|
||||||
void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
|
void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
|
||||||
Level::entityAdded(e);
|
Level::entityAdded(e);
|
||||||
AUTO_VAR(it, reEntries.find(e));
|
auto it = reEntries.find(e);
|
||||||
if (it != reEntries.end()) {
|
if (it != reEntries.end()) {
|
||||||
reEntries.erase(it);
|
reEntries.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -451,7 +451,7 @@ void MultiPlayerLevel::entityAdded(std::shared_ptr<Entity> e) {
|
||||||
|
|
||||||
void MultiPlayerLevel::entityRemoved(std::shared_ptr<Entity> e) {
|
void MultiPlayerLevel::entityRemoved(std::shared_ptr<Entity> e) {
|
||||||
Level::entityRemoved(e);
|
Level::entityRemoved(e);
|
||||||
AUTO_VAR(it, forced.find(e));
|
auto it = forced.find(e);
|
||||||
if (it != forced.end()) {
|
if (it != forced.end()) {
|
||||||
reEntries.insert(e);
|
reEntries.insert(e);
|
||||||
}
|
}
|
||||||
|
|
@ -472,14 +472,14 @@ void MultiPlayerLevel::putEntity(int id, std::shared_ptr<Entity> e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Entity> MultiPlayerLevel::getEntity(int id) {
|
std::shared_ptr<Entity> MultiPlayerLevel::getEntity(int id) {
|
||||||
AUTO_VAR(it, entitiesById.find(id));
|
auto it = entitiesById.find(id);
|
||||||
if (it == entitiesById.end()) return nullptr;
|
if (it == entitiesById.end()) return nullptr;
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
|
std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
|
||||||
std::shared_ptr<Entity> e;
|
std::shared_ptr<Entity> e;
|
||||||
AUTO_VAR(it, entitiesById.find(id));
|
auto it = entitiesById.find(id);
|
||||||
if (it != entitiesById.end()) {
|
if (it != entitiesById.end()) {
|
||||||
e = it->second;
|
e = it->second;
|
||||||
entitiesById.erase(it);
|
entitiesById.erase(it);
|
||||||
|
|
@ -495,10 +495,10 @@ std::shared_ptr<Entity> MultiPlayerLevel::removeEntity(int id) {
|
||||||
// remove entities slightly differently
|
// remove entities slightly differently
|
||||||
void MultiPlayerLevel::removeEntities(
|
void MultiPlayerLevel::removeEntities(
|
||||||
std::vector<std::shared_ptr<Entity> >* list) {
|
std::vector<std::shared_ptr<Entity> >* list) {
|
||||||
for (AUTO_VAR(it, list->begin()); it < list->end(); ++it) {
|
for (auto it = list->begin(); it < list->end(); ++it) {
|
||||||
std::shared_ptr<Entity> e = *it;
|
std::shared_ptr<Entity> e = *it;
|
||||||
|
|
||||||
AUTO_VAR(reIt, reEntries.find(e));
|
auto reIt = reEntries.find(e);
|
||||||
if (reIt != reEntries.end()) {
|
if (reIt != reEntries.end()) {
|
||||||
reEntries.erase(reIt);
|
reEntries.erase(reIt);
|
||||||
}
|
}
|
||||||
|
|
@ -613,12 +613,12 @@ bool MultiPlayerLevel::doSetTileAndData(int x, int y, int z, int tile,
|
||||||
|
|
||||||
void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) {
|
void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) {
|
||||||
if (sendDisconnect) {
|
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<DisconnectPacket>(
|
(*it)->sendAndDisconnect(std::shared_ptr<DisconnectPacket>(
|
||||||
new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting)));
|
new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (AUTO_VAR(it, connections.begin()); it < connections.end(); ++it) {
|
for (auto it = connections.begin(); it < connections.end(); ++it) {
|
||||||
(*it)->close();
|
(*it)->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -704,7 +704,7 @@ void MultiPlayerLevel::animateTickDoWork() {
|
||||||
MemSect(0);
|
MemSect(0);
|
||||||
|
|
||||||
for (int i = 0; i < ticksPerChunk; i++) {
|
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++) {
|
it++) {
|
||||||
int packed = *it;
|
int packed = *it;
|
||||||
// 4jcraft changed the extraction logic to be safe
|
// 4jcraft changed the extraction logic to be safe
|
||||||
|
|
@ -809,9 +809,9 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
|
||||||
// entities.removeAll(entitiesToRemove);
|
// entities.removeAll(entitiesToRemove);
|
||||||
|
|
||||||
EnterCriticalSection(&m_entitiesCS);
|
EnterCriticalSection(&m_entitiesCS);
|
||||||
for (AUTO_VAR(it, entities.begin()); it != entities.end();) {
|
for (auto it = entities.begin(); it != entities.end();) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (AUTO_VAR(it2, entitiesToRemove.begin());
|
for (auto it2 = entitiesToRemove.begin();
|
||||||
it2 != entitiesToRemove.end(); it2++) {
|
it2 != entitiesToRemove.end(); it2++) {
|
||||||
if ((*it) == (*it2)) {
|
if ((*it) == (*it2)) {
|
||||||
found = true;
|
found = true;
|
||||||
|
|
@ -826,8 +826,8 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() {
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&m_entitiesCS);
|
LeaveCriticalSection(&m_entitiesCS);
|
||||||
|
|
||||||
AUTO_VAR(endIt, entitiesToRemove.end());
|
auto endIt = entitiesToRemove.end();
|
||||||
for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) {
|
for (auto it = entitiesToRemove.begin(); it != endIt; it++) {
|
||||||
std::shared_ptr<Entity> e = *it;
|
std::shared_ptr<Entity> e = *it;
|
||||||
int xc = e->xChunk;
|
int xc = e->xChunk;
|
||||||
int zc = e->zChunk;
|
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
|
// 4J Stu - Is there a reason do this in a separate loop? Thats what the
|
||||||
// Java does...
|
// Java does...
|
||||||
endIt = entitiesToRemove.end();
|
endIt = entitiesToRemove.end();
|
||||||
for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) {
|
for (auto it = entitiesToRemove.begin(); it != endIt; it++) {
|
||||||
entityRemoved(*it);
|
entityRemoved(*it);
|
||||||
}
|
}
|
||||||
entitiesToRemove.clear();
|
entitiesToRemove.clear();
|
||||||
|
|
@ -884,7 +884,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c,
|
||||||
new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting)));
|
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()) {
|
if (it != connections.end()) {
|
||||||
connections.erase(it);
|
connections.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -892,7 +892,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection* c,
|
||||||
|
|
||||||
void MultiPlayerLevel::tickAllConnections() {
|
void MultiPlayerLevel::tickAllConnections() {
|
||||||
PIXBeginNamedEvent(0, "Connection ticking");
|
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();
|
(*it)->tick();
|
||||||
}
|
}
|
||||||
PIXEndNamedEvent();
|
PIXEndNamedEvent();
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ ServerLevel::~ServerLevel() {
|
||||||
delete mobSpawner;
|
delete mobSpawner;
|
||||||
|
|
||||||
EnterCriticalSection(&m_csQueueSendTileUpdates);
|
EnterCriticalSection(&m_csQueueSendTileUpdates);
|
||||||
for (AUTO_VAR(it, m_queuedSendTileUpdates.begin());
|
for (auto it = m_queuedSendTileUpdates.begin();
|
||||||
it != m_queuedSendTileUpdates.end(); ++it) {
|
it != m_queuedSendTileUpdates.end(); ++it) {
|
||||||
Pos* p = *it;
|
Pos* p = *it;
|
||||||
delete p;
|
delete p;
|
||||||
|
|
@ -270,8 +270,8 @@ void ServerLevel::tick() {
|
||||||
if (!SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward
|
if (!SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward
|
||||||
// from 1.8.2
|
// from 1.8.2
|
||||||
{
|
{
|
||||||
AUTO_VAR(itEnd, listeners.end());
|
auto itEnd = listeners.end();
|
||||||
for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) {
|
for (auto it = listeners.begin(); it != itEnd; it++) {
|
||||||
(*it)->skyColorChanged();
|
(*it)->skyColorChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -361,8 +361,8 @@ void ServerLevel::updateSleepingPlayerList() {
|
||||||
allPlayersSleeping = !players.empty();
|
allPlayersSleeping = !players.empty();
|
||||||
m_bAtLeastOnePlayerSleeping = false;
|
m_bAtLeastOnePlayerSleeping = false;
|
||||||
|
|
||||||
AUTO_VAR(itEnd, players.end());
|
auto itEnd = players.end();
|
||||||
for (AUTO_VAR(it, players.begin()); it != itEnd; it++) {
|
for (auto it = players.begin(); it != itEnd; it++) {
|
||||||
if (!(*it)->isSleeping()) {
|
if (!(*it)->isSleeping()) {
|
||||||
allPlayersSleeping = false;
|
allPlayersSleeping = false;
|
||||||
// break;
|
// break;
|
||||||
|
|
@ -377,7 +377,7 @@ void ServerLevel::awakenAllPlayers() {
|
||||||
allPlayersSleeping = false;
|
allPlayersSleeping = false;
|
||||||
m_bAtLeastOnePlayerSleeping = false;
|
m_bAtLeastOnePlayerSleeping = false;
|
||||||
|
|
||||||
AUTO_VAR(itEnd, players.end());
|
auto itEnd = players.end();
|
||||||
for (std::vector<std::shared_ptr<Player> >::iterator it = players.begin();
|
for (std::vector<std::shared_ptr<Player> >::iterator it = players.begin();
|
||||||
it != itEnd; it++) {
|
it != itEnd; it++) {
|
||||||
if ((*it)->isSleeping()) {
|
if ((*it)->isSleeping()) {
|
||||||
|
|
@ -398,7 +398,7 @@ void ServerLevel::stopWeather() {
|
||||||
bool ServerLevel::allPlayersAreSleeping() {
|
bool ServerLevel::allPlayersAreSleeping() {
|
||||||
if (allPlayersSleeping && !isClientSide) {
|
if (allPlayersSleeping && !isClientSide) {
|
||||||
// all players are sleeping, but have they slept long enough?
|
// all players are sleeping, but have they slept long enough?
|
||||||
AUTO_VAR(itEnd, players.end());
|
auto itEnd = players.end();
|
||||||
for (std::vector<std::shared_ptr<Player> >::iterator it =
|
for (std::vector<std::shared_ptr<Player> >::iterator it =
|
||||||
players.begin();
|
players.begin();
|
||||||
it != itEnd; it++) {
|
it != itEnd; it++) {
|
||||||
|
|
@ -483,8 +483,8 @@ void ServerLevel::tickTiles() {
|
||||||
if (app.GetGameSettingsDebugMask() & (1L << eDebugSetting_RegularLightning))
|
if (app.GetGameSettingsDebugMask() & (1L << eDebugSetting_RegularLightning))
|
||||||
prob = 100;
|
prob = 100;
|
||||||
|
|
||||||
AUTO_VAR(itEndCtp, chunksToPoll.end());
|
auto itEndCtp = chunksToPoll.end();
|
||||||
for (AUTO_VAR(it, chunksToPoll.begin()); it != itEndCtp; it++) {
|
for (auto it = chunksToPoll.begin(); it != itEndCtp; it++) {
|
||||||
ChunkPos cp = *it;
|
ChunkPos cp = *it;
|
||||||
int xo = cp.x * 16;
|
int xo = cp.x * 16;
|
||||||
int zo = cp.z * 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;
|
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++) {
|
for (int i = 0; i < count; i++) {
|
||||||
TickNextTickData td = *(itTickList);
|
TickNextTickData td = *(itTickList);
|
||||||
if (!force && td.m_delay > levelData->getGameTime()) {
|
if (!force && td.m_delay > levelData->getGameTime()) {
|
||||||
|
|
@ -665,7 +665,7 @@ bool ServerLevel::tickPendingTicks(bool force) {
|
||||||
toBeTicked.push_back(td);
|
toBeTicked.push_back(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AUTO_VAR(it, toBeTicked.begin()); it != toBeTicked.end();) {
|
for (auto it = toBeTicked.begin(); it != toBeTicked.end();) {
|
||||||
TickNextTickData td = *it;
|
TickNextTickData td = *it;
|
||||||
it = toBeTicked.erase(it);
|
it = toBeTicked.erase(it);
|
||||||
|
|
||||||
|
|
@ -707,7 +707,7 @@ std::vector<TickNextTickData>* ServerLevel::fetchTicksInChunk(LevelChunk* chunk,
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
for (AUTO_VAR(it, tickNextTickList.begin());
|
for (auto it = tickNextTickList.begin();
|
||||||
it != tickNextTickList.end();) {
|
it != tickNextTickList.end();) {
|
||||||
TickNextTickData td = *it;
|
TickNextTickData td = *it;
|
||||||
|
|
||||||
|
|
@ -729,7 +729,7 @@ std::vector<TickNextTickData>* ServerLevel::fetchTicksInChunk(LevelChunk* chunk,
|
||||||
if (!toBeTicked.empty()) {
|
if (!toBeTicked.empty()) {
|
||||||
app.DebugPrintf("To be ticked size: %d\n", toBeTicked.size());
|
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;
|
TickNextTickData td = *it;
|
||||||
|
|
||||||
if (td.x >= xMin && td.x < xMax && td.z >= zMin &&
|
if (td.x >= xMin && td.x < xMax && td.z >= zMin &&
|
||||||
|
|
@ -954,7 +954,7 @@ void ServerLevel::save(bool force, ProgressListener* progressListener,
|
||||||
// clean cache
|
// clean cache
|
||||||
std::vector<LevelChunk*>* loadedChunkList =
|
std::vector<LevelChunk*>* loadedChunkList =
|
||||||
cache->getLoadedChunkList();
|
cache->getLoadedChunkList();
|
||||||
for (AUTO_VAR(it, loadedChunkList->begin());
|
for (auto it = loadedChunkList->begin();
|
||||||
it != loadedChunkList->end(); ++it) {
|
it != loadedChunkList->end(); ++it) {
|
||||||
LevelChunk* lc = *it;
|
LevelChunk* lc = *it;
|
||||||
if (!chunkMap->hasChunk(lc->x, lc->z)) {
|
if (!chunkMap->hasChunk(lc->x, lc->z)) {
|
||||||
|
|
@ -1010,7 +1010,7 @@ void ServerLevel::entityAdded(std::shared_ptr<Entity> e) {
|
||||||
std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities();
|
std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities();
|
||||||
if (es != nullptr) {
|
if (es != nullptr) {
|
||||||
// for (int i = 0; i < es.length; i++)
|
// 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(
|
entitiesById.insert(
|
||||||
intEntityMap::value_type((*it)->entityId, (*it)));
|
intEntityMap::value_type((*it)->entityId, (*it)));
|
||||||
}
|
}
|
||||||
|
|
@ -1024,7 +1024,7 @@ void ServerLevel::entityRemoved(std::shared_ptr<Entity> e) {
|
||||||
std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities();
|
std::vector<std::shared_ptr<Entity> >* es = e->getSubEntities();
|
||||||
if (es != nullptr) {
|
if (es != nullptr) {
|
||||||
// for (int i = 0; i < es.length; i++)
|
// 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);
|
entitiesById.erase((*it)->entityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1070,7 +1070,7 @@ std::shared_ptr<Explosion> ServerLevel::explode(std::shared_ptr<Entity> source,
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<ServerPlayer> > sentTo;
|
std::vector<std::shared_ptr<ServerPlayer> > sentTo;
|
||||||
for (AUTO_VAR(it, players.begin()); it != players.end(); ++it) {
|
for (auto it = players.begin(); it != players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> player =
|
std::shared_ptr<ServerPlayer> player =
|
||||||
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||||
if (player->dimension != dimension->id) continue;
|
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));
|
// TileEventPacket(x, y, z, b0, b1));
|
||||||
TileEventData newEvent(x, y, z, tile, b0, b1);
|
TileEventData newEvent(x, y, z, tile, b0, b1);
|
||||||
// for (TileEventData te : tileEvents[activeTileEventsList])
|
// for (TileEventData te : tileEvents[activeTileEventsList])
|
||||||
for (AUTO_VAR(it, tileEvents[activeTileEventsList].begin());
|
for (auto it = tileEvents[activeTileEventsList].begin();
|
||||||
it != tileEvents[activeTileEventsList].end(); ++it) {
|
it != tileEvents[activeTileEventsList].end(); ++it) {
|
||||||
if ((*it).equals(newEvent)) {
|
if ((*it).equals(newEvent)) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -1132,7 +1132,7 @@ void ServerLevel::runTileEvents() {
|
||||||
activeTileEventsList ^= 1;
|
activeTileEventsList ^= 1;
|
||||||
|
|
||||||
// for (TileEventData te : tileEvents[runList])
|
// for (TileEventData te : tileEvents[runList])
|
||||||
for (AUTO_VAR(it, tileEvents[runList].begin());
|
for (auto it = tileEvents[runList].begin();
|
||||||
it != tileEvents[runList].end(); ++it) {
|
it != tileEvents[runList].end(); ++it) {
|
||||||
if (doTileEvent(&(*it))) {
|
if (doTileEvent(&(*it))) {
|
||||||
TileEventData te = *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
|
// in the set. Instead move to a vector, do the adjustment, put back in the
|
||||||
// set.
|
// set.
|
||||||
std::vector<TickNextTickData> temp;
|
std::vector<TickNextTickData> temp;
|
||||||
for (AUTO_VAR(it, tickNextTickList.begin()); it != tickNextTickList.end();
|
for (auto it = tickNextTickList.begin(); it != tickNextTickList.end();
|
||||||
++it) {
|
++it) {
|
||||||
temp.push_back(*it);
|
temp.push_back(*it);
|
||||||
temp.back().m_delay += delta;
|
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,
|
name, (float)x, (float)y, (float)z, (float)xDist, (float)yDist,
|
||||||
(float)zDist, (float)speed, count));
|
(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<ServerPlayer> player =
|
std::shared_ptr<ServerPlayer> player =
|
||||||
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||||
player->connection->send(packet);
|
player->connection->send(packet);
|
||||||
|
|
@ -1232,7 +1232,7 @@ void ServerLevel::queueSendTileUpdate(int x, int y, int z) {
|
||||||
|
|
||||||
void ServerLevel::runQueuedSendTileUpdates() {
|
void ServerLevel::runQueuedSendTileUpdates() {
|
||||||
EnterCriticalSection(&m_csQueueSendTileUpdates);
|
EnterCriticalSection(&m_csQueueSendTileUpdates);
|
||||||
for (AUTO_VAR(it, m_queuedSendTileUpdates.begin());
|
for (auto it = m_queuedSendTileUpdates.begin();
|
||||||
it != m_queuedSendTileUpdates.end(); ++it) {
|
it != m_queuedSendTileUpdates.end(); ++it) {
|
||||||
Pos* p = *it;
|
Pos* p = *it;
|
||||||
sendTileUpdated(p->x, p->y, p->z);
|
sendTileUpdated(p->x, p->y, p->z);
|
||||||
|
|
@ -1372,7 +1372,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
||||||
EnterCriticalSection(&m_limiterCS);
|
EnterCriticalSection(&m_limiterCS);
|
||||||
// printf("entity removed: item entity count
|
// printf("entity removed: item entity count
|
||||||
//%d\n",m_itemEntities.size());
|
//%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()) {
|
if (it != m_itemEntities.end()) {
|
||||||
// printf("Item to remove found\n");
|
// printf("Item to remove found\n");
|
||||||
m_itemEntities.erase(it);
|
m_itemEntities.erase(it);
|
||||||
|
|
@ -1384,8 +1384,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
||||||
EnterCriticalSection(&m_limiterCS);
|
EnterCriticalSection(&m_limiterCS);
|
||||||
// printf("entity removed: item entity count
|
// printf("entity removed: item entity count
|
||||||
//%d\n",m_itemEntities.size());
|
//%d\n",m_itemEntities.size());
|
||||||
AUTO_VAR(it,
|
auto it =
|
||||||
find(m_hangingEntities.begin(), m_hangingEntities.end(), e));
|
find(m_hangingEntities.begin(), m_hangingEntities.end(), e);
|
||||||
if (it != m_hangingEntities.end()) {
|
if (it != m_hangingEntities.end()) {
|
||||||
// printf("Item to remove found\n");
|
// printf("Item to remove found\n");
|
||||||
m_hangingEntities.erase(it);
|
m_hangingEntities.erase(it);
|
||||||
|
|
@ -1397,7 +1397,7 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
||||||
EnterCriticalSection(&m_limiterCS);
|
EnterCriticalSection(&m_limiterCS);
|
||||||
// printf("entity removed: arrow entity count
|
// printf("entity removed: arrow entity count
|
||||||
//%d\n",m_arrowEntities.size());
|
//%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()) {
|
if (it != m_arrowEntities.end()) {
|
||||||
// printf("Item to remove found\n");
|
// printf("Item to remove found\n");
|
||||||
m_arrowEntities.erase(it);
|
m_arrowEntities.erase(it);
|
||||||
|
|
@ -1409,8 +1409,8 @@ void ServerLevel::entityRemovedExtra(std::shared_ptr<Entity> e) {
|
||||||
EnterCriticalSection(&m_limiterCS);
|
EnterCriticalSection(&m_limiterCS);
|
||||||
// printf("entity removed: experience orb entity count
|
// printf("entity removed: experience orb entity count
|
||||||
//%d\n",m_arrowEntities.size());
|
//%d\n",m_arrowEntities.size());
|
||||||
AUTO_VAR(it, find(m_experienceOrbEntities.begin(),
|
auto it = find(m_experienceOrbEntities.begin(),
|
||||||
m_experienceOrbEntities.end(), e));
|
m_experienceOrbEntities.end(), e);
|
||||||
if (it != m_experienceOrbEntities.end()) {
|
if (it != m_experienceOrbEntities.end()) {
|
||||||
// printf("Item to remove found\n");
|
// printf("Item to remove found\n");
|
||||||
m_experienceOrbEntities.erase(it);
|
m_experienceOrbEntities.erase(it);
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ void ServerLevelListener::globalLevelEvent(int type, int sourceX, int sourceY,
|
||||||
void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z,
|
void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z,
|
||||||
int progress) {
|
int progress) {
|
||||||
// for (ServerPlayer p : server->getPlayers()->players)
|
// 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) {
|
it != server->getPlayers()->players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> p = *it;
|
std::shared_ptr<ServerPlayer> p = *it;
|
||||||
if (p == nullptr || p->level != level || p->entityId == id) continue;
|
if (p == nullptr || p->level != level || p->entityId == id) continue;
|
||||||
|
|
|
||||||
|
|
@ -3467,7 +3467,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
|
||||||
// // see if we can react to this
|
// // see if we can react to this
|
||||||
// if(app.GetXuiAction(iPad)==eAppAction_Idle)
|
// 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(
|
bool Minecraft::addPendingClientTextureRequest(
|
||||||
const std::wstring& textureName) {
|
const std::wstring& textureName) {
|
||||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
auto it = find(m_pendingTextureRequests.begin(),
|
||||||
m_pendingTextureRequests.end(), textureName));
|
m_pendingTextureRequests.end(), textureName);
|
||||||
if (it == m_pendingTextureRequests.end()) {
|
if (it == m_pendingTextureRequests.end()) {
|
||||||
m_pendingTextureRequests.push_back(textureName);
|
m_pendingTextureRequests.push_back(textureName);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -4494,8 +4494,8 @@ bool Minecraft::addPendingClientTextureRequest(
|
||||||
}
|
}
|
||||||
|
|
||||||
void Minecraft::handleClientTextureReceived(const std::wstring& textureName) {
|
void Minecraft::handleClientTextureReceived(const std::wstring& textureName) {
|
||||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
auto it = find(m_pendingTextureRequests.begin(),
|
||||||
m_pendingTextureRequests.end(), textureName));
|
m_pendingTextureRequests.end(), textureName);
|
||||||
if (it != m_pendingTextureRequests.end()) {
|
if (it != m_pendingTextureRequests.end()) {
|
||||||
m_pendingTextureRequests.erase(it);
|
m_pendingTextureRequests.erase(it);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ MinecraftServer::MinecraftServer() {
|
||||||
|
|
||||||
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) {
|
std::uint32_t initSettings, bool findSeed) {
|
||||||
// 4J - removed
|
// 4J - removed
|
||||||
settings = new Settings(new File(L"server.properties"));
|
settings = new Settings(new File(L"server.properties"));
|
||||||
|
|
@ -323,7 +323,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer* mcprogress) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MinecraftServer::loadLevel(LevelStorageSource* storageSource,
|
bool MinecraftServer::loadLevel(LevelStorageSource* storageSource,
|
||||||
const std::wstring& name, __int64 levelSeed,
|
const std::wstring& name, int64_t levelSeed,
|
||||||
LevelType* pLevelType,
|
LevelType* pLevelType,
|
||||||
NetworkGameInitData* initData) {
|
NetworkGameInitData* initData) {
|
||||||
// 4J - TODO - do with new save stuff
|
// 4J - TODO - do with new save stuff
|
||||||
|
|
@ -1396,7 +1396,7 @@ void MinecraftServer::broadcastStopSavingPacket() {
|
||||||
|
|
||||||
void MinecraftServer::tick() {
|
void MinecraftServer::tick() {
|
||||||
std::vector<std::wstring> toRemove;
|
std::vector<std::wstring> toRemove;
|
||||||
for (AUTO_VAR(it, ironTimers.begin()); it != ironTimers.end(); it++) {
|
for (auto it = ironTimers.begin(); it != ironTimers.end(); it++) {
|
||||||
int t = it->second;
|
int t = it->second;
|
||||||
if (t > 0) {
|
if (t > 0) {
|
||||||
ironTimers[it->first] = t - 1;
|
ironTimers[it->first] = t - 1;
|
||||||
|
|
@ -1512,7 +1512,7 @@ void MinecraftServer::handleConsoleInput(const std::wstring& msg,
|
||||||
|
|
||||||
void MinecraftServer::handleConsoleInputs() {
|
void MinecraftServer::handleConsoleInputs() {
|
||||||
while (consoleInput.size() > 0) {
|
while (consoleInput.size() > 0) {
|
||||||
AUTO_VAR(it, consoleInput.begin());
|
auto it = consoleInput.begin();
|
||||||
ConsoleInput* input = *it;
|
ConsoleInput* input = *it;
|
||||||
consoleInput.erase(it);
|
consoleInput.erase(it);
|
||||||
// commands->handleCommand(input); // 4J - removed
|
// commands->handleCommand(input); // 4J - removed
|
||||||
|
|
@ -1612,8 +1612,8 @@ void MinecraftServer::chunkPacketManagement_PreTick() {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int longestTime = 0;
|
int longestTime = 0;
|
||||||
AUTO_VAR(playerConnectionBest, playersOrig.begin());
|
auto playerConnectionBest = playersOrig.begin();
|
||||||
for (AUTO_VAR(it, playersOrig.begin()); it != playersOrig.end();
|
for (auto it = playersOrig.begin(); it != playersOrig.end();
|
||||||
it++) {
|
it++) {
|
||||||
int thisTime = 0;
|
int thisTime = 0;
|
||||||
INetworkPlayer* np = (*it)->getNetworkPlayer();
|
INetworkPlayer* np = (*it)->getNetworkPlayer();
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ class CommandDispatcher;
|
||||||
|
|
||||||
typedef struct _LoadSaveDataThreadParam {
|
typedef struct _LoadSaveDataThreadParam {
|
||||||
void* data;
|
void* data;
|
||||||
__int64 fileSize;
|
int64_t fileSize;
|
||||||
const std::wstring saveName;
|
const std::wstring saveName;
|
||||||
_LoadSaveDataThreadParam(void* data, __int64 filesize,
|
_LoadSaveDataThreadParam(void* data, int64_t filesize,
|
||||||
const std::wstring& saveName)
|
const std::wstring& saveName)
|
||||||
: data(data), fileSize(filesize), saveName(saveName) {}
|
: data(data), fileSize(filesize), saveName(saveName) {}
|
||||||
} LoadSaveDataThreadParam;
|
} LoadSaveDataThreadParam;
|
||||||
|
|
@ -135,11 +135,11 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// 4J Added - LoadSaveDataThreadParam
|
// 4J Added - LoadSaveDataThreadParam
|
||||||
bool initServer(__int64 seed, NetworkGameInitData* initData,
|
bool initServer(int64_t seed, NetworkGameInitData* initData,
|
||||||
std::uint32_t initSettings, bool findSeed);
|
std::uint32_t initSettings, bool findSeed);
|
||||||
void postProcessTerminate(ProgressRenderer* mcprogress);
|
void postProcessTerminate(ProgressRenderer* mcprogress);
|
||||||
bool loadLevel(LevelStorageSource* storageSource, const std::wstring& name,
|
bool loadLevel(LevelStorageSource* storageSource, const std::wstring& name,
|
||||||
__int64 levelSeed, LevelType* pLevelType,
|
int64_t levelSeed, LevelType* pLevelType,
|
||||||
NetworkGameInitData* initData);
|
NetworkGameInitData* initData);
|
||||||
void setProgress(const std::wstring& status, int progress);
|
void setProgress(const std::wstring& status, int progress);
|
||||||
void endProgress();
|
void endProgress();
|
||||||
|
|
@ -184,7 +184,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void halt();
|
void halt();
|
||||||
void run(__int64 seed, void* lpParameter);
|
void run(int64_t seed, void* lpParameter);
|
||||||
|
|
||||||
void broadcastStartSavingPacket();
|
void broadcastStartSavingPacket();
|
||||||
void broadcastStopSavingPacket();
|
void broadcastStopSavingPacket();
|
||||||
|
|
|
||||||
|
|
@ -605,7 +605,7 @@ void ClientConnection::handleAddEntity(
|
||||||
if (subEntities != nullptr) {
|
if (subEntities != nullptr) {
|
||||||
int offs = packet->id - e->entityId;
|
int offs = packet->id - e->entityId;
|
||||||
// for (int i = 0; i < subEntities.length; i++)
|
// 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) {
|
||||||
(*it)->entityId += offs;
|
(*it)->entityId += offs;
|
||||||
// subEntities[i].entityId += offs;
|
// subEntities[i].entityId += offs;
|
||||||
|
|
@ -2003,7 +2003,7 @@ void ClientConnection::handleAddMob(std::shared_ptr<AddMobPacket> packet) {
|
||||||
if (subEntities != nullptr) {
|
if (subEntities != nullptr) {
|
||||||
int offs = packet->id - mob->entityId;
|
int offs = packet->id - mob->entityId;
|
||||||
// for (int i = 0; i < subEntities.length; i++)
|
// 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) {
|
||||||
// subEntities[i].entityId += offs;
|
// subEntities[i].entityId += offs;
|
||||||
(*it)->entityId += offs;
|
(*it)->entityId += offs;
|
||||||
|
|
@ -3444,7 +3444,7 @@ void ClientConnection::handleUpdateAttributes(
|
||||||
(std::dynamic_pointer_cast<LivingEntity>(entity))->getAttributes();
|
(std::dynamic_pointer_cast<LivingEntity>(entity))->getAttributes();
|
||||||
std::unordered_set<UpdateAttributesPacket::AttributeSnapshot*>
|
std::unordered_set<UpdateAttributesPacket::AttributeSnapshot*>
|
||||||
attributeSnapshots = packet->getValues();
|
attributeSnapshots = packet->getValues();
|
||||||
for (AUTO_VAR(it, attributeSnapshots.begin());
|
for (auto it = attributeSnapshots.begin();
|
||||||
it != attributeSnapshots.end(); ++it) {
|
it != attributeSnapshots.end(); ++it) {
|
||||||
UpdateAttributesPacket::AttributeSnapshot* attribute = *it;
|
UpdateAttributesPacket::AttributeSnapshot* attribute = *it;
|
||||||
AttributeInstance* instance =
|
AttributeInstance* instance =
|
||||||
|
|
@ -3465,7 +3465,7 @@ void ClientConnection::handleUpdateAttributes(
|
||||||
std::unordered_set<AttributeModifier*>* modifiers =
|
std::unordered_set<AttributeModifier*>* modifiers =
|
||||||
attribute->getModifiers();
|
attribute->getModifiers();
|
||||||
|
|
||||||
for (AUTO_VAR(it2, modifiers->begin()); it2 != modifiers->end();
|
for (auto it2 = modifiers->begin(); it2 != modifiers->end();
|
||||||
++it2) {
|
++it2) {
|
||||||
AttributeModifier* modifier = *it2;
|
AttributeModifier* modifier = *it2;
|
||||||
instance->addModifier(
|
instance->addModifier(
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,8 @@ MultiPlayerChunkCache::~MultiPlayerChunkCache() {
|
||||||
delete cache;
|
delete cache;
|
||||||
delete hasData;
|
delete hasData;
|
||||||
|
|
||||||
AUTO_VAR(itEnd, loadedChunkList.end());
|
auto itEnd = loadedChunkList.end();
|
||||||
for (AUTO_VAR(it, loadedChunkList.begin()); it != itEnd; it++) delete *it;
|
for (auto it = loadedChunkList.begin(); it != itEnd; it++) delete *it;
|
||||||
|
|
||||||
DeleteCriticalSection(&m_csLoadCreate);
|
DeleteCriticalSection(&m_csLoadCreate);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ void PendingConnection::sendPreLoginResponse() {
|
||||||
StorageManager.GetSaveUniqueFilename(szUniqueMapName);
|
StorageManager.GetSaveUniqueFilename(szUniqueMapName);
|
||||||
|
|
||||||
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
|
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
|
||||||
for (AUTO_VAR(it, playerList->players.begin());
|
for (auto it = playerList->players.begin();
|
||||||
it != playerList->players.end(); ++it) {
|
it != playerList->players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> player = *it;
|
std::shared_ptr<ServerPlayer> player = *it;
|
||||||
// If the offline Xuid is invalid but the online one is not then that's
|
// If the offline Xuid is invalid but the online one is not then that's
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ PlayerChunkMap::PlayerChunk::~PlayerChunk() { delete changedTiles.data; }
|
||||||
// output flag array and adds to it for this ServerPlayer.
|
// output flag array and adds to it for this ServerPlayer.
|
||||||
void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int* flags,
|
void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int* flags,
|
||||||
bool* flagToBeRemoved) {
|
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> serverPlayer = *it;
|
std::shared_ptr<ServerPlayer> serverPlayer = *it;
|
||||||
serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved);
|
serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved);
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +89,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
|
||||||
|
|
||||||
// app.DebugPrintf("--- PlayerChunkMap::PlayerChunk::remove
|
// app.DebugPrintf("--- PlayerChunkMap::PlayerChunk::remove
|
||||||
// x=%d\tz=%d\n",x,z);
|
// 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()) {
|
if (it == players.end()) {
|
||||||
app.DebugPrintf(
|
app.DebugPrintf(
|
||||||
"--- INFO - Removing player from chunk x=%d\t z=%d, but they are "
|
"--- INFO - Removing player from chunk x=%d\t z=%d, but they are "
|
||||||
|
|
@ -104,20 +104,20 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
|
||||||
{
|
{
|
||||||
LevelChunk* chunk = parent->level->getChunk(pos.x, pos.z);
|
LevelChunk* chunk = parent->level->getChunk(pos.x, pos.z);
|
||||||
updateInhabitedTime(chunk);
|
updateInhabitedTime(chunk);
|
||||||
AUTO_VAR(it, find(parent->knownChunks.begin(),
|
auto it = find(parent->knownChunks.begin(),
|
||||||
parent->knownChunks.end(), this));
|
parent->knownChunks.end(), this);
|
||||||
if (it != parent->knownChunks.end()) parent->knownChunks.erase(it);
|
if (it != parent->knownChunks.end()) parent->knownChunks.erase(it);
|
||||||
}
|
}
|
||||||
int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32);
|
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()) {
|
if (it != parent->chunks.end()) {
|
||||||
toDelete = it->second; // Don't delete until the end of the
|
toDelete = it->second; // Don't delete until the end of the
|
||||||
// function, as this might be this instance
|
// function, as this might be this instance
|
||||||
parent->chunks.erase(it);
|
parent->chunks.erase(it);
|
||||||
}
|
}
|
||||||
if (changes > 0) {
|
if (changes > 0) {
|
||||||
AUTO_VAR(it, find(parent->changedChunks.begin(),
|
auto it = find(parent->changedChunks.begin(),
|
||||||
parent->changedChunks.end(), this));
|
parent->changedChunks.end(), this);
|
||||||
parent->changedChunks.erase(it);
|
parent->changedChunks.erase(it);
|
||||||
}
|
}
|
||||||
parent->getLevel()->cache->drop(pos.x, pos.z);
|
parent->getLevel()->cache->drop(pos.x, pos.z);
|
||||||
|
|
@ -135,7 +135,7 @@ void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr<ServerPlayer> player) {
|
||||||
bool noOtherPlayersFound = true;
|
bool noOtherPlayersFound = true;
|
||||||
|
|
||||||
if (thisNetPlayer != nullptr) {
|
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<ServerPlayer> currPlayer = *it;
|
std::shared_ptr<ServerPlayer> currPlayer = *it;
|
||||||
INetworkPlayer* currNetPlayer =
|
INetworkPlayer* currNetPlayer =
|
||||||
currPlayer->connection->getNetworkPlayer();
|
currPlayer->connection->getNetworkPlayer();
|
||||||
|
|
@ -405,7 +405,7 @@ PlayerChunkMap::PlayerChunkMap(ServerLevel* level, int dimension, int radius) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerChunkMap::~PlayerChunkMap() {
|
PlayerChunkMap::~PlayerChunkMap() {
|
||||||
for (AUTO_VAR(it, chunks.begin()); it != chunks.end(); it++) {
|
for (auto it = chunks.begin(); it != chunks.end(); it++) {
|
||||||
delete it->second;
|
delete it->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -471,7 +471,7 @@ bool PlayerChunkMap::hasChunk(int x, int z) {
|
||||||
PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
|
PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
|
||||||
bool create) {
|
bool create) {
|
||||||
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
||||||
AUTO_VAR(it, chunks.find(id));
|
auto it = chunks.find(id);
|
||||||
|
|
||||||
PlayerChunk* chunk = nullptr;
|
PlayerChunk* chunk = nullptr;
|
||||||
if (it != chunks.end()) {
|
if (it != chunks.end()) {
|
||||||
|
|
@ -490,7 +490,7 @@ PlayerChunkMap::PlayerChunk* PlayerChunkMap::getChunk(int x, int z,
|
||||||
void PlayerChunkMap::getChunkAndAddPlayer(
|
void PlayerChunkMap::getChunkAndAddPlayer(
|
||||||
int x, int z, std::shared_ptr<ServerPlayer> player) {
|
int x, int z, std::shared_ptr<ServerPlayer> player) {
|
||||||
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
||||||
AUTO_VAR(it, chunks.find(id));
|
auto it = chunks.find(id);
|
||||||
|
|
||||||
if (it != chunks.end()) {
|
if (it != chunks.end()) {
|
||||||
it->second->add(player);
|
it->second->add(player);
|
||||||
|
|
@ -503,14 +503,14 @@ void PlayerChunkMap::getChunkAndAddPlayer(
|
||||||
// there. Otherwise attempt to remove from main chunk map.
|
// there. Otherwise attempt to remove from main chunk map.
|
||||||
void PlayerChunkMap::getChunkAndRemovePlayer(
|
void PlayerChunkMap::getChunkAndRemovePlayer(
|
||||||
int x, int z, std::shared_ptr<ServerPlayer> player) {
|
int x, int z, std::shared_ptr<ServerPlayer> 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)) {
|
if ((it->x == x) && (it->z == z) && (it->player == player)) {
|
||||||
addRequests.erase(it);
|
addRequests.erase(it);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32);
|
||||||
AUTO_VAR(it, chunks.find(id));
|
auto it = chunks.find(id);
|
||||||
|
|
||||||
if (it != chunks.end()) {
|
if (it != chunks.end()) {
|
||||||
it->second->remove(player);
|
it->second->remove(player);
|
||||||
|
|
@ -526,8 +526,8 @@ void PlayerChunkMap::tickAddRequests(std::shared_ptr<ServerPlayer> player) {
|
||||||
int pz = (int)player->z;
|
int pz = (int)player->z;
|
||||||
int minDistSq = -1;
|
int minDistSq = -1;
|
||||||
|
|
||||||
AUTO_VAR(itNearest, addRequests.end());
|
auto itNearest = addRequests.end();
|
||||||
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++) {
|
for (auto it = addRequests.begin(); it != addRequests.end(); it++) {
|
||||||
if (it->player == player) {
|
if (it->player == player) {
|
||||||
int xm = (it->x * 16) + 8;
|
int xm = (it->x * 16) + 8;
|
||||||
int zm = (it->z * 16) + 8;
|
int zm = (it->z * 16) + 8;
|
||||||
|
|
@ -693,13 +693,13 @@ void PlayerChunkMap::remove(std::shared_ptr<ServerPlayer> player) {
|
||||||
if (playerChunk != nullptr) playerChunk->remove(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())
|
if (players.size() > 0 && it != players.end())
|
||||||
players.erase(find(players.begin(), players.end(), player));
|
players.erase(find(players.begin(), players.end(), player));
|
||||||
|
|
||||||
// 4J - added - also remove any queued requests to be added to playerchunks
|
// 4J - added - also remove any queued requests to be added to playerchunks
|
||||||
// here
|
// here
|
||||||
for (AUTO_VAR(it, addRequests.begin()); it != addRequests.end();) {
|
for (auto it = addRequests.begin(); it != addRequests.end();) {
|
||||||
if (it->player == player) {
|
if (it->player == player) {
|
||||||
it = addRequests.erase(it);
|
it = addRequests.erase(it);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -764,10 +764,10 @@ bool PlayerChunkMap::isPlayerIn(std::shared_ptr<ServerPlayer> player,
|
||||||
if (chunk == nullptr) {
|
if (chunk == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
AUTO_VAR(it1,
|
auto it1 =
|
||||||
find(chunk->players.begin(), chunk->players.end(), player));
|
find(chunk->players.begin(), chunk->players.end(), player);
|
||||||
AUTO_VAR(it2, find(player->chunksToSend.begin(),
|
auto it2 = find(player->chunksToSend.begin(),
|
||||||
player->chunksToSend.end(), chunk->pos));
|
player->chunksToSend.end(), chunk->pos);
|
||||||
return it1 != chunk->players.end() && it2 == player->chunksToSend.end();
|
return it1 != chunk->players.end() && it2 == player->chunksToSend.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -851,8 +851,8 @@ void PlayerConnection::handleTextureAndGeometry(
|
||||||
void PlayerConnection::handleTextureReceived(const std::wstring& textureName) {
|
void PlayerConnection::handleTextureReceived(const std::wstring& textureName) {
|
||||||
// This sends the server received texture out to any other players waiting
|
// This sends the server received texture out to any other players waiting
|
||||||
// for the data
|
// for the data
|
||||||
AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
||||||
textureName));
|
textureName);
|
||||||
if (it != m_texturesRequested.end()) {
|
if (it != m_texturesRequested.end()) {
|
||||||
std::uint8_t* pbData = nullptr;
|
std::uint8_t* pbData = nullptr;
|
||||||
unsigned int dwBytes = 0;
|
unsigned int dwBytes = 0;
|
||||||
|
|
@ -870,8 +870,8 @@ void PlayerConnection::handleTextureAndGeometryReceived(
|
||||||
const std::wstring& textureName) {
|
const std::wstring& textureName) {
|
||||||
// This sends the server received texture out to any other players waiting
|
// This sends the server received texture out to any other players waiting
|
||||||
// for the data
|
// for the data
|
||||||
AUTO_VAR(it, find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
auto it = find(m_texturesRequested.begin(), m_texturesRequested.end(),
|
||||||
textureName));
|
textureName);
|
||||||
if (it != m_texturesRequested.end()) {
|
if (it != m_texturesRequested.end()) {
|
||||||
std::uint8_t* pbData = nullptr;
|
std::uint8_t* pbData = nullptr;
|
||||||
unsigned int dwTextureBytes = 0;
|
unsigned int dwTextureBytes = 0;
|
||||||
|
|
@ -1270,7 +1270,7 @@ void PlayerConnection::handleSetCreativeModeSlot(
|
||||||
|
|
||||||
void PlayerConnection::handleContainerAck(
|
void PlayerConnection::handleContainerAck(
|
||||||
std::shared_ptr<ContainerAckPacket> packet) {
|
std::shared_ptr<ContainerAckPacket> packet) {
|
||||||
AUTO_VAR(it, expectedAcks.find(player->containerMenu->containerId));
|
auto it = expectedAcks.find(player->containerMenu->containerId);
|
||||||
|
|
||||||
if (it != expectedAcks.end() && packet->uid == it->second &&
|
if (it != expectedAcks.end() && packet->uid == it->second &&
|
||||||
player->containerMenu->containerId == packet->containerId &&
|
player->containerMenu->containerId == packet->containerId &&
|
||||||
|
|
@ -1335,7 +1335,7 @@ void PlayerConnection::handlePlayerInfo(
|
||||||
player->isModerator()) {
|
player->isModerator()) {
|
||||||
std::shared_ptr<ServerPlayer> serverPlayer;
|
std::shared_ptr<ServerPlayer> serverPlayer;
|
||||||
// Find the player being edited
|
// 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) {
|
it != server->getPlayers()->players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> checkingPlayer = *it;
|
std::shared_ptr<ServerPlayer> checkingPlayer = *it;
|
||||||
if (checkingPlayer->connection->getNetworkPlayer() != nullptr &&
|
if (checkingPlayer->connection->getNetworkPlayer() != nullptr &&
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ PlayerList::PlayerList(MinecraftServer* server) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerList::~PlayerList() {
|
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
|
(*it)->connection = nullptr; // Must remove reference to connection, or
|
||||||
// else there is a circular dependency
|
// else there is a circular dependency
|
||||||
delete (*it)->gameMode; // Gamemode also needs deleted as it references
|
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];
|
bool usedIndexes[MINECRAFT_NET_MAX_PLAYERS];
|
||||||
ZeroMemory(&usedIndexes, MINECRAFT_NET_MAX_PLAYERS * sizeof(bool));
|
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;
|
usedIndexes[(int)(*it)->getPlayerIndex()] = true;
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) {
|
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->getGameTime(), level->getDayTime(),
|
||||||
level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT))));
|
level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT))));
|
||||||
|
|
||||||
AUTO_VAR(activeEffects, player->getActiveEffects());
|
auto activeEffects = player->getActiveEffects();
|
||||||
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end();
|
for (auto it = activeEffects->begin(); it != activeEffects->end();
|
||||||
++it) {
|
++it) {
|
||||||
MobEffectInstance* effect = *it;
|
MobEffectInstance* effect = *it;
|
||||||
playerConnection->send(std::shared_ptr<UpdateMobEffectPacket>(
|
playerConnection->send(std::shared_ptr<UpdateMobEffectPacket>(
|
||||||
|
|
@ -294,7 +294,7 @@ void PlayerList::placeNewPlayer(Connection* connection,
|
||||||
// to true so that respawning works when the EndPoem is closed
|
// to true so that respawning works when the EndPoem is closed
|
||||||
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
||||||
if (thisPlayer != nullptr) {
|
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<ServerPlayer> servPlayer = *it;
|
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||||
INetworkPlayer* checkPlayer =
|
INetworkPlayer* checkPlayer =
|
||||||
servPlayer->connection->getNetworkPlayer();
|
servPlayer->connection->getNetworkPlayer();
|
||||||
|
|
@ -521,7 +521,7 @@ void PlayerList::remove(std::shared_ptr<ServerPlayer> player) {
|
||||||
}
|
}
|
||||||
level->removeEntity(player);
|
level->removeEntity(player);
|
||||||
level->getChunkMap()->remove(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()) {
|
if (it != players.end()) {
|
||||||
players.erase(it);
|
players.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -632,7 +632,7 @@ std::shared_ptr<ServerPlayer> PlayerList::respawn(
|
||||||
}
|
}
|
||||||
|
|
||||||
serverPlayer->getLevel()->getChunkMap()->remove(serverPlayer);
|
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()) {
|
if (it != players.end()) {
|
||||||
players.erase(it);
|
players.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -752,7 +752,7 @@ std::shared_ptr<ServerPlayer> PlayerList::respawn(
|
||||||
if (keepAllPlayerData) {
|
if (keepAllPlayerData) {
|
||||||
std::vector<MobEffectInstance*>* activeEffects =
|
std::vector<MobEffectInstance*>* activeEffects =
|
||||||
player->getActiveEffects();
|
player->getActiveEffects();
|
||||||
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end();
|
for (auto it = activeEffects->begin(); it != activeEffects->end();
|
||||||
++it) {
|
++it) {
|
||||||
MobEffectInstance* effect = *it;
|
MobEffectInstance* effect = *it;
|
||||||
|
|
||||||
|
|
@ -893,7 +893,7 @@ void PlayerList::toggleDimension(std::shared_ptr<ServerPlayer> player,
|
||||||
// 4J Stu - Fix for #64683 - Customer Encountered: TU7: Content: Gameplay:
|
// 4J Stu - Fix for #64683 - Customer Encountered: TU7: Content: Gameplay:
|
||||||
// Potion effects are removed after using the Nether Portal
|
// Potion effects are removed after using the Nether Portal
|
||||||
std::vector<MobEffectInstance*>* activeEffects = player->getActiveEffects();
|
std::vector<MobEffectInstance*>* activeEffects = player->getActiveEffects();
|
||||||
for (AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end();
|
for (auto it = activeEffects->begin(); it != activeEffects->end();
|
||||||
++it) {
|
++it) {
|
||||||
MobEffectInstance* effect = *it;
|
MobEffectInstance* effect = *it;
|
||||||
|
|
||||||
|
|
@ -1409,7 +1409,7 @@ int PlayerList::getPlayerCount() { return (int)players.size(); }
|
||||||
int PlayerList::getPlayerCount(ServerLevel* level) {
|
int PlayerList::getPlayerCount(ServerLevel* level) {
|
||||||
int count = 0;
|
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;
|
if ((*it)->level == level) ++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1455,7 +1455,7 @@ std::shared_ptr<ServerPlayer> PlayerList::findAlivePlayerOnSystem(
|
||||||
|
|
||||||
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
||||||
if (thisPlayer != nullptr) {
|
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<ServerPlayer> newPlayer = *itP;
|
std::shared_ptr<ServerPlayer> newPlayer = *itP;
|
||||||
|
|
||||||
INetworkPlayer* otherPlayer =
|
INetworkPlayer* otherPlayer =
|
||||||
|
|
@ -1488,8 +1488,8 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
||||||
#endif
|
#endif
|
||||||
bool playerRemoved = false;
|
bool playerRemoved = false;
|
||||||
|
|
||||||
AUTO_VAR(it, find(receiveAllPlayers[dimIndex].begin(),
|
auto it = find(receiveAllPlayers[dimIndex].begin(),
|
||||||
receiveAllPlayers[dimIndex].end(), player));
|
receiveAllPlayers[dimIndex].end(), player);
|
||||||
if (it != receiveAllPlayers[dimIndex].end()) {
|
if (it != receiveAllPlayers[dimIndex].end()) {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
app.DebugPrintf(
|
app.DebugPrintf(
|
||||||
|
|
@ -1502,7 +1502,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
||||||
|
|
||||||
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
INetworkPlayer* thisPlayer = player->connection->getNetworkPlayer();
|
||||||
if (thisPlayer != nullptr && playerRemoved) {
|
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<ServerPlayer> newPlayer = *itP;
|
std::shared_ptr<ServerPlayer> newPlayer = *itP;
|
||||||
|
|
||||||
INetworkPlayer* otherPlayer =
|
INetworkPlayer* otherPlayer =
|
||||||
|
|
@ -1528,7 +1528,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
||||||
// 4J Stu - Something went wrong, or possibly the QNet player left
|
// 4J Stu - Something went wrong, or possibly the QNet player left
|
||||||
// before we got here. Re-check all active players and make sure they
|
// before we got here. Re-check all active players and make sure they
|
||||||
// have someone on their system to receive all packets
|
// 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<ServerPlayer> newPlayer = *itP;
|
std::shared_ptr<ServerPlayer> newPlayer = *itP;
|
||||||
INetworkPlayer* checkingPlayer =
|
INetworkPlayer* checkingPlayer =
|
||||||
newPlayer->connection->getNetworkPlayer();
|
newPlayer->connection->getNetworkPlayer();
|
||||||
|
|
@ -1540,7 +1540,7 @@ void PlayerList::removePlayerFromReceiving(std::shared_ptr<ServerPlayer> player,
|
||||||
else if (newPlayer->dimension == 1)
|
else if (newPlayer->dimension == 1)
|
||||||
newPlayerDim = 2;
|
newPlayerDim = 2;
|
||||||
bool foundPrimary = false;
|
bool foundPrimary = false;
|
||||||
for (AUTO_VAR(it, receiveAllPlayers[newPlayerDim].begin());
|
for (auto it = receiveAllPlayers[newPlayerDim].begin();
|
||||||
it != receiveAllPlayers[newPlayerDim].end(); ++it) {
|
it != receiveAllPlayers[newPlayerDim].end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> primaryPlayer = *it;
|
std::shared_ptr<ServerPlayer> primaryPlayer = *it;
|
||||||
INetworkPlayer* primPlayer =
|
INetworkPlayer* primPlayer =
|
||||||
|
|
@ -1589,7 +1589,7 @@ void PlayerList::addPlayerToReceiving(std::shared_ptr<ServerPlayer> player) {
|
||||||
#endif
|
#endif
|
||||||
shouldAddPlayer = false;
|
shouldAddPlayer = false;
|
||||||
} else {
|
} else {
|
||||||
for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin());
|
for (auto it = receiveAllPlayers[playerDim].begin();
|
||||||
it != receiveAllPlayers[playerDim].end(); ++it) {
|
it != receiveAllPlayers[playerDim].end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> oldPlayer = *it;
|
std::shared_ptr<ServerPlayer> oldPlayer = *it;
|
||||||
INetworkPlayer* checkingPlayer =
|
INetworkPlayer* checkingPlayer =
|
||||||
|
|
@ -1617,7 +1617,7 @@ bool PlayerList::canReceiveAllPackets(std::shared_ptr<ServerPlayer> player) {
|
||||||
playerDim = 1;
|
playerDim = 1;
|
||||||
else if (player->dimension == 1)
|
else if (player->dimension == 1)
|
||||||
playerDim = 2;
|
playerDim = 2;
|
||||||
for (AUTO_VAR(it, receiveAllPlayers[playerDim].begin());
|
for (auto it = receiveAllPlayers[playerDim].begin();
|
||||||
it != receiveAllPlayers[playerDim].end(); ++it) {
|
it != receiveAllPlayers[playerDim].end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> newPlayer = *it;
|
std::shared_ptr<ServerPlayer> newPlayer = *it;
|
||||||
if (newPlayer == player) {
|
if (newPlayer == player) {
|
||||||
|
|
@ -1644,7 +1644,7 @@ bool PlayerList::isXuidBanned(PlayerUID xuid) {
|
||||||
|
|
||||||
bool banned = false;
|
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)) {
|
if (ProfileManager.AreXUIDSEqual(xuid, *it)) {
|
||||||
banned = true;
|
banned = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ ServerChunkCache::~ServerChunkCache() {
|
||||||
delete m_unloadedCache;
|
delete m_unloadedCache;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AUTO_VAR(itEnd, m_loadedChunkList.end());
|
auto itEnd = m_loadedChunkList.end();
|
||||||
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) delete *it;
|
for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) delete *it;
|
||||||
DeleteCriticalSection(&m_csLoadCreate);
|
DeleteCriticalSection(&m_csLoadCreate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -654,7 +654,7 @@ bool ServerChunkCache::saveAllEntities() {
|
||||||
|
|
||||||
PIXBeginNamedEvent(0, "saving to NBT");
|
PIXBeginNamedEvent(0, "saving to NBT");
|
||||||
EnterCriticalSection(&m_csLoadCreate);
|
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) {
|
++it) {
|
||||||
storage->saveEntities(level, *it);
|
storage->saveEntities(level, *it);
|
||||||
}
|
}
|
||||||
|
|
@ -676,8 +676,8 @@ bool ServerChunkCache::save(bool force, ProgressListener* progressListener) {
|
||||||
// 4J - added this to support progressListner
|
// 4J - added this to support progressListner
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (progressListener != nullptr) {
|
if (progressListener != nullptr) {
|
||||||
AUTO_VAR(itEnd, m_loadedChunkList.end());
|
auto itEnd = m_loadedChunkList.end();
|
||||||
for (AUTO_VAR(it, m_loadedChunkList.begin()); it != itEnd; it++) {
|
for (auto it = m_loadedChunkList.begin(); it != itEnd; it++) {
|
||||||
LevelChunk* chunk = *it;
|
LevelChunk* chunk = *it;
|
||||||
if (chunk->shouldSave(force)) {
|
if (chunk->shouldSave(force)) {
|
||||||
count++;
|
count++;
|
||||||
|
|
@ -813,8 +813,8 @@ bool ServerChunkCache::tick() {
|
||||||
|
|
||||||
// loadedChunks.remove(cp);
|
// loadedChunks.remove(cp);
|
||||||
// loadedChunkList.remove(chunk);
|
// loadedChunkList.remove(chunk);
|
||||||
AUTO_VAR(it, find(m_loadedChunkList.begin(),
|
auto it = find(m_loadedChunkList.begin(),
|
||||||
m_loadedChunkList.end(), chunk));
|
m_loadedChunkList.end(), chunk);
|
||||||
if (it != m_loadedChunkList.end())
|
if (it != m_loadedChunkList.end())
|
||||||
m_loadedChunkList.erase(it);
|
m_loadedChunkList.erase(it);
|
||||||
|
|
||||||
|
|
@ -855,7 +855,7 @@ TilePos* ServerChunkCache::findNearestMapFeature(
|
||||||
void ServerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chunkZ) {
|
void ServerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chunkZ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ServerChunkCache::runSaveThreadProc(LPVOID lpParam) {
|
int ServerChunkCache::runSaveThreadProc(void* lpParam) {
|
||||||
SaveThreadData* params = (SaveThreadData*)lpParam;
|
SaveThreadData* params = (SaveThreadData*)lpParam;
|
||||||
|
|
||||||
if (params->useSharedThreadStorage) {
|
if (params->useSharedThreadStorage) {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ void ServerCommandDispatcher::logAdminCommand(
|
||||||
int customData, const std::wstring& additionalMessage) {
|
int customData, const std::wstring& additionalMessage) {
|
||||||
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
|
PlayerList* playerList = MinecraftServer::getInstance()->getPlayers();
|
||||||
// for (Player player : MinecraftServer.getInstance().getPlayers().players)
|
// 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) {
|
it != playerList->players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> player = *it;
|
std::shared_ptr<ServerPlayer> player = *it;
|
||||||
if (player != source && playerList->isOp(player)) {
|
if (player != source && playerList->isOp(player)) {
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,8 @@ void ServerConnection::tick() {
|
||||||
|
|
||||||
bool ServerConnection::addPendingTextureRequest(
|
bool ServerConnection::addPendingTextureRequest(
|
||||||
const std::wstring& textureName) {
|
const std::wstring& textureName) {
|
||||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
auto it = find(m_pendingTextureRequests.begin(),
|
||||||
m_pendingTextureRequests.end(), textureName));
|
m_pendingTextureRequests.end(), textureName);
|
||||||
if (it == m_pendingTextureRequests.end()) {
|
if (it == m_pendingTextureRequests.end()) {
|
||||||
m_pendingTextureRequests.push_back(textureName);
|
m_pendingTextureRequests.push_back(textureName);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -119,8 +119,8 @@ bool ServerConnection::addPendingTextureRequest(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
|
void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
|
||||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
auto it = find(m_pendingTextureRequests.begin(),
|
||||||
m_pendingTextureRequests.end(), textureName));
|
m_pendingTextureRequests.end(), textureName);
|
||||||
if (it != m_pendingTextureRequests.end()) {
|
if (it != m_pendingTextureRequests.end()) {
|
||||||
m_pendingTextureRequests.erase(it);
|
m_pendingTextureRequests.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -134,8 +134,8 @@ void ServerConnection::handleTextureReceived(const std::wstring& textureName) {
|
||||||
|
|
||||||
void ServerConnection::handleTextureAndGeometryReceived(
|
void ServerConnection::handleTextureAndGeometryReceived(
|
||||||
const std::wstring& textureName) {
|
const std::wstring& textureName) {
|
||||||
AUTO_VAR(it, find(m_pendingTextureRequests.begin(),
|
auto it = find(m_pendingTextureRequests.begin(),
|
||||||
m_pendingTextureRequests.end(), textureName));
|
m_pendingTextureRequests.end(), textureName);
|
||||||
if (it != m_pendingTextureRequests.end()) {
|
if (it != m_pendingTextureRequests.end()) {
|
||||||
m_pendingTextureRequests.erase(it);
|
m_pendingTextureRequests.erase(it);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ typedef struct _TMSPPRequest {
|
||||||
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal;
|
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal;
|
||||||
// char szFilename[MAX_TMSFILENAME_SIZE];
|
// char szFilename[MAX_TMSFILENAME_SIZE];
|
||||||
int (*CallbackFunc)(void*, int, int, C4JStorage::PTMSPP_FILEDATA,
|
int (*CallbackFunc)(void*, int, int, C4JStorage::PTMSPP_FILEDATA,
|
||||||
LPCSTR szFilename);
|
const char* szFilename);
|
||||||
WCHAR wchFilename[MAX_TMSFILENAME_SIZE];
|
WCHAR wchFilename[MAX_TMSFILENAME_SIZE];
|
||||||
|
|
||||||
void* lpCallbackParam;
|
void* lpCallbackParam;
|
||||||
|
|
|
||||||
|
|
@ -1909,7 +1909,7 @@ void ConsoleSoundEngine::tick() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AUTO_VAR(it, scheduledSounds.begin()); it != scheduledSounds.end();) {
|
for (auto it = scheduledSounds.begin(); it != scheduledSounds.end();) {
|
||||||
SoundEngine::ScheduledSound* next = *it;
|
SoundEngine::ScheduledSound* next = *it;
|
||||||
next->delay--;
|
next->delay--;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -355,14 +355,14 @@ void ColourTable::loadColoursFromData(std::uint8_t* pbData,
|
||||||
std::wstring colourId = dis.readUTF();
|
std::wstring colourId = dis.readUTF();
|
||||||
int colourValue = dis.readInt();
|
int colourValue = dis.readInt();
|
||||||
setColour(colourId, colourValue);
|
setColour(colourId, colourValue);
|
||||||
AUTO_VAR(it, s_colourNamesMap.find(colourId));
|
auto it = s_colourNamesMap.find(colourId);
|
||||||
}
|
}
|
||||||
|
|
||||||
bais.reset();
|
bais.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColourTable::setColour(const std::wstring& colourName, int value) {
|
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()) {
|
if (it != s_colourNamesMap.end()) {
|
||||||
m_colourValues[(int)it->second] = value;
|
m_colourValues[(int)it->second] = value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1127,7 +1127,7 @@ void CMinecraftApp::ActionGameSettings(int iPad, eGameSetting eVal) {
|
||||||
|
|
||||||
PlayerList* players =
|
PlayerList* players =
|
||||||
MinecraftServer::getInstance()->getPlayerList();
|
MinecraftServer::getInstance()->getPlayerList();
|
||||||
for (AUTO_VAR(it3, players->players.begin());
|
for (auto it3 = players->players.begin();
|
||||||
it3 != players->players.end(); ++it3) {
|
it3 != players->players.end(); ++it3) {
|
||||||
std::shared_ptr<ServerPlayer> decorationPlayer = *it3;
|
std::shared_ptr<ServerPlayer> decorationPlayer = *it3;
|
||||||
decorationPlayer->setShowOnMaps(
|
decorationPlayer->setShowOnMaps(
|
||||||
|
|
@ -4564,7 +4564,7 @@ bool CMinecraftApp::isXuidNotch(PlayerUID xuid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMinecraftApp::isXuidDeadmau5(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
|
// insert elements if they don't exist
|
||||||
if (it != MojangData.end()) {
|
if (it != MojangData.end()) {
|
||||||
MOJANG_DATA* pMojangData = MojangData[xuid];
|
MOJANG_DATA* pMojangData = MojangData[xuid];
|
||||||
|
|
@ -4582,7 +4582,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring& wName,
|
||||||
EnterCriticalSection(&csMemFilesLock);
|
EnterCriticalSection(&csMemFilesLock);
|
||||||
// check it's not already in
|
// check it's not already in
|
||||||
PMEMDATA pData = nullptr;
|
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 (it != m_MEM_Files.end()) {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
wprintf(L"Incrementing the memory texture file count for %ls\n",
|
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) {
|
void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring& wName) {
|
||||||
EnterCriticalSection(&csMemFilesLock);
|
EnterCriticalSection(&csMemFilesLock);
|
||||||
|
|
||||||
AUTO_VAR(it, m_MEM_Files.find(wName));
|
auto it = m_MEM_Files.find(wName);
|
||||||
if (it != m_MEM_Files.end()) {
|
if (it != m_MEM_Files.end()) {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
wprintf(L"Decrementing the memory texture file count for %ls\n",
|
wprintf(L"Decrementing the memory texture file count for %ls\n",
|
||||||
|
|
@ -4650,7 +4650,7 @@ bool CMinecraftApp::DefaultCapeExists() {
|
||||||
bool val = false;
|
bool val = false;
|
||||||
|
|
||||||
EnterCriticalSection(&csMemFilesLock);
|
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;
|
if (it != m_MEM_Files.end()) val = true;
|
||||||
LeaveCriticalSection(&csMemFilesLock);
|
LeaveCriticalSection(&csMemFilesLock);
|
||||||
|
|
||||||
|
|
@ -4661,7 +4661,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring& wName) {
|
||||||
bool val = false;
|
bool val = false;
|
||||||
|
|
||||||
EnterCriticalSection(&csMemFilesLock);
|
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;
|
if (it != m_MEM_Files.end()) val = true;
|
||||||
LeaveCriticalSection(&csMemFilesLock);
|
LeaveCriticalSection(&csMemFilesLock);
|
||||||
|
|
||||||
|
|
@ -4672,7 +4672,7 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring& wName,
|
||||||
std::uint8_t** ppbData,
|
std::uint8_t** ppbData,
|
||||||
unsigned int* pByteCount) {
|
unsigned int* pByteCount) {
|
||||||
EnterCriticalSection(&csMemFilesLock);
|
EnterCriticalSection(&csMemFilesLock);
|
||||||
AUTO_VAR(it, m_MEM_Files.find(wName));
|
auto it = m_MEM_Files.find(wName);
|
||||||
if (it != m_MEM_Files.end()) {
|
if (it != m_MEM_Files.end()) {
|
||||||
PMEMDATA pData = (*it).second;
|
PMEMDATA pData = (*it).second;
|
||||||
*ppbData = pData->pbData;
|
*ppbData = pData->pbData;
|
||||||
|
|
@ -4686,7 +4686,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t* pbData,
|
||||||
EnterCriticalSection(&csMemTPDLock);
|
EnterCriticalSection(&csMemTPDLock);
|
||||||
// check it's not already in
|
// check it's not already in
|
||||||
PMEMDATA pData = nullptr;
|
PMEMDATA pData = nullptr;
|
||||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
auto it = m_MEM_TPD.find(iConfig);
|
||||||
if (it == m_MEM_TPD.end()) {
|
if (it == m_MEM_TPD.end()) {
|
||||||
pData = new MEMDATA();
|
pData = new MEMDATA();
|
||||||
pData->pbData = pbData;
|
pData->pbData = pbData;
|
||||||
|
|
@ -4703,7 +4703,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) {
|
||||||
EnterCriticalSection(&csMemTPDLock);
|
EnterCriticalSection(&csMemTPDLock);
|
||||||
// check it's not already in
|
// check it's not already in
|
||||||
PMEMDATA pData = nullptr;
|
PMEMDATA pData = nullptr;
|
||||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
auto it = m_MEM_TPD.find(iConfig);
|
||||||
if (it != m_MEM_TPD.end()) {
|
if (it != m_MEM_TPD.end()) {
|
||||||
pData = m_MEM_TPD[iConfig];
|
pData = m_MEM_TPD[iConfig];
|
||||||
delete pData;
|
delete pData;
|
||||||
|
|
@ -4720,7 +4720,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) {
|
||||||
bool val = false;
|
bool val = false;
|
||||||
|
|
||||||
EnterCriticalSection(&csMemTPDLock);
|
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;
|
if (it != m_MEM_TPD.end()) val = true;
|
||||||
LeaveCriticalSection(&csMemTPDLock);
|
LeaveCriticalSection(&csMemTPDLock);
|
||||||
|
|
||||||
|
|
@ -4730,7 +4730,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) {
|
||||||
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData,
|
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData,
|
||||||
unsigned int* pByteCount) {
|
unsigned int* pByteCount) {
|
||||||
EnterCriticalSection(&csMemTPDLock);
|
EnterCriticalSection(&csMemTPDLock);
|
||||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
auto it = m_MEM_TPD.find(iConfig);
|
||||||
if (it != m_MEM_TPD.end()) {
|
if (it != m_MEM_TPD.end()) {
|
||||||
PMEMDATA pData = (*it).second;
|
PMEMDATA pData = (*it).second;
|
||||||
*ppbData = pData->pbData;
|
*ppbData = pData->pbData;
|
||||||
|
|
@ -5549,8 +5549,8 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
|
||||||
}
|
}
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
|
HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
|
||||||
int iGender, __uint64 ullOfferID_Full,
|
int iGender, uint64_t ullOfferID_Full,
|
||||||
__uint64 ullOfferID_Trial,
|
uint64_t ullOfferID_Trial,
|
||||||
WCHAR* pFirstSkin,
|
WCHAR* pFirstSkin,
|
||||||
unsigned int uiSortIndex, int iConfig,
|
unsigned int uiSortIndex, int iConfig,
|
||||||
WCHAR* pDataFile) {
|
WCHAR* pDataFile) {
|
||||||
|
|
@ -5610,7 +5610,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char* pchDLCName,
|
||||||
|
|
||||||
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
|
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
|
||||||
ULONGLONG* pullVal) {
|
ULONGLONG* pullVal) {
|
||||||
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
|
auto it = DLCInfo_SkinName.find(FirstSkin);
|
||||||
if (it == DLCInfo_SkinName.end()) {
|
if (it == DLCInfo_SkinName.end()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -5620,7 +5620,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
|
||||||
}
|
}
|
||||||
bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
|
bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
|
||||||
ULONGLONG* pullVal) {
|
ULONGLONG* pullVal) {
|
||||||
AUTO_VAR(it, DLCTextures_PackID.find(iPackID));
|
auto it = DLCTextures_PackID.find(iPackID);
|
||||||
if (it == DLCTextures_PackID.end()) {
|
if (it == DLCTextures_PackID.end()) {
|
||||||
*pullVal = (ULONGLONG)0;
|
*pullVal = (ULONGLONG)0;
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -5632,7 +5632,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
|
||||||
DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) {
|
DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) {
|
||||||
// DLC_INFO *pDLCInfo=nullptr;
|
// DLC_INFO *pDLCInfo=nullptr;
|
||||||
if (DLCInfo_Trial.size() > 0) {
|
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()) {
|
if (it == DLCInfo_Trial.end()) {
|
||||||
// nothing for this
|
// nothing for this
|
||||||
|
|
@ -5678,7 +5678,7 @@ ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) {
|
||||||
|
|
||||||
DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) {
|
DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) {
|
||||||
if (DLCInfo_Full.size() > 0) {
|
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()) {
|
if (it == DLCInfo_Full.end()) {
|
||||||
// nothing for this
|
// nothing for this
|
||||||
|
|
@ -5857,7 +5857,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid,
|
||||||
static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount);
|
static_cast<unsigned int>(sizeof(BANNEDLISTDATA) * bannedListCount);
|
||||||
PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount];
|
PBANNEDLISTDATA pBannedList = new BANNEDLISTDATA[bannedListCount];
|
||||||
int iCount = 0;
|
int iCount = 0;
|
||||||
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin());
|
for (auto it = m_vBannedListA[iPad]->begin();
|
||||||
it != m_vBannedListA[iPad]->end(); ++it) {
|
it != m_vBannedListA[iPad]->end(); ++it) {
|
||||||
PBANNEDLISTDATA pData = *it;
|
PBANNEDLISTDATA pData = *it;
|
||||||
memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA));
|
memcpy(&pBannedList[iCount++], pData, sizeof(BANNEDLISTDATA));
|
||||||
|
|
@ -5876,7 +5876,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid,
|
||||||
|
|
||||||
bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid,
|
bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid,
|
||||||
char* pszLevelName) {
|
char* pszLevelName) {
|
||||||
for (AUTO_VAR(it, m_vBannedListA[iPad]->begin());
|
for (auto it = m_vBannedListA[iPad]->begin();
|
||||||
it != m_vBannedListA[iPad]->end(); ++it) {
|
it != m_vBannedListA[iPad]->end(); ++it) {
|
||||||
PBANNEDLISTDATA pData = *it;
|
PBANNEDLISTDATA pData = *it;
|
||||||
if (IsEqualXUID(pData->xuid, xuid) &&
|
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
|
// we will have retrieved the banned level list from TMS, so remove this one
|
||||||
// from it and write it back to TMS
|
// 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();) {
|
it != m_vBannedListA[iPad]->end();) {
|
||||||
PBANNEDLISTDATA pBannedListData = *it;
|
PBANNEDLISTDATA pBannedListData = *it;
|
||||||
|
|
||||||
|
|
@ -6507,7 +6507,7 @@ unsigned int CMinecraftApp::CreateImageTextData(std::uint8_t* textMetadata,
|
||||||
void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
|
void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
|
||||||
int x, int z) {
|
int x, int z) {
|
||||||
// check we don't already have this in
|
// 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) {
|
it < m_vTerrainFeatures.end(); ++it) {
|
||||||
FEATURE_DATA* pFeatureData = *it;
|
FEATURE_DATA* pFeatureData = *it;
|
||||||
|
|
||||||
|
|
@ -6525,7 +6525,7 @@ void CMinecraftApp::AddTerrainFeaturePosition(_eTerrainFeatureType eFeatureType,
|
||||||
}
|
}
|
||||||
|
|
||||||
_eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) {
|
_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) {
|
it < m_vTerrainFeatures.end(); ++it) {
|
||||||
FEATURE_DATA* pFeatureData = *it;
|
FEATURE_DATA* pFeatureData = *it;
|
||||||
|
|
||||||
|
|
@ -6538,7 +6538,7 @@ _eTerrainFeatureType CMinecraftApp::IsTerrainFeature(int x, int z) {
|
||||||
|
|
||||||
bool CMinecraftApp::GetTerrainFeaturePosition(_eTerrainFeatureType eType,
|
bool CMinecraftApp::GetTerrainFeaturePosition(_eTerrainFeatureType eType,
|
||||||
int* pX, int* pZ) {
|
int* pX, int* pZ) {
|
||||||
for (AUTO_VAR(it, m_vTerrainFeatures.begin());
|
for (auto it = m_vTerrainFeatures.begin();
|
||||||
it < m_vTerrainFeatures.end(); ++it) {
|
it < m_vTerrainFeatures.end(); ++it) {
|
||||||
FEATURE_DATA* pFeatureData = *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
|
// If it's already in there, promote it to the top of the list
|
||||||
int iPosition = 0;
|
int iPosition = 0;
|
||||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
for (auto it = m_DLCDownloadQueue.begin();
|
||||||
it != m_DLCDownloadQueue.end(); ++it) {
|
it != m_DLCDownloadQueue.end(); ++it) {
|
||||||
DLCRequest* pCurrent = *it;
|
DLCRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -6717,7 +6717,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
||||||
bool bPromoted=false;
|
bool bPromoted=false;
|
||||||
|
|
||||||
|
|
||||||
for(AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); it !=
|
for(auto it = m_TMSPPDownloadQueue.begin(); it !=
|
||||||
m_TMSPPDownloadQueue.end(); ++it)
|
m_TMSPPDownloadQueue.end(); ++it)
|
||||||
{
|
{
|
||||||
TMSPPRequest *pCurrent = *it;
|
TMSPPRequest *pCurrent = *it;
|
||||||
|
|
@ -6776,7 +6776,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
||||||
// of a previous trial/full offer
|
// of a previous trial/full offer
|
||||||
|
|
||||||
bool bAlreadyInQueue = false;
|
bool bAlreadyInQueue = false;
|
||||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||||
TMSPPRequest* pCurrent = *it;
|
TMSPPRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -6843,7 +6843,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
||||||
// a previous trial/full offer
|
// a previous trial/full offer
|
||||||
|
|
||||||
bool bAlreadyInQueue = false;
|
bool bAlreadyInQueue = false;
|
||||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||||
TMSPPRequest* pCurrent = *it;
|
TMSPPRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -6895,7 +6895,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
|
||||||
|
|
||||||
bool CMinecraftApp::CheckTMSDLCCanStop() {
|
bool CMinecraftApp::CheckTMSDLCCanStop() {
|
||||||
EnterCriticalSection(&csTMSPPDownloadQueue);
|
EnterCriticalSection(&csTMSPPDownloadQueue);
|
||||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||||
TMSPPRequest* pCurrent = *it;
|
TMSPPRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -6921,7 +6921,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterCriticalSection(&csDLCDownloadQueue);
|
EnterCriticalSection(&csDLCDownloadQueue);
|
||||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
for (auto it = m_DLCDownloadQueue.begin();
|
||||||
it != m_DLCDownloadQueue.end(); ++it) {
|
it != m_DLCDownloadQueue.end(); ++it) {
|
||||||
DLCRequest* pCurrent = *it;
|
DLCRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -6932,7 +6932,7 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now look for the next retrieval
|
// Now look for the next retrieval
|
||||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
for (auto it = m_DLCDownloadQueue.begin();
|
||||||
it != m_DLCDownloadQueue.end(); ++it) {
|
it != m_DLCDownloadQueue.end(); ++it) {
|
||||||
DLCRequest* pCurrent = *it;
|
DLCRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -6964,13 +6964,13 @@ bool CMinecraftApp::RetrieveNextDLCContent() {
|
||||||
|
|
||||||
int CMinecraftApp::TMSPPFileReturned(void* pParam, int iPad, int iUserData,
|
int CMinecraftApp::TMSPPFileReturned(void* pParam, int iPad, int iUserData,
|
||||||
C4JStorage::PTMSPP_FILEDATA pFileData,
|
C4JStorage::PTMSPP_FILEDATA pFileData,
|
||||||
LPCSTR szFilename) {
|
const char* szFilename) {
|
||||||
|
|
||||||
CMinecraftApp* pClass = (CMinecraftApp*)pParam;
|
CMinecraftApp* pClass = (CMinecraftApp*)pParam;
|
||||||
|
|
||||||
// find the right one in the vector
|
// find the right one in the vector
|
||||||
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
|
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
|
||||||
for (AUTO_VAR(it, pClass->m_TMSPPDownloadQueue.begin());
|
for (auto it = pClass->m_TMSPPDownloadQueue.begin();
|
||||||
it != pClass->m_TMSPPDownloadQueue.end(); ++it) {
|
it != pClass->m_TMSPPDownloadQueue.end(); ++it) {
|
||||||
TMSPPRequest* pCurrent = *it;
|
TMSPPRequest* pCurrent = *it;
|
||||||
#if defined(_WINDOWS64)
|
#if defined(_WINDOWS64)
|
||||||
|
|
@ -7030,7 +7030,7 @@ void CMinecraftApp::ClearAndResetDLCDownloadQueue() {
|
||||||
|
|
||||||
int iPosition = 0;
|
int iPosition = 0;
|
||||||
EnterCriticalSection(&csTMSPPDownloadQueue);
|
EnterCriticalSection(&csTMSPPDownloadQueue);
|
||||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
for (auto it = m_DLCDownloadQueue.begin();
|
||||||
it != m_DLCDownloadQueue.end(); ++it) {
|
it != m_DLCDownloadQueue.end(); ++it) {
|
||||||
DLCRequest* pCurrent = *it;
|
DLCRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -7052,7 +7052,7 @@ void CMinecraftApp::TickTMSPPFilesRetrieved() {
|
||||||
void CMinecraftApp::ClearTMSPPFilesRetrieved() {
|
void CMinecraftApp::ClearTMSPPFilesRetrieved() {
|
||||||
int iPosition = 0;
|
int iPosition = 0;
|
||||||
EnterCriticalSection(&csTMSPPDownloadQueue);
|
EnterCriticalSection(&csTMSPPDownloadQueue);
|
||||||
for (AUTO_VAR(it, m_TMSPPDownloadQueue.begin());
|
for (auto it = m_TMSPPDownloadQueue.begin();
|
||||||
it != m_TMSPPDownloadQueue.end(); ++it) {
|
it != m_TMSPPDownloadQueue.end(); ++it) {
|
||||||
TMSPPRequest* pCurrent = *it;
|
TMSPPRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -7070,7 +7070,7 @@ int CMinecraftApp::DLCOffersReturned(void* pParam, int iOfferC,
|
||||||
|
|
||||||
// find the right one in the vector
|
// find the right one in the vector
|
||||||
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
|
EnterCriticalSection(&pClass->csTMSPPDownloadQueue);
|
||||||
for (AUTO_VAR(it, pClass->m_DLCDownloadQueue.begin());
|
for (auto it = pClass->m_DLCDownloadQueue.begin();
|
||||||
it != pClass->m_DLCDownloadQueue.end(); ++it) {
|
it != pClass->m_DLCDownloadQueue.end(); ++it) {
|
||||||
DLCRequest* pCurrent = *it;
|
DLCRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -7102,7 +7102,7 @@ bool CMinecraftApp::DLCContentRetrieved(eDLCMarketplaceType eType) {
|
||||||
// If there's already a retrieve in progress, quit
|
// If there's already a retrieve in progress, quit
|
||||||
// we may have re-ordered the list, so need to check every item
|
// we may have re-ordered the list, so need to check every item
|
||||||
EnterCriticalSection(&csDLCDownloadQueue);
|
EnterCriticalSection(&csDLCDownloadQueue);
|
||||||
for (AUTO_VAR(it, m_DLCDownloadQueue.begin());
|
for (auto it = m_DLCDownloadQueue.begin();
|
||||||
it != m_DLCDownloadQueue.end(); ++it) {
|
it != m_DLCDownloadQueue.end(); ++it) {
|
||||||
DLCRequest* pCurrent = *it;
|
DLCRequest* pCurrent = *it;
|
||||||
|
|
||||||
|
|
@ -7168,7 +7168,7 @@ std::vector<ModelPart*>* CMinecraftApp::SetAdditionalSkinBoxes(
|
||||||
dwSkinID & 0x0FFFFFFF);
|
dwSkinID & 0x0FFFFFFF);
|
||||||
|
|
||||||
// convert the skin boxes into model parts, and add to the humanoid model
|
// 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) {
|
if (pModel) {
|
||||||
ModelPart* pModelPart = pModel->AddOrRetrievePart(*it);
|
ModelPart* pModelPart = pModel->AddOrRetrievePart(*it);
|
||||||
pvModelPart->push_back(pModelPart);
|
pvModelPart->push_back(pModelPart);
|
||||||
|
|
@ -7192,7 +7192,7 @@ std::vector<ModelPart*>* CMinecraftApp::GetAdditionalModelParts(
|
||||||
EnterCriticalSection(&csAdditionalModelParts);
|
EnterCriticalSection(&csAdditionalModelParts);
|
||||||
std::vector<ModelPart*>* pvModelParts = nullptr;
|
std::vector<ModelPart*>* pvModelParts = nullptr;
|
||||||
if (m_AdditionalModelParts.size() > 0) {
|
if (m_AdditionalModelParts.size() > 0) {
|
||||||
AUTO_VAR(it, m_AdditionalModelParts.find(dwSkinID));
|
auto it = m_AdditionalModelParts.find(dwSkinID);
|
||||||
if (it != m_AdditionalModelParts.end()) {
|
if (it != m_AdditionalModelParts.end()) {
|
||||||
pvModelParts = (*it).second;
|
pvModelParts = (*it).second;
|
||||||
}
|
}
|
||||||
|
|
@ -7207,7 +7207,7 @@ std::vector<SKIN_BOX*>* CMinecraftApp::GetAdditionalSkinBoxes(
|
||||||
EnterCriticalSection(&csAdditionalSkinBoxes);
|
EnterCriticalSection(&csAdditionalSkinBoxes);
|
||||||
std::vector<SKIN_BOX*>* pvSkinBoxes = nullptr;
|
std::vector<SKIN_BOX*>* pvSkinBoxes = nullptr;
|
||||||
if (m_AdditionalSkinBoxes.size() > 0) {
|
if (m_AdditionalSkinBoxes.size() > 0) {
|
||||||
AUTO_VAR(it, m_AdditionalSkinBoxes.find(dwSkinID));
|
auto it = m_AdditionalSkinBoxes.find(dwSkinID);
|
||||||
if (it != m_AdditionalSkinBoxes.end()) {
|
if (it != m_AdditionalSkinBoxes.end()) {
|
||||||
pvSkinBoxes = (*it).second;
|
pvSkinBoxes = (*it).second;
|
||||||
}
|
}
|
||||||
|
|
@ -7222,7 +7222,7 @@ unsigned int CMinecraftApp::GetAnimOverrideBitmask(std::uint32_t dwSkinID) {
|
||||||
unsigned int uiAnimOverrideBitmask = 0L;
|
unsigned int uiAnimOverrideBitmask = 0L;
|
||||||
|
|
||||||
if (m_AnimOverrides.size() > 0) {
|
if (m_AnimOverrides.size() > 0) {
|
||||||
AUTO_VAR(it, m_AnimOverrides.find(dwSkinID));
|
auto it = m_AnimOverrides.find(dwSkinID);
|
||||||
if (it != m_AnimOverrides.end()) {
|
if (it != m_AnimOverrides.end()) {
|
||||||
uiAnimOverrideBitmask = (*it).second;
|
uiAnimOverrideBitmask = (*it).second;
|
||||||
}
|
}
|
||||||
|
|
@ -7238,7 +7238,7 @@ void CMinecraftApp::SetAnimOverrideBitmask(std::uint32_t dwSkinID,
|
||||||
EnterCriticalSection(&csAnimOverrideBitmask);
|
EnterCriticalSection(&csAnimOverrideBitmask);
|
||||||
|
|
||||||
if (m_AnimOverrides.size() > 0) {
|
if (m_AnimOverrides.size() > 0) {
|
||||||
AUTO_VAR(it, m_AnimOverrides.find(dwSkinID));
|
auto it = m_AnimOverrides.find(dwSkinID);
|
||||||
if (it != m_AnimOverrides.end()) {
|
if (it != m_AnimOverrides.end()) {
|
||||||
LeaveCriticalSection(&csAnimOverrideBitmask);
|
LeaveCriticalSection(&csAnimOverrideBitmask);
|
||||||
return; // already in here
|
return; // already in here
|
||||||
|
|
|
||||||
|
|
@ -810,7 +810,7 @@ public:
|
||||||
void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes,
|
void GetImageTextData(std::uint8_t* imageData, unsigned int imageBytes,
|
||||||
unsigned char* seedText, unsigned int& uiHostOptions,
|
unsigned char* seedText, unsigned int& uiHostOptions,
|
||||||
bool& bHostOptionsRead, std::uint32_t& uiTexturePack);
|
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,
|
bool hasSeed, unsigned int uiHostOptions,
|
||||||
unsigned int uiTexturePackId);
|
unsigned int uiTexturePackId);
|
||||||
|
|
||||||
|
|
@ -869,7 +869,7 @@ public:
|
||||||
|
|
||||||
static int TMSPPFileReturned(void* pParam, int iPad, int iUserData,
|
static int TMSPPFileReturned(void* pParam, int iPad, int iUserData,
|
||||||
C4JStorage::PTMSPP_FILEDATA pFileData,
|
C4JStorage::PTMSPP_FILEDATA pFileData,
|
||||||
LPCSTR szFilename);
|
const char* szFilename);
|
||||||
DLC_INFO* GetDLCInfoTrialOffer(int iIndex);
|
DLC_INFO* GetDLCInfoTrialOffer(int iIndex);
|
||||||
DLC_INFO* GetDLCInfoFullOffer(int iIndex);
|
DLC_INFO* GetDLCInfoFullOffer(int iIndex);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ bool DLCAudioFile::processDLCDataFile(std::uint8_t* pbData,
|
||||||
for (unsigned int j = 0; j < uiParameterCount; j++) {
|
for (unsigned int j = 0; j < uiParameterCount; j++) {
|
||||||
// EAudioParameterType paramType = e_AudioParamType_Invalid;
|
// EAudioParameterType paramType = e_AudioParamType_Invalid;
|
||||||
|
|
||||||
AUTO_VAR(it, parameterMapping.find(paramBuf.dwType));
|
auto it = parameterMapping.find(paramBuf.dwType);
|
||||||
|
|
||||||
if (it != parameterMapping.end()) {
|
if (it != parameterMapping.end()) {
|
||||||
addParameter(type, (EAudioParameterType)paramBuf.dwType,
|
addParameter(type, (EAudioParameterType)paramBuf.dwType,
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const __int64 endPosition = PortableFileIO::Tell(file);
|
const int64_t endPosition = PortableFileIO::Tell(file);
|
||||||
if (endPosition <= 0 ||
|
if (endPosition <= 0 ||
|
||||||
endPosition > std::numeric_limits<unsigned int>::max()) {
|
endPosition > std::numeric_limits<unsigned int>::max()) {
|
||||||
std::fclose(file);
|
std::fclose(file);
|
||||||
|
|
@ -151,7 +151,7 @@ DLCManager::DLCManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
DLCPack* pack = *it;
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
|
|
@ -174,7 +174,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(
|
||||||
unsigned int DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) {
|
unsigned int DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) {
|
||||||
unsigned int packCount = 0;
|
unsigned int packCount = 0;
|
||||||
if (type != e_DLCType_All) {
|
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;
|
DLCPack* pack = *it;
|
||||||
if (pack->getDLCItemsCount(type) > 0) {
|
if (pack->getDLCItemsCount(type) > 0) {
|
||||||
++packCount;
|
++packCount;
|
||||||
|
|
@ -190,14 +190,14 @@ void DLCManager::addPack(DLCPack* pack) { m_packs.push_back(pack); }
|
||||||
|
|
||||||
void DLCManager::removePack(DLCPack* pack) {
|
void DLCManager::removePack(DLCPack* pack) {
|
||||||
if (pack != nullptr) {
|
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);
|
if (it != m_packs.end()) m_packs.erase(it);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCManager::removeAllPacks(void) {
|
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;
|
DLCPack* pack = (DLCPack*)*it;
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +206,7 @@ void DLCManager::removeAllPacks(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCManager::LanguageChanged(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;
|
DLCPack* pack = (DLCPack*)*it;
|
||||||
// update the language
|
// update the language
|
||||||
pack->UpdateLanguage();
|
pack->UpdateLanguage();
|
||||||
|
|
@ -217,7 +217,7 @@ DLCPack* DLCManager::getPack(const std::wstring& name) {
|
||||||
DLCPack* pack = nullptr;
|
DLCPack* pack = nullptr;
|
||||||
// DWORD currentIndex = 0;
|
// DWORD currentIndex = 0;
|
||||||
DLCPack* currentPack = nullptr;
|
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;
|
currentPack = *it;
|
||||||
std::wstring wsName = currentPack->getName();
|
std::wstring wsName = currentPack->getName();
|
||||||
|
|
||||||
|
|
@ -236,7 +236,7 @@ DLCPack* DLCManager::getPack(unsigned int index,
|
||||||
if (type != e_DLCType_All) {
|
if (type != e_DLCType_All) {
|
||||||
unsigned int currentIndex = 0;
|
unsigned int currentIndex = 0;
|
||||||
DLCPack* currentPack = nullptr;
|
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;
|
currentPack = *it;
|
||||||
if (currentPack->getDLCItemsCount(type) > 0) {
|
if (currentPack->getDLCItemsCount(type) > 0) {
|
||||||
if (currentIndex == index) {
|
if (currentIndex == index) {
|
||||||
|
|
@ -271,7 +271,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
|
||||||
}
|
}
|
||||||
if (type != e_DLCType_All) {
|
if (type != e_DLCType_All) {
|
||||||
unsigned int index = 0;
|
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;
|
DLCPack* thisPack = *it;
|
||||||
if (thisPack->getDLCItemsCount(type) > 0) {
|
if (thisPack->getDLCItemsCount(type) > 0) {
|
||||||
if (thisPack == pack) {
|
if (thisPack == pack) {
|
||||||
|
|
@ -284,7 +284,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unsigned int index = 0;
|
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;
|
DLCPack* thisPack = *it;
|
||||||
if (thisPack == pack) {
|
if (thisPack == pack) {
|
||||||
found = true;
|
found = true;
|
||||||
|
|
@ -302,7 +302,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
|
||||||
unsigned int foundIndex = 0;
|
unsigned int foundIndex = 0;
|
||||||
found = false;
|
found = false;
|
||||||
unsigned int index = 0;
|
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;
|
DLCPack* pack = *it;
|
||||||
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
|
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
|
||||||
if (pack->doesPackContainSkin(path)) {
|
if (pack->doesPackContainSkin(path)) {
|
||||||
|
|
@ -318,7 +318,7 @@ unsigned int DLCManager::getPackIndexContainingSkin(const std::wstring& path,
|
||||||
|
|
||||||
DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
|
DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
|
||||||
DLCPack* foundPack = nullptr;
|
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;
|
DLCPack* pack = *it;
|
||||||
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
|
if (pack->getDLCItemsCount(e_DLCType_Skin) > 0) {
|
||||||
if (pack->doesPackContainSkin(path)) {
|
if (pack->doesPackContainSkin(path)) {
|
||||||
|
|
@ -332,7 +332,7 @@ DLCPack* DLCManager::getPackContainingSkin(const std::wstring& path) {
|
||||||
|
|
||||||
DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) {
|
DLCSkinFile* DLCManager::getSkinFile(const std::wstring& path) {
|
||||||
DLCSkinFile* foundSkinfile = nullptr;
|
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;
|
DLCPack* pack = *it;
|
||||||
foundSkinfile = pack->getSkinFile(path);
|
foundSkinfile = pack->getSkinFile(path);
|
||||||
if (foundSkinfile != nullptr) {
|
if (foundSkinfile != nullptr) {
|
||||||
|
|
@ -348,7 +348,7 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
|
||||||
DLCPack* pack = nullptr;
|
DLCPack* pack = nullptr;
|
||||||
DLCPack* firstCorruptPack = 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;
|
pack = *it;
|
||||||
if (pack->IsCorrupt()) {
|
if (pack->IsCorrupt()) {
|
||||||
++corruptDLCCount;
|
++corruptDLCCount;
|
||||||
|
|
@ -529,7 +529,7 @@ bool DLCManager::processDLCDataFile(unsigned int& dwFilesProcessed,
|
||||||
// DLCManager::EDLCParameterType paramType =
|
// DLCManager::EDLCParameterType paramType =
|
||||||
// DLCManager::e_DLCParamType_Invalid;
|
// DLCManager::e_DLCParamType_Invalid;
|
||||||
|
|
||||||
AUTO_VAR(it, parameterMapping.find(parBuf.dwType));
|
auto it = parameterMapping.find(parBuf.dwType);
|
||||||
|
|
||||||
if (it != parameterMapping.end()) {
|
if (it != parameterMapping.end()) {
|
||||||
if (type == e_DLCType_PackConfig) {
|
if (type == e_DLCType_PackConfig) {
|
||||||
|
|
@ -686,7 +686,7 @@ std::uint32_t DLCManager::retrievePackID(std::uint8_t* pbData,
|
||||||
pbTemp += sizeof(int);
|
pbTemp += sizeof(int);
|
||||||
ReadDlcStruct(¶mBuf, pbTemp);
|
ReadDlcStruct(¶mBuf, pbTemp);
|
||||||
for (unsigned int j = 0; j < uiParameterCount; j++) {
|
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 (it != parameterMapping.end()) {
|
||||||
if (type == e_DLCType_PackConfig) {
|
if (type == e_DLCType_PackConfig) {
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@ DLCPack::DLCPack(const std::wstring& name, std::uint32_t dwLicenseMask) {
|
||||||
|
|
||||||
|
|
||||||
DLCPack::~DLCPack() {
|
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;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < DLCManager::e_DLCType_Max; ++i) {
|
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;
|
delete *it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -122,7 +122,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type,
|
||||||
|
|
||||||
bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type,
|
bool DLCPack::getParameterAsUInt(DLCManager::EDLCParameterType type,
|
||||||
unsigned int& param) {
|
unsigned int& param) {
|
||||||
AUTO_VAR(it, m_parameters.find((int)type));
|
auto it = m_parameters.find((int)type);
|
||||||
if (it != m_parameters.end()) {
|
if (it != m_parameters.end()) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DLCManager::e_DLCParamType_NetherParticleColour:
|
case DLCManager::e_DLCParamType_NetherParticleColour:
|
||||||
|
|
@ -213,8 +213,8 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_pathCmpString = &path;
|
g_pathCmpString = &path;
|
||||||
AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(),
|
auto it = std::find_if(m_files[type].begin(), m_files[type].end(),
|
||||||
pathCmp));
|
pathCmp);
|
||||||
hasFile = it != m_files[type].end();
|
hasFile = it != m_files[type].end();
|
||||||
if (!hasFile && m_parentPack) {
|
if (!hasFile && m_parentPack) {
|
||||||
hasFile = m_parentPack->doesPackContainFile(type, path);
|
hasFile = m_parentPack->doesPackContainFile(type, path);
|
||||||
|
|
@ -252,8 +252,7 @@ DLCFile* DLCPack::getFile(DLCManager::EDLCType type, const std::wstring& path) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_pathCmpString = &path;
|
g_pathCmpString = &path;
|
||||||
AUTO_VAR(it, std::find_if(m_files[type].begin(), m_files[type].end(),
|
auto it = std::find_if(m_files[type].begin(), m_files[type].end(), pathCmp);
|
||||||
pathCmp));
|
|
||||||
|
|
||||||
if (it == m_files[type].end()) {
|
if (it == m_files[type].end()) {
|
||||||
// Not found
|
// Not found
|
||||||
|
|
@ -298,7 +297,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type,
|
||||||
unsigned int foundIndex = 0;
|
unsigned int foundIndex = 0;
|
||||||
found = false;
|
found = false;
|
||||||
unsigned int index = 0;
|
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) {
|
if (path.compare((*it)->getPath()) == 0) {
|
||||||
foundIndex = index;
|
foundIndex = index;
|
||||||
found = true;
|
found = true;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ void AddItemRuleDefinition::writeAttributes(DataOutputStream* dos,
|
||||||
void AddItemRuleDefinition::getChildren(
|
void AddItemRuleDefinition::getChildren(
|
||||||
std::vector<GameRuleDefinition*>* children) {
|
std::vector<GameRuleDefinition*>* children) {
|
||||||
GameRuleDefinition::getChildren(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);
|
children->push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ bool AddItemRuleDefinition::addItemToContainer(
|
||||||
new ItemInstance(m_itemId, quantity, m_auxValue));
|
new ItemInstance(m_itemId, quantity, m_auxValue));
|
||||||
newItem->set4JData(m_dataTag);
|
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) {
|
||||||
(*it)->enchantItem(newItem);
|
(*it)->enchantItem(newItem);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ private:
|
||||||
ConsoleSchematicFile::ESchematicRotation m_rotation;
|
ConsoleSchematicFile::ESchematicRotation m_rotation;
|
||||||
int m_dimension;
|
int m_dimension;
|
||||||
|
|
||||||
__int64 m_totalBlocksChanged;
|
int64_t m_totalBlocksChanged;
|
||||||
__int64 m_totalBlocksChangedLighting;
|
int64_t m_totalBlocksChangedLighting;
|
||||||
bool m_completed;
|
bool m_completed;
|
||||||
|
|
||||||
void updateLocationBox();
|
void updateLocationBox();
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ bool CompleteAllRuleDefinition::onCollectItem(
|
||||||
void CompleteAllRuleDefinition::updateStatus(GameRule* rule) {
|
void CompleteAllRuleDefinition::updateStatus(GameRule* rule) {
|
||||||
int goal = 0;
|
int goal = 0;
|
||||||
int progress = 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) {
|
it != rule->m_parameters.end(); ++it) {
|
||||||
if (it->second.isPointer) {
|
if (it->second.isPointer) {
|
||||||
goal += it->second.gr->getGameRuleDefinition()->getGoal();
|
goal += it->second.gr->getGameRuleDefinition()->getGoal();
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ CompoundGameRuleDefinition::CompoundGameRuleDefinition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
delete (*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,7 @@ CompoundGameRuleDefinition::~CompoundGameRuleDefinition() {
|
||||||
void CompoundGameRuleDefinition::getChildren(
|
void CompoundGameRuleDefinition::getChildren(
|
||||||
std::vector<GameRuleDefinition*>* children) {
|
std::vector<GameRuleDefinition*>* children) {
|
||||||
GameRuleDefinition::getChildren(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);
|
children->push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ void CompoundGameRuleDefinition::populateGameRule(
|
||||||
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) {
|
GameRulesInstance::EGameRulesInstanceType type, GameRule* rule) {
|
||||||
GameRule* newRule = nullptr;
|
GameRule* newRule = nullptr;
|
||||||
int i = 0;
|
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());
|
newRule = new GameRule(*it, rule->getConnection());
|
||||||
(*it)->populateGameRule(type, newRule);
|
(*it)->populateGameRule(type, newRule);
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ void CompoundGameRuleDefinition::populateGameRule(
|
||||||
bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
|
bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
|
||||||
int y, int z) {
|
int y, int z) {
|
||||||
bool statusChanged = false;
|
bool statusChanged = false;
|
||||||
for (AUTO_VAR(it, rule->m_parameters.begin());
|
for (auto it = rule->m_parameters.begin();
|
||||||
it != rule->m_parameters.end(); ++it) {
|
it != rule->m_parameters.end(); ++it) {
|
||||||
if (it->second.isPointer) {
|
if (it->second.isPointer) {
|
||||||
bool changed = it->second.gr->getGameRuleDefinition()->onUseTile(
|
bool changed = it->second.gr->getGameRuleDefinition()->onUseTile(
|
||||||
|
|
@ -84,7 +84,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule* rule, int tileId, int x,
|
||||||
bool CompoundGameRuleDefinition::onCollectItem(
|
bool CompoundGameRuleDefinition::onCollectItem(
|
||||||
GameRule* rule, std::shared_ptr<ItemInstance> item) {
|
GameRule* rule, std::shared_ptr<ItemInstance> item) {
|
||||||
bool statusChanged = false;
|
bool statusChanged = false;
|
||||||
for (AUTO_VAR(it, rule->m_parameters.begin());
|
for (auto it = rule->m_parameters.begin();
|
||||||
it != rule->m_parameters.end(); ++it) {
|
it != rule->m_parameters.end(); ++it) {
|
||||||
if (it->second.isPointer) {
|
if (it->second.isPointer) {
|
||||||
bool changed =
|
bool changed =
|
||||||
|
|
@ -102,7 +102,7 @@ bool CompoundGameRuleDefinition::onCollectItem(
|
||||||
|
|
||||||
void CompoundGameRuleDefinition::postProcessPlayer(
|
void CompoundGameRuleDefinition::postProcessPlayer(
|
||||||
std::shared_ptr<Player> player) {
|
std::shared_ptr<Player> 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);
|
(*it)->postProcessPlayer(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -18,7 +18,7 @@ void ConsoleGenerateStructure::getChildren(
|
||||||
std::vector<GameRuleDefinition*>* children) {
|
std::vector<GameRuleDefinition*>* children) {
|
||||||
GameRuleDefinition::getChildren(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);
|
children->push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@ BoundingBox* ConsoleGenerateStructure::getBoundingBox() {
|
||||||
// Find the max bounds
|
// Find the max bounds
|
||||||
int maxX, maxY, maxZ;
|
int maxX, maxY, maxZ;
|
||||||
maxX = maxY = maxZ = 1;
|
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;
|
ConsoleGenerateStructureAction* action = *it;
|
||||||
maxX = std::max(maxX, action->getEndX());
|
maxX = std::max(maxX, action->getEndX());
|
||||||
maxY = std::max(maxY, action->getEndY());
|
maxY = std::max(maxY, action->getEndY());
|
||||||
|
|
@ -121,7 +121,7 @@ bool ConsoleGenerateStructure::postProcess(Level* level, Random* random,
|
||||||
BoundingBox* chunkBB) {
|
BoundingBox* chunkBB) {
|
||||||
if (level->dimension->id != m_dimension) return false;
|
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;
|
ConsoleGenerateStructureAction* action = *it;
|
||||||
|
|
||||||
switch (action->getActionType()) {
|
switch (action->getActionType()) {
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
|
||||||
ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>();
|
ListTag<CompoundTag>* tileEntityTags = new ListTag<CompoundTag>();
|
||||||
tag->put(L"TileEntities", tileEntityTags);
|
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++) {
|
it++) {
|
||||||
CompoundTag* cTag = new CompoundTag();
|
CompoundTag* cTag = new CompoundTag();
|
||||||
(*it)->save(cTag);
|
(*it)->save(cTag);
|
||||||
|
|
@ -179,14 +179,14 @@ void ConsoleSchematicFile::save_tags(DataOutputStream* dos) {
|
||||||
ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>();
|
ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>();
|
||||||
tag->put(L"Entities", entityTags);
|
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());
|
entityTags->add((CompoundTag*)(*it).second->copy());
|
||||||
|
|
||||||
NbtIo::write(tag, dos);
|
NbtIo::write(tag, dos);
|
||||||
delete tag;
|
delete tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk,
|
int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk* chunk,
|
||||||
AABB* chunkBox,
|
AABB* chunkBox,
|
||||||
AABB* destinationBox,
|
AABB* destinationBox,
|
||||||
ESchematicRotation rot) {
|
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
|
// 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
|
// 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.
|
// 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,
|
AABB* destinationBox,
|
||||||
ESchematicRotation rot) {
|
ESchematicRotation rot) {
|
||||||
int xStart = std::max(destinationBox->x0, (double)chunk->x * 16);
|
int xStart = std::max(destinationBox->x0, (double)chunk->x * 16);
|
||||||
|
|
@ -452,7 +452,7 @@ void ConsoleSchematicFile::schematicCoordToChunkCoord(
|
||||||
void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
||||||
AABB* destinationBox,
|
AABB* destinationBox,
|
||||||
ESchematicRotation rot) {
|
ESchematicRotation rot) {
|
||||||
for (AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();
|
for (auto it = m_tileEntities.begin(); it != m_tileEntities.end();
|
||||||
++it) {
|
++it) {
|
||||||
std::shared_ptr<TileEntity> te = *it;
|
std::shared_ptr<TileEntity> te = *it;
|
||||||
|
|
||||||
|
|
@ -499,7 +499,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
||||||
teCopy->setChanged();
|
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;
|
Vec3 source = it->first;
|
||||||
|
|
||||||
double targetX = source.x;
|
double targetX = source.x;
|
||||||
|
|
@ -714,7 +714,7 @@ void ConsoleSchematicFile::generateSchematicFile(
|
||||||
getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart,
|
getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart,
|
||||||
zStart, xStart + xSize, yStart + ySize,
|
zStart, xStart + xSize, yStart + ySize,
|
||||||
zStart + zSize);
|
zStart + zSize);
|
||||||
for (AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end();
|
for (auto it = tileEntities->begin(); it != tileEntities->end();
|
||||||
++it) {
|
++it) {
|
||||||
std::shared_ptr<TileEntity> te = *it;
|
std::shared_ptr<TileEntity> te = *it;
|
||||||
CompoundTag* teTag = new CompoundTag();
|
CompoundTag* teTag = new CompoundTag();
|
||||||
|
|
@ -738,7 +738,7 @@ void ConsoleSchematicFile::generateSchematicFile(
|
||||||
level->getEntities(nullptr, &bb);
|
level->getEntities(nullptr, &bb);
|
||||||
ListTag<CompoundTag>* entitiesTag = new ListTag<CompoundTag>(L"entities");
|
ListTag<CompoundTag>* entitiesTag = new ListTag<CompoundTag>(L"entities");
|
||||||
|
|
||||||
for (AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) {
|
for (auto it = entities->begin(); it != entities->end(); ++it) {
|
||||||
std::shared_ptr<Entity> e = *it;
|
std::shared_ptr<Entity> e = *it;
|
||||||
|
|
||||||
bool mobCanBeSaved = false;
|
bool mobCanBeSaved = false;
|
||||||
|
|
@ -1070,7 +1070,7 @@ ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk* chunk, int x0, int y0,
|
||||||
int z0, int x1, int y1, int z1) {
|
int z0, int x1, int y1, int z1) {
|
||||||
std::vector<std::shared_ptr<TileEntity> >* result =
|
std::vector<std::shared_ptr<TileEntity> >* result =
|
||||||
new std::vector<std::shared_ptr<TileEntity> >;
|
new std::vector<std::shared_ptr<TileEntity> >;
|
||||||
for (AUTO_VAR(it, chunk->tileEntities.begin());
|
for (auto it = chunk->tileEntities.begin();
|
||||||
it != chunk->tileEntities.end(); ++it) {
|
it != chunk->tileEntities.end(); ++it) {
|
||||||
std::shared_ptr<TileEntity> te = it->second;
|
std::shared_ptr<TileEntity> te = it->second;
|
||||||
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 &&
|
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 &&
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,9 @@ public:
|
||||||
void save(DataOutputStream* dos);
|
void save(DataOutputStream* dos);
|
||||||
void load(DataInputStream* dis);
|
void load(DataInputStream* dis);
|
||||||
|
|
||||||
__int64 applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox,
|
int64_t applyBlocksAndData(LevelChunk* chunk, AABB* chunkBox,
|
||||||
AABB* destinationBox, ESchematicRotation rot);
|
AABB* destinationBox, ESchematicRotation rot);
|
||||||
__int64 applyLighting(LevelChunk* chunk, AABB* chunkBox,
|
int64_t applyLighting(LevelChunk* chunk, AABB* chunkBox,
|
||||||
AABB* destinationBox, ESchematicRotation rot);
|
AABB* destinationBox, ESchematicRotation rot);
|
||||||
void applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
void applyTileEntities(LevelChunk* chunk, AABB* chunkBox,
|
||||||
AABB* destinationBox, ESchematicRotation rot);
|
AABB* destinationBox, ESchematicRotation rot);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ GameRule::GameRule(GameRuleDefinition* definition, Connection* connection) {
|
||||||
}
|
}
|
||||||
|
|
||||||
GameRule::~GameRule() {
|
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) {
|
if (it->second.isPointer) {
|
||||||
delete it->second.gr;
|
delete it->second.gr;
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ void GameRule::onCollectItem(std::shared_ptr<ItemInstance> item) {
|
||||||
void GameRule::write(DataOutputStream* dos) {
|
void GameRule::write(DataOutputStream* dos) {
|
||||||
// Find required parameters.
|
// Find required parameters.
|
||||||
dos->writeInt(m_parameters.size());
|
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;
|
std::wstring pName = (*it).first;
|
||||||
ValueType vType = (*it).second;
|
ValueType vType = (*it).second;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class GameRule {
|
||||||
public:
|
public:
|
||||||
typedef struct _ValueType {
|
typedef struct _ValueType {
|
||||||
union {
|
union {
|
||||||
__int64 i64;
|
int64_t i64;
|
||||||
int i;
|
int i;
|
||||||
char c;
|
char c;
|
||||||
bool b;
|
bool b;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ void GameRuleDefinition::write(DataOutputStream* dos) {
|
||||||
|
|
||||||
// Write children.
|
// Write children.
|
||||||
dos->writeInt(children->size());
|
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);
|
(*it)->write(dos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ GameRuleDefinition::enumerateMap() {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
std::vector<GameRuleDefinition*>* gRules = enumerate();
|
std::vector<GameRuleDefinition*>* 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<GameRuleDefinition*, int>(*it, i++));
|
out->insert(std::pair<GameRuleDefinition*, int>(*it, i++));
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream* dos) {
|
||||||
std::unordered_map<std::wstring, ConsoleSchematicFile*>* files;
|
std::unordered_map<std::wstring, ConsoleSchematicFile*>* files;
|
||||||
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
|
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
|
||||||
dos->writeInt(files->size());
|
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;
|
std::wstring filename = it->first;
|
||||||
ConsoleSchematicFile* file = it->second;
|
ConsoleSchematicFile* file = it->second;
|
||||||
|
|
||||||
|
|
@ -392,7 +392,7 @@ bool GameRuleManager::readRuleFile(
|
||||||
// Read File.
|
// Read File.
|
||||||
|
|
||||||
// version_number
|
// version_number
|
||||||
__int64 version = dis.readShort();
|
int64_t version = dis.readShort();
|
||||||
unsigned char compressionType = 0;
|
unsigned char compressionType = 0;
|
||||||
if (version == 0) {
|
if (version == 0) {
|
||||||
for (int i = 0; i < 14; i++) dis.readByte(); // Read padding.
|
for (int i = 0; i < 14; i++) dis.readByte(); // Read padding.
|
||||||
|
|
@ -528,7 +528,7 @@ bool GameRuleManager::readRuleFile(
|
||||||
int tagId = contentDis->readInt();
|
int tagId = contentDis->readInt();
|
||||||
ConsoleGameRules::EGameRuleType tagVal =
|
ConsoleGameRules::EGameRuleType tagVal =
|
||||||
ConsoleGameRules::eGameRuleType_Invalid;
|
ConsoleGameRules::eGameRuleType_Invalid;
|
||||||
AUTO_VAR(it, tagIdMap.find(tagId));
|
auto it = tagIdMap.find(tagId);
|
||||||
if (it != tagIdMap.end()) tagVal = it->second;
|
if (it != tagIdMap.end()) tagVal = it->second;
|
||||||
|
|
||||||
GameRuleDefinition* rule = nullptr;
|
GameRuleDefinition* rule = nullptr;
|
||||||
|
|
@ -601,7 +601,7 @@ void GameRuleManager::readChildren(
|
||||||
int tagId = dis->readInt();
|
int tagId = dis->readInt();
|
||||||
ConsoleGameRules::EGameRuleType tagVal =
|
ConsoleGameRules::EGameRuleType tagVal =
|
||||||
ConsoleGameRules::eGameRuleType_Invalid;
|
ConsoleGameRules::eGameRuleType_Invalid;
|
||||||
AUTO_VAR(it, tagIdMap->find(tagId));
|
auto it = tagIdMap->find(tagId);
|
||||||
if (it != tagIdMap->end()) tagVal = it->second;
|
if (it != tagIdMap->end()) tagVal = it->second;
|
||||||
|
|
||||||
GameRuleDefinition* childRule = nullptr;
|
GameRuleDefinition* childRule = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -74,21 +74,21 @@ LevelGenerationOptions::LevelGenerationOptions(DLCPack* parentPack) {
|
||||||
LevelGenerationOptions::~LevelGenerationOptions() {
|
LevelGenerationOptions::~LevelGenerationOptions() {
|
||||||
clearSchematics();
|
clearSchematics();
|
||||||
if (m_spawnPos != nullptr) delete m_spawnPos;
|
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) {
|
++it) {
|
||||||
delete *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) {
|
++it) {
|
||||||
delete *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) {
|
++it) {
|
||||||
delete *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;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,20 +124,20 @@ void LevelGenerationOptions::getChildren(
|
||||||
GameRuleDefinition::getChildren(children);
|
GameRuleDefinition::getChildren(children);
|
||||||
|
|
||||||
std::vector<ApplySchematicRuleDefinition*> used_schematics;
|
std::vector<ApplySchematicRuleDefinition*> used_schematics;
|
||||||
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end();
|
for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
|
||||||
it++)
|
it++)
|
||||||
if (!(*it)->isComplete()) used_schematics.push_back(*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++)
|
it++)
|
||||||
children->push_back(*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++)
|
it++)
|
||||||
children->push_back(*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)
|
++it)
|
||||||
children->push_back(*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);
|
children->push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ GameRuleDefinition* LevelGenerationOptions::addChild(
|
||||||
void LevelGenerationOptions::addAttribute(const std::wstring& attributeName,
|
void LevelGenerationOptions::addAttribute(const std::wstring& attributeName,
|
||||||
const std::wstring& attributeValue) {
|
const std::wstring& attributeValue) {
|
||||||
if (attributeName.compare(L"seed") == 0) {
|
if (attributeName.compare(L"seed") == 0) {
|
||||||
m_seed = _fromString<__int64>(attributeValue);
|
m_seed = _fromString<int64_t>(attributeValue);
|
||||||
app.DebugPrintf(
|
app.DebugPrintf(
|
||||||
"LevelGenerationOptions: Adding parameter m_seed=%I64d\n", m_seed);
|
"LevelGenerationOptions: Adding parameter m_seed=%I64d\n", m_seed);
|
||||||
} else if (attributeName.compare(L"spawnX") == 0) {
|
} else if (attributeName.compare(L"spawnX") == 0) {
|
||||||
|
|
@ -255,7 +255,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) {
|
||||||
chunk->z);
|
chunk->z);
|
||||||
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16,
|
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16,
|
||||||
Level::maxBuildHeight, chunk->z * 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) {
|
++it) {
|
||||||
ApplySchematicRuleDefinition* rule = *it;
|
ApplySchematicRuleDefinition* rule = *it;
|
||||||
rule->processSchematic(&chunkBox, chunk);
|
rule->processSchematic(&chunkBox, chunk);
|
||||||
|
|
@ -264,7 +264,7 @@ void LevelGenerationOptions::processSchematics(LevelChunk* chunk) {
|
||||||
int cx = (chunk->x << 4);
|
int cx = (chunk->x << 4);
|
||||||
int cz = (chunk->z << 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++) {
|
it++) {
|
||||||
ConsoleGenerateStructure* structureStart = *it;
|
ConsoleGenerateStructure* structureStart = *it;
|
||||||
|
|
||||||
|
|
@ -283,7 +283,7 @@ void LevelGenerationOptions::processSchematicsLighting(LevelChunk* chunk) {
|
||||||
chunk->x, chunk->z);
|
chunk->x, chunk->z);
|
||||||
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16,
|
AABB chunkBox(chunk->x * 16, 0, chunk->z * 16, chunk->x * 16 + 16,
|
||||||
Level::maxBuildHeight, chunk->z * 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) {
|
++it) {
|
||||||
ApplySchematicRuleDefinition* rule = *it;
|
ApplySchematicRuleDefinition* rule = *it;
|
||||||
rule->processSchematicLighting(&chunkBox, chunk);
|
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 and b) tutorial world additions generally being above
|
||||||
// ground/sea level
|
// ground/sea level
|
||||||
if (!m_bHaveMinY) {
|
if (!m_bHaveMinY) {
|
||||||
for (AUTO_VAR(it, m_schematicRules.begin());
|
for (auto it = m_schematicRules.begin();
|
||||||
it != m_schematicRules.end(); ++it) {
|
it != m_schematicRules.end(); ++it) {
|
||||||
ApplySchematicRuleDefinition* rule = *it;
|
ApplySchematicRuleDefinition* rule = *it;
|
||||||
int minY = rule->getMinY();
|
int minY = rule->getMinY();
|
||||||
if (minY < m_minY) m_minY = minY;
|
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++) {
|
it != m_structureRules.end(); it++) {
|
||||||
ConsoleGenerateStructure* structureStart = *it;
|
ConsoleGenerateStructure* structureStart = *it;
|
||||||
int minY = structureStart->getMinY();
|
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;
|
if (y1 < m_minY) return false;
|
||||||
|
|
||||||
bool intersects = 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) {
|
++it) {
|
||||||
ApplySchematicRuleDefinition* rule = *it;
|
ApplySchematicRuleDefinition* rule = *it;
|
||||||
intersects = rule->checkIntersects(x0, y0, z0, x1, y1, z1);
|
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) {
|
if (!intersects) {
|
||||||
for (AUTO_VAR(it, m_structureRules.begin());
|
for (auto it = m_structureRules.begin();
|
||||||
it != m_structureRules.end(); it++) {
|
it != m_structureRules.end(); it++) {
|
||||||
ConsoleGenerateStructure* structureStart = *it;
|
ConsoleGenerateStructure* structureStart = *it;
|
||||||
intersects =
|
intersects =
|
||||||
|
|
@ -343,7 +343,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1,
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelGenerationOptions::clearSchematics() {
|
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;
|
delete it->second;
|
||||||
}
|
}
|
||||||
m_schematics.clear();
|
m_schematics.clear();
|
||||||
|
|
@ -353,7 +353,7 @@ ConsoleSchematicFile* LevelGenerationOptions::loadSchematicFile(
|
||||||
const std::wstring& filename, std::uint8_t* pbData,
|
const std::wstring& filename, std::uint8_t* pbData,
|
||||||
unsigned int dataLength) {
|
unsigned int dataLength) {
|
||||||
// If we have already loaded this, just return
|
// 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 (it != m_schematics.end()) {
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
wprintf(L"We have already loaded schematic file %ls\n",
|
wprintf(L"We have already loaded schematic file %ls\n",
|
||||||
|
|
@ -378,7 +378,7 @@ ConsoleSchematicFile* LevelGenerationOptions::getSchematicFile(
|
||||||
const std::wstring& filename) {
|
const std::wstring& filename) {
|
||||||
ConsoleSchematicFile* schematic = nullptr;
|
ConsoleSchematicFile* schematic = nullptr;
|
||||||
// If we have already loaded this, just return
|
// 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 (it != m_schematics.end()) {
|
||||||
schematic = it->second;
|
schematic = it->second;
|
||||||
}
|
}
|
||||||
|
|
@ -389,7 +389,7 @@ void LevelGenerationOptions::releaseSchematicFile(
|
||||||
const std::wstring& filename) {
|
const std::wstring& filename) {
|
||||||
// 4J Stu - We don't want to delete them when done, but probably want to
|
// 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
|
// 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())
|
// if(it != m_schematics.end())
|
||||||
//{
|
//{
|
||||||
// ConsoleSchematicFile *schematic = it->second;
|
// 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,
|
void LevelGenerationOptions::getBiomeOverride(int biomeId, std::uint8_t& tile,
|
||||||
std::uint8_t& topTile) {
|
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) {
|
++it) {
|
||||||
BiomeOverride* bo = *it;
|
BiomeOverride* bo = *it;
|
||||||
if (bo->isBiome(biomeId)) {
|
if (bo->isBiome(biomeId)) {
|
||||||
|
|
@ -431,7 +431,7 @@ bool LevelGenerationOptions::isFeatureChunk(
|
||||||
int* orientation) {
|
int* orientation) {
|
||||||
bool isFeature = false;
|
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;
|
StartFeature* sf = *it;
|
||||||
if (sf->isFeatureChunk(chunkX, chunkZ, feature, orientation)) {
|
if (sf->isFeatureChunk(chunkX, chunkZ, feature, orientation)) {
|
||||||
isFeature = true;
|
isFeature = true;
|
||||||
|
|
@ -446,14 +446,14 @@ LevelGenerationOptions::getUnfinishedSchematicFiles() {
|
||||||
// Clean schematic rules.
|
// Clean schematic rules.
|
||||||
std::unordered_set<std::wstring> usedFiles =
|
std::unordered_set<std::wstring> usedFiles =
|
||||||
std::unordered_set<std::wstring>();
|
std::unordered_set<std::wstring>();
|
||||||
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end();
|
for (auto it = m_schematicRules.begin(); it != m_schematicRules.end();
|
||||||
it++)
|
it++)
|
||||||
if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName());
|
if (!(*it)->isComplete()) usedFiles.insert((*it)->getSchematicName());
|
||||||
|
|
||||||
// Clean schematic files.
|
// Clean schematic files.
|
||||||
std::unordered_map<std::wstring, ConsoleSchematicFile*>* out =
|
std::unordered_map<std::wstring, ConsoleSchematicFile*>* out =
|
||||||
new std::unordered_map<std::wstring, ConsoleSchematicFile*>();
|
new std::unordered_map<std::wstring, ConsoleSchematicFile*>();
|
||||||
for (AUTO_VAR(it, usedFiles.begin()); it != usedFiles.end(); it++)
|
for (auto it = usedFiles.begin(); it != usedFiles.end(); it++)
|
||||||
out->insert(std::pair<std::wstring, ConsoleSchematicFile*>(
|
out->insert(std::pair<std::wstring, ConsoleSchematicFile*>(
|
||||||
*it, getSchematicFile(*it)));
|
*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) {
|
DWORD dwLicenceMask) {
|
||||||
LevelGenerationOptions* lgo = (LevelGenerationOptions*)pParam;
|
LevelGenerationOptions* lgo = (LevelGenerationOptions*)pParam;
|
||||||
lgo->m_bLoadingData = false;
|
lgo->m_bLoadingData = false;
|
||||||
|
|
@ -545,7 +545,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr,
|
||||||
DWORD dwFileSize = grf.length();
|
DWORD dwFileSize = grf.length();
|
||||||
DWORD bytesRead;
|
DWORD bytesRead;
|
||||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
||||||
BOOL bSuccess = ReadFile(fileHandle, pbData, dwFileSize,
|
bool bSuccess = ReadFile(fileHandle, pbData, dwFileSize,
|
||||||
&bytesRead, nullptr);
|
&bytesRead, nullptr);
|
||||||
if (bSuccess == FALSE) {
|
if (bSuccess == FALSE) {
|
||||||
app.FatalLoadError();
|
app.FatalLoadError();
|
||||||
|
|
@ -602,7 +602,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr,
|
||||||
if (fileHandle != INVALID_HANDLE_VALUE) {
|
if (fileHandle != INVALID_HANDLE_VALUE) {
|
||||||
DWORD bytesRead, dwFileSize = GetFileSize(fileHandle, nullptr);
|
DWORD bytesRead, dwFileSize = GetFileSize(fileHandle, nullptr);
|
||||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
||||||
BOOL bSuccess = ReadFile(fileHandle, pbData, dwFileSize,
|
bool bSuccess = ReadFile(fileHandle, pbData, dwFileSize,
|
||||||
&bytesRead, nullptr);
|
&bytesRead, nullptr);
|
||||||
if (bSuccess == FALSE) {
|
if (bSuccess == FALSE) {
|
||||||
app.FatalLoadError();
|
app.FatalLoadError();
|
||||||
|
|
@ -624,7 +624,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam, int iPad, DWORD dwErr,
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelGenerationOptions::reset_start() {
|
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++) {
|
||||||
(*it)->reset();
|
(*it)->reset();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ public:
|
||||||
getUnfinishedSchematicFiles();
|
getUnfinishedSchematicFiles();
|
||||||
|
|
||||||
void loadBaseSaveData();
|
void loadBaseSaveData();
|
||||||
static int packMounted(LPVOID pParam, int iPad, DWORD dwErr,
|
static int packMounted(void* pParam, int iPad, DWORD dwErr,
|
||||||
DWORD dwLicenceMask);
|
DWORD dwLicenceMask);
|
||||||
|
|
||||||
// 4J-JEV:
|
// 4J-JEV:
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@
|
||||||
LevelRuleset::LevelRuleset() { m_stringTable = nullptr; }
|
LevelRuleset::LevelRuleset() { m_stringTable = nullptr; }
|
||||||
|
|
||||||
LevelRuleset::~LevelRuleset() {
|
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;
|
delete *it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelRuleset::getChildren(std::vector<GameRuleDefinition*>* children) {
|
void LevelRuleset::getChildren(std::vector<GameRuleDefinition*>* children) {
|
||||||
CompoundGameRuleDefinition::getChildren(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);
|
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* LevelRuleset::getNamedArea(const std::wstring& areaName) {
|
||||||
AABB* area = nullptr;
|
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) {
|
if ((*it)->getName().compare(areaName) == 0) {
|
||||||
area = (*it)->getArea();
|
area = (*it)->getArea();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
delete *it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +54,7 @@ void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream* dos,
|
||||||
void UpdatePlayerRuleDefinition::getChildren(
|
void UpdatePlayerRuleDefinition::getChildren(
|
||||||
std::vector<GameRuleDefinition*>* children) {
|
std::vector<GameRuleDefinition*>* children) {
|
||||||
GameRuleDefinition::getChildren(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);
|
children->push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,7 +147,7 @@ void UpdatePlayerRuleDefinition::postProcessPlayer(
|
||||||
if (m_spawnPos != nullptr || m_bUpdateYRot)
|
if (m_spawnPos != nullptr || m_bUpdateYRot)
|
||||||
player->absMoveTo(x, y, z, yRot, xRot);
|
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;
|
AddItemRuleDefinition* addItem = *it;
|
||||||
|
|
||||||
addItem->addItemToContainer(player->inventory, -1);
|
addItem->addItemToContainer(player->inventory, -1);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ XboxStructureActionPlaceContainer::XboxStructureActionPlaceContainer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
delete *it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() {
|
||||||
void XboxStructureActionPlaceContainer::getChildren(
|
void XboxStructureActionPlaceContainer::getChildren(
|
||||||
std::vector<GameRuleDefinition*>* children) {
|
std::vector<GameRuleDefinition*>* children) {
|
||||||
XboxStructureActionPlaceBlock::getChildren(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);
|
children->push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(
|
||||||
Tile::UPDATE_CLIENTS);
|
Tile::UPDATE_CLIENTS);
|
||||||
// Add items
|
// Add items
|
||||||
int slotId = 0;
|
int slotId = 0;
|
||||||
for (AUTO_VAR(it, m_items.begin());
|
for (auto it = m_items.begin();
|
||||||
it != m_items.end() &&
|
it != m_items.end() &&
|
||||||
(slotId < container->getContainerSize());
|
(slotId < container->getContainerSize());
|
||||||
++it, ++slotId) {
|
++it, ++slotId) {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ SonyLeaderboardManager::~SonyLeaderboardManager() {
|
||||||
DeleteCriticalSection(&m_csViewsLock);
|
DeleteCriticalSection(&m_csViewsLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SonyLeaderboardManager::scoreboardThreadEntry(LPVOID lpParam) {
|
int SonyLeaderboardManager::scoreboardThreadEntry(void* lpParam) {
|
||||||
ShutdownManager::HasStarted(ShutdownManager::eLeaderboardThread);
|
ShutdownManager::HasStarted(ShutdownManager::eLeaderboardThread);
|
||||||
SonyLeaderboardManager* self =
|
SonyLeaderboardManager* self =
|
||||||
reinterpret_cast<SonyLeaderboardManager*>(lpParam);
|
reinterpret_cast<SonyLeaderboardManager*>(lpParam);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ protected:
|
||||||
|
|
||||||
// SceNpId m_myNpId;
|
// SceNpId m_myNpId;
|
||||||
|
|
||||||
static int scoreboardThreadEntry(LPVOID lpParam);
|
static int scoreboardThreadEntry(void* lpParam);
|
||||||
void scoreboardThreadInternal();
|
void scoreboardThreadInternal();
|
||||||
|
|
||||||
virtual bool getScoreByIds();
|
virtual bool getScoreByIds();
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
||||||
DWORD bytesRead,
|
DWORD bytesRead,
|
||||||
dwFileSize = GetFileSize(fileHandle, nullptr);
|
dwFileSize = GetFileSize(fileHandle, nullptr);
|
||||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
||||||
BOOL bSuccess =
|
bool bSuccess =
|
||||||
ReadFile(fileHandle, pbData, dwFileSize,
|
ReadFile(fileHandle, pbData, dwFileSize,
|
||||||
&bytesRead, nullptr);
|
&bytesRead, nullptr);
|
||||||
if (bSuccess == FALSE) {
|
if (bSuccess == FALSE) {
|
||||||
|
|
@ -444,7 +444,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
||||||
do {
|
do {
|
||||||
// We need to keep ticking the connections for players that
|
// We need to keep ticking the connections for players that
|
||||||
// already logged in
|
// already logged in
|
||||||
for (AUTO_VAR(it, createdConnections.begin());
|
for (auto it = createdConnections.begin();
|
||||||
it < createdConnections.end(); ++it) {
|
it < createdConnections.end(); ++it) {
|
||||||
(*it)->tick();
|
(*it)->tick();
|
||||||
}
|
}
|
||||||
|
|
@ -482,8 +482,8 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
||||||
idx, CONTEXT_PRESENCE_MULTIPLAYER, false);
|
idx, CONTEXT_PRESENCE_MULTIPLAYER, false);
|
||||||
} else {
|
} else {
|
||||||
connection->close();
|
connection->close();
|
||||||
AUTO_VAR(it, find(createdConnections.begin(),
|
auto it = find(createdConnections.begin(),
|
||||||
createdConnections.end(), connection));
|
createdConnections.end(), connection);
|
||||||
if (it != createdConnections.end())
|
if (it != createdConnections.end())
|
||||||
createdConnections.erase(it);
|
createdConnections.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -497,7 +497,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_NetworkManager.IsLeavingGame() || !IsInSession()) {
|
if (g_NetworkManager.IsLeavingGame() || !IsInSession()) {
|
||||||
for (AUTO_VAR(it, createdConnections.begin());
|
for (auto it = createdConnections.begin();
|
||||||
it < createdConnections.end(); ++it) {
|
it < createdConnections.end(); ++it) {
|
||||||
(*it)->close();
|
(*it)->close();
|
||||||
}
|
}
|
||||||
|
|
@ -940,7 +940,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
|
||||||
// them being removed from the server when removed from the session
|
// them being removed from the server when removed from the session
|
||||||
if (pServer != nullptr) {
|
if (pServer != nullptr) {
|
||||||
PlayerList* players = pServer->getPlayers();
|
PlayerList* players = pServer->getPlayers();
|
||||||
for (AUTO_VAR(it, players->players.begin());
|
for (auto it = players->players.begin();
|
||||||
it < players->players.end(); ++it) {
|
it < players->players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||||
if (servPlayer->connection->isLocal() &&
|
if (servPlayer->connection->isLocal() &&
|
||||||
|
|
@ -1005,7 +1005,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc(void* lpParam) {
|
||||||
pMinecraft->localplayers[index]->getXuid();
|
pMinecraft->localplayers[index]->getXuid();
|
||||||
|
|
||||||
PlayerList* players = pServer->getPlayers();
|
PlayerList* players = pServer->getPlayers();
|
||||||
for (AUTO_VAR(it, players->players.begin());
|
for (auto it = players->players.begin();
|
||||||
it < players->players.end(); ++it) {
|
it < players->players.end(); ++it) {
|
||||||
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||||
if (servPlayer->getXuid() == localPlayerXuid) {
|
if (servPlayer->getXuid() == localPlayerXuid) {
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,9 @@ public:
|
||||||
|
|
||||||
// Used for debugging output
|
// Used for debugging output
|
||||||
static const int messageQueue_length = 512;
|
static const int messageQueue_length = 512;
|
||||||
static __int64 messageQueue[messageQueue_length];
|
static int64_t messageQueue[messageQueue_length];
|
||||||
static const int byteQueue_length = 512;
|
static const int byteQueue_length = 512;
|
||||||
static __int64 byteQueue[byteQueue_length];
|
static int64_t byteQueue[byteQueue_length];
|
||||||
static int messageQueuePos;
|
static int messageQueuePos;
|
||||||
|
|
||||||
// Methods called from PlatformNetworkManager
|
// Methods called from PlatformNetworkManager
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer* pQNetPlayer) {
|
||||||
if (m_pIQNet->IsHost() && !m_bHostChanged) {
|
if (m_pIQNet->IsHost() && !m_bHostChanged) {
|
||||||
// Do we already have a primary player for this system?
|
// Do we already have a primary player for this system?
|
||||||
bool systemHasPrimaryPlayer = false;
|
bool systemHasPrimaryPlayer = false;
|
||||||
for (AUTO_VAR(it, m_machineQNetPrimaryPlayers.begin());
|
for (auto it = m_machineQNetPrimaryPlayers.begin();
|
||||||
it < m_machineQNetPrimaryPlayers.end(); ++it) {
|
it < m_machineQNetPrimaryPlayers.end(); ++it) {
|
||||||
IQNetPlayer* pQNetPrimaryPlayer = *it;
|
IQNetPlayer* pQNetPrimaryPlayer = *it;
|
||||||
if (pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer)) {
|
if (pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer)) {
|
||||||
|
|
@ -512,7 +512,7 @@ INetworkPlayer* CPlatformNetworkManagerStub::addNetworkPlayer(
|
||||||
void CPlatformNetworkManagerStub::removeNetworkPlayer(
|
void CPlatformNetworkManagerStub::removeNetworkPlayer(
|
||||||
IQNetPlayer* pQNetPlayer) {
|
IQNetPlayer* pQNetPlayer) {
|
||||||
INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
|
INetworkPlayer* pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
|
||||||
for (AUTO_VAR(it, currentNetworkPlayers.begin());
|
for (auto it = currentNetworkPlayers.begin();
|
||||||
it != currentNetworkPlayers.end(); it++) {
|
it != currentNetworkPlayers.end(); it++) {
|
||||||
if (*it == pNetworkPlayer) {
|
if (*it == pNetworkPlayer) {
|
||||||
currentNetworkPlayers.erase(it);
|
currentNetworkPlayers.erase(it);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ bool AreaTask::isCompleted() {
|
||||||
switch (m_completionState) {
|
switch (m_completionState) {
|
||||||
case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: {
|
case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: {
|
||||||
bool allSatisfied = true;
|
bool allSatisfied = true;
|
||||||
for (AUTO_VAR(it, constraints.begin()); it != constraints.end();
|
for (auto it = constraints.begin(); it != constraints.end();
|
||||||
++it) {
|
++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
if (!constraint->isConstraintSatisfied(tutorial->getPad())) {
|
if (!constraint->isConstraintSatisfied(tutorial->getPad())) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ bool InfoTask::isCompleted() {
|
||||||
// If a menu is displayed, then we use the handleUIInput to complete the
|
// If a menu is displayed, then we use the handleUIInput to complete the
|
||||||
// task
|
// task
|
||||||
bAllComplete = true;
|
bAllComplete = true;
|
||||||
for (AUTO_VAR(it, completedMappings.begin());
|
for (auto it = completedMappings.begin();
|
||||||
it != completedMappings.end(); ++it) {
|
it != completedMappings.end(); ++it) {
|
||||||
bool current = (*it).second;
|
bool current = (*it).second;
|
||||||
if (!current) {
|
if (!current) {
|
||||||
|
|
@ -56,7 +56,7 @@ bool InfoTask::isCompleted() {
|
||||||
} else {
|
} else {
|
||||||
int iCurrent = 0;
|
int iCurrent = 0;
|
||||||
|
|
||||||
for (AUTO_VAR(it, completedMappings.begin());
|
for (auto it = completedMappings.begin();
|
||||||
it != completedMappings.end(); ++it) {
|
it != completedMappings.end(); ++it) {
|
||||||
bool current = (*it).second;
|
bool current = (*it).second;
|
||||||
if (!current) {
|
if (!current) {
|
||||||
|
|
@ -94,7 +94,7 @@ void InfoTask::setAsCurrentTask(bool active /*= true*/) {
|
||||||
|
|
||||||
void InfoTask::handleUIInput(int iAction) {
|
void InfoTask::handleUIInput(int iAction) {
|
||||||
if (bHasBeenActivated) {
|
if (bHasBeenActivated) {
|
||||||
for (AUTO_VAR(it, completedMappings.begin());
|
for (auto it = completedMappings.begin();
|
||||||
it != completedMappings.end(); ++it) {
|
it != completedMappings.end(); ++it) {
|
||||||
if (iAction == (*it).first) {
|
if (iAction == (*it).first) {
|
||||||
(*it).second = true;
|
(*it).second = true;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include "ProcedureCompoundTask.h"
|
#include "ProcedureCompoundTask.h"
|
||||||
|
|
||||||
ProcedureCompoundTask::~ProcedureCompoundTask() {
|
ProcedureCompoundTask::~ProcedureCompoundTask() {
|
||||||
for (AUTO_VAR(it, m_taskSequence.begin()); it < m_taskSequence.end();
|
for (auto it = m_taskSequence.begin(); it < m_taskSequence.end();
|
||||||
++it) {
|
++it) {
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
|
@ -19,8 +19,8 @@ int ProcedureCompoundTask::getDescriptionId() {
|
||||||
|
|
||||||
// Return the id of the first task not completed
|
// Return the id of the first task not completed
|
||||||
int descriptionId = -1;
|
int descriptionId = -1;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (!task->isCompleted()) {
|
if (!task->isCompleted()) {
|
||||||
task->setAsCurrentTask(true);
|
task->setAsCurrentTask(true);
|
||||||
|
|
@ -40,8 +40,8 @@ int ProcedureCompoundTask::getPromptId() {
|
||||||
|
|
||||||
// Return the id of the first task not completed
|
// Return the id of the first task not completed
|
||||||
int promptId = -1;
|
int promptId = -1;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (!task->isCompleted()) {
|
if (!task->isCompleted()) {
|
||||||
promptId = task->getPromptId();
|
promptId = task->getPromptId();
|
||||||
|
|
@ -56,8 +56,8 @@ bool ProcedureCompoundTask::isCompleted() {
|
||||||
|
|
||||||
bool allCompleted = true;
|
bool allCompleted = true;
|
||||||
bool isCurrentTask = true;
|
bool isCurrentTask = true;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
|
|
||||||
if (allCompleted && isCurrentTask) {
|
if (allCompleted && isCurrentTask) {
|
||||||
|
|
@ -80,7 +80,7 @@ bool ProcedureCompoundTask::isCompleted() {
|
||||||
if (allCompleted) {
|
if (allCompleted) {
|
||||||
// Disable all constraints
|
// Disable all constraints
|
||||||
itEnd = m_taskSequence.end();
|
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;
|
TutorialTask* task = *it;
|
||||||
task->enableConstraints(false);
|
task->enableConstraints(false);
|
||||||
}
|
}
|
||||||
|
|
@ -90,16 +90,16 @@ bool ProcedureCompoundTask::isCompleted() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item) {
|
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item) {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
task->onCrafted(item);
|
task->onCrafted(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcedureCompoundTask::handleUIInput(int iAction) {
|
void ProcedureCompoundTask::handleUIInput(int iAction) {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
task->handleUIInput(iAction);
|
task->handleUIInput(iAction);
|
||||||
}
|
}
|
||||||
|
|
@ -107,8 +107,8 @@ void ProcedureCompoundTask::handleUIInput(int iAction) {
|
||||||
|
|
||||||
void ProcedureCompoundTask::setAsCurrentTask(bool active /*= true*/) {
|
void ProcedureCompoundTask::setAsCurrentTask(bool active /*= true*/) {
|
||||||
bool allCompleted = true;
|
bool allCompleted = true;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (allCompleted && !task->isCompleted()) {
|
if (allCompleted && !task->isCompleted()) {
|
||||||
task->setAsCurrentTask(true);
|
task->setAsCurrentTask(true);
|
||||||
|
|
@ -123,8 +123,8 @@ bool ProcedureCompoundTask::ShowMinimumTime() {
|
||||||
if (bIsCompleted) return false;
|
if (bIsCompleted) return false;
|
||||||
|
|
||||||
bool showMinimumTime = false;
|
bool showMinimumTime = false;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (!task->isCompleted()) {
|
if (!task->isCompleted()) {
|
||||||
showMinimumTime = task->ShowMinimumTime();
|
showMinimumTime = task->ShowMinimumTime();
|
||||||
|
|
@ -138,8 +138,8 @@ bool ProcedureCompoundTask::hasBeenActivated() {
|
||||||
if (bIsCompleted) return true;
|
if (bIsCompleted) return true;
|
||||||
|
|
||||||
bool hasBeenActivated = false;
|
bool hasBeenActivated = false;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (!task->isCompleted()) {
|
if (!task->isCompleted()) {
|
||||||
hasBeenActivated = task->hasBeenActivated();
|
hasBeenActivated = task->hasBeenActivated();
|
||||||
|
|
@ -150,8 +150,8 @@ bool ProcedureCompoundTask::hasBeenActivated() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcedureCompoundTask::setShownForMinimumTime() {
|
void ProcedureCompoundTask::setShownForMinimumTime() {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (!task->isCompleted()) {
|
if (!task->isCompleted()) {
|
||||||
task->setShownForMinimumTime();
|
task->setShownForMinimumTime();
|
||||||
|
|
@ -164,8 +164,8 @@ bool ProcedureCompoundTask::AllowFade() {
|
||||||
if (bIsCompleted) return true;
|
if (bIsCompleted) return true;
|
||||||
|
|
||||||
bool allowFade = true;
|
bool allowFade = true;
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
if (!task->isCompleted()) {
|
if (!task->isCompleted()) {
|
||||||
allowFade = task->AllowFade();
|
allowFade = task->AllowFade();
|
||||||
|
|
@ -178,8 +178,8 @@ bool ProcedureCompoundTask::AllowFade() {
|
||||||
void ProcedureCompoundTask::useItemOn(Level* level,
|
void ProcedureCompoundTask::useItemOn(Level* level,
|
||||||
std::shared_ptr<ItemInstance> item, int x,
|
std::shared_ptr<ItemInstance> item, int x,
|
||||||
int y, int z, bool bTestUseOnly) {
|
int y, int z, bool bTestUseOnly) {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
task->useItemOn(level, item, x, y, z, bTestUseOnly);
|
task->useItemOn(level, item, x, y, z, bTestUseOnly);
|
||||||
}
|
}
|
||||||
|
|
@ -187,8 +187,8 @@ void ProcedureCompoundTask::useItemOn(Level* level,
|
||||||
|
|
||||||
void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item,
|
void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item,
|
||||||
bool bTestUseOnly) {
|
bool bTestUseOnly) {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
task->useItem(item, bTestUseOnly);
|
task->useItem(item, bTestUseOnly);
|
||||||
}
|
}
|
||||||
|
|
@ -197,16 +197,16 @@ void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item,
|
||||||
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item,
|
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item,
|
||||||
unsigned int invItemCountAnyAux,
|
unsigned int invItemCountAnyAux,
|
||||||
unsigned int invItemCountThisAux) {
|
unsigned int invItemCountThisAux) {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
|
task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcedureCompoundTask::onStateChange(eTutorial_State newState) {
|
void ProcedureCompoundTask::onStateChange(eTutorial_State newState) {
|
||||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
auto 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;
|
TutorialTask* task = *it;
|
||||||
task->onStateChange(newState);
|
task->onStateChange(newState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1929,7 +1929,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad(iPad) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Tutorial::~Tutorial() {
|
Tutorial::~Tutorial() {
|
||||||
for (AUTO_VAR(it, m_globalConstraints.begin());
|
for (auto it = m_globalConstraints.begin();
|
||||||
it != m_globalConstraints.end(); ++it) {
|
it != m_globalConstraints.end(); ++it) {
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
|
@ -1939,11 +1939,11 @@ Tutorial::~Tutorial() {
|
||||||
delete (*it).second;
|
delete (*it).second;
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i < e_Tutorial_State_Max; ++i) {
|
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) {
|
++it) {
|
||||||
delete (*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);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1968,7 +1968,7 @@ void Tutorial::setCompleted(int completableId) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
int completableIndex = -1;
|
int completableIndex = -1;
|
||||||
for (AUTO_VAR(it, s_completableTasks.begin());
|
for (auto it = s_completableTasks.begin();
|
||||||
it < s_completableTasks.end(); ++it) {
|
it < s_completableTasks.end(); ++it) {
|
||||||
++completableIndex;
|
++completableIndex;
|
||||||
if (*it == completableId) {
|
if (*it == completableId) {
|
||||||
|
|
@ -1996,7 +1996,7 @@ bool Tutorial::getCompleted(int completableId) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
int completableIndex = -1;
|
int completableIndex = -1;
|
||||||
for (AUTO_VAR(it, s_completableTasks.begin());
|
for (auto it = s_completableTasks.begin();
|
||||||
it < s_completableTasks.end(); ++it) {
|
it < s_completableTasks.end(); ++it) {
|
||||||
++completableIndex;
|
++completableIndex;
|
||||||
if (*it == completableId) {
|
if (*it == completableId) {
|
||||||
|
|
@ -2079,7 +2079,7 @@ void Tutorial::tick() {
|
||||||
bool taskChanged = false;
|
bool taskChanged = false;
|
||||||
|
|
||||||
for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) {
|
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()) {
|
while (it < constraintsToRemove[state].end()) {
|
||||||
++(*it).second;
|
++(*it).second;
|
||||||
if ((*it).second > m_iTutorialConstraintDelayRemoveTicks) {
|
if ((*it).second > m_iTutorialConstraintDelayRemoveTicks) {
|
||||||
|
|
@ -2152,7 +2152,7 @@ void Tutorial::tick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check constraints
|
// Check constraints
|
||||||
for (AUTO_VAR(it, m_globalConstraints.begin());
|
for (auto it = m_globalConstraints.begin();
|
||||||
it < m_globalConstraints.end(); ++it) {
|
it < m_globalConstraints.end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
constraint->tick(m_iPad);
|
constraint->tick(m_iPad);
|
||||||
|
|
@ -2167,7 +2167,7 @@ void Tutorial::tick() {
|
||||||
m_isFullTutorial || app.GetGameSettings(m_iPad, eGameSetting_Hints);
|
m_isFullTutorial || app.GetGameSettings(m_iPad, eGameSetting_Hints);
|
||||||
|
|
||||||
if (hintsOn) {
|
if (hintsOn) {
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->tick();
|
hintNeeded = hint->tick();
|
||||||
|
|
@ -2195,7 +2195,7 @@ void Tutorial::tick() {
|
||||||
constraintChanged = true;
|
constraintChanged = true;
|
||||||
currentFailedConstraint[m_CurrentState] = nullptr;
|
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) {
|
it < constraints[m_CurrentState].end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
if (!constraint->isConstraintSatisfied(m_iPad) &&
|
if (!constraint->isConstraintSatisfied(m_iPad) &&
|
||||||
|
|
@ -2210,7 +2210,7 @@ void Tutorial::tick() {
|
||||||
currentFailedConstraint[m_CurrentState] == nullptr) {
|
currentFailedConstraint[m_CurrentState] == nullptr) {
|
||||||
// Update tasks
|
// Update tasks
|
||||||
bool isCurrentTask = true;
|
bool isCurrentTask = true;
|
||||||
AUTO_VAR(it, activeTasks[m_CurrentState].begin());
|
auto it = activeTasks[m_CurrentState].begin();
|
||||||
while (activeTasks[m_CurrentState].size() > 0 &&
|
while (activeTasks[m_CurrentState].size() > 0 &&
|
||||||
it < activeTasks[m_CurrentState].end()) {
|
it < activeTasks[m_CurrentState].end()) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
|
|
@ -2233,9 +2233,9 @@ void Tutorial::tick() {
|
||||||
// 4J Stu - Move the delayed constraints to the
|
// 4J Stu - Move the delayed constraints to the
|
||||||
// gameplay state so that they are in effect for
|
// gameplay state so that they are in effect for
|
||||||
// a bit longer
|
// a bit longer
|
||||||
AUTO_VAR(itCon,
|
auto itCon =
|
||||||
constraintsToRemove[m_CurrentState]
|
constraintsToRemove[m_CurrentState]
|
||||||
.begin());
|
.begin();
|
||||||
while (
|
while (
|
||||||
itCon !=
|
itCon !=
|
||||||
constraintsToRemove[m_CurrentState].end()) {
|
constraintsToRemove[m_CurrentState].end()) {
|
||||||
|
|
@ -2259,9 +2259,9 @@ void Tutorial::tick() {
|
||||||
}
|
}
|
||||||
// Fall through the the normal complete state
|
// Fall through the the normal complete state
|
||||||
case e_Tutorial_Completion_Complete_State:
|
case e_Tutorial_Completion_Complete_State:
|
||||||
for (AUTO_VAR(
|
for (auto
|
||||||
itRem,
|
itRem =
|
||||||
activeTasks[m_CurrentState].begin());
|
activeTasks[m_CurrentState].begin();
|
||||||
itRem < activeTasks[m_CurrentState].end();
|
itRem < activeTasks[m_CurrentState].end();
|
||||||
++itRem) {
|
++itRem) {
|
||||||
delete (*itRem);
|
delete (*itRem);
|
||||||
|
|
@ -2273,9 +2273,9 @@ void Tutorial::tick() {
|
||||||
activeTasks[m_CurrentState].at(
|
activeTasks[m_CurrentState].at(
|
||||||
activeTasks[m_CurrentState].size() - 1);
|
activeTasks[m_CurrentState].size() - 1);
|
||||||
activeTasks[m_CurrentState].pop_back();
|
activeTasks[m_CurrentState].pop_back();
|
||||||
for (AUTO_VAR(
|
for (auto
|
||||||
itRem,
|
itRem =
|
||||||
activeTasks[m_CurrentState].begin());
|
activeTasks[m_CurrentState].begin();
|
||||||
itRem < activeTasks[m_CurrentState].end();
|
itRem < activeTasks[m_CurrentState].end();
|
||||||
++itRem) {
|
++itRem) {
|
||||||
delete (*itRem);
|
delete (*itRem);
|
||||||
|
|
@ -2433,7 +2433,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) {
|
||||||
if (!message->m_messageString.empty()) {
|
if (!message->m_messageString.empty()) {
|
||||||
text = message->m_messageString;
|
text = message->m_messageString;
|
||||||
} else {
|
} else {
|
||||||
AUTO_VAR(it, messages.find(message->m_messageId));
|
auto it = messages.find(message->m_messageId);
|
||||||
if (it != messages.end() && it->second != nullptr) {
|
if (it != messages.end() && it->second != nullptr) {
|
||||||
TutorialMessage* messageString = it->second;
|
TutorialMessage* messageString = it->second;
|
||||||
text = std::wstring(messageString->getMessageForDisplay());
|
text = std::wstring(messageString->getMessageForDisplay());
|
||||||
|
|
@ -2457,7 +2457,7 @@ bool Tutorial::setMessage(PopupMessageDetails* message) {
|
||||||
if (!message->m_promptString.empty()) {
|
if (!message->m_promptString.empty()) {
|
||||||
text.append(message->m_promptString);
|
text.append(message->m_promptString);
|
||||||
} else if (message->m_promptId >= 0) {
|
} 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) {
|
if (it != messages.end() && it->second != nullptr) {
|
||||||
TutorialMessage* prompt = it->second;
|
TutorialMessage* prompt = it->second;
|
||||||
text.append(prompt->getMessageForDisplay());
|
text.append(prompt->getMessageForDisplay());
|
||||||
|
|
@ -2555,7 +2555,7 @@ void Tutorial::showTutorialPopup(bool show) {
|
||||||
|
|
||||||
void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item,
|
void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item,
|
||||||
int x, int y, int z, bool bTestUseOnly) {
|
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) {
|
it < activeTasks[m_CurrentState].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->useItemOn(level, item, x, y, z, bTestUseOnly);
|
task->useItemOn(level, item, x, y, z, bTestUseOnly);
|
||||||
|
|
@ -2564,7 +2564,7 @@ void Tutorial::useItemOn(Level* level, std::shared_ptr<ItemInstance> item,
|
||||||
|
|
||||||
void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item,
|
void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item,
|
||||||
bool bTestUseOnly) {
|
bool bTestUseOnly) {
|
||||||
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin());
|
for (auto it = activeTasks[m_CurrentState].begin();
|
||||||
it < activeTasks[m_CurrentState].end(); ++it) {
|
it < activeTasks[m_CurrentState].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->useItem(item, bTestUseOnly);
|
task->useItem(item, bTestUseOnly);
|
||||||
|
|
@ -2572,7 +2572,7 @@ void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item,
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
|
void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
|
||||||
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin());
|
for (auto it = activeTasks[m_CurrentState].begin();
|
||||||
it < activeTasks[m_CurrentState].end(); ++it) {
|
it < activeTasks[m_CurrentState].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->completeUsingItem(item);
|
task->completeUsingItem(item);
|
||||||
|
|
@ -2581,7 +2581,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
|
||||||
// Fix for #46922 - TU5: UI: Player receives a reminder that he is hungry
|
// Fix for #46922 - TU5: UI: Player receives a reminder that he is hungry
|
||||||
// while "hunger bar" is full (triggered in split-screen mode)
|
// while "hunger bar" is full (triggered in split-screen mode)
|
||||||
if (m_CurrentState != e_Tutorial_State_Gameplay) {
|
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) {
|
it < activeTasks[e_Tutorial_State_Gameplay].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->completeUsingItem(item);
|
task->completeUsingItem(item);
|
||||||
|
|
@ -2592,7 +2592,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item) {
|
||||||
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
|
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
|
||||||
Tile* tile) {
|
Tile* tile) {
|
||||||
int hintNeeded = -1;
|
int hintNeeded = -1;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->startDestroyBlock(item, tile);
|
hintNeeded = hint->startDestroyBlock(item, tile);
|
||||||
|
|
@ -2607,7 +2607,7 @@ void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item,
|
||||||
|
|
||||||
void Tutorial::destroyBlock(Tile* tile) {
|
void Tutorial::destroyBlock(Tile* tile) {
|
||||||
int hintNeeded = -1;
|
int hintNeeded = -1;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->destroyBlock(tile);
|
hintNeeded = hint->destroyBlock(tile);
|
||||||
|
|
@ -2623,7 +2623,7 @@ void Tutorial::destroyBlock(Tile* tile) {
|
||||||
void Tutorial::attack(std::shared_ptr<Player> player,
|
void Tutorial::attack(std::shared_ptr<Player> player,
|
||||||
std::shared_ptr<Entity> entity) {
|
std::shared_ptr<Entity> entity) {
|
||||||
int hintNeeded = -1;
|
int hintNeeded = -1;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->attack(player->inventory->getSelected(), entity);
|
hintNeeded = hint->attack(player->inventory->getSelected(), entity);
|
||||||
|
|
@ -2638,7 +2638,7 @@ void Tutorial::attack(std::shared_ptr<Player> player,
|
||||||
|
|
||||||
void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) {
|
void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) {
|
||||||
int hintNeeded = -1;
|
int hintNeeded = -1;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->itemDamaged(item);
|
hintNeeded = hint->itemDamaged(item);
|
||||||
|
|
@ -2654,7 +2654,7 @@ void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item) {
|
||||||
void Tutorial::handleUIInput(int iAction) {
|
void Tutorial::handleUIInput(int iAction) {
|
||||||
if (m_hintDisplayed) return;
|
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)
|
// activeTasks[m_CurrentState].end(); ++it)
|
||||||
//{
|
//{
|
||||||
// TutorialTask *task = *it;
|
// TutorialTask *task = *it;
|
||||||
|
|
@ -2667,7 +2667,7 @@ void Tutorial::handleUIInput(int iAction) {
|
||||||
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item,
|
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item,
|
||||||
bool canMake) {
|
bool canMake) {
|
||||||
int hintNeeded = -1;
|
int hintNeeded = -1;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->createItemSelected(item, canMake);
|
hintNeeded = hint->createItemSelected(item, canMake);
|
||||||
|
|
@ -2682,7 +2682,7 @@ void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item,
|
||||||
|
|
||||||
void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item) {
|
void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item) {
|
||||||
for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) {
|
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) {
|
it < activeTasks[state].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->onCrafted(item);
|
task->onCrafted(item);
|
||||||
|
|
@ -2695,7 +2695,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item,
|
||||||
unsigned int invItemCountThisAux) {
|
unsigned int invItemCountThisAux) {
|
||||||
if (!m_hintDisplayed) {
|
if (!m_hintDisplayed) {
|
||||||
bool hintNeeded = false;
|
bool hintNeeded = false;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->onTake(item);
|
hintNeeded = hint->onTake(item);
|
||||||
|
|
@ -2706,7 +2706,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int state = 0; state < e_Tutorial_State_Max; ++state) {
|
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) {
|
it < activeTasks[state].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
|
task->onTake(item, invItemCountAnyAux, invItemCountThisAux);
|
||||||
|
|
@ -2738,7 +2738,7 @@ void Tutorial::onLookAt(int id, int iData) {
|
||||||
if (m_hintDisplayed) return;
|
if (m_hintDisplayed) return;
|
||||||
|
|
||||||
bool hintNeeded = false;
|
bool hintNeeded = false;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->onLookAt(id, iData);
|
hintNeeded = hint->onLookAt(id, iData);
|
||||||
|
|
@ -2764,7 +2764,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
|
||||||
if (m_hintDisplayed) return;
|
if (m_hintDisplayed) return;
|
||||||
|
|
||||||
bool hintNeeded = false;
|
bool hintNeeded = false;
|
||||||
for (AUTO_VAR(it, hints[m_CurrentState].begin());
|
for (auto it = hints[m_CurrentState].begin();
|
||||||
it < hints[m_CurrentState].end(); ++it) {
|
it < hints[m_CurrentState].end(); ++it) {
|
||||||
TutorialHint* hint = *it;
|
TutorialHint* hint = *it;
|
||||||
hintNeeded = hint->onLookAtEntity(entity->GetType());
|
hintNeeded = hint->onLookAtEntity(entity->GetType());
|
||||||
|
|
@ -2778,7 +2778,7 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
|
||||||
changeTutorialState(e_Tutorial_State_Horse);
|
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 != activeTasks[m_CurrentState].end(); ++it) {
|
||||||
(*it)->onLookAtEntity(entity);
|
(*it)->onLookAtEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
@ -2798,14 +2798,14 @@ void Tutorial::onRideEntity(std::shared_ptr<Entity> entity) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AUTO_VAR(it, activeTasks[m_CurrentState].begin());
|
for (auto it = activeTasks[m_CurrentState].begin();
|
||||||
it != activeTasks[m_CurrentState].end(); ++it) {
|
it != activeTasks[m_CurrentState].end(); ++it) {
|
||||||
(*it)->onRideEntity(entity);
|
(*it)->onRideEntity(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tutorial::onEffectChanged(MobEffect* effect, bool bRemoved) {
|
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) {
|
it < activeTasks[m_CurrentState].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->onEffectChanged(effect, bRemoved);
|
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,
|
bool Tutorial::canMoveToPosition(double xo, double yo, double zo, double xt,
|
||||||
double yt, double zt) {
|
double yt, double zt) {
|
||||||
bool allowed = 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) {
|
it < constraints[m_CurrentState].end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
if (!constraint->isConstraintSatisfied(m_iPad) &&
|
if (!constraint->isConstraintSatisfied(m_iPad) &&
|
||||||
|
|
@ -2837,7 +2837,7 @@ bool Tutorial::isInputAllowed(int mapping) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool allowed = 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) {
|
it < constraints[m_CurrentState].end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
if (constraint->isMappingConstrained(m_iPad, mapping)) {
|
if (constraint->isMappingConstrained(m_iPad, mapping)) {
|
||||||
|
|
@ -2852,7 +2852,7 @@ std::vector<TutorialTask*>* Tutorial::getTasks() { return &tasks; }
|
||||||
|
|
||||||
unsigned int Tutorial::getCurrentTaskIndex() {
|
unsigned int Tutorial::getCurrentTaskIndex() {
|
||||||
unsigned int index = 0;
|
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;
|
if (*it == currentTask[e_Tutorial_State_Gameplay]) break;
|
||||||
|
|
||||||
++index;
|
++index;
|
||||||
|
|
@ -2875,7 +2875,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
|
||||||
|
|
||||||
if (c->getQueuedForRemoval()) {
|
if (c->getQueuedForRemoval()) {
|
||||||
// If it is already queued for removal, remove it on the next tick
|
// 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)
|
constraintsToRemove[m_CurrentState].end(); ++it)
|
||||||
{
|
{
|
||||||
if( it->first == c )
|
if( it->first == c )
|
||||||
|
|
@ -2889,7 +2889,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
|
||||||
constraintsToRemove[m_CurrentState].push_back(
|
constraintsToRemove[m_CurrentState].push_back(
|
||||||
std::pair<TutorialConstraint*, unsigned char>(c, 0));
|
std::pair<TutorialConstraint*, unsigned char>(c, 0));
|
||||||
} else {
|
} else {
|
||||||
for (AUTO_VAR(it, constraintsToRemove[m_CurrentState].begin());
|
for (auto it = constraintsToRemove[m_CurrentState].begin();
|
||||||
it < constraintsToRemove[m_CurrentState].end(); ++it) {
|
it < constraintsToRemove[m_CurrentState].end(); ++it) {
|
||||||
if (it->first == c) {
|
if (it->first == c) {
|
||||||
constraintsToRemove[m_CurrentState].erase(it);
|
constraintsToRemove[m_CurrentState].erase(it);
|
||||||
|
|
@ -2897,8 +2897,8 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AUTO_VAR(it, find(constraints[m_CurrentState].begin(),
|
auto it = find(constraints[m_CurrentState].begin(),
|
||||||
constraints[m_CurrentState].end(), c));
|
constraints[m_CurrentState].end(), c);
|
||||||
if (it != constraints[m_CurrentState].end())
|
if (it != constraints[m_CurrentState].end())
|
||||||
constraints[m_CurrentState].erase(
|
constraints[m_CurrentState].erase(
|
||||||
find(constraints[m_CurrentState].begin(),
|
find(constraints[m_CurrentState].begin(),
|
||||||
|
|
@ -2990,7 +2990,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState,
|
||||||
m_UIScene = scene;
|
m_UIScene = scene;
|
||||||
|
|
||||||
if (m_CurrentState != newState) {
|
if (m_CurrentState != newState) {
|
||||||
for (AUTO_VAR(it, activeTasks[newState].begin());
|
for (auto it = activeTasks[newState].begin();
|
||||||
it < activeTasks[newState].end(); ++it) {
|
it < activeTasks[newState].end(); ++it) {
|
||||||
TutorialTask* task = *it;
|
TutorialTask* task = *it;
|
||||||
task->onStateChange(newState);
|
task->onStateChange(newState);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId,
|
||||||
m_bShowMinimumTime(bShowMinimumTime),
|
m_bShowMinimumTime(bShowMinimumTime),
|
||||||
m_bShownForMinimumTime(false) {
|
m_bShownForMinimumTime(false) {
|
||||||
if (inConstraints != nullptr) {
|
if (inConstraints != nullptr) {
|
||||||
for (AUTO_VAR(it, inConstraints->begin()); it < inConstraints->end();
|
for (auto it = inConstraints->begin(); it < inConstraints->end();
|
||||||
++it) {
|
++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
constraints.push_back(constraint);
|
constraints.push_back(constraint);
|
||||||
|
|
@ -34,7 +34,7 @@ TutorialTask::TutorialTask(Tutorial* tutorial, int descriptionId,
|
||||||
TutorialTask::~TutorialTask() {
|
TutorialTask::~TutorialTask() {
|
||||||
enableConstraints(false);
|
enableConstraints(false);
|
||||||
|
|
||||||
for (AUTO_VAR(it, constraints.begin()); it < constraints.end(); ++it) {
|
for (auto it = constraints.begin(); it < constraints.end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
|
|
||||||
if (constraint->getQueuedForRemoval()) {
|
if (constraint->getQueuedForRemoval()) {
|
||||||
|
|
@ -53,7 +53,7 @@ void TutorialTask::enableConstraints(bool enable,
|
||||||
bool delayRemove /*= false*/) {
|
bool delayRemove /*= false*/) {
|
||||||
if (!enable && (areConstraintsEnabled || !delayRemove)) {
|
if (!enable && (areConstraintsEnabled || !delayRemove)) {
|
||||||
// Remove
|
// Remove
|
||||||
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) {
|
for (auto it = constraints.begin(); it != constraints.end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
// app.DebugPrintf(">>>>>>>> %i\n", constraints.size());
|
// app.DebugPrintf(">>>>>>>> %i\n", constraints.size());
|
||||||
tutorial->RemoveConstraint(constraint, delayRemove);
|
tutorial->RemoveConstraint(constraint, delayRemove);
|
||||||
|
|
@ -61,7 +61,7 @@ void TutorialTask::enableConstraints(bool enable,
|
||||||
areConstraintsEnabled = false;
|
areConstraintsEnabled = false;
|
||||||
} else if (!areConstraintsEnabled && enable) {
|
} else if (!areConstraintsEnabled && enable) {
|
||||||
// Add
|
// Add
|
||||||
for (AUTO_VAR(it, constraints.begin()); it != constraints.end(); ++it) {
|
for (auto it = constraints.begin(); it != constraints.end(); ++it) {
|
||||||
TutorialConstraint* constraint = *it;
|
TutorialConstraint* constraint = *it;
|
||||||
tutorial->AddConstraint(constraint);
|
tutorial->AddConstraint(constraint);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1095,9 +1095,9 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction,
|
||||||
ui.AnimateKeyPress(iPad, iAction, bRepeat, true, false);
|
ui.AnimateKeyPress(iPad, iAction, bRepeat, true, false);
|
||||||
|
|
||||||
int buttonNum = 0; // 0 = LeftMouse, 1 = RightMouse
|
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;
|
bool itemEditorKeyPress = false;
|
||||||
|
|
||||||
// Ignore input from other players
|
// Ignore input from other players
|
||||||
|
|
|
||||||
|
|
@ -631,7 +631,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
|
||||||
Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired =
|
Recipy::INGREDIENTS_REQUIRED* pRecipeIngredientsRequired =
|
||||||
Recipes::getInstance()->getRecipeIngredientsArray();
|
Recipes::getInstance()->getRecipeIngredientsArray();
|
||||||
int iRecipeC = (int)recipes->size();
|
int iRecipeC = (int)recipes->size();
|
||||||
AUTO_VAR(itRecipe, recipes->begin());
|
auto itRecipe = recipes->begin();
|
||||||
|
|
||||||
// dump out the recipe products
|
// dump out the recipe products
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -982,8 +982,8 @@ void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu* menu,
|
||||||
|
|
||||||
// Fill the dynamic group
|
// Fill the dynamic group
|
||||||
if (m_dynamicGroupsCount > 0 && m_dynamicGroupsA != nullptr) {
|
if (m_dynamicGroupsCount > 0 && m_dynamicGroupsA != nullptr) {
|
||||||
for (AUTO_VAR(it,
|
for (auto it=
|
||||||
categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin());
|
categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin();
|
||||||
it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() &&
|
it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() &&
|
||||||
lastSlotIndex < MAX_SIZE;
|
lastSlotIndex < MAX_SIZE;
|
||||||
++it) {
|
++it) {
|
||||||
|
|
@ -1195,7 +1195,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum,
|
||||||
}
|
}
|
||||||
|
|
||||||
void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum,
|
void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum,
|
||||||
BOOL quickKeyHeld) {
|
bool quickKeyHeld) {
|
||||||
// Drop items.
|
// Drop items.
|
||||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ void IUIScene_TradingMenu::updateDisplay() {
|
||||||
m_activeOffers.clear();
|
m_activeOffers.clear();
|
||||||
int unfilteredIndex = 0;
|
int unfilteredIndex = 0;
|
||||||
int firstValidTrade = INT_MAX;
|
int firstValidTrade = INT_MAX;
|
||||||
for (AUTO_VAR(it, unfilteredOffers->begin());
|
for (auto it = unfilteredOffers->begin();
|
||||||
it != unfilteredOffers->end(); ++it) {
|
it != unfilteredOffers->end(); ++it) {
|
||||||
MerchantRecipe* recipe = *it;
|
MerchantRecipe* recipe = *it;
|
||||||
if (!recipe->isDeprecated()) {
|
if (!recipe->isDeprecated()) {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ void UIComponent_Panorama::tick() {
|
||||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||||
EnterCriticalSection(&pMinecraft->m_setLevelCS);
|
EnterCriticalSection(&pMinecraft->m_setLevelCS);
|
||||||
if (pMinecraft->level != nullptr) {
|
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
|
// are we in the Nether? - Leave the time as 0 if we are, so we show
|
||||||
// daylight
|
// daylight
|
||||||
if (pMinecraft->level->dimension->id == 0) {
|
if (pMinecraft->level->dimension->id == 0) {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ private:
|
||||||
float flip, oFlip, flipT, flipA;
|
float flip, oFlip, flipT, flipA;
|
||||||
float open, oOpen;
|
float open, oOpen;
|
||||||
|
|
||||||
// BOOL m_bDirty;
|
// bool m_bDirty;
|
||||||
// float m_fScale,m_fAlpha;
|
// float m_fScale,m_fAlpha;
|
||||||
// int m_iPad;
|
// int m_iPad;
|
||||||
std::shared_ptr<ItemInstance> last;
|
std::shared_ptr<ItemInstance> last;
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) {
|
||||||
// *pAdditionalModelParts=mob->GetAdditionalModelParts();
|
// *pAdditionalModelParts=mob->GetAdditionalModelParts();
|
||||||
|
|
||||||
if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) {
|
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) {
|
it != m_pvAdditionalModelParts->end(); ++it) {
|
||||||
ModelPart* pModelPart = *it;
|
ModelPart* pModelPart = *it;
|
||||||
|
|
||||||
|
|
@ -227,7 +227,7 @@ void UIControl_PlayerSkinPreview::render(IggyCustomDrawCallbackRegion* region) {
|
||||||
|
|
||||||
// hide the additional parts
|
// hide the additional parts
|
||||||
if (m_pvAdditionalModelParts && m_pvAdditionalModelParts->size() != 0) {
|
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) {
|
it != m_pvAdditionalModelParts->end(); ++it) {
|
||||||
ModelPart* pModelPart = *it;
|
ModelPart* pModelPart = *it;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ void UIController::tick() {
|
||||||
|
|
||||||
// Clear out the cached movie file data
|
// Clear out the cached movie file data
|
||||||
int64_t currentTime = System::currentTimeMillis();
|
int64_t currentTime = System::currentTimeMillis();
|
||||||
for (AUTO_VAR(it, m_cachedMovieData.begin());
|
for (auto it = m_cachedMovieData.begin();
|
||||||
it != m_cachedMovieData.end();) {
|
it != m_cachedMovieData.end();) {
|
||||||
if (it->second.m_expiry < currentTime) {
|
if (it->second.m_expiry < currentTime) {
|
||||||
delete[] it->second.m_ba.data;
|
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) {
|
it != m_queuedMessageBoxData.end(); ++it) {
|
||||||
QueuedMessageBoxData* queuedData = *it;
|
QueuedMessageBoxData* queuedData = *it;
|
||||||
ui.NavigateToScene(queuedData->iPad, eUIScene_MessageBox,
|
ui.NavigateToScene(queuedData->iPad, eUIScene_MessageBox,
|
||||||
|
|
@ -682,7 +682,7 @@ void UIController::CleanUpSkinReload() {
|
||||||
byteArray UIController::getMovieData(const std::wstring& filename) {
|
byteArray UIController::getMovieData(const std::wstring& filename) {
|
||||||
// Cache everything we load in the current tick
|
// Cache everything we load in the current tick
|
||||||
int64_t targetTime = System::currentTimeMillis() + (1000LL * 60);
|
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()) {
|
if (it == m_cachedMovieData.end()) {
|
||||||
byteArray baFile = app.getArchiveFile(filename);
|
byteArray baFile = app.getArchiveFile(filename);
|
||||||
CachedMovieData cmd;
|
CachedMovieData cmd;
|
||||||
|
|
@ -1095,8 +1095,8 @@ GDrawTexture* RADLINK UIController::TextureSubstitutionCreateCallback(
|
||||||
void* user_callback_data, IggyUTF16* texture_name, S32* width, S32* height,
|
void* user_callback_data, IggyUTF16* texture_name, S32* width, S32* height,
|
||||||
void** destroy_callback_data) {
|
void** destroy_callback_data) {
|
||||||
UIController* uiController = (UIController*)user_callback_data;
|
UIController* uiController = (UIController*)user_callback_data;
|
||||||
AUTO_VAR(it,
|
auto it =
|
||||||
uiController->m_substitutionTextures.find((wchar_t*)texture_name));
|
uiController->m_substitutionTextures.find((wchar_t*)texture_name);
|
||||||
|
|
||||||
if (it != uiController->m_substitutionTextures.end()) {
|
if (it != uiController->m_substitutionTextures.end()) {
|
||||||
app.DebugPrintf("Found substitution texture %ls, with %d bytes\n",
|
app.DebugPrintf("Found substitution texture %ls, with %d bytes\n",
|
||||||
|
|
@ -1158,7 +1158,7 @@ void UIController::registerSubstitutionTexture(const std::wstring& textureName,
|
||||||
|
|
||||||
void UIController::unregisterSubstitutionTexture(
|
void UIController::unregisterSubstitutionTexture(
|
||||||
const std::wstring& textureName, bool deleteData) {
|
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 (it != m_substitutionTextures.end()) {
|
||||||
if (deleteData) delete[] it->second.data;
|
if (deleteData) delete[] it->second.data;
|
||||||
|
|
@ -1393,7 +1393,7 @@ size_t UIController::RegisterForCallbackId(UIScene* scene) {
|
||||||
|
|
||||||
void UIController::UnregisterCallbackId(size_t id) {
|
void UIController::UnregisterCallbackId(size_t id) {
|
||||||
EnterCriticalSection(&m_registeredCallbackScenesCS);
|
EnterCriticalSection(&m_registeredCallbackScenesCS);
|
||||||
AUTO_VAR(it, m_registeredCallbackScenes.find(id));
|
auto it = m_registeredCallbackScenes.find(id);
|
||||||
if (it != m_registeredCallbackScenes.end()) {
|
if (it != m_registeredCallbackScenes.end()) {
|
||||||
m_registeredCallbackScenes.erase(it);
|
m_registeredCallbackScenes.erase(it);
|
||||||
}
|
}
|
||||||
|
|
@ -1402,7 +1402,7 @@ void UIController::UnregisterCallbackId(size_t id) {
|
||||||
|
|
||||||
UIScene* UIController::GetSceneFromCallbackId(size_t id) {
|
UIScene* UIController::GetSceneFromCallbackId(size_t id) {
|
||||||
UIScene* scene = nullptr;
|
UIScene* scene = nullptr;
|
||||||
AUTO_VAR(it, m_registeredCallbackScenes.find(id));
|
auto it = m_registeredCallbackScenes.find(id);
|
||||||
if (it != m_registeredCallbackScenes.end()) {
|
if (it != m_registeredCallbackScenes.end()) {
|
||||||
scene = it->second;
|
scene = it->second;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class UIControl;
|
||||||
// Base class for all shared functions between UIControllers
|
// Base class for all shared functions between UIControllers
|
||||||
class UIController : public IUIController {
|
class UIController : public IUIController {
|
||||||
public:
|
public:
|
||||||
static __int64 iggyAllocCount;
|
static int64_t iggyAllocCount;
|
||||||
|
|
||||||
// MGH - added to prevent crash loading Iggy movies while the skins were
|
// MGH - added to prevent crash loading Iggy movies while the skins were
|
||||||
// being reloaded
|
// being reloaded
|
||||||
|
|
@ -390,19 +390,19 @@ public:
|
||||||
virtual C4JStorage::EMessageResult RequestAlertMessage(
|
virtual C4JStorage::EMessageResult RequestAlertMessage(
|
||||||
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
|
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
|
||||||
DWORD dwPad = XUSER_INDEX_ANY,
|
DWORD dwPad = XUSER_INDEX_ANY,
|
||||||
int (*Func)(LPVOID, int, const C4JStorage::EMessageResult) = nullptr,
|
int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr,
|
||||||
LPVOID lpParam = nullptr, WCHAR* pwchFormatString = nullptr);
|
void* lpParam = nullptr, WCHAR* pwchFormatString = nullptr);
|
||||||
virtual C4JStorage::EMessageResult RequestErrorMessage(
|
virtual C4JStorage::EMessageResult RequestErrorMessage(
|
||||||
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
|
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
|
||||||
DWORD dwPad = XUSER_INDEX_ANY,
|
DWORD dwPad = XUSER_INDEX_ANY,
|
||||||
int (*Func)(LPVOID, int, const C4JStorage::EMessageResult) = nullptr,
|
int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr,
|
||||||
LPVOID lpParam = nullptr, WCHAR* pwchFormatString = nullptr);
|
void* lpParam = nullptr, WCHAR* pwchFormatString = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual C4JStorage::EMessageResult RequestMessageBox(
|
virtual C4JStorage::EMessageResult RequestMessageBox(
|
||||||
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad,
|
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad,
|
||||||
int (*Func)(LPVOID, int, const C4JStorage::EMessageResult),
|
int (*Func)(void*, int, const C4JStorage::EMessageResult),
|
||||||
LPVOID lpParam, WCHAR* pwchFormatString, DWORD dwFocusButton,
|
void* lpParam, WCHAR* pwchFormatString, DWORD dwFocusButton,
|
||||||
bool bIsError);
|
bool bIsError);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ void UILayer::tick() {
|
||||||
// so we need to make a copy of the scenes that we are going to try and
|
// so we need to make a copy of the scenes that we are going to try and
|
||||||
// destroy this tick
|
// destroy this tick
|
||||||
std::vector<UIScene*> scenesToDeleteCopy;
|
std::vector<UIScene*> scenesToDeleteCopy;
|
||||||
for (AUTO_VAR(it, m_scenesToDelete.begin()); it != m_scenesToDelete.end();
|
for (auto it = m_scenesToDelete.begin(); it != m_scenesToDelete.end();
|
||||||
it++) {
|
it++) {
|
||||||
UIScene* scene = (*it);
|
UIScene* scene = (*it);
|
||||||
scenesToDeleteCopy.push_back(scene);
|
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
|
// 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
|
// back to the ones that are still to be deleted. Actually deleting a scene
|
||||||
// might also add something back into m_scenesToDelete.
|
// might also add something back into m_scenesToDelete.
|
||||||
for (AUTO_VAR(it, scenesToDeleteCopy.begin());
|
for (auto it = scenesToDeleteCopy.begin();
|
||||||
it != scenesToDeleteCopy.end(); it++) {
|
it != scenesToDeleteCopy.end(); it++) {
|
||||||
UIScene* scene = (*it);
|
UIScene* scene = (*it);
|
||||||
if (scene->isReadyToDelete()) {
|
if (scene->isReadyToDelete()) {
|
||||||
|
|
@ -45,12 +45,12 @@ void UILayer::tick() {
|
||||||
}
|
}
|
||||||
m_scenesToDestroy.clear();
|
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();
|
(*it)->tick();
|
||||||
}
|
}
|
||||||
// Note: reverse iterator, the last element is the top of the stack
|
// Note: reverse iterator, the last element is the top of the stack
|
||||||
int sceneIndex = m_sceneStack.size() - 1;
|
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()) {
|
while (sceneIndex >= 0 && sceneIndex < m_sceneStack.size()) {
|
||||||
//(*it)->tick();
|
//(*it)->tick();
|
||||||
UIScene* scene = m_sceneStack[sceneIndex];
|
UIScene* scene = m_sceneStack[sceneIndex];
|
||||||
|
|
@ -63,9 +63,9 @@ void UILayer::tick() {
|
||||||
|
|
||||||
void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) {
|
void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) {
|
||||||
if (!ui.IsExpectingOrReloadingSkin()) {
|
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) {
|
++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 (itRef != m_componentRefCount.end() && itRef->second.second) {
|
||||||
if ((*it)->isVisible()) {
|
if ((*it)->isVisible()) {
|
||||||
PIXBeginNamedEvent(0, "Rendering component %d",
|
PIXBeginNamedEvent(0, "Rendering component %d",
|
||||||
|
|
@ -125,7 +125,7 @@ bool UILayer::HasFocus(int iPad) {
|
||||||
|
|
||||||
bool UILayer::hidesLowerScenes() {
|
bool UILayer::hidesLowerScenes() {
|
||||||
bool hidesScenes = false;
|
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()) {
|
if ((*it)->hidesLowerScenes()) {
|
||||||
hidesScenes = true;
|
hidesScenes = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -147,16 +147,16 @@ void UILayer::getRenderDimensions(S32& width, S32& height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILayer::DestroyAll() {
|
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();
|
(*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();
|
(*it)->destroyMovie();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILayer::ReloadAll(bool force) {
|
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);
|
(*it)->reloadMovie(force);
|
||||||
}
|
}
|
||||||
if (!m_sceneStack.empty()) {
|
if (!m_sceneStack.empty()) {
|
||||||
|
|
@ -437,7 +437,7 @@ bool UILayer::NavigateBack(int iPad, EUIScene eScene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILayer::showComponent(int iPad, EUIScene scene, bool show) {
|
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()) {
|
if (it != m_componentRefCount.end()) {
|
||||||
it->second.second = show;
|
it->second.second = show;
|
||||||
return;
|
return;
|
||||||
|
|
@ -447,7 +447,7 @@ void UILayer::showComponent(int iPad, EUIScene scene, bool show) {
|
||||||
|
|
||||||
bool UILayer::isComponentVisible(EUIScene scene) {
|
bool UILayer::isComponentVisible(EUIScene scene) {
|
||||||
bool visible = false;
|
bool visible = false;
|
||||||
AUTO_VAR(it, m_componentRefCount.find(scene));
|
auto it = m_componentRefCount.find(scene);
|
||||||
if (it != m_componentRefCount.end()) {
|
if (it != m_componentRefCount.end()) {
|
||||||
visible = it->second.second;
|
visible = it->second.second;
|
||||||
}
|
}
|
||||||
|
|
@ -455,11 +455,11 @@ bool UILayer::isComponentVisible(EUIScene scene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) {
|
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()) {
|
if (it != m_componentRefCount.end()) {
|
||||||
++it->second.first;
|
++it->second.first;
|
||||||
|
|
||||||
for (AUTO_VAR(itComp, m_components.begin());
|
for (auto itComp = m_components.begin();
|
||||||
itComp != m_components.end(); ++itComp) {
|
itComp != m_components.end(); ++itComp) {
|
||||||
if ((*itComp)->getSceneType() == scene) {
|
if ((*itComp)->getSceneType() == scene) {
|
||||||
return *itComp;
|
return *itComp;
|
||||||
|
|
@ -525,13 +525,13 @@ UIScene* UILayer::addComponent(int iPad, EUIScene scene, void* initData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILayer::removeComponent(EUIScene scene) {
|
void UILayer::removeComponent(EUIScene scene) {
|
||||||
AUTO_VAR(it, m_componentRefCount.find(scene));
|
auto it = m_componentRefCount.find(scene);
|
||||||
if (it != m_componentRefCount.end()) {
|
if (it != m_componentRefCount.end()) {
|
||||||
--it->second.first;
|
--it->second.first;
|
||||||
|
|
||||||
if (it->second.first <= 0) {
|
if (it->second.first <= 0) {
|
||||||
m_componentRefCount.erase(it);
|
m_componentRefCount.erase(it);
|
||||||
for (AUTO_VAR(compIt, m_components.begin());
|
for (auto compIt = m_components.begin();
|
||||||
compIt != m_components.end();) {
|
compIt != m_components.end();) {
|
||||||
if ((*compIt)->getSceneType() == scene) {
|
if ((*compIt)->getSceneType() == scene) {
|
||||||
m_scenesToDelete.push_back((*compIt));
|
m_scenesToDelete.push_back((*compIt));
|
||||||
|
|
@ -548,8 +548,8 @@ void UILayer::removeComponent(EUIScene scene) {
|
||||||
|
|
||||||
void UILayer::removeScene(UIScene* scene) {
|
void UILayer::removeScene(UIScene* scene) {
|
||||||
|
|
||||||
AUTO_VAR(newEnd,
|
auto newEnd =
|
||||||
std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene));
|
std::remove(m_sceneStack.begin(), m_sceneStack.end(), scene);
|
||||||
m_sceneStack.erase(newEnd, m_sceneStack.end());
|
m_sceneStack.erase(newEnd, m_sceneStack.end());
|
||||||
|
|
||||||
m_scenesToDelete.push_back(scene);
|
m_scenesToDelete.push_back(scene);
|
||||||
|
|
@ -571,7 +571,7 @@ void UILayer::closeAllScenes() {
|
||||||
std::vector<UIScene*> temp;
|
std::vector<UIScene*> temp;
|
||||||
temp.insert(temp.end(), m_sceneStack.begin(), m_sceneStack.end());
|
temp.insert(temp.end(), m_sceneStack.begin(), m_sceneStack.end());
|
||||||
m_sceneStack.clear();
|
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);
|
m_scenesToDelete.push_back(*it);
|
||||||
(*it)->handleDestroy(); // For anything that might require the pointer
|
(*it)->handleDestroy(); // For anything that might require the pointer
|
||||||
// be valid
|
// be valid
|
||||||
|
|
@ -612,7 +612,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) {
|
||||||
m_bIgnorePlayerJoinMenuDisplayed = false;
|
m_bIgnorePlayerJoinMenuDisplayed = false;
|
||||||
|
|
||||||
bool layerFocusSet = 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;
|
UIScene* scene = *it;
|
||||||
|
|
||||||
// UPDATE FOCUS STATES
|
// UPDATE FOCUS STATES
|
||||||
|
|
@ -695,7 +695,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) {
|
||||||
void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed,
|
void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||||
bool released, bool& handled) {
|
bool released, bool& handled) {
|
||||||
// Note: reverse iterator, the last element is the top of the stack
|
// 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;
|
UIScene* scene = *it;
|
||||||
if (scene->hasFocus(iPad) && scene->canHandleInput()) {
|
if (scene->hasFocus(iPad) && scene->canHandleInput()) {
|
||||||
// 4J-PB - ignore repeats of action ABXY buttons
|
// 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() {
|
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;
|
UIScene* topScene = *it;
|
||||||
app.DebugPrintf("UILayer::HandleDLCMountingComplete - topScene\n");
|
app.DebugPrintf("UILayer::HandleDLCMountingComplete - topScene\n");
|
||||||
topScene->HandleDLCMountingComplete();
|
topScene->HandleDLCMountingComplete();
|
||||||
|
|
@ -727,7 +727,7 @@ void UILayer::HandleDLCMountingComplete() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILayer::HandleDLCInstalled() {
|
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;
|
UIScene* topScene = *it;
|
||||||
topScene->HandleDLCInstalled();
|
topScene->HandleDLCInstalled();
|
||||||
}
|
}
|
||||||
|
|
@ -735,7 +735,7 @@ void UILayer::HandleDLCInstalled() {
|
||||||
|
|
||||||
|
|
||||||
void UILayer::HandleMessage(EUIMessage message, void* data) {
|
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;
|
UIScene* topScene = *it;
|
||||||
topScene->HandleMessage(message, data);
|
topScene->HandleMessage(message, data);
|
||||||
}
|
}
|
||||||
|
|
@ -748,7 +748,7 @@ C4JRender::eViewportType UILayer::getViewport() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILayer::handleUnlockFullVersion() {
|
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();
|
(*it)->handleUnlockFullVersion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -757,10 +757,10 @@ void UILayer::PrintTotalMemoryUsage(int64_t& totalStatic,
|
||||||
int64_t& totalDynamic) {
|
int64_t& totalDynamic) {
|
||||||
int64_t layerStatic = 0;
|
int64_t layerStatic = 0;
|
||||||
int64_t layerDynamic = 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);
|
(*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);
|
(*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic);
|
||||||
}
|
}
|
||||||
app.DebugPrintf(app.USER_SR, " \\- Layer static: %d , Layer dynamic: %d\n",
|
app.DebugPrintf(app.USER_SR, " \\- Layer static: %d , Layer dynamic: %d\n",
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ UIScene::~UIScene() {
|
||||||
/* Destroy the Iggy player. */
|
/* Destroy the Iggy player. */
|
||||||
IggyPlayerDestroy(swf);
|
IggyPlayerDestroy(swf);
|
||||||
|
|
||||||
for (AUTO_VAR(it, m_registeredTextures.begin());
|
for (auto it = m_registeredTextures.begin();
|
||||||
it != m_registeredTextures.end(); ++it) {
|
it != m_registeredTextures.end(); ++it) {
|
||||||
ui.unregisterSubstitutionTexture(it->first, it->second);
|
ui.unregisterSubstitutionTexture(it->first, it->second);
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ void UIScene::reloadMovie(bool force) {
|
||||||
handlePreReload();
|
handlePreReload();
|
||||||
|
|
||||||
// Reload controls
|
// 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();
|
(*it)->ReInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -377,7 +377,7 @@ void UIScene::tick() {
|
||||||
if (m_hasTickedOnce) m_bCanHandleInput = true;
|
if (m_hasTickedOnce) m_bCanHandleInput = true;
|
||||||
while (IggyPlayerReadyToTick(swf)) {
|
while (IggyPlayerReadyToTick(swf)) {
|
||||||
tickTimers();
|
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();
|
(*it)->tick();
|
||||||
}
|
}
|
||||||
IggyPlayerTickRS(swf);
|
IggyPlayerTickRS(swf);
|
||||||
|
|
@ -398,7 +398,7 @@ void UIScene::addTimer(int id, int ms) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIScene::killTimer(int id) {
|
void UIScene::killTimer(int id) {
|
||||||
AUTO_VAR(it, m_timers.find(id));
|
auto it = m_timers.find(id);
|
||||||
if (it != m_timers.end()) {
|
if (it != m_timers.end()) {
|
||||||
it->second.running = false;
|
it->second.running = false;
|
||||||
}
|
}
|
||||||
|
|
@ -406,7 +406,7 @@ void UIScene::killTimer(int id) {
|
||||||
|
|
||||||
void UIScene::tickTimers() {
|
void UIScene::tickTimers() {
|
||||||
int currentTime = System::currentTimeMillis();
|
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) {
|
if (!it->second.running) {
|
||||||
it = m_timers.erase(it);
|
it = m_timers.erase(it);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -423,7 +423,7 @@ void UIScene::tickTimers() {
|
||||||
|
|
||||||
IggyName UIScene::registerFastName(const std::wstring& name) {
|
IggyName UIScene::registerFastName(const std::wstring& name) {
|
||||||
IggyName var;
|
IggyName var;
|
||||||
AUTO_VAR(it, m_fastNames.find(name));
|
auto it = m_fastNames.find(name);
|
||||||
if (it != m_fastNames.end()) {
|
if (it != m_fastNames.end()) {
|
||||||
var = it->second;
|
var = it->second;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -551,7 +551,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion* region,
|
||||||
|
|
||||||
PIXBeginNamedEvent(0, "Draw all cache");
|
PIXBeginNamedEvent(0, "Draw all cache");
|
||||||
// Draw all the cached slots
|
// Draw all the cached slots
|
||||||
for (AUTO_VAR(it, m_cachedSlotDraw.begin());
|
for (auto it = m_cachedSlotDraw.begin();
|
||||||
it != m_cachedSlotDraw.end(); ++it) {
|
it != m_cachedSlotDraw.end(); ++it) {
|
||||||
CachedSlotDrawData* drawData = *it;
|
CachedSlotDrawData* drawData = *it;
|
||||||
ui.setupCustomDrawMatrices(this,
|
ui.setupCustomDrawMatrices(this,
|
||||||
|
|
@ -1094,7 +1094,7 @@ void UIScene::registerSubstitutionTexture(const std::wstring& textureName,
|
||||||
|
|
||||||
bool UIScene::hasRegisteredSubstitutionTexture(
|
bool UIScene::hasRegisteredSubstitutionTexture(
|
||||||
const std::wstring& textureName) {
|
const std::wstring& textureName) {
|
||||||
AUTO_VAR(it, m_registeredTextures.find(textureName));
|
auto it = m_registeredTextures.find(textureName);
|
||||||
|
|
||||||
return it != m_registeredTextures.end();
|
return it != m_registeredTextures.end();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ private:
|
||||||
IggyMemoryUseInfo& memoryInfo);
|
IggyMemoryUseInfo& memoryInfo);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void PrintTotalMemoryUsage(__int64& totalStatic, __int64& totalDynamic);
|
void PrintTotalMemoryUsage(int64_t& totalStatic, int64_t& totalDynamic);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UIScene(int iPad, UILayer* parentLayer);
|
UIScene(int iPad, UILayer* parentLayer);
|
||||||
|
|
|
||||||
|
|
@ -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();
|
HandleInventoryUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ protected:
|
||||||
virtual void UpdateMultiPanel();
|
virtual void UpdateMultiPanel();
|
||||||
|
|
||||||
virtual void HandleMessage(EUIMessage message, void* data);
|
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
|
// 4J - TomK If update tooltips is called then make sure the correct parent
|
||||||
// is invoked! (both UIScene AND IUIScene_CraftingMenu have an instance of
|
// is invoked! (both UIScene AND IUIScene_CraftingMenu have an instance of
|
||||||
|
|
|
||||||
|
|
@ -708,12 +708,12 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass,
|
||||||
|
|
||||||
// start the game
|
// start the game
|
||||||
bool isFlat = pClass->m_MoreOptionsParams.bFlatWorld;
|
bool isFlat = pClass->m_MoreOptionsParams.bFlatWorld;
|
||||||
__int64 seedValue = 0;
|
int64_t seedValue = 0;
|
||||||
|
|
||||||
NetworkGameInitData* param = new NetworkGameInitData();
|
NetworkGameInitData* param = new NetworkGameInitData();
|
||||||
|
|
||||||
if (wSeed.length() != 0) {
|
if (wSeed.length() != 0) {
|
||||||
__int64 value = 0;
|
int64_t value = 0;
|
||||||
unsigned int len = (unsigned int)wSeed.length();
|
unsigned int len = (unsigned int)wSeed.length();
|
||||||
|
|
||||||
// Check if the input string contains a numerical value
|
// 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 the input string is a numerical value, convert it to a number
|
||||||
if (isNumber) value = _fromString<__int64>(wSeed);
|
if (isNumber) value = _fromString<int64_t>(wSeed);
|
||||||
|
|
||||||
// If the value is not 0 use it, otherwise use the algorithm from the
|
// If the value is not 0 use it, otherwise use the algorithm from the
|
||||||
// java String.hashCode() function to hash it
|
// java String.hashCode() function to hash it
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) {
|
||||||
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
||||||
uiIDA, 2, m_iPad,
|
uiIDA, 2, m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
} else {
|
} else {
|
||||||
if (g_NetworkManager.IsHost()) {
|
if (g_NetworkManager.IsHost()) {
|
||||||
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
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,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3,
|
||||||
m_iPad,
|
m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameSaveDialogReturned,
|
&IUIScene_PauseMenu::ExitGameSaveDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
} else {
|
} else {
|
||||||
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
||||||
uiIDA[1] = IDS_CONFIRM_OK;
|
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,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2,
|
||||||
m_iPad,
|
m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -149,7 +149,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) {
|
||||||
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
||||||
uiIDA, 2, m_iPad,
|
uiIDA, 2, m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
} else {
|
} else {
|
||||||
TelemetryManager->RecordLevelExit(
|
TelemetryManager->RecordLevelExit(
|
||||||
m_iPad, eSen_LevelExitStatus_Failed);
|
m_iPad, eSen_LevelExitStatus_Failed);
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ void UIScene_EndPoem::updateNoise() {
|
||||||
|
|
||||||
std::wstring tag = L"{*NOISE*}";
|
std::wstring tag = L"{*NOISE*}";
|
||||||
|
|
||||||
AUTO_VAR(it, m_noiseLengths.begin());
|
auto it = m_noiseLengths.begin();
|
||||||
int found = (int)noiseString.find(tag);
|
int found = (int)noiseString.find(tag);
|
||||||
while (found != std::string::npos && it != m_noiseLengths.end()) {
|
while (found != std::string::npos && it != m_noiseLengths.end()) {
|
||||||
length = *it;
|
length = *it;
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay() {
|
||||||
int iValue = 0;
|
int iValue = 0;
|
||||||
IggyDataValue* UpdateValue = new IggyDataValue[activeEffects->size() * 2];
|
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) {
|
++it) {
|
||||||
MobEffectInstance* effect = *it;
|
MobEffectInstance* effect = *it;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu() {
|
||||||
app.SetLiveLinkRequired(false);
|
app.SetLiveLinkRequired(false);
|
||||||
|
|
||||||
if (m_currentSessions) {
|
if (m_currentSessions) {
|
||||||
for (AUTO_VAR(it, m_currentSessions->begin());
|
for (auto it = m_currentSessions->begin();
|
||||||
it < m_currentSessions->end(); ++it) {
|
it < m_currentSessions->end(); ++it) {
|
||||||
delete (*it);
|
delete (*it);
|
||||||
}
|
}
|
||||||
|
|
@ -641,7 +641,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (AUTO_VAR(it, app.getLevelGenerators()->begin());
|
for (auto it = app.getLevelGenerators()->begin();
|
||||||
it != app.getLevelGenerators()->end(); ++it) {
|
it != app.getLevelGenerators()->end(); ++it) {
|
||||||
LevelGenerationOptions* levelGen = *it;
|
LevelGenerationOptions* levelGen = *it;
|
||||||
|
|
||||||
|
|
@ -1176,7 +1176,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() {
|
||||||
unsigned int sessionIndex = 0;
|
unsigned int sessionIndex = 0;
|
||||||
m_buttonListGames.setCurrentSelection(0);
|
m_buttonListGames.setCurrentSelection(0);
|
||||||
|
|
||||||
for (AUTO_VAR(it, m_currentSessions->begin());
|
for (auto it = m_currentSessions->begin();
|
||||||
it < m_currentSessions->end(); ++it) {
|
it < m_currentSessions->end(); ++it) {
|
||||||
FriendSessionInfo* sessionInfo = *it;
|
FriendSessionInfo* sessionInfo = *it;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
|
||||||
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
||||||
uiIDA, 2, m_iPad,
|
uiIDA, 2, m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
} else {
|
} else {
|
||||||
if (g_NetworkManager.IsHost()) {
|
if (g_NetworkManager.IsHost()) {
|
||||||
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
||||||
|
|
@ -374,14 +374,14 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
|
||||||
uiIDA, 3, m_iPad,
|
uiIDA, 3, m_iPad,
|
||||||
&UIScene_PauseMenu::
|
&UIScene_PauseMenu::
|
||||||
ExitGameSaveDialogReturned,
|
ExitGameSaveDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
} else {
|
} else {
|
||||||
ui.RequestAlertMessage(
|
ui.RequestAlertMessage(
|
||||||
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA,
|
||||||
3, m_iPad,
|
3, m_iPad,
|
||||||
&UIScene_PauseMenu::
|
&UIScene_PauseMenu::
|
||||||
ExitGameSaveDialogReturned,
|
ExitGameSaveDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uiIDA[0] = IDS_CONFIRM_CANCEL;
|
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,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2,
|
||||||
m_iPad,
|
m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -427,7 +427,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) {
|
||||||
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST,
|
||||||
uiIDA, 2, m_iPad,
|
uiIDA, 2, m_iPad,
|
||||||
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
&IUIScene_PauseMenu::ExitGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int playTime = -1;
|
int playTime = -1;
|
||||||
|
|
@ -460,7 +460,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() {
|
||||||
ui.RequestAlertMessage(IDS_UNLOCK_TITLE, IDS_UNLOCK_TOSAVE_TEXT,
|
ui.RequestAlertMessage(IDS_UNLOCK_TITLE, IDS_UNLOCK_TOSAVE_TEXT,
|
||||||
uiIDA, 2, m_iPad,
|
uiIDA, 2, m_iPad,
|
||||||
&UIScene_PauseMenu::UnlockFullSaveReturned,
|
&UIScene_PauseMenu::UnlockFullSaveReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -488,7 +488,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() {
|
||||||
IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
|
IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE,
|
||||||
IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, m_iPad,
|
IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, m_iPad,
|
||||||
&UIScene_PauseMenu::WarningTrialTexturePackReturned,
|
&UIScene_PauseMenu::WarningTrialTexturePackReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -512,7 +512,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() {
|
||||||
ui.RequestAlertMessage(
|
ui.RequestAlertMessage(
|
||||||
IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2,
|
IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2,
|
||||||
m_iPad, &IUIScene_PauseMenu::SaveGameDialogReturned,
|
m_iPad, &IUIScene_PauseMenu::SaveGameDialogReturned,
|
||||||
(LPVOID)GetCallbackUniqueId());
|
(void*)GetCallbackUniqueId());
|
||||||
} else {
|
} else {
|
||||||
// flag a app action of save game
|
// flag a app action of save game
|
||||||
app.SetAction(m_iPad, eAppAction_SaveGame);
|
app.SetAction(m_iPad, eAppAction_SaveGame);
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public:
|
||||||
virtual void handleInput(int iPad, int key, bool repeat, bool pressed,
|
virtual void handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||||
bool released, bool& handled);
|
bool released, bool& handled);
|
||||||
// 4jcraft: made public for thumbnail thunk
|
// 4jcraft: made public for thumbnail thunk
|
||||||
static int AvatarReturned(LPVOID lpParam, PBYTE pbThumbnail,
|
static int AvatarReturned(void* lpParam, PBYTE pbThumbnail,
|
||||||
DWORD dwThumbnailBytes);
|
DWORD dwThumbnailBytes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -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();
|
HandleInventoryUpdated();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ protected:
|
||||||
virtual void setOfferDescription(std::vector<HtmlString>* description);
|
virtual void setOfferDescription(std::vector<HtmlString>* description);
|
||||||
|
|
||||||
virtual void HandleMessage(EUIMessage message, void* data);
|
virtual void HandleMessage(EUIMessage message, void* data);
|
||||||
void handleInventoryUpdated(LPVOID data);
|
void handleInventoryUpdated(void* data);
|
||||||
|
|
||||||
int getPad() { return m_iPad; }
|
int getPad() { return m_iPad; }
|
||||||
};
|
};
|
||||||
|
|
@ -392,8 +392,8 @@ typedef struct _MessageBoxInfo {
|
||||||
UINT* uiOptionA;
|
UINT* uiOptionA;
|
||||||
UINT uiOptionC;
|
UINT uiOptionC;
|
||||||
DWORD dwPad;
|
DWORD dwPad;
|
||||||
int (*Func)(LPVOID, int, const C4JStorage::EMessageResult);
|
int (*Func)(void*, int, const C4JStorage::EMessageResult);
|
||||||
LPVOID lpParam;
|
void* lpParam;
|
||||||
// C4JStringTable *pStringTable; // 4J Stu - We don't need this for our
|
// C4JStringTable *pStringTable; // 4J Stu - We don't need this for our
|
||||||
// internal message boxes
|
// internal message boxes
|
||||||
wchar_t* pwchFormatString;
|
wchar_t* pwchFormatString;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ UITTFFont::UITTFFont(const std::string& name, const std::string& path,
|
||||||
app.FatalLoadError();
|
app.FatalLoadError();
|
||||||
}
|
}
|
||||||
|
|
||||||
const __int64 endPosition = PortableFileIO::Tell(file);
|
const int64_t endPosition = PortableFileIO::Tell(file);
|
||||||
if (endPosition < 0) {
|
if (endPosition < 0) {
|
||||||
std::fclose(file);
|
std::fclose(file);
|
||||||
app.FatalLoadError();
|
app.FatalLoadError();
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ VOID XMLParser::FillBuffer()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dwCharsConsumed += NChars;
|
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_pISAXCallback->SetParseProgress( (DWORD)iProgress );
|
||||||
|
|
||||||
m_pReadBuf[ NChars ] = '\0';
|
m_pReadBuf[ NChars ] = '\0';
|
||||||
|
|
@ -344,7 +344,7 @@ HRESULT XMLParser::AdvanceName()
|
||||||
// and getting another chunk of the file if needed
|
// and getting another chunk of the file if needed
|
||||||
// Returns S_OK if there are more characters, E_ABORT for no characters to read
|
// 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 )
|
if( m_bSkipNextAdvance )
|
||||||
{
|
{
|
||||||
|
|
@ -737,7 +737,7 @@ ISAXCallback* XMLParser::GetSAXCallbackInterface()
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
HRESULT XMLParser::MainParseLoop()
|
HRESULT XMLParser::MainParseLoop()
|
||||||
{
|
{
|
||||||
BOOL bWhiteSpaceOnly = TRUE;
|
bool bWhiteSpaceOnly = TRUE;
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
if( FAILED( m_pISAXCallback->StartDocument() ) )
|
if( FAILED( m_pISAXCallback->StartDocument() ) )
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,11 @@ public:
|
||||||
|
|
||||||
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
|
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
|
||||||
CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0;
|
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 ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0;
|
||||||
|
|
||||||
virtual HRESULT CDATABegin( ) = 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 HRESULT CDATAEnd( ) = 0;
|
||||||
|
|
||||||
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
|
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
|
||||||
|
|
@ -111,7 +111,7 @@ public:
|
||||||
private:
|
private:
|
||||||
HRESULT MainParseLoop();
|
HRESULT MainParseLoop();
|
||||||
|
|
||||||
HRESULT AdvanceCharacter( BOOL bOkToFail = FALSE );
|
HRESULT AdvanceCharacter( bool bOkToFail = FALSE );
|
||||||
VOID SkipNextAdvance();
|
VOID SkipNextAdvance();
|
||||||
|
|
||||||
HRESULT ConsumeSpace();
|
HRESULT ConsumeSpace();
|
||||||
|
|
@ -144,10 +144,10 @@ private:
|
||||||
BYTE* m_pReadPtr;
|
BYTE* m_pReadPtr;
|
||||||
WCHAR* m_pWritePtr; // write pointer within m_pBuf
|
WCHAR* m_pWritePtr; // write pointer within m_pBuf
|
||||||
|
|
||||||
BOOL m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
|
bool m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
|
||||||
BOOL m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
|
bool m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
|
||||||
|
|
||||||
BOOL m_bSkipNextAdvance;
|
bool m_bSkipNextAdvance;
|
||||||
WCHAR m_Ch; // Current character being parsed
|
WCHAR m_Ch; // Current character being parsed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; };
|
||||||
|
|
||||||
virtual HRESULT CDATABegin( ) { 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; };
|
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 ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; };
|
||||||
|
|
||||||
virtual HRESULT CDATABegin( ) { 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; };
|
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 ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; };
|
||||||
|
|
||||||
virtual HRESULT CDATABegin( ) { 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; };
|
virtual HRESULT CDATAEnd( ){ return S_OK; };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEF
|
||||||
|
|
||||||
void XSetThreadProcessor(HANDLE a, int b) {}
|
void XSetThreadProcessor(HANDLE a, int b) {}
|
||||||
// #if !(0) && !(0)
|
// #if !(0) && !(0)
|
||||||
// BOOL XCloseHandle(HANDLE a) { return CloseHandle(a); }
|
// bool XCloseHandle(HANDLE a) { return CloseHandle(a); }
|
||||||
// #endif // 0
|
// #endif // 0
|
||||||
|
|
||||||
DWORD XUserGetSigninInfo(
|
DWORD XUserGetSigninInfo(
|
||||||
|
|
@ -181,7 +181,7 @@ LPCWSTR CXuiStringTable::Lookup(UINT nIndex) { return L"String"; }
|
||||||
void CXuiStringTable::Clear() {}
|
void CXuiStringTable::Clear() {}
|
||||||
HRESULT CXuiStringTable::Load(LPCWSTR szId) { return S_OK; }
|
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(
|
HRESULT XMemDecompress(
|
||||||
XMEMDECOMPRESSION_CONTEXT Context,
|
XMEMDECOMPRESSION_CONTEXT Context,
|
||||||
|
|
@ -302,7 +302,7 @@ void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context)
|
||||||
//#if 1
|
//#if 1
|
||||||
DWORD XGetLanguage() { return 1; }
|
DWORD XGetLanguage() { return 1; }
|
||||||
DWORD XGetLocale() { return 0; }
|
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__)
|
#if defined(__linux__)
|
||||||
C4JStorage::C4JStorage() {}
|
C4JStorage::C4JStorage() {}
|
||||||
void C4JStorage::Tick() {}
|
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; }
|
C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; }
|
||||||
bool C4JStorage::SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice) { return true; }
|
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)(LPVOID, const ESavingMessage, int),LPVOID lpParam) {}
|
void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(void*, const ESavingMessage, int),void* lpParam) {}
|
||||||
void C4JStorage::ResetSaveData() {}
|
void C4JStorage::ResetSaveData() {}
|
||||||
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName) {}
|
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName) {}
|
||||||
void C4JStorage::SetSaveTitle(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::GetSaveUniqueNumber(INT *piVal) { return true; }
|
||||||
bool C4JStorage::GetSaveUniqueFilename(char *pszName) { return true; }
|
bool C4JStorage::GetSaveUniqueFilename(char *pszName) { return true; }
|
||||||
void C4JStorage::SetSaveUniqueFilename(char *szFilename) { }
|
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) {}
|
void C4JStorage::SetSaveDisabled(bool bDisable) {}
|
||||||
bool C4JStorage::GetSaveDisabled(void) { return false; }
|
bool C4JStorage::GetSaveDisabled(void) { return false; }
|
||||||
unsigned int C4JStorage::GetSaveSize() { return 0; }
|
unsigned int C4JStorage::GetSaveSize() { return 0; }
|
||||||
void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {}
|
void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {}
|
||||||
PVOID C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; }
|
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::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) {}
|
void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {}
|
||||||
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; }
|
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; }
|
||||||
C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { return C4JStorage::ELoadGame_Idle; }
|
C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { return C4JStorage::ELoadGame_Idle; }
|
||||||
bool C4JStorage::EnoughSpaceForAMinSaveGame() { return true; }
|
bool C4JStorage::EnoughSpaceForAMinSaveGame() { return true; }
|
||||||
void C4JStorage::SetSaveMessageVPosition(float fY) {}
|
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::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)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_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,XCONTENT_DATA &xContentData) {}
|
||||||
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t * *ppbImageData, unsigned int *pImageBytes) {}
|
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::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)(LPVOID lpParam,const bool), LPVOID lpParam) { return C4JStorage::EDeleteGame_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;}
|
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) {}
|
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; }
|
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; }
|
unsigned int C4JStorage::CancelGetDLCOffers() { return 0; }
|
||||||
void C4JStorage::ClearDLCOffers() {}
|
void C4JStorage::ClearDLCOffers() {}
|
||||||
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; }
|
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; }
|
||||||
int C4JStorage::GetOfferCount() { return 0; }
|
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; }
|
unsigned int C4JStorage::GetAvailableDLCCount( int iPad) { return 0; }
|
||||||
XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA retval = {0}; return retval; }
|
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; }
|
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,LPCSTR szMountDrive) { return 0; }
|
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(LPCSTR 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)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
|
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::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; }
|
bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; }
|
||||||
void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {}
|
void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {}
|
||||||
unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; }
|
unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; }
|
||||||
|
|
||||||
struct PTMSPP_FILEDATA;
|
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
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -521,25 +521,25 @@ C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGloba
|
||||||
HRESULT CSentientManager::Init() { return S_OK; }
|
HRESULT CSentientManager::Init() { return S_OK; }
|
||||||
HRESULT CSentientManager::Tick() { return S_OK; }
|
HRESULT CSentientManager::Tick() { return S_OK; }
|
||||||
HRESULT CSentientManager::Flush() { return S_OK; }
|
HRESULT CSentientManager::Flush() { return S_OK; }
|
||||||
BOOL CSentientManager::RecordPlayerSessionStart(DWORD dwUserId) { return true; }
|
bool CSentientManager::RecordPlayerSessionStart(DWORD dwUserId) { return true; }
|
||||||
BOOL CSentientManager::RecordPlayerSessionExit(DWORD dwUserId, int exitStatus) { return true; }
|
bool CSentientManager::RecordPlayerSessionExit(DWORD dwUserId, int exitStatus) { return true; }
|
||||||
BOOL CSentientManager::RecordHeartBeat(DWORD dwUserId) { 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::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::RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus) { return true; }
|
||||||
BOOL CSentientManager::RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes) { 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::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::RecordPauseOrInactive(DWORD dwUserId) { return true; }
|
||||||
BOOL CSentientManager::RecordUnpauseOrActive(DWORD dwUserId) { return true; }
|
bool CSentientManager::RecordUnpauseOrActive(DWORD dwUserId) { return true; }
|
||||||
BOOL CSentientManager::RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID) { 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::RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore) { return true; }
|
||||||
BOOL CSentientManager::RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) { 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::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::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::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::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::RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId) { return true; }
|
||||||
BOOL CSentientManager::RecordBanLevel(DWORD dwUserId) { return true; }
|
bool CSentientManager::RecordBanLevel(DWORD dwUserId) { return true; }
|
||||||
BOOL CSentientManager::RecordUnBanLevel(DWORD dwUserId) { return true; }
|
bool CSentientManager::RecordUnBanLevel(DWORD dwUserId) { return true; }
|
||||||
INT CSentientManager::GetMultiplayerInstanceID() { return 0; }
|
INT CSentientManager::GetMultiplayerInstanceID() { return 0; }
|
||||||
INT CSentientManager::GenerateMultiplayerInstanceId() { return 0; }
|
INT CSentientManager::GenerateMultiplayerInstanceId() { return 0; }
|
||||||
void CSentientManager::SetMultiplayerInstanceId(INT value) {}
|
void CSentientManager::SetMultiplayerInstanceId(INT value) {}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() {
|
||||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||||
|
|
||||||
bool isFlat = false;
|
bool isFlat = false;
|
||||||
__int64 seedValue =
|
int64_t seedValue =
|
||||||
0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal);
|
0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal);
|
||||||
// // 4J - was (new Random())->nextLong() - now trying to actually
|
// // 4J - was (new Random())->nextLong() - now trying to actually
|
||||||
// find a seed to suit our requirements
|
// find a seed to suit our requirements
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES] = {
|
||||||
uint8_t* AddRichPresenceString(int iID);
|
uint8_t* AddRichPresenceString(int iID);
|
||||||
void FreeRichPresenceStrings();
|
void FreeRichPresenceStrings();
|
||||||
|
|
||||||
BOOL g_bWidescreen = TRUE;
|
bool g_bWidescreen = TRUE;
|
||||||
|
|
||||||
void DefineActions(void) {
|
void DefineActions(void) {
|
||||||
// The app needs to define the actions required, and the possible mappings
|
// The app needs to define the actions required, and the possible mappings
|
||||||
|
|
@ -583,7 +583,7 @@ HRESULT InitDevice() {
|
||||||
// Create a render target view
|
// Create a render target view
|
||||||
ID3D11Texture2D* pBackBuffer = nullptr;
|
ID3D11Texture2D* pBackBuffer = nullptr;
|
||||||
hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D),
|
hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D),
|
||||||
(LPVOID*)&pBackBuffer);
|
(void**)&pBackBuffer);
|
||||||
if (FAILED(hr)) return hr;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
// Create a depth stencil buffer
|
// Create a depth stencil buffer
|
||||||
|
|
@ -716,7 +716,7 @@ int main(int argc, const char* argv[]) {
|
||||||
StorageManager.Init(0, app.GetString(IDS_DEFAULT_SAVENAME),
|
StorageManager.Init(0, app.GetString(IDS_DEFAULT_SAVENAME),
|
||||||
(char*)"savegame.dat", FIFTY_ONE_MB,
|
(char*)"savegame.dat", FIFTY_ONE_MB,
|
||||||
&CConsoleMinecraftApp::DisplaySavingMessage,
|
&CConsoleMinecraftApp::DisplaySavingMessage,
|
||||||
(LPVOID)&app, (char*)"");
|
(void*)&app, (char*)"");
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
// Initialise //
|
// Initialise //
|
||||||
|
|
@ -1049,7 +1049,7 @@ volatile int sectCheck = 48;
|
||||||
CRITICAL_SECTION memCS;
|
CRITICAL_SECTION memCS;
|
||||||
DWORD tlsIdx;
|
DWORD tlsIdx;
|
||||||
|
|
||||||
LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
||||||
if (!trackStarted) {
|
if (!trackStarted) {
|
||||||
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
||||||
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
||||||
|
|
@ -1142,7 +1142,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
|
||||||
|
|
||||||
void DumpMem() {
|
void DumpMem() {
|
||||||
int totalLeak = 0;
|
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) {
|
if (it->second > 0) {
|
||||||
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
|
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
|
||||||
it->first & 0x03ffffff, it->second,
|
it->first & 0x03ffffff, it->second,
|
||||||
|
|
@ -1176,7 +1176,7 @@ void MemSect(int section) {
|
||||||
} else {
|
} else {
|
||||||
value = (value << 6) | section;
|
value = (value << 6) | section;
|
||||||
}
|
}
|
||||||
TlsSetValue(tlsIdx, (LPVOID)value);
|
TlsSetValue(tlsIdx, (void*)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemPixStuff() {
|
void MemPixStuff() {
|
||||||
|
|
@ -1184,7 +1184,7 @@ void MemPixStuff() {
|
||||||
|
|
||||||
int totals[MAX_SECT] = {0};
|
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) {
|
if (it->second > 0) {
|
||||||
int sect = (it->first >> 26) & 0x3f;
|
int sect = (it->first >> 26) & 0x3f;
|
||||||
int bytes = it->first & 0x03ffffff;
|
int bytes = it->first & 0x03ffffff;
|
||||||
|
|
|
||||||
|
|
@ -26,45 +26,45 @@ public:
|
||||||
|
|
||||||
HRESULT Flush();
|
HRESULT Flush();
|
||||||
|
|
||||||
BOOL RecordPlayerSessionStart(DWORD dwUserId);
|
bool RecordPlayerSessionStart(DWORD dwUserId);
|
||||||
BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus);
|
bool RecordPlayerSessionExit(DWORD dwUserId, int exitStatus);
|
||||||
BOOL RecordHeartBeat(DWORD dwUserId);
|
bool RecordHeartBeat(DWORD dwUserId);
|
||||||
BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
bool RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
||||||
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
||||||
DWORD numberOfLocalPlayers,
|
DWORD numberOfLocalPlayers,
|
||||||
DWORD numberOfOnlinePlayers);
|
DWORD numberOfOnlinePlayers);
|
||||||
BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus);
|
bool RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus);
|
||||||
BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID,
|
bool RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID,
|
||||||
INT saveSizeInBytes);
|
INT saveSizeInBytes);
|
||||||
BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
bool RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
||||||
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
||||||
DWORD numberOfLocalPlayers,
|
DWORD numberOfLocalPlayers,
|
||||||
DWORD numberOfOnlinePlayers, INT saveOrCheckPointID);
|
DWORD numberOfOnlinePlayers, INT saveOrCheckPointID);
|
||||||
BOOL RecordPauseOrInactive(DWORD dwUserId);
|
bool RecordPauseOrInactive(DWORD dwUserId);
|
||||||
BOOL RecordUnpauseOrActive(DWORD dwUserId);
|
bool RecordUnpauseOrActive(DWORD dwUserId);
|
||||||
BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID);
|
bool RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID);
|
||||||
BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID,
|
bool RecordAchievementUnlocked(DWORD dwUserId, INT achievementID,
|
||||||
INT achievementGamerscore);
|
INT achievementGamerscore);
|
||||||
BOOL RecordMediaShareUpload(DWORD dwUserId,
|
bool RecordMediaShareUpload(DWORD dwUserId,
|
||||||
ESen_MediaDestination mediaDestination,
|
ESen_MediaDestination mediaDestination,
|
||||||
ESen_MediaType mediaType);
|
ESen_MediaType mediaType);
|
||||||
BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId,
|
bool RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId,
|
||||||
INT marketplaceOfferID);
|
INT marketplaceOfferID);
|
||||||
BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId,
|
bool RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId,
|
||||||
INT marketplaceOfferID,
|
INT marketplaceOfferID,
|
||||||
ESen_UpsellOutcome upsellOutcome);
|
ESen_UpsellOutcome upsellOutcome);
|
||||||
BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX,
|
bool RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX,
|
||||||
INT lowResMapY, INT lowResMapZ, INT mapID,
|
INT lowResMapY, INT lowResMapZ, INT mapID,
|
||||||
INT playerWeaponID, INT enemyWeaponID,
|
INT playerWeaponID, INT enemyWeaponID,
|
||||||
ETelemetryChallenges enemyTypeID);
|
ETelemetryChallenges enemyTypeID);
|
||||||
BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX,
|
bool RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX,
|
||||||
INT lowResMapY, INT lowResMapZ, INT mapID,
|
INT lowResMapY, INT lowResMapZ, INT mapID,
|
||||||
INT playerWeaponID, INT enemyWeaponID,
|
INT playerWeaponID, INT enemyWeaponID,
|
||||||
ETelemetryChallenges enemyTypeID);
|
ETelemetryChallenges enemyTypeID);
|
||||||
|
|
||||||
BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId);
|
bool RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId);
|
||||||
BOOL RecordBanLevel(DWORD dwUserId);
|
bool RecordBanLevel(DWORD dwUserId);
|
||||||
BOOL RecordUnBanLevel(DWORD dwUserId);
|
bool RecordUnBanLevel(DWORD dwUserId);
|
||||||
|
|
||||||
INT GetMultiplayerInstanceID();
|
INT GetMultiplayerInstanceID();
|
||||||
INT GenerateMultiplayerInstanceId();
|
INT GenerateMultiplayerInstanceId();
|
||||||
|
|
|
||||||
|
|
@ -12,77 +12,77 @@
|
||||||
|
|
||||||
// PlayerSessionStart
|
// PlayerSessionStart
|
||||||
// Player signed in or joined
|
// 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
|
// PlayerSessionExit
|
||||||
// Player signed out or left
|
// 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
|
// HeartBeat
|
||||||
// Sent every 60 seconds by title
|
// Sent every 60 seconds by title
|
||||||
BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize );
|
bool SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize );
|
||||||
|
|
||||||
// LevelStart
|
// LevelStart
|
||||||
// Level started
|
// 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
|
// LevelExit
|
||||||
// Level exited
|
// 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
|
// LevelSaveOrCheckpoint
|
||||||
// Level saved explicitly or implicitly
|
// 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
|
// LevelResume
|
||||||
// Level resumed from a save or restarted at a checkpoint
|
// 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
|
// PauseOrInactive
|
||||||
// Player paused game or has become inactive, level and mode are for what the player is leaving
|
// 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
|
// UnpauseOrActive
|
||||||
// Player unpaused game or has become active, level and mode are for what the player is entering into
|
// 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
|
// MenuShown
|
||||||
// A menu screen or major menu area has been shown
|
// 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
|
// AchievementUnlocked
|
||||||
// An achievement was unlocked
|
// 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
|
// MediaShareUpload
|
||||||
// The user uploaded something to Kinect Share
|
// 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
|
// UpsellPresented
|
||||||
// The user is shown an upsell to purchase something
|
// 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
|
// UpsellResponded
|
||||||
// The user responded to the upsell
|
// 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
|
// PlayerDiedOrFailed
|
||||||
// The player died or failed a challenge - can be used for many types of failure
|
// 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
|
// EnemyKilledOrOvercome
|
||||||
// The player killed an enemy or overcame or solved a major challenge
|
// 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
|
// SkinChanged
|
||||||
// The player has changed their skin, level and mode are for what the player is currently in
|
// 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
|
// BanLevel
|
||||||
// The player has banned a level, level and mode are for what the player is currently in and banning
|
// 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
|
// UnBanLevel
|
||||||
// The player has ubbanned a level, level and mode are for what the player is currently in and unbanning
|
// 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 );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ typedef RECT D3D11_RECT;
|
||||||
typedef void ID3D11RenderTargetView;
|
typedef void ID3D11RenderTargetView;
|
||||||
typedef void ID3D11DepthStencilView;
|
typedef void ID3D11DepthStencilView;
|
||||||
typedef void ID3D11Buffer;
|
typedef void ID3D11Buffer;
|
||||||
// typedef DWORD (*PTHREAD_START_ROUTINE)( LPVOID lpThreadParameter);
|
// typedef DWORD (*PTHREAD_START_ROUTINE)( void* lpThreadParameter);
|
||||||
// typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
|
// typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
|
||||||
|
|
||||||
// Used only by windows/durango gdraw and UIController. Will be unnecessary once
|
// Used only by windows/durango gdraw and UIController. Will be unnecessary once
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,6 @@
|
||||||
|
|
||||||
#define S_OK 0
|
#define S_OK 0
|
||||||
typedef unsigned int DWORD;
|
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 wchar_t WCHAR;
|
||||||
typedef unsigned char BYTE;
|
typedef unsigned char BYTE;
|
||||||
typedef BYTE* PBYTE;
|
typedef BYTE* PBYTE;
|
||||||
|
|
@ -62,10 +57,7 @@ typedef size_t SIZE_T;
|
||||||
typedef WCHAR *LPWSTR, *PWSTR;
|
typedef WCHAR *LPWSTR, *PWSTR;
|
||||||
typedef unsigned char boolean; // java brainrot
|
typedef unsigned char boolean; // java brainrot
|
||||||
#define __debugbreak()
|
#define __debugbreak()
|
||||||
#define __int32 int
|
|
||||||
#define CONST const
|
#define CONST const
|
||||||
typedef int64_t __int64;
|
|
||||||
typedef uint64_t __uint64;
|
|
||||||
typedef unsigned long ULONG;
|
typedef unsigned long ULONG;
|
||||||
// typedef unsigned char byte;
|
// typedef unsigned char byte;
|
||||||
typedef short SHORT;
|
typedef short SHORT;
|
||||||
|
|
@ -429,7 +421,7 @@ static inline HANDLE CreateFile(const wchar_t* lpFileName,
|
||||||
dwFlagsAndAttributes, hTemplateFile);
|
dwFlagsAndAttributes, hTemplateFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL CloseHandle(HANDLE hObject) {
|
static inline bool CloseHandle(HANDLE hObject) {
|
||||||
if (hObject == INVALID_HANDLE_VALUE) return FALSE;
|
if (hObject == INVALID_HANDLE_VALUE) return FALSE;
|
||||||
return close((int)(intptr_t)hObject) == 0;
|
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);
|
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{};
|
struct stat st{};
|
||||||
if (fstat((int)(intptr_t)hFile, &st) != 0) return FALSE;
|
if (fstat((int)(intptr_t)hFile, &st) != 0) return FALSE;
|
||||||
if (lpFileSize) {
|
if (lpFileSize) {
|
||||||
|
|
@ -456,7 +448,7 @@ static inline BOOL GetFileSizeEx(HANDLE hFile, LARGE_INTEGER* lpFileSize) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL ReadFile(HANDLE hFile, void* lpBuffer,
|
static inline bool ReadFile(HANDLE hFile, void* lpBuffer,
|
||||||
DWORD nNumberOfBytesToRead,
|
DWORD nNumberOfBytesToRead,
|
||||||
DWORD* lpNumberOfBytesRead, void* lpOverlapped) {
|
DWORD* lpNumberOfBytesRead, void* lpOverlapped) {
|
||||||
ssize_t n = read((int)(intptr_t)hFile, lpBuffer, nNumberOfBytesToRead);
|
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;
|
return n >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL WriteFile(HANDLE hFile, const void* lpBuffer,
|
static inline bool WriteFile(HANDLE hFile, const void* lpBuffer,
|
||||||
DWORD nNumberOfBytesToWrite,
|
DWORD nNumberOfBytesToWrite,
|
||||||
DWORD* lpNumberOfBytesWritten,
|
DWORD* lpNumberOfBytesWritten,
|
||||||
void* lpOverlapped) {
|
void* lpOverlapped) {
|
||||||
|
|
@ -503,7 +495,7 @@ static inline DWORD GetFileAttributes(const char* lpFileName) {
|
||||||
return GetFileAttributesA(lpFileName);
|
return GetFileAttributesA(lpFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL GetFileAttributesExA(const char* lpFileName,
|
static inline bool GetFileAttributesExA(const char* lpFileName,
|
||||||
GET_FILEEX_INFO_LEVELS fInfoLevelId,
|
GET_FILEEX_INFO_LEVELS fInfoLevelId,
|
||||||
void* lpFileInformation) {
|
void* lpFileInformation) {
|
||||||
if (fInfoLevelId != GetFileExInfoStandard || !lpFileInformation)
|
if (fInfoLevelId != GetFileExInfoStandard || !lpFileInformation)
|
||||||
|
|
@ -521,36 +513,36 @@ static inline BOOL GetFileAttributesExA(const char* lpFileName,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL GetFileAttributesEx(const char* lpFileName,
|
static inline bool GetFileAttributesEx(const char* lpFileName,
|
||||||
GET_FILEEX_INFO_LEVELS fInfoLevelId,
|
GET_FILEEX_INFO_LEVELS fInfoLevelId,
|
||||||
void* lpFileInformation) {
|
void* lpFileInformation) {
|
||||||
return GetFileAttributesExA(lpFileName, fInfoLevelId, lpFileInformation);
|
return GetFileAttributesExA(lpFileName, fInfoLevelId, lpFileInformation);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL CreateDirectoryA(const char* lpPathName,
|
static inline bool CreateDirectoryA(const char* lpPathName,
|
||||||
void* lpSecurityAttributes) {
|
void* lpSecurityAttributes) {
|
||||||
return mkdir(lpPathName, 0755) == 0;
|
return mkdir(lpPathName, 0755) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL CreateDirectory(const char* lpPathName,
|
static inline bool CreateDirectory(const char* lpPathName,
|
||||||
void* lpSecurityAttributes) {
|
void* lpSecurityAttributes) {
|
||||||
return CreateDirectoryA(lpPathName, lpSecurityAttributes);
|
return CreateDirectoryA(lpPathName, lpSecurityAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL DeleteFileA(const char* lpFileName) {
|
static inline bool DeleteFileA(const char* lpFileName) {
|
||||||
return unlink(lpFileName) == 0;
|
return unlink(lpFileName) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL DeleteFile(const char* lpFileName) {
|
static inline bool DeleteFile(const char* lpFileName) {
|
||||||
return DeleteFileA(lpFileName);
|
return DeleteFileA(lpFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL MoveFileA(const char* lpExistingFileName,
|
static inline bool MoveFileA(const char* lpExistingFileName,
|
||||||
const char* lpNewFileName) {
|
const char* lpNewFileName) {
|
||||||
return rename(lpExistingFileName, lpNewFileName) == 0;
|
return rename(lpExistingFileName, lpNewFileName) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL MoveFile(const char* lpExistingFileName,
|
static inline bool MoveFile(const char* lpExistingFileName,
|
||||||
const char* lpNewFileName) {
|
const char* lpNewFileName) {
|
||||||
return MoveFileA(lpExistingFileName, 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
|
// 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) {
|
WIN32_FIND_DATAA* lpFindFileData) {
|
||||||
if (hFindFile == INVALID_HANDLE_VALUE || !lpFindFileData) return FALSE;
|
if (hFindFile == INVALID_HANDLE_VALUE || !lpFindFileData) return FALSE;
|
||||||
_LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile;
|
_LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile;
|
||||||
|
|
@ -642,13 +634,13 @@ static inline BOOL FindNextFileA(HANDLE hFindFile,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL FindNextFile(HANDLE hFindFile,
|
static inline bool FindNextFile(HANDLE hFindFile,
|
||||||
WIN32_FIND_DATAA* lpFindFileData) {
|
WIN32_FIND_DATAA* lpFindFileData) {
|
||||||
return FindNextFileA(hFindFile, lpFindFileData);
|
return FindNextFileA(hFindFile, lpFindFileData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findclose
|
// 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;
|
if (hFindFile == INVALID_HANDLE_VALUE) return FALSE;
|
||||||
_LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile;
|
_LINUXSTUBS_FIND_HANDLE* fh = (_LINUXSTUBS_FIND_HANDLE*)hFindFile;
|
||||||
closedir(fh->dir);
|
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
|
// 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) {
|
LPFILETIME lpFileTime) {
|
||||||
struct tm tm = {};
|
struct tm tm = {};
|
||||||
tm.tm_year = lpSystemTime->wYear - 1900;
|
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
|
// 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) {
|
LPSYSTEMTIME lpSystemTime) {
|
||||||
ULONGLONG ft = ((ULONGLONG)lpFileTime->dwHighDateTime << 32) |
|
ULONGLONG ft = ((ULONGLONG)lpFileTime->dwHighDateTime << 32) |
|
||||||
lpFileTime->dwLowDateTime;
|
lpFileTime->dwLowDateTime;
|
||||||
|
|
@ -751,13 +743,13 @@ static inline DWORD GetTickCount() {
|
||||||
return (long long)ts.tv_sec * 1000 + (long long)ts.tv_nsec / 1000000;
|
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
|
// nanoseconds
|
||||||
lpFrequency->QuadPart = 1000000000;
|
lpFrequency->QuadPart = 1000000000;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) {
|
static inline bool QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &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
|
// 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;
|
if (!lpOutputString) return;
|
||||||
fputs(lpOutputString, stderr);
|
fputs(lpOutputString, stderr);
|
||||||
}
|
}
|
||||||
|
|
@ -780,7 +772,7 @@ static inline VOID OutputDebugStringW(LPCWSTR lpOutputString) {
|
||||||
fprintf(stderr, "%ls", lpOutputString);
|
fprintf(stderr, "%ls", lpOutputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VOID OutputDebugString(LPCSTR lpOutputString) {
|
static inline VOID OutputDebugString(const char* lpOutputString) {
|
||||||
return OutputDebugStringA(lpOutputString);
|
return OutputDebugStringA(lpOutputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -800,12 +792,12 @@ static inline HANDLE CreateEvent(int manual_reset, int initial_state) {
|
||||||
return (HANDLE)ev;
|
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*) {
|
void*) {
|
||||||
return CreateEvent(manual_reset, initial_state);
|
return CreateEvent(manual_reset, initial_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL SetEvent(HANDLE hEvent) {
|
static inline bool SetEvent(HANDLE hEvent) {
|
||||||
Event* ev = (Event*)hEvent;
|
Event* ev = (Event*)hEvent;
|
||||||
if (!ev) return FALSE;
|
if (!ev) return FALSE;
|
||||||
pthread_mutex_lock(&ev->mutex);
|
pthread_mutex_lock(&ev->mutex);
|
||||||
|
|
@ -818,7 +810,7 @@ static inline BOOL SetEvent(HANDLE hEvent) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL ResetEvent(HANDLE hEvent) {
|
static inline bool ResetEvent(HANDLE hEvent) {
|
||||||
Event* ev = (Event*)hEvent;
|
Event* ev = (Event*)hEvent;
|
||||||
if (!ev) return FALSE;
|
if (!ev) return FALSE;
|
||||||
pthread_mutex_lock(&ev->mutex);
|
pthread_mutex_lock(&ev->mutex);
|
||||||
|
|
@ -877,7 +869,7 @@ static inline DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) {
|
||||||
|
|
||||||
static inline DWORD WaitForMultipleObjects(DWORD nCount,
|
static inline DWORD WaitForMultipleObjects(DWORD nCount,
|
||||||
const HANDLE* lpHandles,
|
const HANDLE* lpHandles,
|
||||||
BOOL bWaitAll,
|
bool bWaitAll,
|
||||||
DWORD dwMilliseconds) {
|
DWORD dwMilliseconds) {
|
||||||
if (bWaitAll) {
|
if (bWaitAll) {
|
||||||
for (DWORD i = 0; i < nCount; i++)
|
for (DWORD i = 0; i < nCount; i++)
|
||||||
|
|
@ -1008,13 +1000,13 @@ static inline DWORD ResumeThread(HANDLE hThread) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL SetThreadPriority(HANDLE hThread, int nPriority) {
|
static inline bool SetThreadPriority(HANDLE hThread, int nPriority) {
|
||||||
(void)hThread;
|
(void)hThread;
|
||||||
(void)nPriority;
|
(void)nPriority;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL GetExitCodeThread(HANDLE hThread, DWORD* lpExitCode) {
|
static inline bool GetExitCodeThread(HANDLE hThread, DWORD* lpExitCode) {
|
||||||
LinuxThread* lt = (LinuxThread*)hThread;
|
LinuxThread* lt = (LinuxThread*)hThread;
|
||||||
if (!lt || !lpExitCode) return FALSE;
|
if (!lt || !lpExitCode) return FALSE;
|
||||||
*lpExitCode = lt->exitCode;
|
*lpExitCode = lt->exitCode;
|
||||||
|
|
@ -1063,9 +1055,9 @@ static inline int swprintf_s(wchar_t* buf, size_t sz, const wchar_t* fmt, ...) {
|
||||||
return ret;
|
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) {
|
DWORD flAllocationType, DWORD flProtect) {
|
||||||
// MEM_COMMIT | MEM_RESERVE → mmap anonymous
|
// MEM_COMMIT | MEM_RESERVE → mmap anonymous
|
||||||
int prot = 0;
|
int prot = 0;
|
||||||
|
|
@ -1086,7 +1078,7 @@ static inline LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize,
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize,
|
static inline bool VirtualFree(void* lpAddress, SIZE_T dwSize,
|
||||||
DWORD dwFreeType) {
|
DWORD dwFreeType) {
|
||||||
if (lpAddress == nullptr) return FALSE;
|
if (lpAddress == nullptr) return FALSE;
|
||||||
// MEM_RELEASE (0x8000) frees the whole region
|
// MEM_RELEASE (0x8000) frees the whole region
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,8 @@ public:
|
||||||
|
|
||||||
void SetMenuDisplayed(int iPad, bool bVal);
|
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, 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)(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)(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);
|
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);
|
void GetText(uint16_t *UTF16String);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,21 +54,21 @@ public:
|
||||||
bool IsSignedIn(int iQuadrant);
|
bool IsSignedIn(int iQuadrant);
|
||||||
bool IsSignedInLive(int iProf);
|
bool IsSignedInLive(int iProf);
|
||||||
bool IsGuest(int iQuadrant);
|
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 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)(LPVOID,const bool, const int iPad),LPVOID 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)(LPVOID,const bool, const int iPad),LPVOID 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);
|
void SetPrimaryPlayerChanged(bool bVal);
|
||||||
bool QuerySigninStatus(void);
|
bool QuerySigninStatus(void);
|
||||||
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
||||||
BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
bool AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
||||||
BOOL XUIDIsGuest(PlayerUID xuid);
|
bool XUIDIsGuest(PlayerUID xuid);
|
||||||
bool AllowedToPlayMultiplayer(int iProf);
|
bool AllowedToPlayMultiplayer(int iProf);
|
||||||
bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
||||||
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
|
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
|
||||||
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed);
|
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed);
|
||||||
BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount );
|
bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount );
|
||||||
void ShowProfileCard(int iPad, PlayerUID targetUid);
|
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();
|
void CancelProfileAvatarRequest();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -78,18 +78,18 @@ public:
|
||||||
char* GetGamertag(int iPad);
|
char* GetGamertag(int iPad);
|
||||||
std::wstring GetDisplayName(int iPad);
|
std::wstring GetDisplayName(int iPad);
|
||||||
bool IsFullVersion();
|
bool IsFullVersion();
|
||||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam);
|
||||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
void SetNotificationsCallback(void ( *Func)(void*, DWORD, unsigned int),void* lpParam);
|
||||||
bool RegionIsNorthAmerica(void);
|
bool RegionIsNorthAmerica(void);
|
||||||
bool LocaleIsUSorCanada(void);
|
bool LocaleIsUSorCanada(void);
|
||||||
HRESULT GetLiveConnectionStatus();
|
HRESULT GetLiveConnectionStatus();
|
||||||
bool IsSystemUIDisplayed();
|
bool IsSystemUIDisplayed();
|
||||||
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
|
void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam);
|
||||||
|
|
||||||
|
|
||||||
// PROFILE DATA
|
// PROFILE DATA
|
||||||
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam);
|
int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam);
|
||||||
int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam);
|
int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam);
|
||||||
PROFILESETTINGS * GetDashboardProfileSettings(int iPad);
|
PROFILESETTINGS * GetDashboardProfileSettings(int iPad);
|
||||||
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false);
|
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false);
|
||||||
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY);
|
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY);
|
||||||
|
|
@ -116,7 +116,7 @@ public:
|
||||||
|
|
||||||
// PURCHASE
|
// PURCHASE
|
||||||
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
|
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
|
// Debug
|
||||||
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
||||||
|
|
|
||||||
|
|
@ -239,31 +239,31 @@ public:
|
||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY,
|
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();
|
C4JStorage::EMessageResult GetMessageBoxResult();
|
||||||
|
|
||||||
// save device
|
// 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
|
// 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 ResetSaveData(); // Call before a new save to clear out stored save file name
|
||||||
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
|
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
|
||||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||||
bool GetSaveUniqueNumber(INT *piVal);
|
bool GetSaveUniqueNumber(INT *piVal);
|
||||||
bool GetSaveUniqueFilename(char *pszName);
|
bool GetSaveUniqueFilename(char *pszName);
|
||||||
void SetSaveUniqueFilename(char *szFilename);
|
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);
|
void SetSaveDisabled(bool bDisable);
|
||||||
bool GetSaveDisabled(void);
|
bool GetSaveDisabled(void);
|
||||||
unsigned int GetSaveSize();
|
unsigned int GetSaveSize();
|
||||||
void GetSaveData(void *pvData,unsigned int *puiBytes);
|
void GetSaveData(void *pvData,unsigned int *puiBytes);
|
||||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
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
|
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);
|
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(void* ,const bool),void* lpParam);
|
||||||
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam);
|
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam);
|
||||||
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
|
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
|
||||||
bool GetSaveDeviceSelected(unsigned int iPad);
|
bool GetSaveDeviceSelected(unsigned int iPad);
|
||||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
|
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
|
void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed
|
||||||
// Get the info for the saves
|
// 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();
|
PSAVE_DETAILS ReturnSavesInfo();
|
||||||
void ClearSavesInfo(); // Clears results
|
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,XCONTENT_DATA &xContentData);
|
||||||
void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes);
|
void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes);
|
||||||
|
|
||||||
// Load the save. Need to call GetSaveData once the callback is called
|
// 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 LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam);
|
||||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam);
|
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* lpParam);
|
||||||
|
|
||||||
// DLC
|
// 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);
|
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();
|
DWORD CancelGetDLCOffers();
|
||||||
void ClearDLCOffers();
|
void ClearDLCOffers();
|
||||||
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
||||||
int GetOfferCount();
|
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);
|
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);
|
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||||
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=nullptr);
|
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(void*, int, DWORD,DWORD),void* lpParam,const char* szMountDrive=nullptr);
|
||||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = nullptr);
|
DWORD UnmountInstalledDLC(const char* szMountDrive = nullptr);
|
||||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
||||||
std::string GetMountedPath(std::string szMount);
|
std::string GetMountedPath(std::string szMount);
|
||||||
|
|
||||||
// Global title storage
|
// Global title storage
|
||||||
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,
|
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 WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize);
|
||||||
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename);
|
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename);
|
||||||
void StoreTMSPathName(WCHAR *pwchName=nullptr);
|
void StoreTMSPathName(WCHAR *pwchName=nullptr);
|
||||||
|
|
||||||
// TMS++
|
// 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_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,LPVOID lpParam, 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,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=nullptr,LPVOID lpParam=nullptr, 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)(LPVOID,int,int,PTMSPP_FILE_LIST)=nullptr,LPVOID 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,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID 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);
|
// bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const std::wstring &Filename);
|
||||||
// unsigned int CRC(unsigned char *buf, int len);
|
// unsigned int CRC(unsigned char *buf, int len);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -917,8 +917,8 @@
|
||||||
#define RAD_S32 signed int
|
#define RAD_S32 signed int
|
||||||
// But pointers are 64 bits.
|
// But pointers are 64 bits.
|
||||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||||
#define RAD_SINTa __w64 signed __int64
|
#define RAD_SINTa __w64 signed int64_t
|
||||||
#define RAD_UINTa __w64 unsigned __int64
|
#define RAD_UINTa __w64 unsigned int64_t
|
||||||
#else // non-vc.net compiler or /Wp64 turned off
|
#else // non-vc.net compiler or /Wp64 turned off
|
||||||
#define RAD_UINTa unsigned long long
|
#define RAD_UINTa unsigned long long
|
||||||
#define RAD_SINTa signed long long
|
#define RAD_SINTa signed long long
|
||||||
|
|
@ -976,8 +976,8 @@
|
||||||
#define RAD_U64 unsigned long long
|
#define RAD_U64 unsigned long long
|
||||||
#define RAD_S64 signed long long
|
#define RAD_S64 signed long long
|
||||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||||
#define RAD_U64 unsigned __int64
|
#define RAD_U64 unsigned int64_t
|
||||||
#define RAD_S64 signed __int64
|
#define RAD_S64 signed int64_t
|
||||||
#else
|
#else
|
||||||
// 16-bit
|
// 16-bit
|
||||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
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_BSWAP16 _byteswap_ushort
|
||||||
#define RR_BSWAP32 _byteswap_ulong
|
#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)
|
#pragma intrinsic(_byteswap_uint64)
|
||||||
#define RR_BSWAP64 _byteswap_uint64
|
#define RR_BSWAP64 _byteswap_uint64
|
||||||
|
|
||||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
||||||
return _Long;
|
return _Long;
|
||||||
}
|
}
|
||||||
|
|
||||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long)
|
||||||
{
|
{
|
||||||
__asm {
|
__asm {
|
||||||
mov eax, DWORD PTR _Long
|
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)
|
#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)
|
#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__)
|
#elif defined(__RADCELL__)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ RADDEFSTART
|
||||||
typedef CHAR *LPSTR, *PSTR;
|
typedef CHAR *LPSTR, *PSTR;
|
||||||
|
|
||||||
#ifdef IS_WIN64
|
#ifdef IS_WIN64
|
||||||
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
|
typedef unsigned int64_t ULONG_PTR, *PULONG_PTR;
|
||||||
#else
|
#else
|
||||||
#ifdef _Wp64
|
#ifdef _Wp64
|
||||||
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||||
|
|
|
||||||
|
|
@ -917,8 +917,8 @@
|
||||||
#define RAD_S32 signed int
|
#define RAD_S32 signed int
|
||||||
// But pointers are 64 bits.
|
// But pointers are 64 bits.
|
||||||
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
|
||||||
#define RAD_SINTa __w64 signed __int64
|
#define RAD_SINTa __w64 signed int64_t
|
||||||
#define RAD_UINTa __w64 unsigned __int64
|
#define RAD_UINTa __w64 unsigned int64_t
|
||||||
#else // non-vc.net compiler or /Wp64 turned off
|
#else // non-vc.net compiler or /Wp64 turned off
|
||||||
#define RAD_UINTa unsigned long long
|
#define RAD_UINTa unsigned long long
|
||||||
#define RAD_SINTa signed long long
|
#define RAD_SINTa signed long long
|
||||||
|
|
@ -976,8 +976,8 @@
|
||||||
#define RAD_U64 unsigned long long
|
#define RAD_U64 unsigned long long
|
||||||
#define RAD_S64 signed long long
|
#define RAD_S64 signed long long
|
||||||
#elif defined(__RADX64__) || defined(__RAD32__)
|
#elif defined(__RADX64__) || defined(__RAD32__)
|
||||||
#define RAD_U64 unsigned __int64
|
#define RAD_U64 unsigned int64_t
|
||||||
#define RAD_S64 signed __int64
|
#define RAD_S64 signed int64_t
|
||||||
#else
|
#else
|
||||||
// 16-bit
|
// 16-bit
|
||||||
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
|
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_BSWAP16 _byteswap_ushort
|
||||||
#define RR_BSWAP32 _byteswap_ulong
|
#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)
|
#pragma intrinsic(_byteswap_uint64)
|
||||||
#define RR_BSWAP64 _byteswap_uint64
|
#define RR_BSWAP64 _byteswap_uint64
|
||||||
|
|
||||||
|
|
@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
|
||||||
return _Long;
|
return _Long;
|
||||||
}
|
}
|
||||||
|
|
||||||
RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
|
RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long)
|
||||||
{
|
{
|
||||||
__asm {
|
__asm {
|
||||||
mov eax, DWORD PTR _Long
|
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)
|
#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)
|
#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__)
|
#elif defined(__RADCELL__)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,45 +26,45 @@ public:
|
||||||
|
|
||||||
HRESULT Flush();
|
HRESULT Flush();
|
||||||
|
|
||||||
BOOL RecordPlayerSessionStart(DWORD dwUserId);
|
bool RecordPlayerSessionStart(DWORD dwUserId);
|
||||||
BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus);
|
bool RecordPlayerSessionExit(DWORD dwUserId, int exitStatus);
|
||||||
BOOL RecordHeartBeat(DWORD dwUserId);
|
bool RecordHeartBeat(DWORD dwUserId);
|
||||||
BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
bool RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
||||||
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
||||||
DWORD numberOfLocalPlayers,
|
DWORD numberOfLocalPlayers,
|
||||||
DWORD numberOfOnlinePlayers);
|
DWORD numberOfOnlinePlayers);
|
||||||
BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus);
|
bool RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus);
|
||||||
BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID,
|
bool RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID,
|
||||||
INT saveSizeInBytes);
|
INT saveSizeInBytes);
|
||||||
BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
bool RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch,
|
||||||
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
ESen_CompeteOrCoop competeOrCoop, int difficulty,
|
||||||
DWORD numberOfLocalPlayers,
|
DWORD numberOfLocalPlayers,
|
||||||
DWORD numberOfOnlinePlayers, INT saveOrCheckPointID);
|
DWORD numberOfOnlinePlayers, INT saveOrCheckPointID);
|
||||||
BOOL RecordPauseOrInactive(DWORD dwUserId);
|
bool RecordPauseOrInactive(DWORD dwUserId);
|
||||||
BOOL RecordUnpauseOrActive(DWORD dwUserId);
|
bool RecordUnpauseOrActive(DWORD dwUserId);
|
||||||
BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID);
|
bool RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID);
|
||||||
BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID,
|
bool RecordAchievementUnlocked(DWORD dwUserId, INT achievementID,
|
||||||
INT achievementGamerscore);
|
INT achievementGamerscore);
|
||||||
BOOL RecordMediaShareUpload(DWORD dwUserId,
|
bool RecordMediaShareUpload(DWORD dwUserId,
|
||||||
ESen_MediaDestination mediaDestination,
|
ESen_MediaDestination mediaDestination,
|
||||||
ESen_MediaType mediaType);
|
ESen_MediaType mediaType);
|
||||||
BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId,
|
bool RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId,
|
||||||
INT marketplaceOfferID);
|
INT marketplaceOfferID);
|
||||||
BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId,
|
bool RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId,
|
||||||
INT marketplaceOfferID,
|
INT marketplaceOfferID,
|
||||||
ESen_UpsellOutcome upsellOutcome);
|
ESen_UpsellOutcome upsellOutcome);
|
||||||
BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX,
|
bool RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX,
|
||||||
INT lowResMapY, INT lowResMapZ, INT mapID,
|
INT lowResMapY, INT lowResMapZ, INT mapID,
|
||||||
INT playerWeaponID, INT enemyWeaponID,
|
INT playerWeaponID, INT enemyWeaponID,
|
||||||
ETelemetryChallenges enemyTypeID);
|
ETelemetryChallenges enemyTypeID);
|
||||||
BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX,
|
bool RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX,
|
||||||
INT lowResMapY, INT lowResMapZ, INT mapID,
|
INT lowResMapY, INT lowResMapZ, INT mapID,
|
||||||
INT playerWeaponID, INT enemyWeaponID,
|
INT playerWeaponID, INT enemyWeaponID,
|
||||||
ETelemetryChallenges enemyTypeID);
|
ETelemetryChallenges enemyTypeID);
|
||||||
|
|
||||||
BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId);
|
bool RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId);
|
||||||
BOOL RecordBanLevel(DWORD dwUserId);
|
bool RecordBanLevel(DWORD dwUserId);
|
||||||
BOOL RecordUnBanLevel(DWORD dwUserId);
|
bool RecordUnBanLevel(DWORD dwUserId);
|
||||||
|
|
||||||
INT GetMultiplayerInstanceID();
|
INT GetMultiplayerInstanceID();
|
||||||
INT GenerateMultiplayerInstanceId();
|
INT GenerateMultiplayerInstanceId();
|
||||||
|
|
|
||||||
|
|
@ -12,77 +12,77 @@
|
||||||
|
|
||||||
// PlayerSessionStart
|
// PlayerSessionStart
|
||||||
// Player signed in or joined
|
// 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
|
// PlayerSessionExit
|
||||||
// Player signed out or left
|
// 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
|
// HeartBeat
|
||||||
// Sent every 60 seconds by title
|
// Sent every 60 seconds by title
|
||||||
BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize );
|
bool SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize );
|
||||||
|
|
||||||
// LevelStart
|
// LevelStart
|
||||||
// Level started
|
// 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
|
// LevelExit
|
||||||
// Level exited
|
// 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
|
// LevelSaveOrCheckpoint
|
||||||
// Level saved explicitly or implicitly
|
// 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
|
// LevelResume
|
||||||
// Level resumed from a save or restarted at a checkpoint
|
// 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
|
// PauseOrInactive
|
||||||
// Player paused game or has become inactive, level and mode are for what the player is leaving
|
// 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
|
// UnpauseOrActive
|
||||||
// Player unpaused game or has become active, level and mode are for what the player is entering into
|
// 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
|
// MenuShown
|
||||||
// A menu screen or major menu area has been shown
|
// 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
|
// AchievementUnlocked
|
||||||
// An achievement was unlocked
|
// 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
|
// MediaShareUpload
|
||||||
// The user uploaded something to Kinect Share
|
// 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
|
// UpsellPresented
|
||||||
// The user is shown an upsell to purchase something
|
// 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
|
// UpsellResponded
|
||||||
// The user responded to the upsell
|
// 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
|
// PlayerDiedOrFailed
|
||||||
// The player died or failed a challenge - can be used for many types of failure
|
// 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
|
// EnemyKilledOrOvercome
|
||||||
// The player killed an enemy or overcame or solved a major challenge
|
// 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
|
// SkinChanged
|
||||||
// The player has changed their skin, level and mode are for what the player is currently in
|
// 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
|
// BanLevel
|
||||||
// The player has banned a level, level and mode are for what the player is currently in and banning
|
// 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
|
// UnBanLevel
|
||||||
// The player has ubbanned a level, level and mode are for what the player is currently in and unbanning
|
// 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 );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
||||||
StorageManager.SetSaveTitle(wWorldName.c_str());
|
StorageManager.SetSaveTitle(wWorldName.c_str());
|
||||||
|
|
||||||
bool isFlat = false;
|
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();
|
NetworkGameInitData *param = new NetworkGameInitData();
|
||||||
param->seed = seedValue;
|
param->seed = seedValue;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES] = {
|
||||||
// running for a long time.
|
// running for a long time.
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
|
|
||||||
BOOL g_bWidescreen = TRUE;
|
bool g_bWidescreen = TRUE;
|
||||||
|
|
||||||
int g_iScreenWidth = 1920;
|
int g_iScreenWidth = 1920;
|
||||||
int g_iScreenHeight = 1080;
|
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
|
// In this function, we save the instance handle in a global variable and
|
||||||
// create and display the main program window.
|
// 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
|
g_hInst = hInstance; // Store instance handle in our global variable
|
||||||
|
|
||||||
RECT wr = {0, 0, g_iScreenWidth,
|
RECT wr = {0, 0, g_iScreenWidth,
|
||||||
|
|
@ -601,7 +601,7 @@ HRESULT InitDevice() {
|
||||||
// Create a render target view
|
// Create a render target view
|
||||||
ID3D11Texture2D* pBackBuffer = nullptr;
|
ID3D11Texture2D* pBackBuffer = nullptr;
|
||||||
hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D),
|
hr = g_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D),
|
||||||
(LPVOID*)&pBackBuffer);
|
(void**)&pBackBuffer);
|
||||||
if (FAILED(hr)) return hr;
|
if (FAILED(hr)) return hr;
|
||||||
|
|
||||||
// Create a depth stencil buffer
|
// 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
|
// Set a callback for the default player options to be set - when there is
|
||||||
// no profile data for the player
|
// no profile data for the player
|
||||||
ProfileManager.SetDefaultOptionsCallback(
|
ProfileManager.SetDefaultOptionsCallback(
|
||||||
&CConsoleMinecraftApp::DefaultOptionsCallback, (LPVOID)&app);
|
&CConsoleMinecraftApp::DefaultOptionsCallback, (void*)&app);
|
||||||
// QNet needs to be setup after profile manager, as we do not want its
|
// QNet needs to be setup after profile manager, as we do not want its
|
||||||
// Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does
|
// Notify listener to handle XN_SYS_SIGNINCHANGED notifications. This does
|
||||||
// mean that we need to have a callback in the ProfileManager for
|
// mean that we need to have a callback in the ProfileManager for
|
||||||
|
|
@ -935,7 +935,7 @@ volatile int sectCheck = 48;
|
||||||
CRITICAL_SECTION memCS;
|
CRITICAL_SECTION memCS;
|
||||||
DWORD tlsIdx;
|
DWORD tlsIdx;
|
||||||
|
|
||||||
LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
||||||
if (!trackStarted) {
|
if (!trackStarted) {
|
||||||
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
||||||
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
||||||
|
|
@ -1028,7 +1028,7 @@ SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
|
||||||
|
|
||||||
void DumpMem() {
|
void DumpMem() {
|
||||||
int totalLeak = 0;
|
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) {
|
if (it->second > 0) {
|
||||||
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
|
app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f,
|
||||||
it->first & 0x03ffffff, it->second,
|
it->first & 0x03ffffff, it->second,
|
||||||
|
|
@ -1062,7 +1062,7 @@ void MemSect(int section) {
|
||||||
} else {
|
} else {
|
||||||
value = (value << 6) | section;
|
value = (value << 6) | section;
|
||||||
}
|
}
|
||||||
TlsSetValue(tlsIdx, (LPVOID)value);
|
TlsSetValue(tlsIdx, (void*)value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemPixStuff() {
|
void MemPixStuff() {
|
||||||
|
|
@ -1070,7 +1070,7 @@ void MemPixStuff() {
|
||||||
|
|
||||||
int totals[MAX_SECT] = {0};
|
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) {
|
if (it->second > 0) {
|
||||||
int sect = (it->first >> 26) & 0x3f;
|
int sect = (it->first >> 26) & 0x3f;
|
||||||
int bytes = it->first & 0x03ffffff;
|
int bytes = it->first & 0x03ffffff;
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,11 @@ public:
|
||||||
|
|
||||||
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
|
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
|
||||||
CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0;
|
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 ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0;
|
||||||
|
|
||||||
virtual HRESULT CDATABegin( ) = 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 HRESULT CDATAEnd( ) = 0;
|
||||||
|
|
||||||
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
|
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
|
||||||
|
|
@ -111,7 +111,7 @@ public:
|
||||||
private:
|
private:
|
||||||
HRESULT MainParseLoop();
|
HRESULT MainParseLoop();
|
||||||
|
|
||||||
HRESULT AdvanceCharacter( BOOL bOkToFail = FALSE );
|
HRESULT AdvanceCharacter( bool bOkToFail = FALSE );
|
||||||
VOID SkipNextAdvance();
|
VOID SkipNextAdvance();
|
||||||
|
|
||||||
HRESULT ConsumeSpace();
|
HRESULT ConsumeSpace();
|
||||||
|
|
@ -144,10 +144,10 @@ private:
|
||||||
BYTE* m_pReadPtr;
|
BYTE* m_pReadPtr;
|
||||||
WCHAR* m_pWritePtr; // write pointer within m_pBuf
|
WCHAR* m_pWritePtr; // write pointer within m_pBuf
|
||||||
|
|
||||||
BOOL m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
|
bool m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
|
||||||
BOOL m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
|
bool m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
|
||||||
|
|
||||||
BOOL m_bSkipNextAdvance;
|
bool m_bSkipNextAdvance;
|
||||||
WCHAR m_Ch; // Current character being parsed
|
WCHAR m_Ch; // Current character being parsed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ DWORD XUserAreUsersFriends(
|
||||||
DWORD dwUserIndex,
|
DWORD dwUserIndex,
|
||||||
PPlayerUID pXuids,
|
PPlayerUID pXuids,
|
||||||
DWORD dwXuidCount,
|
DWORD dwXuidCount,
|
||||||
PBOOL pfResult,
|
bool* pfResult,
|
||||||
void *pOverlapped);
|
void *pOverlapped);
|
||||||
|
|
||||||
class XSOCIAL_IMAGEPOSTPARAMS
|
class XSOCIAL_IMAGEPOSTPARAMS
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
// use - #pragma message(__LOC__"Need to do something here")
|
// use - #pragma message(__LOC__"Need to do something here")
|
||||||
|
|
||||||
#define AUTO_VAR(_var, _val) auto _var = _val
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
@ -23,8 +22,6 @@
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include "../Platform/Linux/Stubs/LinuxStubs.h"
|
#include "../Platform/Linux/Stubs/LinuxStubs.h"
|
||||||
#else
|
|
||||||
typedef unsigned __int64 __uint64;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WINDOWS64
|
#ifdef _WINDOWS64
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ void EntityTracker::addEntity(std::shared_ptr<Entity> e) {
|
||||||
addEntity(e, 32 * 16, 2);
|
addEntity(e, 32 * 16, 2);
|
||||||
std::shared_ptr<ServerPlayer> player =
|
std::shared_ptr<ServerPlayer> player =
|
||||||
std::dynamic_pointer_cast<ServerPlayer>(e);
|
std::dynamic_pointer_cast<ServerPlayer>(e);
|
||||||
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) {
|
for (auto it = entities.begin(); it != entities.end(); it++) {
|
||||||
if ((*it)->e != player) {
|
if ((*it)->e != player) {
|
||||||
(*it)->updatePlayer(this, player);
|
(*it)->updatePlayer(this, player);
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +115,7 @@ void EntityTracker::addEntity(std::shared_ptr<Entity> e, int range,
|
||||||
// to allow us to now choose to remove the player as a "seenBy" only when the
|
// 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
|
// player has actually been removed from the level's own player array
|
||||||
void EntityTracker::removeEntity(std::shared_ptr<Entity> e) {
|
void EntityTracker::removeEntity(std::shared_ptr<Entity> e) {
|
||||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
auto it = entityMap.find(e->entityId);
|
||||||
if (it != entityMap.end()) {
|
if (it != entityMap.end()) {
|
||||||
std::shared_ptr<TrackedEntity> te = it->second;
|
std::shared_ptr<TrackedEntity> te = it->second;
|
||||||
entityMap.erase(it);
|
entityMap.erase(it);
|
||||||
|
|
@ -128,7 +128,7 @@ void EntityTracker::removePlayer(std::shared_ptr<Entity> e) {
|
||||||
if (e->GetType() == eTYPE_SERVERPLAYER) {
|
if (e->GetType() == eTYPE_SERVERPLAYER) {
|
||||||
std::shared_ptr<ServerPlayer> player =
|
std::shared_ptr<ServerPlayer> player =
|
||||||
std::dynamic_pointer_cast<ServerPlayer>(e);
|
std::dynamic_pointer_cast<ServerPlayer>(e);
|
||||||
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) {
|
for (auto it = entities.begin(); it != entities.end(); it++) {
|
||||||
(*it)->removePlayer(player);
|
(*it)->removePlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ void EntityTracker::removePlayer(std::shared_ptr<Entity> e) {
|
||||||
|
|
||||||
void EntityTracker::tick() {
|
void EntityTracker::tick() {
|
||||||
std::vector<std::shared_ptr<ServerPlayer> > movedPlayers;
|
std::vector<std::shared_ptr<ServerPlayer> > movedPlayers;
|
||||||
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) {
|
for (auto it = entities.begin(); it != entities.end(); it++) {
|
||||||
std::shared_ptr<TrackedEntity> te = *it;
|
std::shared_ptr<TrackedEntity> te = *it;
|
||||||
te->tick(this, &level->players);
|
te->tick(this, &level->players);
|
||||||
if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) {
|
if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) {
|
||||||
|
|
@ -182,7 +182,7 @@ void EntityTracker::tick() {
|
||||||
for (unsigned int i = 0; i < movedPlayers.size(); i++) {
|
for (unsigned int i = 0; i < movedPlayers.size(); i++) {
|
||||||
std::shared_ptr<ServerPlayer> player = movedPlayers[i];
|
std::shared_ptr<ServerPlayer> player = movedPlayers[i];
|
||||||
if (player->connection == nullptr) continue;
|
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<TrackedEntity> te = *it;
|
std::shared_ptr<TrackedEntity> te = *it;
|
||||||
if (te->e != player) {
|
if (te->e != player) {
|
||||||
te->updatePlayer(this, 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
|
// 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) {
|
++it) {
|
||||||
std::shared_ptr<ServerPlayer> player =
|
std::shared_ptr<ServerPlayer> player =
|
||||||
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
std::dynamic_pointer_cast<ServerPlayer>(*it);
|
||||||
|
|
@ -203,7 +203,7 @@ void EntityTracker::tick() {
|
||||||
|
|
||||||
void EntityTracker::broadcast(std::shared_ptr<Entity> e,
|
void EntityTracker::broadcast(std::shared_ptr<Entity> e,
|
||||||
std::shared_ptr<Packet> packet) {
|
std::shared_ptr<Packet> packet) {
|
||||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
auto it = entityMap.find(e->entityId);
|
||||||
if (it != entityMap.end()) {
|
if (it != entityMap.end()) {
|
||||||
std::shared_ptr<TrackedEntity> te = it->second;
|
std::shared_ptr<TrackedEntity> te = it->second;
|
||||||
te->broadcast(packet);
|
te->broadcast(packet);
|
||||||
|
|
@ -212,7 +212,7 @@ void EntityTracker::broadcast(std::shared_ptr<Entity> e,
|
||||||
|
|
||||||
void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
|
void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
|
||||||
std::shared_ptr<Packet> packet) {
|
std::shared_ptr<Packet> packet) {
|
||||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
auto it = entityMap.find(e->entityId);
|
||||||
if (it != entityMap.end()) {
|
if (it != entityMap.end()) {
|
||||||
std::shared_ptr<TrackedEntity> te = it->second;
|
std::shared_ptr<TrackedEntity> te = it->second;
|
||||||
te->broadcastAndSend(packet);
|
te->broadcastAndSend(packet);
|
||||||
|
|
@ -220,7 +220,7 @@ void EntityTracker::broadcastAndSend(std::shared_ptr<Entity> e,
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) {
|
void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) {
|
||||||
for (AUTO_VAR(it, entities.begin()); it != entities.end(); it++) {
|
for (auto it = entities.begin(); it != entities.end(); it++) {
|
||||||
std::shared_ptr<TrackedEntity> te = *it;
|
std::shared_ptr<TrackedEntity> te = *it;
|
||||||
te->clear(serverPlayer);
|
te->clear(serverPlayer);
|
||||||
}
|
}
|
||||||
|
|
@ -228,7 +228,7 @@ void EntityTracker::clear(std::shared_ptr<ServerPlayer> serverPlayer) {
|
||||||
|
|
||||||
void EntityTracker::playerLoadedChunk(std::shared_ptr<ServerPlayer> player,
|
void EntityTracker::playerLoadedChunk(std::shared_ptr<ServerPlayer> player,
|
||||||
LevelChunk* chunk) {
|
LevelChunk* chunk) {
|
||||||
for (AUTO_VAR(it, entities.begin()); it != entities.end(); ++it) {
|
for (auto it = entities.begin(); it != entities.end(); ++it) {
|
||||||
std::shared_ptr<TrackedEntity> te = *it;
|
std::shared_ptr<TrackedEntity> te = *it;
|
||||||
if (te->e != player && te->e->xChunk == chunk->x &&
|
if (te->e != player && te->e->xChunk == chunk->x &&
|
||||||
te->e->zChunk == chunk->z) {
|
te->e->zChunk == chunk->z) {
|
||||||
|
|
@ -244,7 +244,7 @@ void EntityTracker::updateMaxRange() {
|
||||||
|
|
||||||
std::shared_ptr<TrackedEntity> EntityTracker::getTracker(
|
std::shared_ptr<TrackedEntity> EntityTracker::getTracker(
|
||||||
std::shared_ptr<Entity> e) {
|
std::shared_ptr<Entity> e) {
|
||||||
AUTO_VAR(it, entityMap.find(e->entityId));
|
auto it = entityMap.find(e->entityId);
|
||||||
if (it != entityMap.end()) {
|
if (it != entityMap.end()) {
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,8 @@ void ServerPlayer::flagEntitiesToBeRemoved(unsigned int* flags,
|
||||||
memset(flags, 0, 2048 / 32);
|
memset(flags, 0, 2048 / 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
AUTO_VAR(it, entitiesToRemove.begin());
|
auto it = entitiesToRemove.begin();
|
||||||
for (AUTO_VAR(it, entitiesToRemove.begin()); it != entitiesToRemove.end();
|
for (auto it = entitiesToRemove.begin(); it != entitiesToRemove.end();
|
||||||
it++) {
|
it++) {
|
||||||
int index = *it;
|
int index = *it;
|
||||||
if (index < 2048) {
|
if (index < 2048) {
|
||||||
|
|
@ -259,7 +259,7 @@ void ServerPlayer::flushEntitiesToRemove() {
|
||||||
intArray ids(amount);
|
intArray ids(amount);
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
AUTO_VAR(it, entitiesToRemove.begin());
|
auto it = entitiesToRemove.begin();
|
||||||
while (it != entitiesToRemove.end() && pos < amount) {
|
while (it != entitiesToRemove.end() && pos < amount) {
|
||||||
ids[pos++] = *it;
|
ids[pos++] = *it;
|
||||||
it = entitiesToRemove.erase(it);
|
it = entitiesToRemove.erase(it);
|
||||||
|
|
@ -331,7 +331,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) {
|
||||||
// the spiral of chunks that that method creates, long before
|
// the spiral of chunks that that method creates, long before
|
||||||
// transmission of them is complete.
|
// transmission of them is complete.
|
||||||
double dist = DBL_MAX;
|
double dist = DBL_MAX;
|
||||||
for (AUTO_VAR(it, chunksToSend.begin()); it != chunksToSend.end();
|
for (auto it = chunksToSend.begin(); it != chunksToSend.end();
|
||||||
it++) {
|
it++) {
|
||||||
ChunkPos chunk = *it;
|
ChunkPos chunk = *it;
|
||||||
if (level->isChunkFinalised(chunk.x, chunk.z)) {
|
if (level->isChunkFinalised(chunk.x, chunk.z)) {
|
||||||
|
|
@ -572,7 +572,7 @@ void ServerPlayer::doTickB() {
|
||||||
players.push_back(
|
players.push_back(
|
||||||
std::dynamic_pointer_cast<Player>(shared_from_this()));
|
std::dynamic_pointer_cast<Player>(shared_from_this()));
|
||||||
|
|
||||||
for (AUTO_VAR(it, objectives->begin()); it != objectives->end();
|
for (auto it = objectives->begin(); it != objectives->end();
|
||||||
++it) {
|
++it) {
|
||||||
Objective* objective = *it;
|
Objective* objective = *it;
|
||||||
getScoreboard()
|
getScoreboard()
|
||||||
|
|
@ -806,9 +806,9 @@ void ServerPlayer::changeDimension(int i) {
|
||||||
thisPlayer->GetUserIndex());
|
thisPlayer->GetUserIndex());
|
||||||
}
|
}
|
||||||
if (thisPlayer != nullptr) {
|
if (thisPlayer != nullptr) {
|
||||||
for (AUTO_VAR(it, MinecraftServer::getInstance()
|
for (auto it = MinecraftServer::getInstance()
|
||||||
->getPlayers()
|
->getPlayers()
|
||||||
->players.begin());
|
->players.begin();
|
||||||
it !=
|
it !=
|
||||||
MinecraftServer::getInstance()->getPlayers()->players.end();
|
MinecraftServer::getInstance()->getPlayers()->players.end();
|
||||||
++it) {
|
++it) {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue