From e4883d87fcc3f17eab83cc56aa577222ec325c0f Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:58:49 -0500 Subject: [PATCH] replace __debugbreak with assert, fix full build --- targets/app/common/DLC/DLCManager.cpp | 2 +- targets/app/common/DLC/DLCPack.cpp | 6 ++-- targets/app/common/Game.cpp | 2 +- .../app/common/GameRules/GameRuleManager.cpp | 2 +- .../LevelGeneration/ConsoleSchematicFile.cpp | 4 +-- .../GameRules/LevelRules/Rules/GameRule.cpp | 2 +- .../app/common/Localisation/StringTable.cpp | 6 ++-- targets/app/common/MenuController.cpp | 1 + targets/app/common/Tutorial/FullTutorial.cpp | 1 + .../common/UI/All Platforms/ArchiveFile.cpp | 2 +- .../UI/Components/UIComponent_Tooltips.h | 1 + .../UIScene_MainMenu.cpp | 2 +- targets/app/common/UI/UIScene.cpp | 36 +++++++++---------- targets/app/linux/Iggy/include/rrCore.h | 2 +- targets/app/linux/Stubs/LinuxStubs.h | 9 ----- targets/app/linux/Stubs/winapi_stubs.h | 11 ------ targets/app/windows/Iggy/include/rrCore.h | 2 +- .../app/windows/Windows64_UIController.cpp | 2 +- targets/java/include/java/Class.h | 2 +- targets/minecraft/client/Minecraft.h | 1 + targets/minecraft/client/Options.cpp | 1 + targets/minecraft/client/gui/Gui.cpp | 3 +- .../client/gui/particle/GuiParticle.cpp | 3 +- targets/minecraft/client/model/ChestModel.cpp | 3 +- .../minecraft/client/particle/Particle.cpp | 4 +-- .../minecraft/client/player/LocalPlayer.cpp | 2 +- targets/minecraft/client/renderer/Chunk.cpp | 2 +- .../client/renderer/GameRenderer.cpp | 2 +- .../renderer/MobSkinTextureProcessor.cpp | 1 + .../entity/EntityRenderDispatcher.cpp | 2 +- .../texture/PreStitchedTextureMap.cpp | 8 ++--- .../client/renderer/texture/Stitcher.cpp | 2 +- .../client/renderer/texture/TextureMap.cpp | 2 +- .../client/skins/AbstractTexturePack.cpp | 3 +- .../minecraft/client/skins/DLCTexturePack.cpp | 4 +-- .../network/packet/CustomPayloadPacket.cpp | 2 +- .../network/packet/GameCommandPacket.cpp | 2 +- .../network/packet/MoveEntityPacket.cpp | 2 +- .../network/packet/MoveEntityPacketSmall.cpp | 10 +++--- targets/minecraft/network/packet/Packet.cpp | 4 +-- .../network/packet/SetPlayerTeamPacket.cpp | 4 +-- .../minecraft/server/level/EntityTracker.cpp | 2 +- targets/minecraft/util/WeighedRandom.cpp | 5 +-- targets/minecraft/world/entity/Entity.cpp | 2 +- targets/minecraft/world/item/ArmorItem.cpp | 2 +- targets/minecraft/world/level/Level.cpp | 2 +- .../world/level/biome/BiomeDecorator.cpp | 2 +- .../level/chunk/CompressedTileStorage.cpp | 2 +- .../world/level/chunk/storage/RegionFile.cpp | 2 +- .../level/levelgen/CustomLevelSource.cpp | 4 +-- .../levelgen/structure/StrongholdFeature.cpp | 2 +- .../newbiome/layer/BiomeOverrideLayer.cpp | 2 +- .../ConsoleSaveFileOriginal.cpp | 8 ++--- .../ConsoleSaveFileSplit.cpp | 11 +++--- .../storage/ConsoleSaveFileIO/FileHeader.cpp | 2 +- .../level/storage/DirectoryLevelStorage.cpp | 4 +-- .../world/level/storage/SavedDataStorage.cpp | 2 +- .../world/level/tile/PressurePlateTile.cpp | 2 +- targets/minecraft/world/scores/Scoreboard.cpp | 2 +- targets/platform/stubs.h | 5 --- 60 files changed, 105 insertions(+), 120 deletions(-) delete mode 100644 targets/app/linux/Stubs/LinuxStubs.h diff --git a/targets/app/common/DLC/DLCManager.cpp b/targets/app/common/DLC/DLCManager.cpp index 6fdbe3048..b583b93ff 100644 --- a/targets/app/common/DLC/DLCManager.cpp +++ b/targets/app/common/DLC/DLCManager.cpp @@ -259,7 +259,7 @@ unsigned int DLCManager::getPackIndex(DLCPack* pack, bool& found, if (pack == nullptr) { app.DebugPrintf( "DLCManager: Attempting to find the index for a nullptr pack\n"); - //__debugbreak(); + //assert(0); return foundIndex; } if (type != e_DLCType_All) { diff --git a/targets/app/common/DLC/DLCPack.cpp b/targets/app/common/DLC/DLCPack.cpp index 5eb690ac4..919d45f4f 100644 --- a/targets/app/common/DLC/DLCPack.cpp +++ b/targets/app/common/DLC/DLCPack.cpp @@ -84,7 +84,7 @@ void DLCPack::addChildPack(DLCPack* childPack) { const std::uint32_t packId = childPack->GetPackId(); #if !defined(_CONTENT_PACKAGE) if (packId < 0 || packId > 15) { - __debugbreak(); + assert(0); } #endif childPack->SetPackId((packId << 24) | m_packId); @@ -302,7 +302,7 @@ unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type, if (type == DLCManager::e_DLCType_All) { app.DebugPrintf("Unimplemented\n"); #if !defined(__CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return 0; } @@ -327,7 +327,7 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, if (type == DLCManager::e_DLCType_All) { app.DebugPrintf("Unimplemented\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return false; } diff --git a/targets/app/common/Game.cpp b/targets/app/common/Game.cpp index a17dccfcb..4c14b9bcd 100644 --- a/targets/app/common/Game.cpp +++ b/targets/app/common/Game.cpp @@ -119,7 +119,7 @@ Game::Game() { "%d\n", sizeof(GAME_SETTINGS), GAME_SETTINGS_PROFILE_DATA_BYTES); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif } diff --git a/targets/app/common/GameRules/GameRuleManager.cpp b/targets/app/common/GameRules/GameRuleManager.cpp index 000e198b9..321596d45 100644 --- a/targets/app/common/GameRules/GameRuleManager.cpp +++ b/targets/app/common/GameRules/GameRuleManager.cpp @@ -473,7 +473,7 @@ bool GameRuleManager::readRuleFile( compressedBuffer.data(), compressedSize); break; default: app.DebugPrintf("Invalid compression type %d found\n", compressionType); - __debugbreak(); + assert(0); [] decompressedBuffer.data(); dis.close(); bais.reset(); diff --git a/targets/app/common/GameRules/LevelGeneration/ConsoleSchematicFile.cpp b/targets/app/common/GameRules/LevelGeneration/ConsoleSchematicFile.cpp index 5a4567217..29b521f14 100644 --- a/targets/app/common/GameRules/LevelGeneration/ConsoleSchematicFile.cpp +++ b/targets/app/common/GameRules/LevelGeneration/ConsoleSchematicFile.cpp @@ -142,7 +142,7 @@ void ConsoleSchematicFile::load(DataInputStream* dis) { app.DebugPrintf( "ConsoleSchematicFile has read a nullptr tile " "entity\n"); - __debugbreak(); + assert(0); #endif } else { m_tileEntities.push_back(te); @@ -675,7 +675,7 @@ void ConsoleSchematicFile::generateSchematicFile( } #ifndef _CONTENT_PACKAGE - if (p != blockCount) __debugbreak(); + if (p != blockCount) assert(0); #endif // We don't know how this will compress - just make a fixed length buffer to diff --git a/targets/app/common/GameRules/LevelRules/Rules/GameRule.cpp b/targets/app/common/GameRules/LevelRules/Rules/GameRule.cpp index 5d00d72cd..ce9750da4 100644 --- a/targets/app/common/GameRules/LevelRules/Rules/GameRule.cpp +++ b/targets/app/common/GameRules/LevelRules/Rules/GameRule.cpp @@ -34,7 +34,7 @@ GameRule::ValueType GameRule::getParameter(const std::wstring& parameterName) { #ifndef _CONTENT_PACKAGE wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str()); - __debugbreak(); + assert(0); #endif } return m_parameters[parameterName]; diff --git a/targets/app/common/Localisation/StringTable.cpp b/targets/app/common/Localisation/StringTable.cpp index 838e005e9..262f7cd26 100644 --- a/targets/app/common/Localisation/StringTable.cpp +++ b/targets/app/common/Localisation/StringTable.cpp @@ -115,7 +115,7 @@ void StringTable::ProcessStringTableData(void) { } else { app.DebugPrintf("Failed to get language\n"); #ifdef _DEBUG - __debugbreak(); + assert(0); #endif isStatic = false; @@ -137,7 +137,7 @@ void StringTable::getData(std::uint8_t** ppData, unsigned int* pSize) { const wchar_t* StringTable::getString(const std::wstring& id) { #ifndef _CONTENT_PACKAGE if (isStatic) { - __debugbreak(); + assert(0); return L""; } #endif @@ -154,7 +154,7 @@ const wchar_t* StringTable::getString(const std::wstring& id) { const wchar_t* StringTable::getString(int id) { #ifndef _CONTENT_PACKAGE if (!isStatic) { - __debugbreak(); + assert(0); return L""; } #endif diff --git a/targets/app/common/MenuController.cpp b/targets/app/common/MenuController.cpp index 0549a1cc3..6089184fd 100644 --- a/targets/app/common/MenuController.cpp +++ b/targets/app/common/MenuController.cpp @@ -6,6 +6,7 @@ #include "app/common/UI/Scenes/UIScene_FullscreenProgress.h" #include "app/linux/LinuxGame.h" #include "app/linux/Linux_UIController.h" +#include "app/linux/Stubs/winapi_stubs.h" #include "minecraft/client/Minecraft.h" #include "minecraft/client/ProgressRenderer.h" #include "minecraft/client/renderer/GameRenderer.h" diff --git a/targets/app/common/Tutorial/FullTutorial.cpp b/targets/app/common/Tutorial/FullTutorial.cpp index 9d357652c..079f85dec 100644 --- a/targets/app/common/Tutorial/FullTutorial.cpp +++ b/targets/app/common/Tutorial/FullTutorial.cpp @@ -31,6 +31,7 @@ #include "minecraft/world/level/LevelSettings.h" #include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/phys/AABB.h" +#include "platform/input/InputConstants.h" #include "strings.h" class TutorialConstraint; diff --git a/targets/app/common/UI/All Platforms/ArchiveFile.cpp b/targets/app/common/UI/All Platforms/ArchiveFile.cpp index c64ecfb64..932cfe514 100644 --- a/targets/app/common/UI/All Platforms/ArchiveFile.cpp +++ b/targets/app/common/UI/All Platforms/ArchiveFile.cpp @@ -102,7 +102,7 @@ std::vector ArchiveFile::getFile(const std::wstring& filename) { app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str()); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif app.FatalLoadError(); } else { diff --git a/targets/app/common/UI/Components/UIComponent_Tooltips.h b/targets/app/common/UI/Components/UIComponent_Tooltips.h index 24501c2b9..943c81f82 100644 --- a/targets/app/common/UI/Components/UIComponent_Tooltips.h +++ b/targets/app/common/UI/Components/UIComponent_Tooltips.h @@ -13,6 +13,7 @@ #include "app/linux/Stubs/iggy_stubs.h" #endif #include "app/linux/Iggy/include/rrCore.h" +#include "platform/input/InputConstants.h" class UILayer; diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp index 28032e4cd..a298e7a3c 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp @@ -286,7 +286,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) { } break; default: - __debugbreak(); + assert(0); } bool confirmUser = false; diff --git a/targets/app/common/UI/UIScene.cpp b/targets/app/common/UI/UIScene.cpp index 63a8d8d12..ff764d2ca 100644 --- a/targets/app/common/UI/UIScene.cpp +++ b/targets/app/common/UI/UIScene.cpp @@ -307,7 +307,7 @@ void UIScene::loadMovie() { app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str()); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif app.FatalLoadError(); } @@ -323,7 +323,7 @@ void UIScene::loadMovie() { if (!swf) { app.DebugPrintf("ERROR: Failed to load iggy scene!\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif app.FatalLoadError(); } @@ -718,7 +718,7 @@ void UIScene::_customDrawSlotControl(CustomDrawData* region, int iPad, // { // app.DebugPrintf("A scene is trying to navigate forwards, but // it's parent layer is nullptr!\n"); #ifndef _CONTENT_PACKAGE -// __debugbreak(); +// assert(0); // #endif // } // else @@ -911,7 +911,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handlePress did not have the correct number of " "arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -920,7 +920,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { app.DebugPrintf( "Arguments for handlePress were not of the correct type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -932,7 +932,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleFocusChange did not have the correct " "number of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -942,7 +942,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Arguments for handleFocusChange were not of the correct " "type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -955,7 +955,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleInitFocus did not have the correct number " "of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -964,7 +964,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { app.DebugPrintf( "Arguments for handleInitFocus were not of the correct type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -977,7 +977,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleCheckboxToggled did not have the correct " "number of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -987,7 +987,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Arguments for handleCheckboxToggled were not of the correct " "type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1000,7 +1000,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleSliderMove did not have the correct number " "of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1010,7 +1010,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Arguments for handleSliderMove were not of the correct " "type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1023,7 +1023,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleAnimationEnd did not have the correct " "number of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1036,7 +1036,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleSelectionChanged did not have the correct " "number of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1045,7 +1045,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Arguments for handleSelectionChanged were not of the correct " "type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1061,7 +1061,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Callback for handleRequestMoreData did not have the " "correct number of arguments\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } @@ -1071,7 +1071,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16* call) { "Arguments for handleRequestMoreData were not of the " "correct type\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return; } diff --git a/targets/app/linux/Iggy/include/rrCore.h b/targets/app/linux/Iggy/include/rrCore.h index e88b5f8c3..ab39323d3 100644 --- a/targets/app/linux/Iggy/include/rrCore.h +++ b/targets/app/linux/Iggy/include/rrCore.h @@ -1619,7 +1619,7 @@ RADDEFSTART #define RR_BREAK() __builtin_trap() #define RR_CACHE_LINE_SIZE 32 #elif defined(__RADXENON__) - #define RR_BREAK() __debugbreak() + #define RR_BREAK() assert(0) #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/targets/app/linux/Stubs/LinuxStubs.h b/targets/app/linux/Stubs/LinuxStubs.h deleted file mode 100644 index 7ed4032d3..000000000 --- a/targets/app/linux/Stubs/LinuxStubs.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef STUBS_H -#define STUBS_H - -#pragma once -#include "winapi_stubs.h" -#ifndef _ENABLEIGGY -#include "iggy_stubs.h" -#endif -#endif // STUBS_H \ No newline at end of file diff --git a/targets/app/linux/Stubs/winapi_stubs.h b/targets/app/linux/Stubs/winapi_stubs.h index 7adbe7d38..52ef81a12 100644 --- a/targets/app/linux/Stubs/winapi_stubs.h +++ b/targets/app/linux/Stubs/winapi_stubs.h @@ -9,15 +9,8 @@ #include #include -#include -#include #include -#include #include -#include - -#define __cdecl -#define _vsnprintf_s vsnprintf; typedef struct { int32_t LowPart; @@ -31,8 +24,6 @@ typedef struct { uint64_t QuadPart; } ULARGE_INTEGER; -#define __debugbreak() - #define ERROR_SUCCESS 0L #define ERROR_IO_PENDING 997L // dderror #define ERROR_CANCELLED 1223L @@ -147,8 +138,6 @@ static inline bool FileTimeToSystemTime(const FILETIME* lpFileTime, return true; } -static inline void* GetModuleHandle(const char* lpModuleName) { return 0; } - static inline void* VirtualAlloc(void* lpAddress, size_t dwSize, int32_t flAllocationType, int32_t flProtect) { // MEM_COMMIT | MEM_RESERVE → mmap anonymous diff --git a/targets/app/windows/Iggy/include/rrCore.h b/targets/app/windows/Iggy/include/rrCore.h index 6465f7577..83110cabc 100644 --- a/targets/app/windows/Iggy/include/rrCore.h +++ b/targets/app/windows/Iggy/include/rrCore.h @@ -1619,7 +1619,7 @@ RADDEFSTART #define RR_BREAK() __builtin_trap() #define RR_CACHE_LINE_SIZE 32 #elif defined(__RADXENON__) - #define RR_BREAK() __debugbreak() + #define RR_BREAK() assert(0) #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/targets/app/windows/Windows64_UIController.cpp b/targets/app/windows/Windows64_UIController.cpp index d37be6d73..5b1a825ad 100644 --- a/targets/app/windows/Windows64_UIController.cpp +++ b/targets/app/windows/Windows64_UIController.cpp @@ -25,7 +25,7 @@ void ConsoleUIController::init(ID3D11Device* dev, ID3D11DeviceContext* ctx, if (!gdraw_funcs) { app.DebugPrintf("Failed to initialise GDraw!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif app.FatalLoadError(); } diff --git a/targets/java/include/java/Class.h b/targets/java/include/java/Class.h index c4e602d89..ce61e1bcf 100644 --- a/targets/java/include/java/Class.h +++ b/targets/java/include/java/Class.h @@ -750,7 +750,7 @@ public: } if ((m_falsePositives.size() > 0) || (m_falseNegatives.size() > 0)) { - __debugbreak(); + assert(0); } } }; diff --git a/targets/minecraft/client/Minecraft.h b/targets/minecraft/client/Minecraft.h index 7d1ec07ed..1c0a205d0 100644 --- a/targets/minecraft/client/Minecraft.h +++ b/targets/minecraft/client/Minecraft.h @@ -11,6 +11,7 @@ #include "java/File.h" #include "minecraft/client/resources/ResourceLocation.h" #include "minecraft/network/packet/DisconnectPacket.h" +#include "platform/stubs.h" class Timer; class MultiPlayerLevel; diff --git a/targets/minecraft/client/Options.cpp b/targets/minecraft/client/Options.cpp index 12142849f..63e8da42a 100644 --- a/targets/minecraft/client/Options.cpp +++ b/targets/minecraft/client/Options.cpp @@ -16,6 +16,7 @@ #include "minecraft/client/renderer/Textures.h" #include "minecraft/locale/I18n.h" #include "minecraft/locale/Language.h" +#include "platform/stubs.h" // 4J - the Option sub-class used to be an java enumerated type, trying to // emulate that functionality here diff --git a/targets/minecraft/client/gui/Gui.cpp b/targets/minecraft/client/gui/Gui.cpp index b820e6ea1..0a373143b 100644 --- a/targets/minecraft/client/gui/Gui.cpp +++ b/targets/minecraft/client/gui/Gui.cpp @@ -17,6 +17,7 @@ #include "java/JavaMath.h" #include "java/Random.h" #include "java/System.h" +#include "java/Color.h" #include "minecraft/client/ClientConstants.h" #include "minecraft/client/GuiMessage.h" #include "minecraft/client/Lighting.h" @@ -1084,7 +1085,7 @@ max) + "% (" + (total / 1024 / 1024) + "MB)"; drawString(font, msg, screenWidth int col = 0xffffff; if (animateOverlayMessageColor) { - col = Color::HSBtoRGB(t / 50.0f, 0.7f, 0.6f) & 0xffffff; + col = Color::getHSBColor(t / 50.0f, 0.7f, 0.6f).getRGB() & 0xffffff; } // 4J-PB - this is the string displayed when cds are placed in a // jukebox diff --git a/targets/minecraft/client/gui/particle/GuiParticle.cpp b/targets/minecraft/client/gui/particle/GuiParticle.cpp index c7aae80d0..9d46a83b7 100644 --- a/targets/minecraft/client/gui/particle/GuiParticle.cpp +++ b/targets/minecraft/client/gui/particle/GuiParticle.cpp @@ -2,6 +2,7 @@ #include "platform/stubs.h" #include "java/Random.h" +#include "java/Color.h" Random* GuiParticle::random = new Random(); @@ -17,7 +18,7 @@ GuiParticle::GuiParticle(double x, double y, double xa, double ya) { this->xa = xa; this->ya = ya; - int col = Color::HSBtoRGB(random->nextFloat(), 0.5f, 1); + int col = Color::getHSBColor(random->nextFloat(), 0.5f, 1).getRGB(); r = ((col >> 16) & 0xff) / 255.0; g = ((col >> 8) & 0xff) / 255.0; b = ((col) & 0xff) / 255.0; diff --git a/targets/minecraft/client/model/ChestModel.cpp b/targets/minecraft/client/model/ChestModel.cpp index 3169b41bb..80f849e8e 100644 --- a/targets/minecraft/client/model/ChestModel.cpp +++ b/targets/minecraft/client/model/ChestModel.cpp @@ -1,7 +1,6 @@ #include "ChestModel.h" - - +#include "platform/renderer/renderer.h" #include "minecraft/client/model/geom/ModelPart.h" ChestModel::ChestModel() { diff --git a/targets/minecraft/client/particle/Particle.cpp b/targets/minecraft/client/particle/Particle.cpp index cddabd80e..41b27c006 100644 --- a/targets/minecraft/client/particle/Particle.cpp +++ b/targets/minecraft/client/particle/Particle.cpp @@ -185,7 +185,7 @@ void Particle::setTex(Textures* textures, Icon* icon) { } else { #if !defined(_CONTENT_PACKAGE) printf("Invalid call to Particle.setTex, use coordinate methods\n"); - __debugbreak(); + assert(0); #endif // throw new RuntimeException("Invalid call to Particle.setTex, use // coordinate methods"); @@ -197,7 +197,7 @@ void Particle::setMiscTex(int slotIndex) { getParticleTexture() != ParticleEngine::DRAGON_BREATH_TEXTURE) { #if !defined(_CONTENT_PACKAGE) printf("Invalid call to Particle.setMixTex\n"); - __debugbreak(); + assert(0); // throw new RuntimeException("Invalid call to Particle.setMiscTex"); #endif } diff --git a/targets/minecraft/client/player/LocalPlayer.cpp b/targets/minecraft/client/player/LocalPlayer.cpp index b0648a94f..baecf09b7 100644 --- a/targets/minecraft/client/player/LocalPlayer.cpp +++ b/targets/minecraft/client/player/LocalPlayer.cpp @@ -523,7 +523,7 @@ void LocalPlayer::changeDimension(int i) { Log::info( "LocalPlayer::changeDimension from 1 to 1 but WinScreen has " "not been implemented.\n"); - __debugbreak(); + assert(0); #endif } else { awardStat(GenericStats::theEnd(), GenericStats::param_theEnd()); diff --git a/targets/minecraft/client/renderer/Chunk.cpp b/targets/minecraft/client/renderer/Chunk.cpp index 75de01de2..0bdc5bfe3 100644 --- a/targets/minecraft/client/renderer/Chunk.cpp +++ b/targets/minecraft/client/renderer/Chunk.cpp @@ -797,7 +797,7 @@ bool Chunk::isEmpty() { void Chunk::setDirty() { // 4J - not used, but if this starts being used again then we'll need to // investigate how best to handle it. - __debugbreak(); + assert(0); levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_DIRTY); } diff --git a/targets/minecraft/client/renderer/GameRenderer.cpp b/targets/minecraft/client/renderer/GameRenderer.cpp index 7bbbc69a2..b7cdcc947 100644 --- a/targets/minecraft/client/renderer/GameRenderer.cpp +++ b/targets/minecraft/client/renderer/GameRenderer.cpp @@ -2024,7 +2024,7 @@ void GameRenderer::setupFog(int i, float alpha) { } if (i == 999) { - __debugbreak(); + assert(0); // 4J TODO /* glFog(GL_FOG_COLOR, getBuffer(0, 0, 0, 1)); diff --git a/targets/minecraft/client/renderer/MobSkinTextureProcessor.cpp b/targets/minecraft/client/renderer/MobSkinTextureProcessor.cpp index 335256b11..3c48ed8c8 100644 --- a/targets/minecraft/client/renderer/MobSkinTextureProcessor.cpp +++ b/targets/minecraft/client/renderer/MobSkinTextureProcessor.cpp @@ -1,6 +1,7 @@ #include "MobSkinTextureProcessor.h" #include "minecraft/client/BufferedImage.h" +#include "platform/stubs.h" BufferedImage* MobSkinTextureProcessor::process(BufferedImage* in) { if (in == nullptr) return nullptr; diff --git a/targets/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp b/targets/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp index 6f9e4d4bd..31bda5f4f 100644 --- a/targets/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp +++ b/targets/minecraft/client/renderer/entity/EntityRenderDispatcher.cpp @@ -198,7 +198,7 @@ EntityRenderer* EntityRenderDispatcher::getRenderer(eINSTANCEOF e) { if (it == renderers.end()) { Log::info("Couldn't find renderer for entity of type %d\n", e); // New renderer mapping required in above table - // __debugbreak(); + // assert(0); assert(0); } /* 4J - not doing this hierarchical search anymore. We need to explicitly diff --git a/targets/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp b/targets/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp index 03ea642c1..ff9fd08c5 100644 --- a/targets/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp +++ b/targets/minecraft/client/renderer/texture/PreStitchedTextureMap.cpp @@ -178,7 +178,7 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack* texturePack, textureFileName.c_str(), first->getWidth(), tex->getWidth(), first->getHeight(), tex->getHeight()); - __debugbreak(); + assert(0); } #endif @@ -196,7 +196,7 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack* texturePack, StitchedTexture* PreStitchedTextureMap::getTexture(const std::wstring& name) { #if !defined(_CONTENT_PACKAGE) Log::info("Not implemented!\n"); - __debugbreak(); + assert(0); #endif return nullptr; } @@ -218,7 +218,7 @@ Icon* PreStitchedTextureMap::registerIcon(const std::wstring& name) { if (name.empty()) { Log::info("Don't register nullptr\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif result = missingPosition; // new RuntimeException("Don't register null!").printStackTrace(); @@ -230,7 +230,7 @@ Icon* PreStitchedTextureMap::registerIcon(const std::wstring& name) { if (result == nullptr) { #if !defined(_CONTENT_PACKAGE) Log::info("Could not find uv data for icon %ls\n", name.c_str()); - __debugbreak(); + assert(0); #endif result = missingPosition; } diff --git a/targets/minecraft/client/renderer/texture/Stitcher.cpp b/targets/minecraft/client/renderer/texture/Stitcher.cpp index 30f656257..9056aac66 100644 --- a/targets/minecraft/client/renderer/texture/Stitcher.cpp +++ b/targets/minecraft/client/renderer/texture/Stitcher.cpp @@ -84,7 +84,7 @@ void Stitcher::stitch() { if (!addToStorage(textureHolder)) { Log::info("Stitcher exception!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif // throw new StitcherException(textureHolder); } diff --git a/targets/minecraft/client/renderer/texture/TextureMap.cpp b/targets/minecraft/client/renderer/texture/TextureMap.cpp index 8421fa863..b6e6f6ce2 100644 --- a/targets/minecraft/client/renderer/texture/TextureMap.cpp +++ b/targets/minecraft/client/renderer/texture/TextureMap.cpp @@ -237,7 +237,7 @@ Icon* TextureMap::registerIcon(const std::wstring& name) { if (name.empty()) { Log::info("Don't register nullptr\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif // new RuntimeException("Don't register null!").printStackTrace(); } diff --git a/targets/minecraft/client/skins/AbstractTexturePack.cpp b/targets/minecraft/client/skins/AbstractTexturePack.cpp index c8dc44f83..7a901bbc3 100644 --- a/targets/minecraft/client/skins/AbstractTexturePack.cpp +++ b/targets/minecraft/client/skins/AbstractTexturePack.cpp @@ -214,7 +214,8 @@ void AbstractTexturePack::unloadUI() { } std::wstring AbstractTexturePack::getXuiRootPath() { - const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(nullptr); + // const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(nullptr); + const uintptr_t c_ModuleHandle = 0; // 4jcraft changed // Load new skin constexpr int LOCATOR_SIZE = diff --git a/targets/minecraft/client/skins/DLCTexturePack.cpp b/targets/minecraft/client/skins/DLCTexturePack.cpp index 4e8d803c1..3a25807e3 100644 --- a/targets/minecraft/client/skins/DLCTexturePack.cpp +++ b/targets/minecraft/client/skins/DLCTexturePack.cpp @@ -150,7 +150,7 @@ void DLCTexturePack::loadDescription() { std::wstring DLCTexturePack::getResource(const std::wstring& name) { // 4J Stu - We should never call this function #if !defined(__CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return L""; } @@ -160,7 +160,7 @@ InputStream* DLCTexturePack::getResourceImplementation( { // 4J Stu - We should never call this function #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); if (hasFile(name)) return nullptr; #endif return nullptr; // resource; diff --git a/targets/minecraft/network/packet/CustomPayloadPacket.cpp b/targets/minecraft/network/packet/CustomPayloadPacket.cpp index 66f373aec..9402bc31e 100644 --- a/targets/minecraft/network/packet/CustomPayloadPacket.cpp +++ b/targets/minecraft/network/packet/CustomPayloadPacket.cpp @@ -33,7 +33,7 @@ CustomPayloadPacket::CustomPayloadPacket(const std::wstring& identifier, if (length > std::numeric_limits::max()) { Log::info("Payload may not be larger than 32K\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif // throw new IllegalArgumentException("Payload may not be larger // than 32k"); diff --git a/targets/minecraft/network/packet/GameCommandPacket.cpp b/targets/minecraft/network/packet/GameCommandPacket.cpp index 71944da60..2410169f7 100644 --- a/targets/minecraft/network/packet/GameCommandPacket.cpp +++ b/targets/minecraft/network/packet/GameCommandPacket.cpp @@ -26,7 +26,7 @@ GameCommandPacket::GameCommandPacket(EGameCommand command, if (length > std::numeric_limits::max()) { Log::info("Payload may not be larger than 32K\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif // throw new IllegalArgumentException("Payload may not be larger // than 32k"); diff --git a/targets/minecraft/network/packet/MoveEntityPacket.cpp b/targets/minecraft/network/packet/MoveEntityPacket.cpp index ee5d26cf1..1f3bdadd4 100644 --- a/targets/minecraft/network/packet/MoveEntityPacket.cpp +++ b/targets/minecraft/network/packet/MoveEntityPacket.cpp @@ -40,7 +40,7 @@ void MoveEntityPacket::write(DataOutputStream* dos) // throws IOException if ((id < 0) || (id >= 2048)) { // We shouln't be tracking an entity that doesn't have a short type of // id - __debugbreak(); + assert(0); } dos->writeShort((short)id); } diff --git a/targets/minecraft/network/packet/MoveEntityPacketSmall.cpp b/targets/minecraft/network/packet/MoveEntityPacketSmall.cpp index 50a109954..97410a0fe 100644 --- a/targets/minecraft/network/packet/MoveEntityPacketSmall.cpp +++ b/targets/minecraft/network/packet/MoveEntityPacketSmall.cpp @@ -23,7 +23,7 @@ MoveEntityPacketSmall::MoveEntityPacketSmall(int id) { if ((id < 0) || (id >= 2048)) { // We shouln't be tracking an entity that doesn't have a short type of // id - __debugbreak(); + assert(0); } this->id = id; @@ -46,7 +46,7 @@ void MoveEntityPacketSmall::write(DataOutputStream* dos) // throws IOException if ((id < 0) || (id >= 2048)) { // We shouln't be tracking an entity that doesn't have a short type of // id - __debugbreak(); + assert(0); } dos->writeShort((short)id); } @@ -96,7 +96,7 @@ void MoveEntityPacketSmall::PosRot::write( if ((id < 0) || (id >= 2048)) { // We shouln't be tracking an entity that doesn't have a short type of // id - __debugbreak(); + assert(0); } short idAndRot = id | yRot << 11; dos->writeShort(idAndRot); @@ -132,7 +132,7 @@ void MoveEntityPacketSmall::Pos::write( if ((id < 0) || (id >= 2048)) { // We shouln't be tracking an entity that doesn't have a short type of // id - __debugbreak(); + assert(0); } short idAndY = id | ya << 11; dos->writeShort(idAndY); @@ -165,7 +165,7 @@ void MoveEntityPacketSmall::Rot::write( if ((id < 0) || (id >= 2048)) { // We shouln't be tracking an entity that doesn't have a short type of // id - __debugbreak(); + assert(0); } short idAndRot = id | yRot << 11; dos->writeShort(idAndRot); diff --git a/targets/minecraft/network/packet/Packet.cpp b/targets/minecraft/network/packet/Packet.cpp index d2eb450c2..5e18938b1 100644 --- a/targets/minecraft/network/packet/Packet.cpp +++ b/targets/minecraft/network/packet/Packet.cpp @@ -468,7 +468,7 @@ std::vector Packet::readBytes(DataInputStream* datainputstream) { if (size < 0) { Log::info("Key was smaller than nothing! Weird key!"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif return std::vector(); // throw new IOException("Key was smaller than nothing! Weird key!"); @@ -517,7 +517,7 @@ std::shared_ptr Packet::readPacket( (!isServer && clientReceivedPackets.find(id) == clientReceivedPackets.end())) { // Log::info("Bad packet id %d\n", id); - __debugbreak(); + assert(0); assert(false); // throw new IOException(wstring(L"Bad packet id ") + // toWString(id)); diff --git a/targets/minecraft/network/packet/SetPlayerTeamPacket.cpp b/targets/minecraft/network/packet/SetPlayerTeamPacket.cpp index cd5448d2e..ae33874ef 100644 --- a/targets/minecraft/network/packet/SetPlayerTeamPacket.cpp +++ b/targets/minecraft/network/packet/SetPlayerTeamPacket.cpp @@ -43,13 +43,13 @@ SetPlayerTeamPacket::SetPlayerTeamPacket(PlayerTeam* team, if (method != METHOD_JOIN && method != METHOD_LEAVE) { Log::info("Method must be join or leave for player constructor"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif } if (playerNames == nullptr || playerNames->empty()) { Log::info("Players cannot be null/empty"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif } diff --git a/targets/minecraft/server/level/EntityTracker.cpp b/targets/minecraft/server/level/EntityTracker.cpp index 3768ef7a1..0ee2a9d84 100644 --- a/targets/minecraft/server/level/EntityTracker.cpp +++ b/targets/minecraft/server/level/EntityTracker.cpp @@ -102,7 +102,7 @@ void EntityTracker::addEntity(std::shared_ptr e, int range, assert(false); // Entity already tracked } if (e->entityId >= 2048) { - __debugbreak(); + assert(0); } std::shared_ptr te = std::shared_ptr( new TrackedEntity(e, range, updateInterval, trackDeltas)); diff --git a/targets/minecraft/util/WeighedRandom.cpp b/targets/minecraft/util/WeighedRandom.cpp index 1a07dd078..07a99f54d 100644 --- a/targets/minecraft/util/WeighedRandom.cpp +++ b/targets/minecraft/util/WeighedRandom.cpp @@ -2,6 +2,7 @@ #include "minecraft/util/WeighedRandom.h" #include +#include #include "app/linux/Stubs/winapi_stubs.h" #include "java/Random.h" @@ -17,7 +18,7 @@ int WeighedRandom::getTotalWeight(std::vector* items) { WeighedRandomItem* WeighedRandom::getRandomItem( Random* random, std::vector* items, int totalWeight) { if (totalWeight <= 0) { - __debugbreak(); + assert(0); } int selection = random->nextInt(totalWeight); @@ -49,7 +50,7 @@ WeighedRandomItem* WeighedRandom::getRandomItem( Random* random, const std::vector& items, int totalWeight) { if (totalWeight <= 0) { - __debugbreak(); + assert(0); } int selection = random->nextInt(totalWeight); diff --git a/targets/minecraft/world/entity/Entity.cpp b/targets/minecraft/world/entity/Entity.cpp index d9b45abb6..cce8ff4d0 100644 --- a/targets/minecraft/world/entity/Entity.cpp +++ b/targets/minecraft/world/entity/Entity.cpp @@ -126,7 +126,7 @@ int Entity::getSmallId() { } Log::info("Out of small entity Ids... possible leak?\n"); - __debugbreak(); + assert(0); return -1; } diff --git a/targets/minecraft/world/item/ArmorItem.cpp b/targets/minecraft/world/item/ArmorItem.cpp index 9a7c38108..1daa05977 100644 --- a/targets/minecraft/world/item/ArmorItem.cpp +++ b/targets/minecraft/world/item/ArmorItem.cpp @@ -206,7 +206,7 @@ void ArmorItem::setColor(std::shared_ptr item, int color) { if (armorType != ArmorMaterial::CLOTH) { #ifndef _CONTENT_PACKAGE printf("Can't dye non-leather!"); - __debugbreak(); + assert(0); #endif // throw new UnsupportedOperationException("Can't dye non-leather!"); } diff --git a/targets/minecraft/world/level/Level.cpp b/targets/minecraft/world/level/Level.cpp index d7cd0b255..e760030ea 100644 --- a/targets/minecraft/world/level/Level.cpp +++ b/targets/minecraft/world/level/Level.cpp @@ -2188,7 +2188,7 @@ void Level::tickEntities() { if (tileEntitiesToUnload.find(*it) != tileEntitiesToUnload.end()) { if (isClientSide) { - __debugbreak(); + assert(0); } it = tileEntityList.erase(it); } else { diff --git a/targets/minecraft/world/level/biome/BiomeDecorator.cpp b/targets/minecraft/world/level/biome/BiomeDecorator.cpp index 339bd2f23..ac352882c 100644 --- a/targets/minecraft/world/level/biome/BiomeDecorator.cpp +++ b/targets/minecraft/world/level/biome/BiomeDecorator.cpp @@ -37,7 +37,7 @@ void BiomeDecorator::decorate(Level* level, Random* random, int xo, int zo) { if (this->level != nullptr) { Log::info("BiomeDecorator::decorate - Already decorating!!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); // throw new RuntimeException("Already decorating!!"); #endif } diff --git a/targets/minecraft/world/level/chunk/CompressedTileStorage.cpp b/targets/minecraft/world/level/chunk/CompressedTileStorage.cpp index 067474dee..7c4e3eef8 100644 --- a/targets/minecraft/world/level/chunk/CompressedTileStorage.cpp +++ b/targets/minecraft/world/level/chunk/CompressedTileStorage.cpp @@ -956,7 +956,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) { // uint32_t lastError = GetLastError(); // MEMORYSTATUS memStatus; // GlobalMemoryStatus(&memStatus); - // __debugbreak(); + // assert(0); } unsigned char* pucData = newIndicesAndData + 1024; unsigned short usDataOffset = 0; diff --git a/targets/minecraft/world/level/chunk/storage/RegionFile.cpp b/targets/minecraft/world/level/chunk/storage/RegionFile.cpp index dd5eb2060..882981e02 100644 --- a/targets/minecraft/world/level/chunk/storage/RegionFile.cpp +++ b/targets/minecraft/world/level/chunk/storage/RegionFile.cpp @@ -320,7 +320,7 @@ void RegionFile::write(int x, int z, std::uint8_t* data, #ifndef _CONTENT_PACKAGE if (sectorNumber < 0) { - __debugbreak(); + assert(0); } #endif diff --git a/targets/minecraft/world/level/levelgen/CustomLevelSource.cpp b/targets/minecraft/world/level/levelgen/CustomLevelSource.cpp index 21fc21605..036e5436c 100644 --- a/targets/minecraft/world/level/levelgen/CustomLevelSource.cpp +++ b/targets/minecraft/world/level/levelgen/CustomLevelSource.cpp @@ -51,7 +51,7 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed, path, m_heightmapOverride.data(), m_heightmapOverride.size()); if (result.status == IPlatformFilesystem::ReadStatus::TooLarge) { Log::info("Heightmap binary is too large!!\n"); - __debugbreak(); + assert(0); } else if (result.status != IPlatformFilesystem::ReadStatus::Ok) { gameServices().fatalLoadError(); assert(false); @@ -71,7 +71,7 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed, m_waterheightOverride.size()); } else if (result.status == IPlatformFilesystem::ReadStatus::TooLarge) { Log::info("waterheight binary is too large!!\n"); - __debugbreak(); + assert(0); } else if (result.status != IPlatformFilesystem::ReadStatus::Ok) { gameServices().fatalLoadError(); } diff --git a/targets/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp b/targets/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp index 8435768a2..6f7c741da 100644 --- a/targets/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp +++ b/targets/minecraft/world/level/levelgen/structure/StrongholdFeature.cpp @@ -159,7 +159,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z, bool bIsSuperflat) { #ifndef _CONTENT_PACKAGE if (position->x > 2560 || position->x < -2560 || position->z > 2560 || position->z < -2560) { - __debugbreak(); + assert(0); } #endif diff --git a/targets/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp b/targets/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp index d390191f4..784dfccf6 100644 --- a/targets/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp +++ b/targets/minecraft/world/level/newbiome/layer/BiomeOverrideLayer.cpp @@ -24,7 +24,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) { m_biomeOverride.size()); } else if (result.status == IPlatformFilesystem::ReadStatus::TooLarge) { Log::info("Biomemap binary is too large!!\n"); - __debugbreak(); + assert(0); } else if (result.status != IPlatformFilesystem::ReadStatus::Ok) { gameServices().fatalLoadError(); } diff --git a/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp b/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp index a7f4da1b4..c34ce5774 100644 --- a/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp +++ b/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp @@ -91,7 +91,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal( // pages committed should always be zero at this point. if (pagesCommitted != 0) { #ifndef _CONTENT_PACKAGE - __debugbreak(); + assert(0); #endif } @@ -103,7 +103,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal( if (pvRet == nullptr) { #ifndef _CONTENT_PACKAGE // Out of physical memory - __debugbreak(); + assert(0); #endif } pagesCommitted = pagesRequired; @@ -162,7 +162,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal( COMMIT_ALLOCATION, PAGE_READWRITE); if (pvRet == nullptr) { // Out of physical memory - __debugbreak(); + assert(0); } pagesCommitted = pagesRequired; } @@ -438,7 +438,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond( COMMIT_ALLOCATION, PAGE_READWRITE); if (pvRet == nullptr) { // Out of physical memory - __debugbreak(); + assert(0); } pagesCommitted = pagesRequired; } diff --git a/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp b/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp index 299deac45..663aa8942 100644 --- a/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp +++ b/targets/minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp @@ -15,6 +15,7 @@ #include #include +#include "platform/fs/fs.h" #include "platform/PlatformTypes.h" #include "minecraft/GameEnums.h" #include "app/common/BuildVer/BuildVer.h" @@ -469,7 +470,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData, // pages committed should always be zero at this point. if (pagesCommitted != 0) { #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif } @@ -481,7 +482,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData, if (pvRet == nullptr) { #if !defined(_CONTENT_PACKAGE) // Out of physical memory - __debugbreak(); + assert(0); #endif } pagesCommitted = pagesRequired; @@ -530,7 +531,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData, COMMIT_ALLOCATION, PAGE_READWRITE); if (pvRet == nullptr) { // Out of physical memory - __debugbreak(); + assert(0); } pagesCommitted = pagesRequired; } @@ -541,7 +542,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData, // actually be ok Log::info("Failed to decompress save data!\n"); #if !defined(_CONTENT_PACKAGE) - __debugbreak(); + assert(0); #endif memset(pvSaveMem, 0, fileSize); // Clear the first 8 bytes that reference the header @@ -1036,7 +1037,7 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry* file, COMMIT_ALLOCATION, PAGE_READWRITE); if (pvRet == nullptr) { // Out of physical memory - __debugbreak(); + assert(0); } pagesCommitted = pagesRequired; } diff --git a/targets/minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.cpp b/targets/minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.cpp index 8f8521493..43ee5a88f 100644 --- a/targets/minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.cpp +++ b/targets/minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.cpp @@ -284,7 +284,7 @@ void FileHeader::ReadHeader( #if !defined(_CONTENT_PACKAGE) Log::info("********** Invalid save version %d\n", m_saveVersion); - __debugbreak(); + assert(0); #endif break; } diff --git a/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp b/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp index 360b99f02..be4abd24d 100644 --- a/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp +++ b/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp @@ -70,7 +70,7 @@ int _MapDataMappings::getDimension(int id) { default: #if !defined(_CONTENT_PACKAGE) printf("Read invalid dimension from MapDataMapping\n"); - __debugbreak(); + assert(0); #endif break; } @@ -98,7 +98,7 @@ void _MapDataMappings::setMapping(int id, PlayerUID xuid, int dimension) { #if !defined(_CONTENT_PACKAGE) printf( "Trinyg to set a MapDataMapping for an invalid dimension.\n"); - __debugbreak(); + assert(0); #endif break; } diff --git a/targets/minecraft/world/level/storage/SavedDataStorage.cpp b/targets/minecraft/world/level/storage/SavedDataStorage.cpp index 71635ed81..4be1c0ccc 100644 --- a/targets/minecraft/world/level/storage/SavedDataStorage.cpp +++ b/targets/minecraft/world/level/storage/SavedDataStorage.cpp @@ -63,7 +63,7 @@ std::shared_ptr SavedDataStorage::get(const std::type_info& clazz, new StructureFeatureSavedData(id))); } else { // Handling of new SavedData class required - __debugbreak(); + assert(0); } ConsoleSaveFileInputStream fis = diff --git a/targets/minecraft/world/level/tile/PressurePlateTile.cpp b/targets/minecraft/world/level/tile/PressurePlateTile.cpp index 8d18d8117..b1e198b1a 100644 --- a/targets/minecraft/world/level/tile/PressurePlateTile.cpp +++ b/targets/minecraft/world/level/tile/PressurePlateTile.cpp @@ -43,7 +43,7 @@ int PressurePlateTile::getSignalStrength(Level* level, int x, int y, int z) { else if (sensitivity == players) entities = level->getEntitiesOfClass(typeid(Player), &at_bb); else - __debugbreak(); // 4J-JEV: We're going to delete something at a random + assert(0); // 4J-JEV: We're going to delete something at a random // location. if (entities != nullptr && !entities->empty()) { diff --git a/targets/minecraft/world/scores/Scoreboard.cpp b/targets/minecraft/world/scores/Scoreboard.cpp index 46e68ec0a..af12ee670 100644 --- a/targets/minecraft/world/scores/Scoreboard.cpp +++ b/targets/minecraft/world/scores/Scoreboard.cpp @@ -14,7 +14,7 @@ Objective* Scoreboard::addObjective(const std::wstring& name, // if (objective != nullptr) // { // #indef _CONTENT_PACKAGE - // __debugbreak(); + // assert(0); // #endif // //throw new IllegalArgumentException("An objective with the name //'" + name + "' already exists!"); diff --git a/targets/platform/stubs.h b/targets/platform/stubs.h index c9ba7f71b..afaced233 100644 --- a/targets/platform/stubs.h +++ b/targets/platform/stubs.h @@ -300,8 +300,3 @@ public: void halt() {} void forceReload() {} }; - -class Color { -public: - static int HSBtoRGB(float, float, float) { return 0; } -};