fixed a bunch of shit, might fix renderer ?

This commit is contained in:
JuiceyDev 2026-03-06 19:53:03 +01:00
parent 58780ca7cd
commit 3f489a4202
6 changed files with 21 additions and 20 deletions

View file

@ -49,6 +49,7 @@ void GameMode::render(float a)
bool GameMode::useItem(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, bool bTestUseOnly)
{
return false;
}
void GameMode::initPlayer(shared_ptr<Player> player)

View file

@ -262,7 +262,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
// 4J delete passed in save data now - this is only required for the tutorial which is loaded by passing data directly in rather than using the storage manager
if( initData->saveData )
{
delete initData->saveData->data;
delete[] (unsigned char*)initData->saveData->data;
initData->saveData->data = 0;
initData->saveData->fileSize = 0;
}

View file

@ -2386,7 +2386,7 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev
dirtyChunksLockFreeStack.Push((int *)(index));
#else
dirtyChunksLockFreeStack.Push((int *)(index + 2));
dirtyChunksLockFreeStack.Push((int *)(uintptr_t)(index + 2));
#endif
#ifdef _XBOX
@ -3596,14 +3596,13 @@ void LevelRenderer::staticCtor()
{
s_rebuildCompleteEvents = new C4JThread::EventArray(MAX_CHUNK_REBUILD_THREADS);
char threadName[256];
for(unsigned int i = 0; i < MAX_CHUNK_REBUILD_THREADS; ++i)
{
sprintf(threadName,"Rebuild Chunk Thread %d\n",i);
rebuildThreads[i] = new C4JThread(rebuildChunkThreadProc,(void *)i,threadName);
s_activationEventA[i] = new C4JThread::Event();
// Threads 1,3 and 5 are generally idle so use them
for(unsigned int i = 0; i < MAX_CHUNK_REBUILD_THREADS; ++i)
{
sprintf(threadName,"Rebuild Chunk Thread %d\n",i);
rebuildThreads[i] = new C4JThread(rebuildChunkThreadProc,(void *)(uintptr_t)i,threadName);
s_activationEventA[i] = new C4JThread::Event();
// Threads 1,3 and 5 are generally idle so use them
if((i%3) == 0) rebuildThreads[i]->SetProcessor(CPU_CORE_CHUNK_REBUILD_A);
else if((i%3) == 1)
{
@ -3626,12 +3625,13 @@ int LevelRenderer::rebuildChunkThreadProc(LPVOID lpParam)
IntCache::CreateNewThreadStorage();
Tesselator::CreateNewThreadStorage(1024*1024);
RenderManager.InitialiseContext();
Chunk::CreateNewThreadStorage();
Tile::CreateNewThreadStorage();
int index = (size_t)lpParam;
while(true)
Chunk::CreateNewThreadStorage();
Tile::CreateNewThreadStorage();
int index = (int)(uintptr_t)lpParam;
while(true)
{
s_activationEventA[index]->WaitForSignal(INFINITE);

View file

@ -7,7 +7,7 @@
ControlsScreen::ControlsScreen(Screen *lastScreen, Options *options)
{
// 4J - added initialisers
title == L"Controls";
title = L"Controls";
selectedKey = -1;
this->lastScreen = lastScreen;

View file

@ -359,7 +359,7 @@ void ConsoleSaveFileSplit::RegionFileReference::ReleaseCompressed()
// app.DebugPrintf("Releasing compressed data for region file from 0x%.8x\n", fileEntry->data.regionIndex );
free(dataCompressed);
dataCompressed = NULL;
dataCompressedSize = NULL;
dataCompressedSize = 0;
}
FileEntry *ConsoleSaveFileSplit::GetRegionFileEntry(unsigned int regionIndex)

View file

@ -344,7 +344,7 @@ void Socket::SocketInputStreamLocal::close()
{
m_streamOpen = false;
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
s_hostQueue[m_queueIdx].empty();
s_hostQueue[m_queueIdx] = std::queue<unsigned char>();
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
}
@ -392,7 +392,7 @@ void Socket::SocketOutputStreamLocal::close()
{
m_streamOpen = false;
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
s_hostQueue[m_queueIdx].empty();
s_hostQueue[m_queueIdx] = std::queue<unsigned char>();
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
}