From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: 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 a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.World/IntCache.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Minecraft.World/IntCache.cpp') diff --git a/Minecraft.World/IntCache.cpp b/Minecraft.World/IntCache.cpp index cd980d16..174d01d3 100644 --- a/Minecraft.World/IntCache.cpp +++ b/Minecraft.World/IntCache.cpp @@ -28,7 +28,7 @@ IntCache::ThreadStorage::~ThreadStorage() { delete [] allocated[i].data; } - for( size_t i = 0; i < toosmall.size(); i++ ) + for( int i = 0; i < toosmall.size(); i++ ) { delete [] toosmall[i].data; } @@ -36,7 +36,7 @@ IntCache::ThreadStorage::~ThreadStorage() void IntCache::ReleaseThreadStorage() { - ThreadStorage *tls = static_cast(TlsGetValue(tlsIdx)); + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(tlsIdx); delete tls; @@ -44,13 +44,13 @@ void IntCache::ReleaseThreadStorage() intArray IntCache::allocate(int size) { - ThreadStorage *tls = static_cast(TlsGetValue(tlsIdx)); + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(tlsIdx); if (size <= TINY_CUTOFF) { if (tls->tcache.empty()) { - intArray result = intArray(static_cast(TINY_CUTOFF), true); + intArray result = intArray(TINY_CUTOFF, true); tls->tallocated.push_back(result); return result; } @@ -76,7 +76,7 @@ intArray IntCache::allocate(int size) tls->cache.clear(); tls->allocated.clear(); - intArray result = intArray(static_cast(tls->maxSize), true); + intArray result = intArray(tls->maxSize, true); tls->allocated.push_back(result); return result; } @@ -84,7 +84,7 @@ intArray IntCache::allocate(int size) { if (tls->cache.empty()) { - intArray result = intArray(static_cast(tls->maxSize), true); + intArray result = intArray(tls->maxSize, true); tls->allocated.push_back(result); return result; } @@ -100,10 +100,10 @@ intArray IntCache::allocate(int size) void IntCache::releaseAll() { - ThreadStorage *tls = static_cast(TlsGetValue(tlsIdx)); + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(tlsIdx); // 4J - added - we can now remove the vectors that were deemed as too small (see comment in IntCache::allocate) - for( size_t i = 0; i < tls->toosmall.size(); i++ ) + for( int i = 0; i < tls->toosmall.size(); i++ ) { delete [] tls->toosmall[i].data; } @@ -130,27 +130,27 @@ void IntCache::releaseAll() // 4J added so that we can fully reset between levels void IntCache::Reset() { - ThreadStorage *tls = static_cast(TlsGetValue(tlsIdx)); + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(tlsIdx); tls->maxSize = TINY_CUTOFF; - for( size_t i = 0; i < tls->allocated.size(); i++ ) + for( int i = 0; i < tls->allocated.size(); i++ ) { delete [] tls->allocated[i].data; } tls->allocated.clear(); - for( size_t i = 0; i < tls->cache.size(); i++ ) + for( int i = 0; i < tls->cache.size(); i++ ) { delete [] tls->cache[i].data; } tls->cache.clear(); - for( size_t i = 0; i < tls->tallocated.size(); i++ ) + for( int i = 0; i < tls->tallocated.size(); i++ ) { delete [] tls->tallocated[i].data; } tls->tallocated.clear(); - for( size_t i = 0; i < tls->tcache.size(); i++ ) + for( int i = 0; i < tls->tcache.size(); i++ ) { delete [] tls->tcache[i].data; } -- cgit v1.2.3