From f9e89c2be6ca629ab4c63448b97db8ca1e311371 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 30 Mar 2026 21:58:19 -0500 Subject: [PATCH] nuke memory tracking --- .../Common/Source Files/Network/Socket.cpp | 2 - .../Controls/UIControl_PlayerSkinPreview.cpp | 4 - .../Minecraft.Client/Header Files/stdafx.h | 1 - .../Linux/Linux_Minecraft.cpp | 216 ------------------ .../Source Files/Windows64_Minecraft.cpp | 216 ------------------ .../net/minecraft/client/Minecraft.cpp | 14 -- .../net/minecraft/client/gui/Gui.cpp | 10 - .../client/multiplayer/ClientConnection.cpp | 2 - .../client/multiplayer/MultiPlayerLevel.cpp | 2 - .../client/particle/ParticleEngine.cpp | 2 - .../net/minecraft/client/renderer/Chunk.cpp | 2 - .../client/renderer/GameRenderer.cpp | 12 - .../client/renderer/ItemInHandRenderer.cpp | 13 -- .../client/renderer/LevelRenderer.cpp | 4 - .../minecraft/client/renderer/Textures.cpp | 7 - .../client/renderer/entity/EntityRenderer.cpp | 4 - .../renderer/entity/FireballRenderer.cpp | 4 - .../client/renderer/entity/ItemRenderer.cpp | 6 - .../renderer/entity/LivingEntityRenderer.cpp | 2 - .../client/renderer/entity/PigRenderer.cpp | 2 - .../client/renderer/entity/SheepRenderer.cpp | 2 - .../client/renderer/entity/SpiderRenderer.cpp | 2 - .../texture/PreStitchedTextureMap.cpp | 4 - .../client/renderer/texture/Texture.cpp | 4 - .../renderer/texture/TextureManager.cpp | 2 - .../net/minecraft/server/PlayerList.cpp | 2 - .../net/minecraft/server/Settings.cpp | 2 - .../minecraft/server/level/ServerLevel.cpp | 7 - .../server/level/ServerLevelListener.cpp | 2 - .../Minecraft.World/Header Files/stdafx.h | 1 - .../net/minecraft/network/Connection.cpp | 4 - .../minecraft/network/packet/AddMobPacket.cpp | 2 - .../network/packet/AddPlayerPacket.cpp | 2 - .../packet/BlockRegionUpdatePacket.cpp | 2 - .../minecraft/world/entity/LivingEntity.cpp | 12 - .../net/minecraft/world/entity/Mob.cpp | 8 - .../world/entity/SyncedEntityData.cpp | 12 - .../entity/ai/navigation/PathNavigation.cpp | 4 - .../world/entity/item/ItemEntity.cpp | 2 - .../minecraft/world/entity/player/Player.cpp | 2 - .../world/entity/projectile/Fireball.cpp | 2 - .../world/inventory/InventoryMenu.cpp | 2 - .../net/minecraft/world/item/MapItem.cpp | 2 - .../net/minecraft/world/level/Level.cpp | 12 - .../net/minecraft/world/level/MobSpawner.cpp | 6 - .../world/level/biome/BiomeCache.cpp | 2 - .../world/level/biome/BiomeDecorator.cpp | 2 - .../world/level/biome/BiomeSource.cpp | 2 - .../world/level/biome/FixedBiomeSource.cpp | 6 - .../world/level/chunk/LevelChunk.cpp | 6 - .../chunk/storage/McRegionChunkStorage.cpp | 10 - .../world/level/chunk/storage/RegionFile.cpp | 2 - .../level/chunk/storage/RegionFileCache.cpp | 2 - .../world/level/levelgen/CanyonFeature.cpp | 2 - .../levelgen/structure/MineShaftPieces.cpp | 2 - .../level/levelgen/synth/PerlinNoise.cpp | 2 - .../levelgen/synth/PerlinSimplexNoise.cpp | 2 - .../world/level/pathfinder/PathFinder.cpp | 2 - .../level/saveddata/MapItemSavedData.cpp | 2 - .../level/storage/McRegionLevelStorage.cpp | 2 - .../world/level/tile/BaseRailTile.cpp | 6 - .../minecraft/world/level/tile/ChestTile.cpp | 2 - .../minecraft/world/level/tile/LiquidTile.cpp | 2 - minecraft/nbt/src/NbtIo.cpp | 2 - 64 files changed, 685 deletions(-) diff --git a/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp b/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp index c6c472e74..680328f9a 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Network/Socket.cpp @@ -327,14 +327,12 @@ void Socket::SocketOutputStreamLocal::write(const std::vector& b, unsig if (m_streamOpen != true) { return; } - // MemSect(12); { std::lock_guard lock(s_hostQueueLock[m_queueIdx]); for (unsigned int i = 0; i < length; i++) { s_hostQueue[m_queueIdx].push(b[offset + i]); } } - // MemSect(0); } void Socket::SocketOutputStreamLocal::close() { diff --git a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp index 95d621c7f..bd9c3c989 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/UI/Controls/UIControl_PlayerSkinPreview.cpp @@ -341,9 +341,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer* renderer, double x, if (ws > 1) ws = 1; - MemSect(31); bindTexture(m_customTextureUrl, m_backupTexture); - MemSect(0); glEnable(GL_ALPHA_TEST); // model->prepareMobModel(mob, wp, ws, a); @@ -458,9 +456,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer* renderer, double x, glPopMatrix(); - MemSect(31); // renderName(mob, x, y, z); - MemSect(0); // Reset the model values to stop the changes we made here affecting // anything in game (like the player hand render) diff --git a/minecraft/Minecraft.Client/Header Files/stdafx.h b/minecraft/Minecraft.Client/Header Files/stdafx.h index 3e0dfe14f..a36a77543 100644 --- a/minecraft/Minecraft.Client/Header Files/stdafx.h +++ b/minecraft/Minecraft.Client/Header Files/stdafx.h @@ -140,4 +140,3 @@ using namespace DirectX; #define OutputDebugStringW BREAKTHECOMPILE #endif -void MemSect(int sect); diff --git a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp index bc5cbf0bd..1d848a0fd 100644 --- a/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Linux/Linux_Minecraft.cpp @@ -405,16 +405,6 @@ void DefineActions(void) { _360_JOY_BUTTON_DPAD_DOWN); } -// #define MEMORY_TRACKING - -#if defined(MEMORY_TRACKING) -void ResetMem(); -void DumpMem(); -void MemPixStuff(); -#else -void MemSect(int sect) {} -#endif - #if !defined(__linux__) HINSTANCE g_hInst = nullptr; HWND g_hWnd = nullptr; @@ -690,14 +680,6 @@ int main(int argc, const char* argv[]) { static bool bTrialTimerDisplayed = true; -#if defined(MEMORY_TRACKING) - ResetMem(); - MEMORYSTATUS memStat; - GlobalMemoryStatus(&memStat); - printf("RESETMEM start: Avail. phys %d\n", - memStat.dwAvailPhys / (1024 * 1024)); -#endif - RenderManager.Initialise(); // Read the file containing the product codes @@ -797,9 +779,7 @@ int main(int argc, const char* argv[]) { // Tick sentient. PIXBeginNamedEvent(0, "Sentient tick"); - MemSect(37); // SentientManager.Tick(); - MemSect(0); PIXEndNamedEvent(); PIXBeginNamedEvent(0, "Network manager do work #1"); @@ -823,9 +803,7 @@ int main(int argc, const char* argv[]) { g_NetworkManager.GetPlayerCount() == 1 && ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())); } else { - MemSect(28); pMinecraft->soundEngine->tick(nullptr, 0.0f); - MemSect(0); pMinecraft->textures->tick(true, false); if (app.GetReallyChangingSessionType()) { pMinecraft @@ -842,31 +820,6 @@ int main(int argc, const char* argv[]) { g_NetworkManager.Initialise(); } -#if defined(MEMORY_TRACKING) - static bool bResetMemTrack = false; - static bool bDumpMemTrack = false; - - MemPixStuff(); - - if (bResetMemTrack) { - ResetMem(); - MEMORYSTATUS memStat; - GlobalMemoryStatus(&memStat); - printf("RESETMEM: Avail. phys %d\n", - memStat.dwAvailPhys / (1024 * 1024)); - bResetMemTrack = false; - } - - if (bDumpMemTrack) { - DumpMem(); - bDumpMemTrack = false; - MEMORYSTATUS memStat; - GlobalMemoryStatus(&memStat); - printf("DUMPMEM: Avail. phys %d\n", - memStat.dwAvailPhys / (1024 * 1024)); - printf("Renderer used: %d\n", RenderManager.CBuffSize(-1)); - } -#endif ui.tick(); ui.render(); @@ -1031,172 +984,3 @@ void FreeRichPresenceStrings() { } vRichPresenceStrings.clear(); } - -#if 0 // #ifdef MEMORY_TRACKING - -int totalAllocGen = 0; -std::unordered_map allocCounts; -bool trackEnable = false; -bool trackStarted = false; -volatile size_t sizeCheckMin = 1160; -volatile size_t sizeCheckMax = 1160; -volatile int sectCheck = 48; -std::mutex memCS; -uint32_t tlsIdx; - -void* XMemAlloc(size_t dwSize, uint32_t dwAllocAttributes) { - if (!trackStarted) { - void* p = XMemAllocDefault(dwSize, dwAllocAttributes); - size_t realSize = XMemSizeDefault(p, dwAllocAttributes); - totalAllocGen += realSize; - return p; - } - - void* p; - { - std::lock_guard lock(memCS); - - p = XMemAllocDefault(dwSize + 16, dwAllocAttributes); - size_t realSize = XMemSizeDefault(p, dwAllocAttributes) - 16; - - if (trackEnable) { - int sect = ((int)TlsGetValue(tlsIdx)) & 0x3f; - *(((unsigned char*)p) + realSize) = sect; - - if ((realSize >= sizeCheckMin) && (realSize <= sizeCheckMax) && - ((sect == sectCheck) || (sectCheck == -1))) { - app.DebugPrintf("Found one\n"); - } - - if (p) { - totalAllocGen += realSize; - trackEnable = false; - int key = (sect << 26) | realSize; - int oldCount = allocCounts[key]; - allocCounts[key] = oldCount + 1; - - trackEnable = true; - } - } - } - - return p; -} - -void* operator new(size_t size) { - return (unsigned char*)XMemAlloc( - size, MAKE_XALLOC_ATTRIBUTES( - 0, false, true, false, 0, XALLOC_PHYSICAL_ALIGNMENT_DEFAULT, - XALLOC_MEMPROTECT_READWRITE, false, XALLOC_MEMTYPE_HEAP)); -} - -void operator delete(void* p) { - XMemFree(p, MAKE_XALLOC_ATTRIBUTES( - 0, false, true, false, 0, XALLOC_PHYSICAL_ALIGNMENT_DEFAULT, - XALLOC_MEMPROTECT_READWRITE, false, XALLOC_MEMTYPE_HEAP)); -} - -void WINAPI XMemFree(void* pAddress, uint32_t dwAllocAttributes) { - bool special = false; - if (dwAllocAttributes == 0) { - dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES( - 0, false, true, false, 0, XALLOC_PHYSICAL_ALIGNMENT_DEFAULT, - XALLOC_MEMPROTECT_READWRITE, false, XALLOC_MEMTYPE_HEAP); - special = true; - } - if (!trackStarted) { - size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes); - XMemFreeDefault(pAddress, dwAllocAttributes); - totalAllocGen -= realSize; - return; - } - { - std::lock_guard lock(memCS); - if (pAddress) { - size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes) - 16; - - if (trackEnable) { - int sect = *(((unsigned char*)pAddress) + realSize); - totalAllocGen -= realSize; - trackEnable = false; - int key = (sect << 26) | realSize; - int oldCount = allocCounts[key]; - allocCounts[key] = oldCount - 1; - trackEnable = true; - } - XMemFreeDefault(pAddress, dwAllocAttributes); - } - } -} - -size_t WINAPI XMemSize(void* pAddress, uint32_t dwAllocAttributes) { - if (trackStarted) { - return XMemSizeDefault(pAddress, dwAllocAttributes) - 16; - } else { - return XMemSizeDefault(pAddress, dwAllocAttributes); - } -} - -void DumpMem() { - int totalLeak = 0; - for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { - if (it->second > 0) { - app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f, - it->first & 0x03ffffff, it->second, - (it->first & 0x03ffffff) * it->second); - totalLeak += (it->first & 0x03ffffff) * it->second; - } - } - app.DebugPrintf("Total %d\n", totalLeak); -} - -void ResetMem() { - if (!trackStarted) { - trackEnable = true; - trackStarted = true; - totalAllocGen = 0; - tlsIdx = TlsAlloc(); - } - { - std::lock_guard lock(memCS); - trackEnable = false; - allocCounts.clear(); - trackEnable = true; - } -} - -void MemSect(int section) { - unsigned int value = (unsigned int)TlsGetValue(tlsIdx); - if (section == 0) // pop - { - value = (value >> 6) & 0x03ffffff; - } else { - value = (value << 6) | section; - } - TlsSetValue(tlsIdx, (void*)value); -} - -void MemPixStuff() { - const int MAX_SECT = 46; - - int totals[MAX_SECT] = {0}; - - for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { - if (it->second > 0) { - int sect = (it->first >> 26) & 0x3f; - int bytes = it->first & 0x03ffffff; - totals[sect] += bytes * it->second; - } - } - - unsigned int allSectsTotal = 0; - for (int i = 0; i < MAX_SECT; i++) { - allSectsTotal += totals[i]; - PIXAddNamedCounter(((float)totals[i]) / 1024.0f, "MemSect%d", i); - } - - PIXAddNamedCounter(((float)allSectsTotal) / (4096.0f), - "MemSect total pages"); -} - -#endif diff --git a/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp b/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp index bc1687b66..42e7d2788 100644 --- a/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp +++ b/minecraft/Minecraft.Client/Windows64/Source Files/Windows64_Minecraft.cpp @@ -376,16 +376,6 @@ void DefineActions(void) { _360_JOY_BUTTON_DPAD_DOWN); } -// #define MEMORY_TRACKING - -#if defined(MEMORY_TRACKING) -void ResetMem(); -void DumpMem(); -void MemPixStuff(); -#else -void MemSect(int sect) {} -#endif - HINSTANCE g_hInst = nullptr; HWND g_hWnd = nullptr; D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL; @@ -717,14 +707,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, static bool bTrialTimerDisplayed = true; -#if defined(MEMORY_TRACKING) - ResetMem(); - MEMORYSTATUS memStat; - GlobalMemoryStatus(&memStat); - printf("RESETMEM start: Avail. phys %d\n", - memStat.dwAvailPhys / (1024 * 1024)); -#endif - app.loadMediaArchive(); RenderManager.Initialise(g_pd3dDevice, g_pSwapChain); @@ -828,9 +810,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // Tick sentient. PIXBeginNamedEvent(0, "Sentient tick"); - MemSect(37); // SentientManager.Tick(); - MemSect(0); PIXEndNamedEvent(); PIXBeginNamedEvent(0, "Network manager do work #1"); @@ -846,9 +826,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, g_NetworkManager.GetPlayerCount() == 1 && ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())); } else { - MemSect(28); pMinecraft->soundEngine->tick(nullptr, 0.0f); - MemSect(0); pMinecraft->textures->tick(true, false); if (app.GetReallyChangingSessionType()) { pMinecraft @@ -860,31 +838,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, pMinecraft->soundEngine->playMusicTick(); -#if defined(MEMORY_TRACKING) - static bool bResetMemTrack = false; - static bool bDumpMemTrack = false; - - MemPixStuff(); - - if (bResetMemTrack) { - ResetMem(); - MEMORYSTATUS memStat; - GlobalMemoryStatus(&memStat); - printf("RESETMEM: Avail. phys %d\n", - memStat.dwAvailPhys / (1024 * 1024)); - bResetMemTrack = false; - } - - if (bDumpMemTrack) { - DumpMem(); - bDumpMemTrack = false; - MEMORYSTATUS memStat; - GlobalMemoryStatus(&memStat); - printf("DUMPMEM: Avail. phys %d\n", - memStat.dwAvailPhys / (1024 * 1024)); - printf("Renderer used: %d\n", RenderManager.CBuffSize(-1)); - } -#endif ui.tick(); ui.render(); // Present the frame. @@ -921,172 +874,3 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // app.Uninit(); g_pd3dDevice->Release(); } - -#if defined(MEMORY_TRACKING) - -int totalAllocGen = 0; -std::unordered_map allocCounts; -bool trackEnable = false; -bool trackStarted = false; -volatile size_t sizeCheckMin = 1160; -volatile size_t sizeCheckMax = 1160; -volatile int sectCheck = 48; -std::mutex memCS; -uint32_t tlsIdx; - -void* XMemAlloc(size_t dwSize, uint32_t dwAllocAttributes) { - if (!trackStarted) { - void* p = XMemAllocDefault(dwSize, dwAllocAttributes); - size_t realSize = XMemSizeDefault(p, dwAllocAttributes); - totalAllocGen += realSize; - return p; - } - - void* p; - { - std::lock_guard lock(memCS); - - p = XMemAllocDefault(dwSize + 16, dwAllocAttributes); - size_t realSize = XMemSizeDefault(p, dwAllocAttributes) - 16; - - if (trackEnable) { - int sect = ((int)TlsGetValue(tlsIdx)) & 0x3f; - *(((unsigned char*)p) + realSize) = sect; - - if ((realSize >= sizeCheckMin) && (realSize <= sizeCheckMax) && - ((sect == sectCheck) || (sectCheck == -1))) { - app.DebugPrintf("Found one\n"); - } - - if (p) { - totalAllocGen += realSize; - trackEnable = false; - int key = (sect << 26) | realSize; - int oldCount = allocCounts[key]; - allocCounts[key] = oldCount + 1; - - trackEnable = true; - } - } - } - - return p; -} - -void* operator new(size_t size) { - return (unsigned char*)XMemAlloc( - size, MAKE_XALLOC_ATTRIBUTES( - 0, false, true, false, 0, XALLOC_PHYSICAL_ALIGNMENT_DEFAULT, - XALLOC_MEMPROTECT_READWRITE, false, XALLOC_MEMTYPE_HEAP)); -} - -void operator delete(void* p) { - XMemFree(p, MAKE_XALLOC_ATTRIBUTES( - 0, false, true, false, 0, XALLOC_PHYSICAL_ALIGNMENT_DEFAULT, - XALLOC_MEMPROTECT_READWRITE, false, XALLOC_MEMTYPE_HEAP)); -} - -void WINAPI XMemFree(void* pAddress, uint32_t dwAllocAttributes) { - bool special = false; - if (dwAllocAttributes == 0) { - dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES( - 0, false, true, false, 0, XALLOC_PHYSICAL_ALIGNMENT_DEFAULT, - XALLOC_MEMPROTECT_READWRITE, false, XALLOC_MEMTYPE_HEAP); - special = true; - } - if (!trackStarted) { - size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes); - XMemFreeDefault(pAddress, dwAllocAttributes); - totalAllocGen -= realSize; - return; - } - { - std::lock_guard lock(memCS); - if (pAddress) { - size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes) - 16; - - if (trackEnable) { - int sect = *(((unsigned char*)pAddress) + realSize); - totalAllocGen -= realSize; - trackEnable = false; - int key = (sect << 26) | realSize; - int oldCount = allocCounts[key]; - allocCounts[key] = oldCount - 1; - trackEnable = true; - } - XMemFreeDefault(pAddress, dwAllocAttributes); - } - } -} - -size_t WINAPI XMemSize(void* pAddress, uint32_t dwAllocAttributes) { - if (trackStarted) { - return XMemSizeDefault(pAddress, dwAllocAttributes) - 16; - } else { - return XMemSizeDefault(pAddress, dwAllocAttributes); - } -} - -void DumpMem() { - int totalLeak = 0; - for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { - if (it->second > 0) { - app.DebugPrintf("%d %d %d %d\n", (it->first >> 26) & 0x3f, - it->first & 0x03ffffff, it->second, - (it->first & 0x03ffffff) * it->second); - totalLeak += (it->first & 0x03ffffff) * it->second; - } - } - app.DebugPrintf("Total %d\n", totalLeak); -} - -void ResetMem() { - if (!trackStarted) { - trackEnable = true; - trackStarted = true; - totalAllocGen = 0; - tlsIdx = TlsAlloc(); - } - { - std::lock_guard lock(memCS); - trackEnable = false; - allocCounts.clear(); - trackEnable = true; - } -} - -void MemSect(int section) { - unsigned int value = (unsigned int)TlsGetValue(tlsIdx); - if (section == 0) // pop - { - value = (value >> 6) & 0x03ffffff; - } else { - value = (value << 6) | section; - } - TlsSetValue(tlsIdx, (void*)value); -} - -void MemPixStuff() { - const int MAX_SECT = 46; - - int totals[MAX_SECT] = {0}; - - for (auto it = allocCounts.begin(); it != allocCounts.end(); it++) { - if (it->second > 0) { - int sect = (it->first >> 26) & 0x3f; - int bytes = it->first & 0x03ffffff; - totals[sect] += bytes * it->second; - } - } - - unsigned int allSectsTotal = 0; - for (int i = 0; i < MAX_SECT; i++) { - allSectsTotal += totals[i]; - PIXAddNamedCounter(((float)totals[i]) / 1024.0f, "MemSect%d", i); - } - - PIXAddNamedCounter(((float)allSectsTotal) / (4096.0f), - "MemSect total pages"); -} - -#endif diff --git a/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp b/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp index 5a07931b2..d44621a5e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/Minecraft.cpp @@ -282,9 +282,7 @@ void Minecraft::init() { // Keyboard::create(); Mouse::create(); - MemSect(31); checkGlError(L"Pre startup"); - MemSect(0); // width = Display.getDisplayMode().getWidth(); // height = Display.getDisplayMode().getHeight(); @@ -301,9 +299,7 @@ void Minecraft::init() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); - MemSect(31); checkGlError(L"Startup"); - MemSect(0); // openGLCapabilities = new OpenGLCapabilities(); // 4J - removed @@ -323,9 +319,7 @@ void Minecraft::init() { // } catch (Exception e) { // } - MemSect(31); checkGlError(L"Post startup"); - MemSect(0); gui = new Gui(this); if (connectToIp != L"") // 4J - was nullptr comparison @@ -1560,9 +1554,7 @@ void Minecraft::run_middle() { // // 4J added } // int64_t tickDuraction = System::nanoTime() - beforeTickTime; - MemSect(31); checkGlError(L"Pre render"); - MemSect(0); TileRenderer::fancy = options->fancyGraphics; @@ -1719,9 +1711,7 @@ void Minecraft::run_middle() { } } */ - MemSect(31); checkGlError(L"Post render"); - MemSect(0); frames++; // pause = !isClientSide() && screen != nullptr && // screen->isPauseScreen(); @@ -1735,11 +1725,9 @@ void Minecraft::run_middle() { #if !defined(_CONTENT_PACKAGE) while (System::nanoTime() >= lastTime + 1000000000) { - MemSect(31); fpsString = _toString(frames) + L" fps, " + _toString(Chunk::updates) + L" chunk updates"; - MemSect(0); Chunk::updates = 0; lastTime += 1000000000; frames = 0; @@ -1978,10 +1966,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { // soundEngine.playMusicTick(); if (!pause && level != nullptr) gameMode->tick(); - MemSect(31); glBindTexture(GL_TEXTURE_2D, textures->loadTexture(TN_TERRAIN)); // L"/terrain.png")); - MemSect(0); if (bFirst) { PIXBeginNamedEvent(0, "Texture tick"); if (!pause) textures->tick(bUpdateTextures); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp b/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp index ed85f4abe..82007a2a6 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/gui/Gui.cpp @@ -342,10 +342,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { // the crosshair ///////////////////////////////////////////////////////////////////////////////////// if (bDisplayGui) { - MemSect(31); minecraft->textures->bindTexture( &GUI_GUI_LOCATION); // 4J was L"/gui/gui.png" - MemSect(0); std::shared_ptr inventory = minecraft->player->inventory; if (bTwoPlayerSplitscreen) { @@ -380,10 +378,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { 0, 22, 24, 22); } - MemSect(31); minecraft->textures->bindTexture( &GUI_ICONS_LOCATION); // L"/gui/icons.png")); - MemSect(0); glEnable(GL_BLEND); RenderManager.StateSetBlendFactor(0xffffff | (((unsigned int)fVal) << 24)); @@ -923,7 +919,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { // } #if !defined(_FINAL_BUILD) - MemSect(31); if (minecraft->options->renderDebug) { glPushMatrix(); if (Minecraft::warezTime > 0) glTranslatef(0, 32, 0); @@ -1032,7 +1027,6 @@ max) + "% (" + (total / 1024 / 1024) + "MB)"; drawString(font, msg, screenWidth glPopMatrix(); } - MemSect(0); #endif lastTickA = a; @@ -1191,9 +1185,7 @@ void Gui::renderPumpkin(int w, int h) { glColor4f(1, 1, 1, 1); glDisable(GL_ALPHA_TEST); - MemSect(31); minecraft->textures->bindTexture(&PUMPKIN_BLUR_LOCATION); - MemSect(0); Tesselator* t = Tesselator::getInstance(); t->begin(); t->vertexUV((float)(0), (float)(h), (float)(-90), (float)(0), (float)(1)); @@ -1250,10 +1242,8 @@ void Gui::renderTp(float br, int w, int h) { glDepthMask(false); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(1, 1, 1, br); - MemSect(31); minecraft->textures->bindTexture( &TextureAtlas::LOCATION_BLOCKS); // L"/terrain.png")); - MemSect(0); Icon* slot = Tile::portalTile->getTexture(Facing::UP); float u0 = slot->getU0(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp index 78477c82d..f354c7021 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/ClientConnection.cpp @@ -197,10 +197,8 @@ void ClientConnection::handleLogin(std::shared_ptr packet) { minecraft->gameMode = new TrialMode(ProfileManager.GetPrimaryPad(), minecraft, this); } else { - MemSect(13); minecraft->gameMode = new ConsoleGameMode( ProfileManager.GetPrimaryPad(), minecraft, this); - MemSect(0); } Level* dimensionLevel = minecraft->getLevel(packet->dimension); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp index 8262021e5..ae38a726f 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.cpp @@ -701,9 +701,7 @@ void MultiPlayerLevel::animateTickDoWork() { // be based on the current player. Minecraft::GetInstance()->animateTickLevel = this; - MemSect(31); Random* animateRandom = new Random(); - MemSect(0); for (int i = 0; i < ticksPerChunk; i++) { for (auto it = chunksToAnimate.begin(); it != chunksToAnimate.end(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp b/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp index 3776607c9..04a41112d 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/particle/ParticleEngine.cpp @@ -110,14 +110,12 @@ void ParticleEngine::render(std::shared_ptr player, float a, int list) { break; } - MemSect(31); if (tt == MISC_TEXTURE || tt == DRAGON_BREATH_TEXTURE) textures->bindTexture(&PARTICLES_LOCATION); if (tt == TERRAIN_TEXTURE) textures->bindTexture(&TextureAtlas::LOCATION_BLOCKS); if (tt == ITEM_TEXTURE) textures->bindTexture(&TextureAtlas::LOCATION_ITEMS); - MemSect(0); Tesselator* t = Tesselator::getInstance(); glColor4f(1.0f, 1.0f, 1.0f, 1); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp index 92ff48f65..20c7a61d0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Chunk.cpp @@ -463,9 +463,7 @@ void Chunk::rebuild() { if (!started) { started = true; - MemSect(31); glNewList(lists + currentLayer, GL_COMPILE); - MemSect(0); glDepthMask(true); // 4J added t->useCompactVertices(true); // 4J added t->begin(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp index efba87130..fa8873bb0 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/GameRenderer.cpp @@ -253,9 +253,7 @@ void GameRenderer::pick(float a) { double range = mc->gameMode->getPickRange(); delete mc->hitResult; - MemSect(31); mc->hitResult = mc->cameraTargetPlayer->pick(range, a); - MemSect(0); // 4J - added - stop blocks right at the edge of the world from being // pickable so we shouldn't be able to directly destroy or create anything @@ -1253,11 +1251,9 @@ void GameRenderer::renderLevel(float a, int64_t until) { } PIXBeginNamedEvent(0, "Culling"); - MemSect(31); // Culler *frustum = new FrustumCuller(); FrustumCuller frustObj; Culler* frustum = &frustObj; - MemSect(0); frustum->prepare(xOff, yOff, zOff); { @@ -1300,10 +1296,8 @@ void GameRenderer::renderLevel(float a, int64_t until) { setupFog(0, a); glEnable(GL_FOG); - MemSect(31); mc->textures->bindTexture( &TextureAtlas::LOCATION_BLOCKS); // 4J was L"/terrain.png" - MemSect(0); Lighting::turnOff(); PIXBeginNamedEvent(0, "Level render"); levelRenderer->render(cameraEntity, 0, a, updateChunks); @@ -1372,10 +1366,8 @@ void GameRenderer::renderLevel(float a, int64_t until) { setupFog(0, a); glEnable(GL_BLEND); glDisable(GL_CULL_FACE); - MemSect(31); mc->textures->bindTexture( &TextureAtlas::LOCATION_BLOCKS); // 4J was L"/terrain.png" - MemSect(0); // 4J - have changed this fancy rendering option to work with our // command buffers. The original used to use frame buffer flags to // disable writing to colour when doing the z-only pass, but that value @@ -1573,7 +1565,6 @@ void GameRenderer::tickRain() { if (rainPosSamples > 0 && random->nextInt(3) < rainSoundTime++) { rainSoundTime = 0; - MemSect(24); if (rainPosY > player->y + 1 && level->getTopRainBlock(Mth::floor(player->x), Mth::floor(player->z)) > @@ -1586,7 +1577,6 @@ void GameRenderer::tickRain() { eSoundType_AMBIENT_WEATHER_RAIN, 0.2f, 1.0f); } - MemSect(0); } } @@ -1629,10 +1619,8 @@ void GameRenderer::renderSnowAndRain(float a) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glAlphaFunc(GL_GREATER, 0.01f); - MemSect(31); mc->textures->bindTexture( &SNOW_LOCATION); // 4J was L"/environment/snow.png" - MemSect(0); double xo = player->xOld + (player->x - player->xOld) * a; double yo = player->yOld + (player->y - player->yOld) * a; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp index 356fd14c0..2f89ff525 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/ItemInHandRenderer.cpp @@ -244,10 +244,8 @@ void ItemInHandRenderer::renderItem(std::shared_ptr mob, Tile* tile = Tile::tiles[item->id]; if (item->getIconType() == Icon::TYPE_TERRAIN && tile != nullptr && TileRenderer::canRender(tile->getRenderShape())) { - MemSect(31); minecraft->textures->bindTexture( minecraft->textures->getTextureLocation(Icon::TYPE_TERRAIN)); - MemSect(0); tileRenderer->renderTile( Tile::tiles[item->id], item->getAuxValue(), SharedConstants::TEXTURE_LIGHTING @@ -255,11 +253,9 @@ void ItemInHandRenderer::renderItem(std::shared_ptr mob, : mob->getBrightness( 1)); // 4J - change brought forward from 1.8.2 } else { - MemSect(31); Icon* icon = mob->getItemInHandIcon(item, layer); if (icon == nullptr) { glPopMatrix(); - MemSect(0); return; } @@ -267,7 +263,6 @@ void ItemInHandRenderer::renderItem(std::shared_ptr mob, minecraft->textures->bindTexture( minecraft->textures->getTextureLocation(item->getIconType())); - MemSect(0); Tesselator* t = Tesselator::getInstance(); // Consider forcing the mipmap LOD level to use, if this is to be @@ -555,10 +550,8 @@ void ItemInHandRenderer::render(float a) { float s = 2 / 128.0f; glScalef(s, s, s); - MemSect(31); minecraft->textures->bindTexture( &MAP_BACKGROUND_LOCATION); // 4J was L"/misc/mapbg.png" - MemSect(0); Tesselator* t = Tesselator::getInstance(); // glNormal3f(0, 0, -1); // 4J - changed to use tesselator @@ -725,11 +718,9 @@ void ItemInHandRenderer::render(float a) { // minecraft->textures->loadHttpTexture(minecraft->player->customTextureUrl, // minecraft->player->getTexture())); - MemSect(31); glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadMemTexture( minecraft->player->customTextureUrl, minecraft->player->getTexture())); - MemSect(0); minecraft->textures->clearLastBoundId(); glTranslatef(-1.0f, +3.6f, +3.5f); glRotatef(120, 0, 0, 1); @@ -743,7 +734,6 @@ void ItemInHandRenderer::render(float a) { PlayerRenderer* playerRenderer = (PlayerRenderer*)er; float ss = 1; glScalef(ss, ss, ss); - MemSect(31); // Can't turn off the hand if the player is holding a map std::shared_ptr itemInstance = player->inventory->getSelected(); @@ -753,7 +743,6 @@ void ItemInHandRenderer::render(float a) { eGameSetting_DisplayHand) != 0) { playerRenderer->renderHand(); } - MemSect(0); glPopMatrix(); } @@ -798,10 +787,8 @@ void ItemInHandRenderer::renderScreenEffect(float a) { } if (minecraft->player->isUnderLiquid(Material::water)) { - MemSect(31); minecraft->textures->bindTexture( &UNDERWATER_LOCATION); // 4J was L"/misc/water.png" - MemSect(0); renderWater(a); } glEnable(GL_ALPHA_TEST); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp index 7cda3c9dc..f693ecfa5 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/LevelRenderer.cpp @@ -989,9 +989,7 @@ void LevelRenderer::renderSky(float alpha) { glRotatef(level[playerIndex]->getTimeOfDay(alpha) * 360, 1, 0, 0); float ss = 30; - MemSect(31); textures->bindTexture(&SUN_LOCATION); - MemSect(0); t->begin(); t->vertexUV((float)(-ss), (float)(100), (float)(-ss), (float)(0), (float)(0)); @@ -1441,10 +1439,8 @@ void LevelRenderer::renderAdvancedClouds(float alpha) { glEnable(GL_CULL_FACE); } - MemSect(31); textures->bindTexture( &CLOUDS_LOCATION); // 4J was L"/environment/clouds.png" - MemSect(0); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp index 2b4e65b77..a2c735d4d 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/Textures.cpp @@ -662,7 +662,6 @@ void Textures::loadTexture(BufferedImage* img, int id, bool blur, bool clamp) { // printf("Textures::loadTexture BufferedImage with blur and clamp //%d\n",id); int iMipLevels = 1; - MemSect(33); glBindTexture(GL_TEXTURE_2D, id); if (MIPMAP) { @@ -802,7 +801,6 @@ void Textures::loadTexture(BufferedImage* img, int id, bool blur, bool clamp) { * GL_RGBA, GL_UNSIGNED_BYTE, pixels); } else { } */ delete pixels; // 4J - now creating this dynamically - MemSect(0); } std::vector Textures::anaglyph(std::vector& rawPixels) { @@ -1122,7 +1120,6 @@ void Textures::tick( bool updateTextures, bool tickDynamics) // 4J added updateTextures parameter & tickDynamics { - MemSect(22); if (tickDynamics) { // 4J - added - if we aren't updating the final renderer textures, just // tick each of the dynamic textures instead. This is used so that in @@ -1130,7 +1127,6 @@ void Textures::tick( // that we don't lock the renderer textures twice needlessly and force // the CPU to sync with the GPU. if (!updateTextures) { - MemSect(0); return; } @@ -1159,7 +1155,6 @@ void Textures::tick( it++; } } - MemSect(0); } void Textures::reloadAll() { @@ -1208,7 +1203,6 @@ BufferedImage* Textures::readImage( TEXTURE_NAME texId, const std::wstring& name) // 4J was InputStream *in { BufferedImage* img = nullptr; - MemSect(32); // is this image one of the Title Update ones? bool isTu = IsTUImage(texId, name); std::wstring drive = L""; @@ -1239,7 +1233,6 @@ BufferedImage* Textures::readImage( } } - MemSect(0); return img; } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp index b83161cef..ad738e509 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.cpp @@ -82,9 +82,7 @@ void EntityRenderer::renderFlame(std::shared_ptr e, double x, double y, float s = e->bbWidth * 1.4f; glScalef(s, s, s); - MemSect(31); bindTexture(&TextureAtlas::LOCATION_BLOCKS); - MemSect(0); Tesselator* t = Tesselator::getInstance(); float r = 0.5f; @@ -142,9 +140,7 @@ void EntityRenderer::renderShadow(std::shared_ptr e, double x, double y, glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - MemSect(31); entityRenderDispatcher->textures->bindTexture(&SHADOW_LOCATION); - MemSect(0); Level* level = getLevel(); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp index 30dd49588..e3cf21f83 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/FireballRenderer.cpp @@ -25,9 +25,7 @@ void FireballRenderer::render(std::shared_ptr _fireball, double x, glScalef(s / 1.0f, s / 1.0f, s / 1.0f); Icon* icon = Item::fireball->getIcon( fireball->GetType() == eTYPE_DRAGON_FIREBALL ? 1 : 0); // 14 + 2 * 16; - MemSect(31); bindTexture(fireball); - MemSect(0); Tesselator* t = Tesselator::getInstance(); float u0 = icon->getU0(); @@ -68,9 +66,7 @@ void FireballRenderer::renderFlame(std::shared_ptr e, double x, float s = e->bbWidth * 1.4f; glScalef(s, s, s); - MemSect(31); bindTexture(&TextureAtlas::LOCATION_BLOCKS); - MemSect(0); Tesselator* t = Tesselator::getInstance(); float r = 1.0f; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp index e538ae4d2..ca9f15ca1 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/ItemRenderer.cpp @@ -342,9 +342,7 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, if (item->getIconType() == Icon::TYPE_TERRAIN && TileRenderer::canRender(Tile::tiles[itemId]->getRenderShape())) { PIXBeginNamedEvent(0, "3D gui item render %d\n", itemId); - MemSect(31); textures->bindTexture(&TextureAtlas::LOCATION_BLOCKS); - MemSect(0); Tile* tile = Tile::tiles[itemId]; glPushMatrix(); @@ -397,7 +395,6 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, } else { PIXBeginNamedEvent(0, "2D gui item render %d\n", itemIcon); glDisable(GL_LIGHTING); - MemSect(31); if (item->getIconType() == Icon::TYPE_TERRAIN) { textures->bindTexture( &TextureAtlas::LOCATION_BLOCKS); // L"/terrain.png")); @@ -405,7 +402,6 @@ void ItemRenderer::renderGuiItem(Font* font, Textures* textures, textures->bindTexture( &TextureAtlas::LOCATION_ITEMS); // L"/gui/items.png")); } - MemSect(0); if (itemIcon == nullptr) { itemIcon = textures->getMissingIcon(item->getIconType()); @@ -583,7 +579,6 @@ void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, if (item->count > 1 || !countText.empty() || item->GetForceNumberDisplay()) { - MemSect(31); std::wstring amount = countText; if (amount.empty()) { int count = item->count; @@ -593,7 +588,6 @@ void ItemRenderer::renderGuiItemDecorations(Font* font, Textures* textures, amount = _toString(item->count); } } - MemSect(0); glDisable(GL_LIGHTING); glDisable(GL_DEPTH_TEST); font->drawShadow(amount, x + 19 - 2 - font->width(amount), y + 6 + 3, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp index 782056a4d..4924d9147 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/LivingEntityRenderer.cpp @@ -219,9 +219,7 @@ void LivingEntityRenderer::render(std::shared_ptr _mob, double x, glPopMatrix(); - MemSect(31); renderName(mob, x, y, z); - MemSect(0); } void LivingEntityRenderer::renderModel(std::shared_ptr mob, diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp index 8428c6832..219b10029 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/PigRenderer.cpp @@ -17,9 +17,7 @@ int PigRenderer::prepareArmor(std::shared_ptr _pig, int layer, std::shared_ptr pig = std::dynamic_pointer_cast(_pig); if (layer == 0 && pig->hasSaddle()) { - MemSect(31); bindTexture(&SADDLE_LOCATION); - MemSect(0); return 1; } diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp index 0f6ed3416..5c5548eb1 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SheepRenderer.cpp @@ -24,9 +24,7 @@ int SheepRenderer::prepareArmor(std::shared_ptr _sheep, int layer, ->player)) // 4J-JEV: Todo, merge with java fix (for invisible // sheep armour) in '1.7.5'. { - MemSect(31); bindTexture(&SHEEP_FUR_LOCATION); - MemSect(0); if (sheep->hasCustomName() && sheep->getCustomName().compare(L"jeb_") == 0) { diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp index 486081949..c9483e590 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/entity/SpiderRenderer.cpp @@ -23,9 +23,7 @@ int SpiderRenderer::prepareArmor(std::shared_ptr _spider, std::shared_ptr spider = std::dynamic_pointer_cast(_spider); if (layer != 0) return -1; - MemSect(31); bindTexture(&SPIDER_EYES_LOCATION); - MemSect(0); // 4J - changes brought forward from 1.8.2 float br = 1.0f; // was (1-spider->getBrightness(1))*0.5f; glEnable(GL_BLEND); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp index 65101d182..2c4dd2c0e 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp @@ -88,7 +88,6 @@ void PreStitchedTextureMap::stitch() { int minFilter = Texture::TFLT_NEAREST; int magFilter = Texture::TFLT_NEAREST; - MemSect(32); std::wstring drive = L""; // 4J-PB - need to check for BD patched files @@ -104,7 +103,6 @@ void PreStitchedTextureMap::stitch() { // //ImageIO::read(texturePack->getResource(L"/" + filename)); BufferedImage* image = texturePack->getImageResource(filename, false, true, drive); - MemSect(0); int height = image->getHeight(); int width = image->getWidth(); @@ -130,13 +128,11 @@ void PreStitchedTextureMap::stitch() { preStitched->init(stitchResult, nullptr, x, y, width, height, false); } - MemSect(52); for (auto it = texturesByName.begin(); it != texturesByName.end(); ++it) { StitchedTexture* preStitched = (StitchedTexture*)(it->second); makeTextureAnimated(texturePack, preStitched); } - MemSect(0); // missingPosition = (StitchedTexture // *)texturesByName.find(NAME_MISSING_TEXTURE)->second; diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp index 94daf2648..45d004ec8 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/Texture.cpp @@ -381,9 +381,7 @@ void Texture::transferFromImage(BufferedImage* image) { } } - MemSect(51); data[0] = ByteBuffer::allocateDirect(tempBytes.size()); - MemSect(0); data[0]->clear(); data[0]->put(tempBytes); data[0]->limit(tempBytes.size()); @@ -465,9 +463,7 @@ void Texture::transferFromImage(BufferedImage* image) { } } - MemSect(51); data[level] = ByteBuffer::allocateDirect(tempBytes.size()); - MemSect(0); data[level]->clear(); data[level]->put(tempBytes); data[level]->limit(tempBytes.size()); diff --git a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp index 67e439b66..d37ee51d7 100644 --- a/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/client/renderer/texture/TextureManager.cpp @@ -81,7 +81,6 @@ std::vector* TextureManager::createTextures( int minFilter = Texture::TFLT_NEAREST; int magFilter = Texture::TFLT_NEAREST; - MemSect(32); std::wstring drive = L""; if (texturePack->hasFile(L"res/" + filename, false)) { @@ -99,7 +98,6 @@ std::vector* TextureManager::createTextures( BufferedImage* image = texturePack->getImageResource(filename, false, true, drive); - MemSect(0); int height = image->getHeight(); int width = image->getWidth(); diff --git a/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp b/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp index 250b3e538..9cc5650c3 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/PlayerList.cpp @@ -245,9 +245,7 @@ void PlayerList::placeNewPlayer(Connection* connection, broadcastAll(std::shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerJoinedGame))); - MemSect(14); add(player); - MemSect(0); player->doTick( true, true, diff --git a/minecraft/Minecraft.Client/net/minecraft/server/Settings.cpp b/minecraft/Minecraft.Client/net/minecraft/server/Settings.cpp index cc94304e5..b579a7a9a 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/Settings.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/Settings.cpp @@ -31,9 +31,7 @@ bool Settings::getBoolean(const std::wstring& key, bool defaultValue) { properties[key] = _toString(defaultValue); saveProperties(); } - MemSect(35); bool retval = _fromString(properties[key]); - MemSect(0); return retval; } diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp index f6bbd39f5..42b4579f3 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevel.cpp @@ -315,18 +315,14 @@ void ServerLevel::tick() { PIXEndNamedEvent(); PIXBeginNamedEvent(0, "Tick tiles"); - MemSect(18); tickTiles(); - MemSect(0); PIXEndNamedEvent(); chunkMap->tick(); PIXBeginNamedEvent(0, "Tick villages"); - // MemSect(18); villages->tick(); villageSiege->tick(); - // MemSect(0); PIXEndNamedEvent(); PIXBeginNamedEvent(0, "Tick portal forcer"); @@ -577,7 +573,6 @@ void ServerLevel::addToTickNextTick(int x, int y, int z, int tileId, void ServerLevel::addToTickNextTick(int x, int y, int z, int tileId, int tickDelay, int priorityTilt) { - MemSect(27); TickNextTickData td = TickNextTickData(x, y, z, tileId); int r = 0; if (getInstaTick() && tileId > 0) { @@ -590,7 +585,6 @@ void ServerLevel::addToTickNextTick(int x, int y, int z, int tileId, Tile::tiles[id]->tick(this, td.x, td.y, td.z, random); } } - MemSect(0); return; } else { tickDelay = 1; @@ -610,7 +604,6 @@ void ServerLevel::addToTickNextTick(int x, int y, int z, int tileId, } } } - MemSect(0); } void ServerLevel::forceAddTileTick(int x, int y, int z, int tileId, diff --git a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp index 36ee1d97d..06470aa56 100644 --- a/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp +++ b/minecraft/Minecraft.Client/net/minecraft/server/level/ServerLevelListener.cpp @@ -32,9 +32,7 @@ void ServerLevelListener::addParticle(ePARTICLE_TYPE name, double x, double y, void ServerLevelListener::allChanged() {} void ServerLevelListener::entityAdded(std::shared_ptr entity) { - MemSect(10); level->getTracker()->addEntity(entity); - MemSect(0); } void ServerLevelListener::entityRemoved(std::shared_ptr entity) { diff --git a/minecraft/Minecraft.World/Header Files/stdafx.h b/minecraft/Minecraft.World/Header Files/stdafx.h index a1e4bb5e2..9b2839035 100644 --- a/minecraft/Minecraft.World/Header Files/stdafx.h +++ b/minecraft/Minecraft.World/Header Files/stdafx.h @@ -65,7 +65,6 @@ #define OutputDebugStringW BREAKTHECOMPILE #endif -void MemSect(int sect); #ifdef _WINDOWS64 #include "Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Profile.h" diff --git a/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp b/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp index ed16efdd1..75a93091b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/Connection.cpp @@ -139,7 +139,6 @@ void Connection::setListener(PacketListener* packetListener) { void Connection::send(std::shared_ptr packet) { if (quitting) return; - MemSect(15); // 4J Jev, synchronized (&writeLock) { std::lock_guard lock(writeLock); @@ -156,7 +155,6 @@ void Connection::send(std::shared_ptr packet) { } // 4J Jev, end synchronized. - MemSect(0); } void Connection::queueSend(std::shared_ptr packet) { @@ -549,7 +547,6 @@ int Connection::runRead(void* lpParam) { // try { - MemSect(19); while ( con->running && !con->quitting && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads)) { @@ -561,7 +558,6 @@ int Connection::runRead(void* lpParam) { // whether we should do that as well con->m_hWakeReadThread->waitForSignal(100L); } - MemSect(0); /* 4J JEV, removed try/catch } catch (InterruptedException e) { diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp index f75dcb52e..429459705 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddMobPacket.cpp @@ -78,9 +78,7 @@ void AddMobPacket::read(DataInputStream* dis) // throws IOException xd = dis->readShort(); yd = dis->readShort(); zd = dis->readShort(); - MemSect(1); unpack = SynchedEntityData::unpack(dis); - MemSect(0); } void AddMobPacket::write(DataOutputStream* dos) // throws IOException diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp index b35dafa55..0c24bd87b 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/AddPlayerPacket.cpp @@ -85,9 +85,7 @@ void AddPlayerPacket::read(DataInputStream* dis) // throws IOException m_capeId = *(uint32_t*)&capeId; int32_t privileges = dis->readInt(); m_uiGamePrivileges = *(unsigned int*)&privileges; - MemSect(1); unpack = SynchedEntityData::unpack(dis); - MemSect(0); } void AddPlayerPacket::write(DataOutputStream* dos) // throws IOException diff --git a/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp b/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp index b7b1e2ff5..f069105bd 100644 --- a/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp +++ b/minecraft/Minecraft.World/net/minecraft/network/packet/BlockRegionUpdatePacket.cpp @@ -56,9 +56,7 @@ BlockRegionUpdatePacket::BlockRegionUpdatePacket(int x, int y, int z, int xs, rawBuffer = lc->getReorderedBlocksAndData(x & 0xF, y, z & 0xF, xs, this->ys, zs); } else { - MemSect(50); rawBuffer = level->getBlocksAndData(x, y, z, xs, ys, zs, false); - MemSect(0); } if (rawBuffer.size() == 0) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp index 33a77ad5f..c14248000 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/LivingEntity.cpp @@ -99,9 +99,7 @@ void LivingEntity::_init() { } LivingEntity::LivingEntity(Level* level) : Entity(level) { - MemSect(56); _init(); - MemSect(0); // 4J Stu - This will not call the correct derived function, so moving to // each derived class @@ -775,7 +773,6 @@ bool LivingEntity::hurt(DamageSource* source, float dmg) { } } - MemSect(31); if (getHealth() <= 0) { if (sound) playSound(getDeathSound(), getSoundVolume(), getVoicePitch()); @@ -783,7 +780,6 @@ bool LivingEntity::hurt(DamageSource* source, float dmg) { } else { if (sound) playSound(getHurtSound(), getSoundVolume(), getVoicePitch()); } - MemSect(0); return true; } @@ -930,10 +926,8 @@ void LivingEntity::causeFallDamage(float distance) { Mth::floor(z)); if (t > 0) { const Tile::SoundType* soundType = Tile::tiles[t]->soundType; - MemSect(31); playSound(soundType->getStepSound(), soundType->getVolume() * 0.5f, soundType->getPitch() * 0.75f); - MemSect(0); } } } @@ -1080,7 +1074,6 @@ void LivingEntity::handleEntityEvent(uint8_t id) { hurtTime = hurtDuration = 10; hurtDir = 0; - MemSect(31); // 4J-PB -added because villagers have no sounds int iHurtSound = getHurtSound(); if (iHurtSound != -1) { @@ -1088,10 +1081,8 @@ void LivingEntity::handleEntityEvent(uint8_t id) { iHurtSound, getSoundVolume(), (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f); } - MemSect(0); hurt(DamageSource::genericSource, 0); } else if (id == EntityEvent::DEATH) { - MemSect(31); // 4J-PB -added because villagers have no sounds int iDeathSound = getDeathSound(); if (iDeathSound != -1) { @@ -1099,7 +1090,6 @@ void LivingEntity::handleEntityEvent(uint8_t id) { iDeathSound, getSoundVolume(), (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f); } - MemSect(0); setHealth(0); die(DamageSource::genericSource); } else { @@ -1539,7 +1529,6 @@ void LivingEntity::aiStep() { yya = 0; yRotA = 0; } else { - MemSect(25); if (isEffectiveAi()) { if (useNewAi()) { newServerAiStep(); @@ -1548,7 +1537,6 @@ void LivingEntity::aiStep() { yHeadRot = yRot; } } - MemSect(0); } if (jumping) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp index 4b54f72b1..4d7c424cd 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/Mob.cpp @@ -59,15 +59,11 @@ void Mob::_init() { } Mob::Mob(Level* level) : LivingEntity(level) { - MemSect(57); _init(); - MemSect(0); - MemSect(58); // 4J Stu - We call this again in the derived classes, but need to do it // here for some internal members registerAttributes(); - MemSect(0); lookControl = new LookControl(this); moveControl = new MoveControl(this); @@ -133,12 +129,10 @@ void Mob::defineSynchedData() { int Mob::getAmbientSoundInterval() { return 20 * 4; } void Mob::playAmbientSound() { - MemSect(31); int ambient = getAmbientSound(); if (ambient != -1) { playSound(ambient, getSoundVolume(), getVoicePitch()); } - MemSect(0); } void Mob::baseTick() { @@ -406,7 +400,6 @@ void Mob::checkDespawn() { void Mob::newServerAiStep() { PIXBeginNamedEvent(0, "Tick target selector for %d", GetType()); - MemSect(51); noActionTime++; PIXBeginNamedEvent(0, "Check despawn"); checkDespawn(); @@ -442,7 +435,6 @@ void Mob::newServerAiStep() { PIXBeginNamedEvent(0, "Consider extra wandering"); considerForExtraWandering(isDespawnProtected()); PIXEndNamedEvent(); - MemSect(0); PIXEndNamedEvent(); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp index 203b97301..e2bcc6492 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/SyncedEntityData.cpp @@ -12,68 +12,56 @@ SynchedEntityData::SynchedEntityData() { } void SynchedEntityData::define(int id, int value) { - MemSect(17); checkId(id); int type = TYPE_INT; std::shared_ptr dataItem = std::shared_ptr(new DataItem(type, id, value)); itemsById[id] = dataItem; - MemSect(0); m_isEmpty = false; } void SynchedEntityData::define(int id, uint8_t value) { - MemSect(17); checkId(id); int type = TYPE_BYTE; std::shared_ptr dataItem = std::shared_ptr(new DataItem(type, id, value)); itemsById[id] = dataItem; - MemSect(0); m_isEmpty = false; } void SynchedEntityData::define(int id, short value) { - MemSect(17); checkId(id); int type = TYPE_SHORT; std::shared_ptr dataItem = std::shared_ptr(new DataItem(type, id, value)); itemsById[id] = dataItem; - MemSect(0); m_isEmpty = false; } void SynchedEntityData::define(int id, float value) { - MemSect(17); checkId(id); int type = TYPE_FLOAT; std::shared_ptr dataItem = std::shared_ptr(new DataItem(type, id, value)); itemsById[id] = dataItem; - MemSect(0); m_isEmpty = false; } void SynchedEntityData::define(int id, const std::wstring& value) { - MemSect(17); checkId(id); int type = TYPE_STRING; std::shared_ptr dataItem = std::shared_ptr(new DataItem(type, id, value)); itemsById[id] = dataItem; - MemSect(0); m_isEmpty = false; } void SynchedEntityData::defineNULL(int id, void* pVal) { - MemSect(17); checkId(id); int type = TYPE_ITEMINSTANCE; std::shared_ptr dataItem = std::shared_ptr( new DataItem(type, id, std::shared_ptr())); itemsById[id] = dataItem; - MemSect(0); m_isEmpty = false; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp index 392b04618..3d1ff3ab6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/ai/navigation/PathNavigation.cpp @@ -66,9 +66,7 @@ Path* PathNavigation::createPath(double x, double y, double z) { bool PathNavigation::moveTo(double x, double y, double z, double speedModifier) { - MemSect(52); Path* newPath = createPath(Mth::floor(x), (int)y, Mth::floor(z)); - MemSect(0); // No need to delete newPath here as this will be copied into the member // variable path and the class can assume responsibility for it return moveTo(newPath, speedModifier); @@ -82,9 +80,7 @@ Path* PathNavigation::createPath(std::shared_ptr target) { bool PathNavigation::moveTo(std::shared_ptr target, double speedModifier) { - MemSect(53); Path* newPath = createPath(target); - MemSect(0); // No need to delete newPath here as this will be copied into the member // variable path and the class can assume responsibility for it if (newPath != nullptr) diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp index 69b0256b0..e282b861d 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/item/ItemEntity.cpp @@ -82,10 +82,8 @@ void ItemEntity::tick() { yd = 0.2f; xd = (random->nextFloat() - random->nextFloat()) * 0.2f; zd = (random->nextFloat() - random->nextFloat()) * 0.2f; - MemSect(31); playSound(eSoundType_RANDOM_FIZZ, 0.4f, 2.0f + random->nextFloat() * 0.4f); - MemSect(0); } if (!level->isClientSide) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp index e920d8508..dae68c840 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/player/Player.cpp @@ -115,9 +115,7 @@ Player::Player(Level* level, const std::wstring& name) : LivingEntity(level) { this->name = name; _init(); - MemSect(11); inventoryMenu = new InventoryMenu(inventory, !level->isClientSide, this); - MemSect(0); containerMenu = inventoryMenu; diff --git a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp index 7654c010c..07e6502f1 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/entity/projectile/Fireball.cpp @@ -165,7 +165,6 @@ void Fireball::tick() { flightTime++; } - MemSect(41); Vec3 from(x, y, z); Vec3 to(x + xd, y + yd, z + zd); HitResult* res = level->clip(&from, &to); @@ -204,7 +203,6 @@ void Fireball::tick() { delete res; res = new HitResult(hitEntity); } - MemSect(0); if (res != nullptr) { onHit(res); diff --git a/minecraft/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp b/minecraft/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp index b2542d2ac..9ca033ad5 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/inventory/InventoryMenu.cpp @@ -69,10 +69,8 @@ void InventoryMenu::slotsChanged() // 4J used to take a shared_ptr // but wasn't using it, so removed to // simplify things { - MemSect(23); resultSlots->setItem( 0, Recipes::getInstance()->getItemFor(craftSlots, owner->level)); - MemSect(0); } void InventoryMenu::removed(std::shared_ptr player) { diff --git a/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp b/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp index 1b7190fa9..ec566f960 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/item/MapItem.cpp @@ -42,10 +42,8 @@ std::shared_ptr MapItem::getSavedData(short idNum, std::shared_ptr MapItem::getSavedData( std::shared_ptr itemInstance, Level* level) { - MemSect(31); std::wstring id = std::wstring(L"map_") + _toString(itemInstance->getAuxValue()); - MemSect(0); std::shared_ptr mapItemSavedData = std::dynamic_pointer_cast( level->getSavedData(typeid(MapItemSavedData), id)); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp index f54affbb0..a396cf04e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/Level.cpp @@ -1611,18 +1611,12 @@ bool Level::addEntity(std::shared_ptr e) { updateSleepingPlayerList(); } - MemSect(42); getChunk(xc, zc)->addEntity(e); - MemSect(0); { std::lock_guard lock(m_entitiesCS); - MemSect(43); entities.push_back(e); - MemSect(0); } - MemSect(44); entityAdded(e); - MemSect(0); return true; } return false; @@ -2305,9 +2299,7 @@ void Level::tick(std::shared_ptr e, bool actual) { if (hasChunk(xcn, zcn)) { e->inChunk = true; - MemSect(39); getChunk(xcn, zcn)->addEntity(e); - MemSect(0); } else { e->inChunk = false; // e.remove(); @@ -3372,7 +3364,6 @@ std::vector >* Level::getEntities( std::vector >* Level::getEntities( std::shared_ptr except, AABB* bb, const EntitySelector* selector) { - MemSect(40); es.clear(); int xc0 = Mth::floor((bb->x0 - 2) / 16); int xc1 = Mth::floor((bb->x1 + 2) / 16); @@ -3385,7 +3376,6 @@ std::vector >* Level::getEntities( getChunk(xc, zc)->getEntities(except, bb, es, selector); } } - MemSect(0); return &es; } @@ -3694,7 +3684,6 @@ std::shared_ptr Level::getNearestPlayer(std::shared_ptr source, std::shared_ptr Level::getNearestPlayer(double x, double y, double z, double maxDist, double maxYDist /*= -1*/) { - MemSect(21); double best = -1; std::shared_ptr result = nullptr; auto itEnd = players.end(); @@ -3712,7 +3701,6 @@ std::shared_ptr Level::getNearestPlayer(double x, double y, double z, result = p; } } - MemSect(0); return result; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/MobSpawner.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/MobSpawner.cpp index ff92a1281..876dfb28b 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/MobSpawner.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/MobSpawner.cpp @@ -44,7 +44,6 @@ const int MobSpawner::tick(ServerLevel* level, bool spawnEnemies, if (!spawnEnemies && !spawnFriendlies && !spawnPersistent) { return 0; } - MemSect(20); chunksToPoll.clear(); // 4J - rewritten to add chunks interleaved by player, and to add them from @@ -103,11 +102,8 @@ const int MobSpawner::tick(ServerLevel* level, bool spawnEnemies, } delete[] xx; delete[] zz; - MemSect(0); int count = 0; - MemSect(31); Pos* spawnPos = level->getSharedSpawnPos(); - MemSect(0); for (unsigned int i = 0; i < MobCategory::values.size(); i++) { MobCategory* mobCategory = MobCategory::values[i]; @@ -210,13 +206,11 @@ const int MobSpawner::tick(ServerLevel* level, bool spawnEnemies, // 4J - removed try/catch // try // { - MemSect(29); // mob = // type.mobClass.getConstructor(Level.class).newInstance(level); mob = std::dynamic_pointer_cast( EntityIO::newByEnumType(currentMobType->mobClass, level)); - MemSect(0); // } // catch //(exception e) diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp index 67f8d50be..c4712bed9 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeCache.cpp @@ -83,11 +83,9 @@ BiomeCache::Block* BiomeCache::getBlockAt(int x, int z) { auto it = cached.find(slot); Block* block = nullptr; if (it == cached.end()) { - MemSect(48); block = new Block(x, z, this); cached[slot] = block; all.push_back(block); - MemSect(0); } else { block = it->second; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp index 767c6aea3..f03251fa1 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeDecorator.cpp @@ -138,9 +138,7 @@ void BiomeDecorator::decorate() { int x = xo + random->nextInt(16) + 8; int y = random->nextInt(Level::genDepth); int z = zo + random->nextInt(16) + 8; - MemSect(50); Feature* grassFeature = biome->getGrassFeature(random); - MemSect(0); grassFeature->place(level, random, x, y, z); delete grassFeature; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp index 329b694fd..c9a947508 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/BiomeSource.cpp @@ -317,7 +317,6 @@ TilePos* BiomeSource::findBiome(int x, int z, int r, int w = x1 - x0 + 1; int h = z1 - z0 + 1; - MemSect(50); std::vector biomes = layer->getArea(x0, z0, w, h); TilePos* res = nullptr; int found = 0; @@ -333,7 +332,6 @@ TilePos* BiomeSource::findBiome(int x, int z, int r, } } } - MemSect(0); return res; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp index 72109b529..448f896e8 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/biome/FixedBiomeSource.cpp @@ -69,9 +69,7 @@ void FixedBiomeSource::getDownfallBlock(std::vector& downfalls, int x, i // arrays output if pointers are passed in (_temperatures, _downfalls) void FixedBiomeSource::getBiomeBlock(std::vector& biomes, int x, int z, int w, int h, bool useCache) const { - MemSect(36); biomes = std::vector(w * h); - MemSect(0); Arrays::fill(biomes, 0, w * h, biome); } @@ -80,9 +78,7 @@ void FixedBiomeSource::getBiomeBlock(std::vector& biomes, int x, int z, // arrays output if pointers are passed in (_temperatures, _downfalls) void FixedBiomeSource::getBiomeIndexBlock(std::vector& biomeIndices, int x, int z, int w, int h, bool useCache) const { - MemSect(36); biomeIndices = std::vector(w * h); - MemSect(0); int biomeIndex = biome->id; Arrays::fill(biomeIndices, 0, w * h, biomeIndex); } @@ -92,9 +88,7 @@ void FixedBiomeSource::getBiomeIndexBlock(std::vector& biomeIndices, in // arrays output if pointers are passed in (_temperatures, _downfalls) void FixedBiomeSource::getRawBiomeBlock(std::vector& biomes, int x, int z, int w, int h) const { - MemSect(36); biomes = std::vector(w * h); - MemSect(0); Arrays::fill(biomes, 0, w * h, biome); } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp index 324c19a66..65b09a58f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp @@ -57,7 +57,6 @@ void LevelChunk::init(Level* level, int x, int z) { this->level = level; this->x = x; this->z = z; - MemSect(1); heightmap = std::vector(16 * 16); { std::lock_guard lock(m_csEntities); @@ -66,7 +65,6 @@ void LevelChunk::init(Level* level, int x, int z) { } } - MemSect(0); lowestHeightmap = 256; inhabitedTime = 0; @@ -251,7 +249,6 @@ void LevelChunk::stopSharingTilesAndData() { return; } - MemSect(47); // Changed to used compressed storage - these CTORs make deep copies of // the storage passed as a parameter @@ -281,7 +278,6 @@ void LevelChunk::stopSharingTilesAndData() { */ sharingTilesAndData = false; - MemSect(0); } #endif } @@ -1176,9 +1172,7 @@ void LevelChunk::removeEntity(std::shared_ptr e, int yc) { entityBlocks[yc]->erase(it); // 4J - we don't want storage creeping up here as thinkgs move round // the world accumulating up spare space - MemSect(31); entityBlocks[yc]->shrink_to_fit(); - MemSect(0); } } } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp index 8b943dd81..8bab14780 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp @@ -96,19 +96,15 @@ LevelChunk* McRegionChunkStorage::load(Level* level, int x, int z) { if (m_saveFile->getOriginalSaveVersion() >= SAVE_FILE_VERSION_COMPRESSED_CHUNK_STORAGE) { if (regionChunkInputStream != nullptr) { - MemSect(9); levelChunk = OldChunkStorage::load(level, regionChunkInputStream); loadEntities(level, levelChunk); - MemSect(0); regionChunkInputStream->deleteChildStream(); delete regionChunkInputStream; } } else { CompoundTag* chunkData; if (regionChunkInputStream != nullptr) { - MemSect(8); chunkData = NbtIo::read((DataInput*)regionChunkInputStream); - MemSect(0); } else { return nullptr; } @@ -134,10 +130,8 @@ LevelChunk* McRegionChunkStorage::load(Level* level, int x, int z) { delete chunkData; return nullptr; } - MemSect(9); levelChunk = OldChunkStorage::load(level, chunkData->getCompound(L"Level")); - MemSect(0); if (!levelChunk->isAt(x, z)) { char buf[256]; sprintf(buf, @@ -153,9 +147,7 @@ LevelChunk* McRegionChunkStorage::load(Level* level, int x, int z) { // can never reload from it // chunkData->putInt(L"xPos", x); // chunkData->putInt(L"zPos", z); - // MemSect(10); // levelChunk = OldChunkStorage::load(level, - // chunkData->getCompound(L"Level")); MemSect(0); } #if defined(SPLIT_SAVES) loadEntities(level, levelChunk); @@ -184,7 +176,6 @@ void McRegionChunkStorage::save(Level* level, LevelChunk* levelChunk) { // running saves on multiple threads these sections have a lot of // contention. Better to let each thread have its turn at a higher level of // granularity. - MemSect(30); PIXBeginNamedEvent(0, "Getting output stream\n"); DataOutputStream* output = RegionFileCache::getChunkDataOutputStream( m_saveFile, m_prefix, levelChunk->x, levelChunk->z); @@ -232,7 +223,6 @@ void McRegionChunkStorage::save(Level* level, LevelChunk* levelChunk) { } PIXEndNamedEvent(); } - MemSect(0); LevelData* levelInfo = level->getLevelData(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp index 635f0fcce..d4e4c07c1 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.cpp @@ -231,10 +231,8 @@ DataInputStream* RegionFile::getChunkDataInputStream( return nullptr; } - MemSect(50); std::uint8_t* data = new std::uint8_t[length]; std::uint8_t* decomp = new std::uint8_t[decompLength]; - MemSect(0); readDecompLength = decompLength; m_saveFile->readFile(fileEntry, data, length, &numberOfBytesRead); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp index c5b9c784a..94bda67dd 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.cpp @@ -27,7 +27,6 @@ RegionFile* RegionFileCache::_getRegionFile( // File file(regionDir, wstring(L"r.") + _toString(chunkX>>5) + L"." + // _toString(chunkZ>>5) + L".mcr" ); - MemSect(31); File file; if (useSplitSaves(saveFile->getSavePlatform())) { file = File(prefix + std::wstring(L"r.") + _toString(chunkX >> 4) + @@ -36,7 +35,6 @@ RegionFile* RegionFileCache::_getRegionFile( file = File(prefix + std::wstring(L"r.") + _toString(chunkX >> 5) + L"." + _toString(chunkZ >> 5) + L".mcr"); } - MemSect(0); RegionFile* ref = nullptr; auto it = cache.find(file); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp index b635a7fd9..938c550df 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CanyonFeature.cpp @@ -8,9 +8,7 @@ void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, std::vector& blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { - MemSect(49); Random* random = new Random(seed); - MemSect(0); double xMid = xOffs * 16 + 8; double zMid = zOffs * 16 + 8; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp index 9b6a8407a..b2650d530 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/structure/MineShaftPieces.cpp @@ -92,9 +92,7 @@ StructurePiece* MineShaftPieces::generateAndAddPiece( StructurePiece* newPiece = createRandomShaftPiece( pieces, random, footX, footY, footZ, direction, depth + 1); if (newPiece != nullptr) { - MemSect(50); pieces->push_back(newPiece); - MemSect(0); newPiece->addChildren(startPiece, pieces, random); } return newPiece; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp index 7b06a1858..c0adc5f2a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinNoise.cpp @@ -10,13 +10,11 @@ PerlinNoise::PerlinNoise(int levels) { PerlinNoise::PerlinNoise(Random* random, int levels) { init(random, levels); } void PerlinNoise::init(Random* random, int levels) { - MemSect(2); this->levels = levels; noiseLevels = new ImprovedNoise*[levels]; for (int i = 0; i < levels; i++) { noiseLevels[i] = new ImprovedNoise(random); } - MemSect(0); } PerlinNoise::~PerlinNoise() { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp index dc84a6a10..e4a52b62f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/synth/PerlinSimplexNoise.cpp @@ -12,13 +12,11 @@ PerlinSimplexNoise::PerlinSimplexNoise(Random* random, int levels) { } void PerlinSimplexNoise::init(Random* random, int levels) { - MemSect(3); this->levels = levels; noiseLevels = new SimplexNoise*[levels]; for (int i = 0; i < levels; i++) { noiseLevels[i] = new SimplexNoise(random); } - MemSect(0); } PerlinSimplexNoise::~PerlinSimplexNoise() { diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp index 0c2a6220f..7711314c3 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/pathfinder/PathFinder.cpp @@ -190,9 +190,7 @@ Node* PathFinder::getNode(Entity* entity, int x, int y, int z, Node* size, Node* node; auto it = nodes.find(i); if (it == nodes.end()) { - MemSect(54); node = new Node(x, y, z); - MemSect(0); nodes.insert(std::unordered_map::value_type(i, node)); } else { node = (*it).second; diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp index 12dcac681..ddfa5ab73 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/saveddata/MapItemSavedData.cpp @@ -414,12 +414,10 @@ void MapItemSavedData::tickCarriedBy(std::shared_ptr player, } #endif - MemSect(45); decorations.push_back(new MapDecoration( imgIndex, x, y, rot, decorationPlayer->entityId, (decorationPlayer == hp->player || decorationPlayer->canShowOnMaps()))); - MemSect(0); } } } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp index a7f8d3d1a..efbe4cfd2 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/storage/McRegionLevelStorage.cpp @@ -93,9 +93,7 @@ ChunkStorage* McRegionLevelStorage::createChunkStorage(Dimension* dimension) { void McRegionLevelStorage::saveLevelData( LevelData* levelData, std::vector >* players) { levelData->setVersion(MCREGION_VERSION_ID); - MemSect(38); DirectoryLevelStorage::saveLevelData(levelData, players); - MemSect(0); } void McRegionLevelStorage::closeAll() { RegionFileCache::clear(); } \ No newline at end of file diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp index 5b7f16893..9a46020cb 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/BaseRailTile.cpp @@ -41,7 +41,6 @@ void BaseRailTile::Rail::updateConnections(int direction) { delete connections[i]; } connections.clear(); - MemSect(50); if (direction == DIR_FLAT_Z) { connections.push_back(new TilePos(x, y, z - 1)); connections.push_back(new TilePos(x, y, z + 1)); @@ -73,7 +72,6 @@ void BaseRailTile::Rail::updateConnections(int direction) { connections.push_back(new TilePos(x + 1, y, z)); connections.push_back(new TilePos(x, y, z - 1)); } - MemSect(0); } } @@ -87,9 +85,7 @@ void BaseRailTile::Rail::removeSoftConnections() { i--; } else { delete connections[i]; - MemSect(50); connections[i] = new TilePos(rail->x, rail->y, rail->z); - MemSect(0); } delete rail; } @@ -169,9 +165,7 @@ bool BaseRailTile::Rail::canConnectTo(Rail* rail) { void BaseRailTile::Rail::connectTo(Rail* rail) { if (m_bValidRail) { - MemSect(50); connections.push_back(new TilePos(rail->x, rail->y, rail->z)); - MemSect(0); bool n = hasConnection(x, y, z - 1); bool s = hasConnection(x, y, z + 1); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp index ae213494c..df6a70845 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/ChestTile.cpp @@ -317,10 +317,8 @@ std::shared_ptr ChestTile::getContainer(Level* level, int x, int y, } std::shared_ptr ChestTile::newTileEntity(Level* level) { - MemSect(50); std::shared_ptr retval = std::shared_ptr(new ChestTileEntity()); - MemSect(0); return retval; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp index fdffce1ed..76f3683ba 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/tile/LiquidTile.cpp @@ -352,12 +352,10 @@ void LiquidTile::updateLiquid(Level* level, int x, int y, int z) { } void LiquidTile::fizz(Level* level, int x, int y, int z) { - MemSect(31); level->playSound( x + 0.5f, y + 0.5f, z + 0.5f, eSoundType_RANDOM_FIZZ, 0.5f, 2.6f + (level->random->nextFloat() - level->random->nextFloat()) * 0.8f); - MemSect(0); for (int i = 0; i < 8; i++) { level->addParticle(eParticleType_largesmoke, x + Math::random(), y + 1.2, z + Math::random(), 0, 0, 0); diff --git a/minecraft/nbt/src/NbtIo.cpp b/minecraft/nbt/src/NbtIo.cpp index 8ee8d0c67..2cae95c68 100644 --- a/minecraft/nbt/src/NbtIo.cpp +++ b/minecraft/nbt/src/NbtIo.cpp @@ -2,13 +2,11 @@ #include "nbt/NbtIo.h" CompoundTag* NbtIo::readCompressed(InputStream* in) { - // MemSect(26); // 4J - this was using a try/finally block DataInputStream dis = DataInputStream(in); // 4J - was new GZIPInputStream as well CompoundTag* ret = NbtIo::read((DataInput*)&dis); dis.close(); - // MemSect(0); return ret; }