Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a.
This commit is contained in:
@@ -76,7 +76,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
|
||||
|
||||
#ifdef SPLIT_SAVES
|
||||
// If we can't find the chunk in the save file, then we should remove any entities we might have for that chunk
|
||||
if(regionChunkInputStream == nullptr)
|
||||
if(regionChunkInputStream == NULL)
|
||||
{
|
||||
int64_t index = ((int64_t)(x) << 32) | (((int64_t)(z))&0x00000000FFFFFFFF);
|
||||
|
||||
@@ -89,11 +89,11 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
|
||||
}
|
||||
#endif
|
||||
|
||||
LevelChunk *levelChunk = nullptr;
|
||||
LevelChunk *levelChunk = NULL;
|
||||
|
||||
if(m_saveFile->getOriginalSaveVersion() >= SAVE_FILE_VERSION_COMPRESSED_CHUNK_STORAGE)
|
||||
{
|
||||
if (regionChunkInputStream != nullptr)
|
||||
if (regionChunkInputStream != NULL)
|
||||
{
|
||||
MemSect(9);
|
||||
levelChunk = OldChunkStorage::load(level, regionChunkInputStream);
|
||||
@@ -106,14 +106,14 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
|
||||
else
|
||||
{
|
||||
CompoundTag *chunkData;
|
||||
if (regionChunkInputStream != nullptr)
|
||||
if (regionChunkInputStream != NULL)
|
||||
{
|
||||
MemSect(8);
|
||||
chunkData = NbtIo::read((DataInput *)regionChunkInputStream);
|
||||
MemSect(0);
|
||||
} else
|
||||
{
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
regionChunkInputStream->deleteChildStream();
|
||||
@@ -125,7 +125,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
|
||||
sprintf(buf,"Chunk file at %d, %d is missing level data, skipping\n",x, z);
|
||||
app.DebugPrintf(buf);
|
||||
delete chunkData;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
if (!chunkData->getCompound(L"Level")->contains(L"Blocks"))
|
||||
{
|
||||
@@ -133,7 +133,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
|
||||
sprintf(buf,"Chunk file at %d, %d is missing block data, skipping\n",x, z);
|
||||
app.DebugPrintf(buf);
|
||||
delete chunkData;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
MemSect(9);
|
||||
levelChunk = OldChunkStorage::load(level, chunkData->getCompound(L"Level"));
|
||||
@@ -146,7 +146,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z)
|
||||
app.DebugPrintf(buf);
|
||||
delete levelChunk;
|
||||
delete chunkData;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// 4J Stu - We delete the data within OldChunkStorage::load, so we can never reload from it
|
||||
//chunkData->putInt(L"xPos", x);
|
||||
@@ -330,8 +330,8 @@ void McRegionChunkStorage::staticCtor()
|
||||
sprintf(threadName,"McRegion Save thread %d\n",i);
|
||||
SetThreadName(0, threadName);
|
||||
|
||||
//saveThreads[j] = CreateThread(nullptr,0,runSaveThreadProc,&threadData[j],CREATE_SUSPENDED,&threadId[j]);
|
||||
s_saveThreads[i] = new C4JThread(runSaveThreadProc,nullptr,threadName);
|
||||
//saveThreads[j] = CreateThread(NULL,0,runSaveThreadProc,&threadData[j],CREATE_SUSPENDED,&threadId[j]);
|
||||
s_saveThreads[i] = new C4JThread(runSaveThreadProc,NULL,threadName);
|
||||
|
||||
|
||||
//app.DebugPrintf("Created new thread: %s\n",threadName);
|
||||
@@ -359,7 +359,7 @@ int McRegionChunkStorage::runSaveThreadProc(LPVOID lpParam)
|
||||
bool running = true;
|
||||
size_t lastQueueSize = 0;
|
||||
|
||||
DataOutputStream *dos = nullptr;
|
||||
DataOutputStream *dos = NULL;
|
||||
while(running)
|
||||
{
|
||||
if( TryEnterCriticalSection(&cs_memory) )
|
||||
@@ -382,7 +382,7 @@ int McRegionChunkStorage::runSaveThreadProc(LPVOID lpParam)
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
delete dos;
|
||||
dos = nullptr;
|
||||
dos = NULL;
|
||||
|
||||
EnterCriticalSection(&cs_memory);
|
||||
s_runningThreadCount--;
|
||||
|
||||
Reference in New Issue
Block a user