diff --git a/Minecraft.Client/ArchiveFile.cpp b/Minecraft.Client/ArchiveFile.cpp index bf41ec970..defef24e4 100644 --- a/Minecraft.Client/ArchiveFile.cpp +++ b/Minecraft.Client/ArchiveFile.cpp @@ -104,7 +104,7 @@ byteArray ArchiveFile::getFile(const wstring &filename) app.DebugPrintf("Couldn't find file in archive\n"); app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str()); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif app.FatalLoadError(); } diff --git a/Minecraft.Client/Chunk.cpp b/Minecraft.Client/Chunk.cpp index bf2922450..204107f66 100644 --- a/Minecraft.Client/Chunk.cpp +++ b/Minecraft.Client/Chunk.cpp @@ -1016,7 +1016,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(); + DEBUG_BREAK(); levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_DIRTY); } diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index c7fe15d14..72e68a971 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -96,7 +96,7 @@ CMinecraftApp::CMinecraftApp() // 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES in Xbox_App.h DebugPrintf("WARNING: The size of the profile GAME_SETTINGS struct has changed, so all stat data is likely incorrect. Is: %d, Should be: %d\n",sizeof(GAME_SETTINGS),GAME_SETTINGS_PROFILE_DATA_BYTES); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif } @@ -1300,9 +1300,6 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat { // This might be from a version during testing of new profile updates app.DebugPrintf("Don't know what to do with this profile version!\n"); -#ifndef _CONTENT_PACKAGE - // __debugbreak(); -#endif GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu @@ -6421,7 +6418,7 @@ void CMinecraftApp::InitialiseTips() { // the m_TriviaTipA or the m_GameTipA are out of sync #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif } } diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index 90614a97c..8f35b1d1f 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/DLC/DLCManager.cpp @@ -171,7 +171,7 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/) if(index >= m_packs.size()) { app.DebugPrintf("DLCManager: Trying to access a DLC pack beyond the range of valid packs\n"); - __debugbreak(); + DEBUG_BREAK(); } pack = m_packs[index]; } @@ -186,7 +186,6 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D if(pack == nullptr) { app.DebugPrintf("DLCManager: Attempting to find the index for a nullptr pack\n"); - //__debugbreak(); return foundIndex; } if( type != e_DLCType_All ) diff --git a/Minecraft.Client/Common/DLC/DLCPack.cpp b/Minecraft.Client/Common/DLC/DLCPack.cpp index 9247c6b8c..5f3874d06 100644 --- a/Minecraft.Client/Common/DLC/DLCPack.cpp +++ b/Minecraft.Client/Common/DLC/DLCPack.cpp @@ -107,7 +107,7 @@ void DLCPack::addChildPack(DLCPack *childPack) #ifndef _CONTENT_PACKAGE if(packId < 0 || packId > 15) { - __debugbreak(); + DEBUG_BREAK(); } #endif childPack->SetPackId( (packId<<24) | m_packId ); @@ -362,7 +362,7 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo { app.DebugPrintf("Unimplemented\n"); #ifndef __CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return 0; } @@ -392,9 +392,6 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path) /*if(type == DLCManager::e_DLCType_All) { app.DebugPrintf("Unimplemented\n"); -#ifndef _CONTENT_PACKAGE - __debugbreak(); -#endif return false; } #ifndef _CONTENT_PACKAGE diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp index 4990dd4a1..25ca419c4 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp @@ -122,7 +122,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis) { #ifndef _CONTENT_PACKAGE app.DebugPrintf("ConsoleSchematicFile has read a nullptr tile entity\n"); - __debugbreak(); + DEBUG_BREAK(); #endif } else @@ -635,7 +635,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l } #ifndef _CONTENT_PACKAGE - if(p!=blockCount) __debugbreak(); + if(p!=blockCount) DEBUG_BREAK(); #endif // We don't know how this will compress - just make a fixed length buffer to initially decompress into diff --git a/Minecraft.Client/Common/GameRules/GameRule.cpp b/Minecraft.Client/Common/GameRules/GameRule.cpp index b37df84d7..cae35f166 100644 --- a/Minecraft.Client/Common/GameRules/GameRule.cpp +++ b/Minecraft.Client/Common/GameRules/GameRule.cpp @@ -24,7 +24,7 @@ GameRule::ValueType GameRule::getParameter(const wstring ¶meterName) { #ifndef _CONTENT_PACKAGE wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str()); - __debugbreak(); + DEBUG_BREAK(); #endif } return m_parameters[parameterName]; diff --git a/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp b/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp index f4e00ab34..377d85e0c 100644 --- a/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp +++ b/Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp @@ -238,7 +238,7 @@ HRESULT SonyLeaderboardManager::fillByIdsQuery(const SceNpId &myNpId, SceNpId* & { // 4J-JEV: Something terrible must have happend, // 'getFriendslist' was supposed to be a synchronous operation. - __debugbreak(); + DEBUG_BREAK(); // 4J-JEV: We can at least fall-back to just the players score. len = 1; diff --git a/Minecraft.Client/Common/Network/Sony/PlatformNetworkManagerSony.cpp b/Minecraft.Client/Common/Network/Sony/PlatformNetworkManagerSony.cpp index cf009aa0c..aa27f544b 100644 --- a/Minecraft.Client/Common/Network/Sony/PlatformNetworkManagerSony.cpp +++ b/Minecraft.Client/Common/Network/Sony/PlatformNetworkManagerSony.cpp @@ -247,8 +247,6 @@ void CPlatformNetworkManagerSony::HandlePlayerJoined(SQRNetworkPlayer * void CPlatformNetworkManagerSony::HandlePlayerLeaving(SQRNetworkPlayer *pSQRPlayer) { - //__debugbreak(); - app.DebugPrintf( "Player 0x%p leaving.\n", pSQRPlayer ); diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index b29a7e563..2c9718de4 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -320,7 +320,7 @@ void UIScene::loadMovie() { app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str()); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif app.FatalLoadError(); } @@ -335,7 +335,7 @@ void UIScene::loadMovie() { app.DebugPrintf("ERROR: Failed to load iggy scene!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif app.FatalLoadError(); } @@ -941,9 +941,6 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt // if(m_parentLayer == nullptr) // { // app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is nullptr!\n"); -//#ifndef _CONTENT_PACKAGE -// __debugbreak(); -//#endif // } // else // { @@ -960,10 +957,6 @@ void UIScene::navigateBack() if(m_parentLayer == nullptr) { -// app.DebugPrintf("A scene is trying to navigate back, but it's parent layer is nullptr!\n"); -#ifndef _CONTENT_PACKAGE -// __debugbreak(); -#endif } else { @@ -1194,7 +1187,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handlePress did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1202,7 +1195,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handlePress were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1214,7 +1207,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleFocusChange did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1222,7 +1215,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handleFocusChange were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1234,7 +1227,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleInitFocus did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1242,7 +1235,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handleInitFocus were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1254,7 +1247,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleCheckboxToggled did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1262,7 +1255,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1274,7 +1267,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleSliderMove did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1282,7 +1275,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1294,7 +1287,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleAnimationEnd did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1306,7 +1299,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleSelectionChanged did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1314,7 +1307,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handleSelectionChanged were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1332,7 +1325,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Callback for handleRequestMoreData did not have the correct number of arguments\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } @@ -1340,7 +1333,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) { app.DebugPrintf("Arguments for handleRequestMoreData were not of the correct type\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return; } diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index 1eef994f4..1af1b27b3 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -390,7 +390,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) break; #endif - default: __debugbreak(); + default: DEBUG_BREAK(); } bool confirmUser = false; diff --git a/Minecraft.Client/DLCTexturePack.cpp b/Minecraft.Client/DLCTexturePack.cpp index 8fe1860be..c12e15415 100644 --- a/Minecraft.Client/DLCTexturePack.cpp +++ b/Minecraft.Client/DLCTexturePack.cpp @@ -106,7 +106,7 @@ wstring DLCTexturePack::getResource(const wstring& name) { // 4J Stu - We should never call this function #ifndef __CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return L""; } @@ -115,7 +115,7 @@ InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //th { // 4J Stu - We should never call this function #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); if(hasFile(name)) return nullptr; #endif return nullptr; //resource; diff --git a/Minecraft.Client/Durango/Durango_App.cpp b/Minecraft.Client/Durango/Durango_App.cpp index 1c2ffbe29..fb3f20ec5 100644 --- a/Minecraft.Client/Durango/Durango_App.cpp +++ b/Minecraft.Client/Durango/Durango_App.cpp @@ -641,7 +641,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i { DWORD error = GetLastError(); app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error); - __debugbreak(); + DEBUG_BREAK(); return 0; } diff --git a/Minecraft.Client/Durango/Durango_UIController.cpp b/Minecraft.Client/Durango/Durango_UIController.cpp index e27d91d23..63bc75add 100644 --- a/Minecraft.Client/Durango/Durango_UIController.cpp +++ b/Minecraft.Client/Durango/Durango_UIController.cpp @@ -20,7 +20,7 @@ void ConsoleUIController::init(Microsoft::WRL::ComPtr dev, Microso { app.DebugPrintf("Failed to initialise GDraw!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif app.FatalLoadError(); } diff --git a/Minecraft.Client/Durango/Iggy/include/rrCore.h b/Minecraft.Client/Durango/Iggy/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/Durango/Iggy/include/rrCore.h +++ b/Minecraft.Client/Durango/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/Durango/Miles/include/rrCore.h b/Minecraft.Client/Durango/Miles/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/Durango/Miles/include/rrCore.h +++ b/Minecraft.Client/Durango/Miles/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp b/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp index 9e8d1fc65..8b663ea38 100644 --- a/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp +++ b/Minecraft.Client/Durango/Network/PlatformNetworkManagerDurango.cpp @@ -187,8 +187,6 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRPlayer) { - //__debugbreak(); - app.DebugPrintf( "Player 0x%p leaving.\n", pDQRPlayer ); diff --git a/Minecraft.Client/EntityRenderDispatcher.cpp b/Minecraft.Client/EntityRenderDispatcher.cpp index 7a39f0e3e..a5ffbeba5 100644 --- a/Minecraft.Client/EntityRenderDispatcher.cpp +++ b/Minecraft.Client/EntityRenderDispatcher.cpp @@ -187,7 +187,7 @@ EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF e) { app.DebugPrintf("Couldn't find renderer for entity of type %d\n", e); // New renderer mapping required in above table - __debugbreak(); + DEBUG_BREAK(); } /* 4J - not doing this hierarchical search anymore. We need to explicitly add renderers for any eINSTANCEOF type that we want to be able to render if (it == renderers.end() && e != Entity::_class) diff --git a/Minecraft.Client/EntityTracker.cpp b/Minecraft.Client/EntityTracker.cpp index 79ce26582..7525edb79 100644 --- a/Minecraft.Client/EntityTracker.cpp +++ b/Minecraft.Client/EntityTracker.cpp @@ -83,7 +83,7 @@ void EntityTracker::addEntity(shared_ptr e, int range, int updateInterva } if( e->entityId >= 16384 ) { - __debugbreak(); + DEBUG_BREAK(); } shared_ptr te = std::make_shared(e, range, updateInterval, trackDeltas); entities.insert(te); diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index c65e4b166..cea5ef96f 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -2112,7 +2112,7 @@ void GameRenderer::setupFog(int i, float alpha) if (i == 999) { - __debugbreak(); + DEBUG_BREAK(); // 4J TODO /* glFog(GL_FOG_COLOR, getBuffer(0, 0, 0, 1)); diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index 852b83081..f1e5a17b5 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -518,7 +518,7 @@ void LocalPlayer::changeDimension(int i) //minecraft.setScreen(new WinScreen()); #ifndef _CONTENT_PACKAGE app.DebugPrintf("LocalPlayer::changeDimension from 1 to 1 but WinScreen has not been implemented.\n"); - __debugbreak(); + DEBUG_BREAK(); #endif } else diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index d04bdc785..c94217e50 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -4817,7 +4817,7 @@ void Minecraft::main() app.DebugPrintf("%ls\n", i, app.GetString( Tile::tiles[i]->getDescriptionId() )); } } - __debugbreak(); + DEBUG_BREAK(); #endif // 4J-PB - Can't call this for the first 5 seconds of a game - MS rule diff --git a/Minecraft.Client/Orbis/Iggy/include/rrCore.h b/Minecraft.Client/Orbis/Iggy/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/Orbis/Iggy/include/rrCore.h +++ b/Minecraft.Client/Orbis/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp b/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp index feede12a1..6437a90eb 100644 --- a/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp +++ b/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp @@ -245,7 +245,7 @@ bool OrbisLeaderboardManager::getScoreByIds() { // 4J-JEV: Something terrible must have happend, // 'getFriendslist' was supposed to be a synchronous operation. - __debugbreak(); + DEBUG_BREAK(); // 4J-JEV: We can at least fall-back to just the players score. num = 1; diff --git a/Minecraft.Client/Orbis/Miles/include/rrCore.h b/Minecraft.Client/Orbis/Miles/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/Orbis/Miles/include/rrCore.h +++ b/Minecraft.Client/Orbis/Miles/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/PS3/Iggy/include/rrCore.h b/Minecraft.Client/PS3/Iggy/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/PS3/Iggy/include/rrCore.h +++ b/Minecraft.Client/PS3/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/PS3/Miles/include/rrCore.h b/Minecraft.Client/PS3/Miles/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/PS3/Miles/include/rrCore.h +++ b/Minecraft.Client/PS3/Miles/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/PSVita/Iggy/include/rrCore.h b/Minecraft.Client/PSVita/Iggy/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/PSVita/Iggy/include/rrCore.h +++ b/Minecraft.Client/PSVita/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/PSVita/Miles/include/rrCore.h b/Minecraft.Client/PSVita/Miles/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/PSVita/Miles/include/rrCore.h +++ b/Minecraft.Client/PSVita/Miles/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/Particle.cpp b/Minecraft.Client/Particle.cpp index 5747286fc..80dac72e3 100644 --- a/Minecraft.Client/Particle.cpp +++ b/Minecraft.Client/Particle.cpp @@ -218,7 +218,7 @@ void Particle::setTex(Textures *textures, Icon *icon) { #ifndef _CONTENT_PACKAGE printf("Invalid call to Particle.setTex, use coordinate methods\n"); - __debugbreak(); + DEBUG_BREAK(); #endif //throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); } @@ -230,7 +230,7 @@ void Particle::setMiscTex(int slotIndex) { #ifndef _CONTENT_PACKAGE printf("Invalid call to Particle.setMixTex\n"); - __debugbreak(); + DEBUG_BREAK(); //throw new RuntimeException("Invalid call to Particle.setMiscTex"); #endif } diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index 9ed3eca10..174bf874f 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -227,7 +227,6 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack *texturePack, Stitch if(first->getWidth() != tex->getWidth() || first->getHeight() != tex->getHeight()) { app.DebugPrintf("%ls - first w - %d, h - %d, tex w - %d, h - %d\n",textureFileName.c_str(),first->getWidth(),tex->getWidth(),first->getHeight(),tex->getHeight()); - //__debugbreak(); } #endif @@ -246,7 +245,7 @@ StitchedTexture *PreStitchedTextureMap::getTexture(const wstring &name) { #ifndef _CONTENT_PACKAGE app.DebugPrintf("Not implemented!\n"); - __debugbreak(); + DEBUG_BREAK(); #endif return nullptr; #if 0 @@ -277,7 +276,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name) { app.DebugPrintf("Don't register nullptr\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif result = missingPosition; //new RuntimeException("Don't register null!").printStackTrace(); @@ -290,7 +289,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name) { #ifndef _CONTENT_PACKAGE app.DebugPrintf("Could not find uv data for icon %ls\n", name.c_str() ); - __debugbreak(); + DEBUG_BREAK(); #endif result = missingPosition; } diff --git a/Minecraft.Client/Stitcher.cpp b/Minecraft.Client/Stitcher.cpp index 450c80264..3243889ad 100644 --- a/Minecraft.Client/Stitcher.cpp +++ b/Minecraft.Client/Stitcher.cpp @@ -87,7 +87,7 @@ void Stitcher::stitch() { app.DebugPrintf("Stitcher exception!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif //throw new StitcherException(textureHolder); } diff --git a/Minecraft.Client/StringTable.cpp b/Minecraft.Client/StringTable.cpp index 1e7298a79..a1dc32ad9 100644 --- a/Minecraft.Client/StringTable.cpp +++ b/Minecraft.Client/StringTable.cpp @@ -144,7 +144,7 @@ LPCWSTR StringTable::getString(const wstring &id) #ifndef _CONTENT_PACKAGE if (isStatic) { - __debugbreak(); + DEBUG_BREAK(); return L""; } #endif @@ -166,7 +166,7 @@ LPCWSTR StringTable::getString(int id) #ifndef _CONTENT_PACKAGE if (!isStatic) { - __debugbreak(); + DEBUG_BREAK(); return L""; } #endif diff --git a/Minecraft.Client/TextureMap.cpp b/Minecraft.Client/TextureMap.cpp index a1eb6f8ae..e329a5323 100644 --- a/Minecraft.Client/TextureMap.cpp +++ b/Minecraft.Client/TextureMap.cpp @@ -214,7 +214,7 @@ Icon *TextureMap::registerIcon(const wstring &name) { app.DebugPrintf("Don't register nullptr\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif //new RuntimeException("Don't register null!").printStackTrace(); } diff --git a/Minecraft.Client/TexturePackRepository.cpp b/Minecraft.Client/TexturePackRepository.cpp index 12604701a..dec1b3686 100644 --- a/Minecraft.Client/TexturePackRepository.cpp +++ b/Minecraft.Client/TexturePackRepository.cpp @@ -339,7 +339,6 @@ bool TexturePackRepository::selectTexturePackById(DWORD id) app.DebugPrintf("Failed to select texture pack %d as it is not in the list\n", id); #ifndef _CONTENT_PACKAGE // TODO - 4J Stu: We should report this to the player in some way - //__debugbreak(); #endif // Fail safely if( selectSkin( DEFAULT_TEXTURE_PACK ) ) diff --git a/Minecraft.Client/Windows64/Iggy/include/rrCore.h b/Minecraft.Client/Windows64/Iggy/include/rrCore.h index 17ebee3a4..d3f4f41e0 100644 --- a/Minecraft.Client/Windows64/Iggy/include/rrCore.h +++ b/Minecraft.Client/Windows64/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() DEBUG_BREAK() #define RR_CACHE_LINE_SIZE 128 #elif defined(__RADANDROID__) #define RR_BREAK() __builtin_trap() diff --git a/Minecraft.Client/Windows64/Windows64_UIController.cpp b/Minecraft.Client/Windows64/Windows64_UIController.cpp index cd47154cc..3f5285aef 100644 --- a/Minecraft.Client/Windows64/Windows64_UIController.cpp +++ b/Minecraft.Client/Windows64/Windows64_UIController.cpp @@ -24,7 +24,7 @@ void ConsoleUIController::init(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D { app.DebugPrintf("Failed to initialise GDraw!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif app.FatalLoadError(); } diff --git a/Minecraft.Client/Xbox/Audio/SoundEngine.cpp b/Minecraft.Client/Xbox/Audio/SoundEngine.cpp index 5587ce815..92421d20f 100644 --- a/Minecraft.Client/Xbox/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Xbox/Audio/SoundEngine.cpp @@ -487,7 +487,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa { #ifndef _CONTENT_PACKAGE #ifdef _DEBUG - __debugbreak(); + DEBUG_BREAK(); #endif //wprintf(L"WARNING: Sound cue not found - %ls\n", name.c_str() ); app.DebugPrintf("Not found: %s\n",xboxName); diff --git a/Minecraft.Client/Xbox/Leaderboards/XboxLeaderboardManager.cpp b/Minecraft.Client/Xbox/Leaderboards/XboxLeaderboardManager.cpp index e7aebf2a4..535ce55ec 100644 --- a/Minecraft.Client/Xbox/Leaderboards/XboxLeaderboardManager.cpp +++ b/Minecraft.Client/Xbox/Leaderboards/XboxLeaderboardManager.cpp @@ -183,7 +183,7 @@ bool XboxLeaderboardManager::WriteStats(unsigned int viewCount, ViewIn views) // some debug code to catch the leaderboard write with 7 views #ifndef _CONTENT_PACKAGE - if(viewCount>5) __debugbreak(); + if(viewCount>5) DEBUG_BREAK(); #endif // 4J Stu - If we are online we already have a session, so use that diff --git a/Minecraft.Client/Xbox/Network/PlatformNetworkManagerXbox.cpp b/Minecraft.Client/Xbox/Network/PlatformNetworkManagerXbox.cpp index 89a42d531..62dccf317 100644 --- a/Minecraft.Client/Xbox/Network/PlatformNetworkManagerXbox.cpp +++ b/Minecraft.Client/Xbox/Network/PlatformNetworkManagerXbox.cpp @@ -211,8 +211,6 @@ VOID CPlatformNetworkManagerXbox::NotifyPlayerLeaving( __in IQNetPlayer * pQNetPlayer ) { - //__debugbreak(); - app.DebugPrintf( "Player 0x%p \"%ls\" leaving.\n", pQNetPlayer, pQNetPlayer->GetGamertag() ); diff --git a/Minecraft.Client/Xbox/Xbox_Minecraft.cpp b/Minecraft.Client/Xbox/Xbox_Minecraft.cpp index bfe084562..a3d872685 100644 --- a/Minecraft.Client/Xbox/Xbox_Minecraft.cpp +++ b/Minecraft.Client/Xbox/Xbox_Minecraft.cpp @@ -315,8 +315,6 @@ int __cdecl main() HRESULT hr; static bool bTrialTimerDisplayed=true; - //__debugbreak(); - #ifdef MEMORY_TRACKING ResetMem(); MEMORYSTATUS memStat; diff --git a/Minecraft.Client/stdafx.h b/Minecraft.Client/stdafx.h index 6dda00a15..cdb513c24 100644 --- a/Minecraft.Client/stdafx.h +++ b/Minecraft.Client/stdafx.h @@ -147,6 +147,7 @@ typedef XUID GameSessionUID; #endif #include "../Minecraft.World/Definitions.h" +#include "../Minecraft.World/Debug.h" #include "../Minecraft.World/Class.h" #include "../Minecraft.World/ArrayWithLength.h" #include "../Minecraft.World/SharedConstants.h" diff --git a/Minecraft.World/ArmorItem.cpp b/Minecraft.World/ArmorItem.cpp index 0bd6111b9..f1f666873 100644 --- a/Minecraft.World/ArmorItem.cpp +++ b/Minecraft.World/ArmorItem.cpp @@ -208,7 +208,7 @@ void ArmorItem::setColor(shared_ptr item, int color) { #ifndef _CONTENT_PACKAGE printf("Can't dye non-leather!"); - __debugbreak(); + DEBUG_BREAK(); #endif //throw new UnsupportedOperationException("Can't dye non-leather!"); } diff --git a/Minecraft.World/BiomeDecorator.cpp b/Minecraft.World/BiomeDecorator.cpp index add156e88..2fd196a56 100644 --- a/Minecraft.World/BiomeDecorator.cpp +++ b/Minecraft.World/BiomeDecorator.cpp @@ -23,7 +23,7 @@ void BiomeDecorator::decorate(Level *level, Random *random, int xo, int zo) { app.DebugPrintf("BiomeDecorator::decorate - Already decorating!!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); //throw new RuntimeException("Already decorating!!"); #endif } diff --git a/Minecraft.World/BiomeOverrideLayer.cpp b/Minecraft.World/BiomeOverrideLayer.cpp index 846057408..39747bc02 100644 --- a/Minecraft.World/BiomeOverrideLayer.cpp +++ b/Minecraft.World/BiomeOverrideLayer.cpp @@ -32,7 +32,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) { #ifdef _DURANGO - __debugbreak(); // TODO + DEBUG_BREAK(); // TODO DWORD bytesRead,dwFileSize = 0; #else DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr); @@ -40,7 +40,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) if(dwFileSize > m_biomeOverride.length) { app.DebugPrintf("Biomemap binary is too large!!\n"); - __debugbreak(); + DEBUG_BREAK(); } BOOL bSuccess = ReadFile(file,m_biomeOverride.data,dwFileSize,&bytesRead,nullptr); diff --git a/Minecraft.World/BiomeSource.cpp b/Minecraft.World/BiomeSource.cpp index 27d0a9432..f84bb20bf 100644 --- a/Minecraft.World/BiomeSource.cpp +++ b/Minecraft.World/BiomeSource.cpp @@ -184,7 +184,7 @@ void BiomeSource::getRawBiomeBlock(BiomeArray &biomes, int x, int z, int w, int if(biomes[i] == nullptr) { app.DebugPrintf("Tried to assign null biome %d\n", result[i]); - __debugbreak(); + DEBUG_BREAK(); } #endif } diff --git a/Minecraft.World/Class.h b/Minecraft.World/Class.h index 25802c3ff..a102d1bb8 100644 --- a/Minecraft.World/Class.h +++ b/Minecraft.World/Class.h @@ -1,4 +1,5 @@ #pragma once +#include "Debug.h" using namespace std; class InputStream; @@ -598,7 +599,7 @@ public: if ( (m_falsePositives.size() > 0) || (m_falseNegatives.size() > 0) ) { - __debugbreak(); + DEBUG_BREAK(); } } }; diff --git a/Minecraft.World/CompoundTag.h b/Minecraft.World/CompoundTag.h index 8f4d045df..b64931a24 100644 --- a/Minecraft.World/CompoundTag.h +++ b/Minecraft.World/CompoundTag.h @@ -36,7 +36,7 @@ public: { #ifndef _CONTENT_PACKAGE printf("Tried to read NBT tag with too high complexity, depth > %d" , MAX_DEPTH); - __debugbreak(); + DEBUG_BREAK(); #endif return; } diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp index 7cdfdbce8..c6ea725b8 100644 --- a/Minecraft.World/CompressedTileStorage.cpp +++ b/Minecraft.World/CompressedTileStorage.cpp @@ -1065,7 +1065,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) #ifndef _DURANGO MEMORYSTATUS memStatus; GlobalMemoryStatus(&memStatus); - __debugbreak(); + DEBUG_BREAK(); #endif } unsigned char *pucData = newIndicesAndData + 1024; diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp index 3814281bc..7f25dd4ea 100644 --- a/Minecraft.World/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp @@ -88,7 +88,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID if( pagesCommitted != 0 ) { #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif } @@ -99,7 +99,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID { #ifndef _CONTENT_PACKAGE // Out of physical memory - __debugbreak(); + DEBUG_BREAK(); #endif } pagesCommitted = pagesRequired; @@ -204,7 +204,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID if( pvRet == nullptr ) { // Out of physical memory - __debugbreak(); + DEBUG_BREAK(); } pagesCommitted = pagesRequired; } @@ -495,7 +495,7 @@ void ConsoleSaveFileOriginal::finalizeWrite() void *pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE, COMMIT_ALLOCATION, PAGE_READWRITE); if( pvRet == NULL ) { - __debugbreak(); + DEBUG_BREAK(); } pagesCommitted = pagesRequired; } @@ -529,7 +529,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt if( pvRet == nullptr ) { // Out of physical memory - __debugbreak(); + DEBUG_BREAK(); } pagesCommitted = pagesRequired; } diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp index 7281d298c..09698880c 100644 --- a/Minecraft.World/CustomLevelSource.cpp +++ b/Minecraft.World/CustomLevelSource.cpp @@ -41,7 +41,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt { #ifdef _DURANGO - __debugbreak(); // TODO + DEBUG_BREAK(); // TODO DWORD bytesRead,dwFileSize = 0; #else DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr); @@ -49,7 +49,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt if(dwFileSize > m_heightmapOverride.length) { app.DebugPrintf("Heightmap binary is too large!!\n"); - __debugbreak(); + DEBUG_BREAK(); } BOOL bSuccess = ReadFile(file,m_heightmapOverride.data,dwFileSize,&bytesRead,nullptr); @@ -83,7 +83,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt { #ifdef _DURANGO - __debugbreak(); // TODO + DEBUG_BREAK(); // TODO DWORD bytesRead,dwFileSize = 0; #else DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr); @@ -91,7 +91,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt if(dwFileSize > m_waterheightOverride.length) { app.DebugPrintf("waterheight binary is too large!!\n"); - __debugbreak(); + DEBUG_BREAK(); } BOOL bSuccess = ReadFile(file,m_waterheightOverride.data,dwFileSize,&bytesRead,nullptr); diff --git a/Minecraft.World/CustomPayloadPacket.cpp b/Minecraft.World/CustomPayloadPacket.cpp index e86f01de0..1bb9b7432 100644 --- a/Minecraft.World/CustomPayloadPacket.cpp +++ b/Minecraft.World/CustomPayloadPacket.cpp @@ -31,7 +31,7 @@ CustomPayloadPacket::CustomPayloadPacket(const wstring &identifier, byteArray da { app.DebugPrintf("Payload may not be larger than 32K\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif //throw new IllegalArgumentException("Payload may not be larger than 32k"); } diff --git a/Minecraft.World/Debug.h b/Minecraft.World/Debug.h new file mode 100644 index 000000000..d1d82836e --- /dev/null +++ b/Minecraft.World/Debug.h @@ -0,0 +1,12 @@ +#pragma once +#include + +#if defined(_MSC_VER) + #define DEBUG_BREAK() __debugbreak() +#elif defined(__GNUC__) || defined(__clang__) + #define DEBUG_BREAK() __builtin_trap() +#elif defined(SIGTRAP) + #define DEBUG_BREAK() std::raise(SIGTRAP) +#else + #define DEBUG_BREAK() ((void)0) +#endif \ No newline at end of file diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index c557e37af..dd5180d7b 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -43,7 +43,7 @@ int _MapDataMappings::getDimension(int id) default: #ifndef _CONTENT_PACKAGE printf("Read invalid dimension from MapDataMapping\n"); - __debugbreak(); + DEBUG_BREAK(); #endif break; } @@ -72,7 +72,7 @@ void _MapDataMappings::setMapping(int id, PlayerUID xuid, int dimension) default: #ifndef _CONTENT_PACKAGE printf("Trinyg to set a MapDataMapping for an invalid dimension.\n"); - __debugbreak(); + DEBUG_BREAK(); #endif break; } diff --git a/Minecraft.World/Enchantment.cpp b/Minecraft.World/Enchantment.cpp index c2f981a61..e89552c7a 100644 --- a/Minecraft.World/Enchantment.cpp +++ b/Minecraft.World/Enchantment.cpp @@ -83,7 +83,7 @@ void Enchantment::_init(int id) { app.DebugPrintf("Duplicate enchantment id!"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif //throw new IllegalArgumentException("Duplicate enchantment id!"); } diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index 02664cd5b..2942d7ef0 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -111,7 +111,7 @@ int Entity::getSmallId() return fallbackId; #else app.DebugPrintf("Out of small entity Ids... possible leak?\n"); - __debugbreak(); + DEBUG_BREAK(); return -1; #endif } diff --git a/Minecraft.World/File.cpp b/Minecraft.World/File.cpp index 11871e426..23e1051cf 100644 --- a/Minecraft.World/File.cpp +++ b/Minecraft.World/File.cpp @@ -239,7 +239,7 @@ bool File::renameTo(File dest) std::string sourcePath = wstringtofilename(getPath()); const char *destPath = wstringtofilename(dest.getPath()); #ifdef _DURANGO - __debugbreak(); // TODO + DEBUG_BREAK(); // TODO BOOL result = false; #else BOOL result = MoveFile(sourcePath.c_str(), destPath); diff --git a/Minecraft.World/FileHeader.cpp b/Minecraft.World/FileHeader.cpp index a7bdbc904..b2ebe083e 100644 --- a/Minecraft.World/FileHeader.cpp +++ b/Minecraft.World/FileHeader.cpp @@ -298,7 +298,7 @@ void FileHeader::ReadHeader( LPVOID saveMem, ESavePlatform plat /*= SAVE_FILE_PL default: #ifndef _CONTENT_PACKAGE app.DebugPrintf("********** Invalid save version %d\n",m_saveVersion); - __debugbreak(); + DEBUG_BREAK(); #endif break; } diff --git a/Minecraft.World/FileInputStream.cpp b/Minecraft.World/FileInputStream.cpp index 7c34a22f3..a18464404 100644 --- a/Minecraft.World/FileInputStream.cpp +++ b/Minecraft.World/FileInputStream.cpp @@ -44,7 +44,6 @@ FileInputStream::FileInputStream(const File &file) if( m_fileHandle == INVALID_HANDLE_VALUE ) { // TODO 4J Stu - Any form of error/exception handling - //__debugbreak(); app.FatalLoadError(); } } diff --git a/Minecraft.World/GameCommandPacket.cpp b/Minecraft.World/GameCommandPacket.cpp index ada5b04cd..d7922293d 100644 --- a/Minecraft.World/GameCommandPacket.cpp +++ b/Minecraft.World/GameCommandPacket.cpp @@ -23,7 +23,7 @@ GameCommandPacket::GameCommandPacket(EGameCommand command, byteArray data) { app.DebugPrintf("Payload may not be larger than 32K\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif //throw new IllegalArgumentException("Payload may not be larger than 32k"); } diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index 19126b242..fa552c467 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -2411,7 +2411,7 @@ void Level::tickEntities() { if(isClientSide) { - __debugbreak(); + DEBUG_BREAK(); } it = tileEntityList.erase(it); } diff --git a/Minecraft.World/MoveEntityPacket.cpp b/Minecraft.World/MoveEntityPacket.cpp index aef9e6217..a2b79db31 100644 --- a/Minecraft.World/MoveEntityPacket.cpp +++ b/Minecraft.World/MoveEntityPacket.cpp @@ -38,7 +38,7 @@ void MoveEntityPacket::write(DataOutputStream *dos) //throws IOException if( (id < 0 ) || (id >= 16384 ) ) { // We shouln't be tracking an entity that doesn't have a short type of id - __debugbreak(); + DEBUG_BREAK(); } dos->writeShort(static_cast(id)); } diff --git a/Minecraft.World/MoveEntityPacketSmall.cpp b/Minecraft.World/MoveEntityPacketSmall.cpp index 7d91a15d5..3e1b922c9 100644 --- a/Minecraft.World/MoveEntityPacketSmall.cpp +++ b/Minecraft.World/MoveEntityPacketSmall.cpp @@ -22,7 +22,7 @@ MoveEntityPacketSmall::MoveEntityPacketSmall(int id) if( (id < 0 ) || (id >= 16384 ) ) { // We shouln't be tracking an entity that doesn't have a short type of id - __debugbreak(); + DEBUG_BREAK(); } this->id = id; @@ -45,7 +45,7 @@ void MoveEntityPacketSmall::write(DataOutputStream *dos) //throws IOException if( (id < 0 ) || (id >= 16384 ) ) { // We shouln't be tracking an entity that doesn't have a short type of id - __debugbreak(); + DEBUG_BREAK(); } dos->writeShort(static_cast(id)); } @@ -102,7 +102,7 @@ void MoveEntityPacketSmall::PosRot::write(DataOutputStream *dos) //throws IOExce if( (id < 0 ) || (id >= 16384 ) ) { // We shouln't be tracking an entity that doesn't have a short type of id - __debugbreak(); + DEBUG_BREAK(); } short idAndRot = id | yRot << 11; dos->writeShort(idAndRot); @@ -141,7 +141,7 @@ void MoveEntityPacketSmall::Pos::write(DataOutputStream *dos) //throws IOExcepti if( (id < 0 ) || (id >= 16384 ) ) { // We shouln't be tracking an entity that doesn't have a short type of id - __debugbreak(); + DEBUG_BREAK(); } short idAndY = id | ya << 11; dos->writeShort(idAndY); @@ -179,7 +179,7 @@ void MoveEntityPacketSmall::Rot::write(DataOutputStream *dos) //throws IOExcepti if( (id < 0 ) || (id >= 16384 ) ) { // We shouln't be tracking an entity that doesn't have a short type of id - __debugbreak(); + DEBUG_BREAK(); } short idAndRot = id | yRot << 11; dos->writeShort(idAndRot); diff --git a/Minecraft.World/Packet.cpp b/Minecraft.World/Packet.cpp index 1769c2acb..dc6343448 100644 --- a/Minecraft.World/Packet.cpp +++ b/Minecraft.World/Packet.cpp @@ -288,7 +288,7 @@ byteArray Packet::readBytes(DataInputStream *datainputstream) { app.DebugPrintf("Key was smaller than nothing! Weird key!"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif return byteArray(); //throw new IOException("Key was smaller than nothing! Weird key!"); diff --git a/Minecraft.World/PressurePlateTile.cpp b/Minecraft.World/PressurePlateTile.cpp index 650fbf9f8..4a61cf274 100644 --- a/Minecraft.World/PressurePlateTile.cpp +++ b/Minecraft.World/PressurePlateTile.cpp @@ -28,7 +28,7 @@ int PressurePlateTile::getSignalStrength(Level *level, int x, int y, int z) if (sensitivity == everything) entities = level->getEntities(nullptr, getSensitiveAABB(x, y, z)); else if (sensitivity == mobs) entities = level->getEntitiesOfClass(typeid(LivingEntity), getSensitiveAABB(x, y, z)); else if (sensitivity == players) entities = level->getEntitiesOfClass(typeid(Player), getSensitiveAABB(x, y, z)); - else __debugbreak(); // 4J-JEV: We're going to delete something at a random location. + else DEBUG_BREAK(); // 4J-JEV: We're going to delete something at a random location. if (entities != nullptr && !entities->empty()) { diff --git a/Minecraft.World/RegionFile.cpp b/Minecraft.World/RegionFile.cpp index 175ea6c1b..9ef17fd4b 100644 --- a/Minecraft.World/RegionFile.cpp +++ b/Minecraft.World/RegionFile.cpp @@ -299,7 +299,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync #ifndef _CONTENT_PACKAGE if(sectorNumber < 0) { - __debugbreak(); + DEBUG_BREAK(); } #endif diff --git a/Minecraft.World/SavedDataStorage.cpp b/Minecraft.World/SavedDataStorage.cpp index 049a19fc2..36c79b6fe 100644 --- a/Minecraft.World/SavedDataStorage.cpp +++ b/Minecraft.World/SavedDataStorage.cpp @@ -50,7 +50,7 @@ shared_ptr SavedDataStorage::get(const type_info& clazz, const wstrin else { // Handling of new SavedData class required - __debugbreak(); + DEBUG_BREAK(); } ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(levelStorage->getSaveFile(), file); diff --git a/Minecraft.World/Scoreboard.cpp b/Minecraft.World/Scoreboard.cpp index bab0b213e..2af268cc3 100644 --- a/Minecraft.World/Scoreboard.cpp +++ b/Minecraft.World/Scoreboard.cpp @@ -14,9 +14,6 @@ Objective *Scoreboard::addObjective(const wstring &name, ObjectiveCriteria *crit // Objective *objective = getObjective(name); // if (objective != nullptr) // { -//#indef _CONTENT_PACKAGE -// __debugbreak(); -//#endif // //throw new IllegalArgumentException("An objective with the name '" + name + "' already exists!"); // } // diff --git a/Minecraft.World/SetPlayerTeamPacket.cpp b/Minecraft.World/SetPlayerTeamPacket.cpp index a574067dd..b5fc825bd 100644 --- a/Minecraft.World/SetPlayerTeamPacket.cpp +++ b/Minecraft.World/SetPlayerTeamPacket.cpp @@ -39,14 +39,14 @@ SetPlayerTeamPacket::SetPlayerTeamPacket(PlayerTeam *team, vector *play { app.DebugPrintf("Method must be join or leave for player constructor"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif } if (playerNames == nullptr || playerNames->empty()) { app.DebugPrintf("Players cannot be null/empty"); #ifndef _CONTENT_PACKAGE - __debugbreak(); + DEBUG_BREAK(); #endif } diff --git a/Minecraft.World/StrongholdFeature.cpp b/Minecraft.World/StrongholdFeature.cpp index 83f05cf3f..47aae0d30 100644 --- a/Minecraft.World/StrongholdFeature.cpp +++ b/Minecraft.World/StrongholdFeature.cpp @@ -148,7 +148,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(); + DEBUG_BREAK(); } #endif diff --git a/Minecraft.World/WeighedRandom.cpp b/Minecraft.World/WeighedRandom.cpp index 777ab92f5..ff75be742 100644 --- a/Minecraft.World/WeighedRandom.cpp +++ b/Minecraft.World/WeighedRandom.cpp @@ -15,7 +15,7 @@ WeighedRandomItem *WeighedRandom::getRandomItem(Random *random, vectornextInt(totalWeight); @@ -50,7 +50,7 @@ WeighedRandomItem *WeighedRandom::getRandomItem(Random *random, WeighedRandomIte { if (totalWeight <= 0) { - __debugbreak(); + DEBUG_BREAK(); } int selection = random->nextInt(totalWeight); diff --git a/Minecraft.World/cmake/sources/Common.cmake b/Minecraft.World/cmake/sources/Common.cmake index 8a4d68330..926f437cf 100644 --- a/Minecraft.World/cmake/sources/Common.cmake +++ b/Minecraft.World/cmake/sources/Common.cmake @@ -104,6 +104,7 @@ set(_MINECRAFT_WORLD_COMMON_CONSOLEJAVALIBS_INPUTOUTPUTSTREAM source_group("ConsoleJavaLibs/InputOutputStream" FILES ${_MINECRAFT_WORLD_COMMON_CONSOLEJAVALIBS_INPUTOUTPUTSTREAM}) set(_MINECRAFT_WORLD_COMMON_HEADER_FILES + "${CMAKE_CURRENT_SOURCE_DIR}/Debug.h" "${CMAKE_CURRENT_SOURCE_DIR}/LevelObjectInputStream.h" "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World.h" "${CMAKE_CURRENT_SOURCE_DIR}/ParticleTypes.h" diff --git a/Minecraft.World/stdafx.h b/Minecraft.World/stdafx.h index 29adbe519..89224ba2a 100644 --- a/Minecraft.World/stdafx.h +++ b/Minecraft.World/stdafx.h @@ -126,6 +126,7 @@ typedef XUID GameSessionUID; #include "TilePos.h" #include "ChunkPos.h" #include "compression.h" +#include "Debug.h" #include "PerformanceTimer.h"