Merge branch 'MCLCE:main' into KBM-Icons

This commit is contained in:
PUFF_MON 2026-05-03 10:50:21 +02:00 committed by GitHub
commit 2aec1907bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 135 additions and 152 deletions

View file

@ -2,13 +2,14 @@
## Visual Studio ## Visual Studio
1. Clone or download the repository 1. Clone the repo, including submodules.
1. Open the repo folder in Visual Studio 2022+. - If you don't, the build will fail. `git clone --recurse-submodules https://github.com/MCLCE/MinecraftConsoles.git`
2. Wait for cmake to configure the project and load all assets (this may take a few minutes on the first run). 2. Open the repo folder in Visual Studio 2022+.
3. Right click a folder in the solution explorer and switch to the 'CMake Targets View' 3. Wait for cmake to configure the project and load all assets (this may take a few minutes on the first run).
4. Select platform and configuration from the dropdown. EG: `Windows64 - Debug` or `Windows64 - Release` 4. Right click a folder in the solution explorer and switch to the 'CMake Targets View'
5. Pick the startup project `Minecraft.Client.exe` or `Minecraft.Server.exe` using the debug targets dropdown 5. Select platform and configuration from the dropdown. EG: `Windows64 - Debug` or `Windows64 - Release`
6. Build and run the project: 6. Pick the startup project `Minecraft.Client.exe` or `Minecraft.Server.exe` using the debug targets dropdown
7. Build and run the project:
- `Build > Build Solution` (or `Ctrl+Shift+B`) - `Build > Build Solution` (or `Ctrl+Shift+B`)
- Start debugging with `F5`. - Start debugging with `F5`.

View file

@ -104,7 +104,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
app.DebugPrintf("Couldn't find file in archive\n"); app.DebugPrintf("Couldn't find file in archive\n");
app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str()); app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str());
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
app.FatalLoadError(); app.FatalLoadError();
} }

View file

@ -1016,7 +1016,7 @@ bool Chunk::isEmpty()
void Chunk::setDirty() void Chunk::setDirty()
{ {
// 4J - not used, but if this starts being used again then we'll need to investigate how best to handle it. // 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); levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_DIRTY);
} }

View file

@ -96,7 +96,7 @@ CMinecraftApp::CMinecraftApp()
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES in Xbox_App.h // 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); 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 #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #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 // 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"); app.DebugPrintf("Don't know what to do with this profile version!\n");
#ifndef _CONTENT_PACKAGE
// __debugbreak();
#endif
GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData;
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
@ -6421,7 +6418,7 @@ void CMinecraftApp::InitialiseTips()
{ {
// the m_TriviaTipA or the m_GameTipA are out of sync // the m_TriviaTipA or the m_GameTipA are out of sync
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
} }
@ -6599,13 +6596,12 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
//found list of html escapes at https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html //found list of html escapes at https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html
wstring CMinecraftApp::EscapeHTMLString(const wstring& desc) wstring CMinecraftApp::EscapeHTMLString(const wstring& desc)
{ {
static std::unordered_map<wchar_t, wchar_t*> replacementMap = { static std::unordered_map<wchar_t, wchar_t*> replacementMap = {
{L'&', L"&amp;"}, {L'&', L"&amp;"},
{L'<', L"&lt;"}, {L'<', L"&lt;"},
{L'>', L"&gt;"}, {L'>', L"&gt;"},
{L'\"', L"&quot;"}, {L'\"', L"&quot;"},
{L'\'', L"&#39;"}, };
};
wstring finalString = L""; wstring finalString = L"";
for (int i = 0; i < desc.size(); i++) { for (int i = 0; i < desc.size(); i++) {

View file

@ -171,7 +171,7 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/)
if(index >= m_packs.size()) if(index >= m_packs.size())
{ {
app.DebugPrintf("DLCManager: Trying to access a DLC pack beyond the range of valid packs\n"); app.DebugPrintf("DLCManager: Trying to access a DLC pack beyond the range of valid packs\n");
__debugbreak(); DEBUG_BREAK();
} }
pack = m_packs[index]; pack = m_packs[index];
} }
@ -186,7 +186,6 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
if(pack == nullptr) if(pack == nullptr)
{ {
app.DebugPrintf("DLCManager: Attempting to find the index for a nullptr pack\n"); app.DebugPrintf("DLCManager: Attempting to find the index for a nullptr pack\n");
//__debugbreak();
return foundIndex; return foundIndex;
} }
if( type != e_DLCType_All ) if( type != e_DLCType_All )

View file

@ -107,7 +107,7 @@ void DLCPack::addChildPack(DLCPack *childPack)
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if(packId < 0 || packId > 15) if(packId < 0 || packId > 15)
{ {
__debugbreak(); DEBUG_BREAK();
} }
#endif #endif
childPack->SetPackId( (packId<<24) | m_packId ); childPack->SetPackId( (packId<<24) | m_packId );
@ -362,7 +362,7 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
{ {
app.DebugPrintf("Unimplemented\n"); app.DebugPrintf("Unimplemented\n");
#ifndef __CONTENT_PACKAGE #ifndef __CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return 0; return 0;
} }
@ -392,9 +392,6 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
/*if(type == DLCManager::e_DLCType_All) /*if(type == DLCManager::e_DLCType_All)
{ {
app.DebugPrintf("Unimplemented\n"); app.DebugPrintf("Unimplemented\n");
#ifndef _CONTENT_PACKAGE
__debugbreak();
#endif
return false; return false;
} }
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE

View file

@ -122,7 +122,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
app.DebugPrintf("ConsoleSchematicFile has read a nullptr tile entity\n"); app.DebugPrintf("ConsoleSchematicFile has read a nullptr tile entity\n");
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
else else
@ -635,7 +635,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
} }
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if(p!=blockCount) __debugbreak(); if(p!=blockCount) DEBUG_BREAK();
#endif #endif
// We don't know how this will compress - just make a fixed length buffer to initially decompress into // We don't know how this will compress - just make a fixed length buffer to initially decompress into

View file

@ -24,7 +24,7 @@ GameRule::ValueType GameRule::getParameter(const wstring &parameterName)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str()); wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str());
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
return m_parameters[parameterName]; return m_parameters[parameterName];

View file

@ -238,7 +238,7 @@ HRESULT SonyLeaderboardManager::fillByIdsQuery(const SceNpId &myNpId, SceNpId* &
{ {
// 4J-JEV: Something terrible must have happend, // 4J-JEV: Something terrible must have happend,
// 'getFriendslist' was supposed to be a synchronous operation. // 'getFriendslist' was supposed to be a synchronous operation.
__debugbreak(); DEBUG_BREAK();
// 4J-JEV: We can at least fall-back to just the players score. // 4J-JEV: We can at least fall-back to just the players score.
len = 1; len = 1;

View file

@ -247,8 +247,6 @@ void CPlatformNetworkManagerSony::HandlePlayerJoined(SQRNetworkPlayer *
void CPlatformNetworkManagerSony::HandlePlayerLeaving(SQRNetworkPlayer *pSQRPlayer) void CPlatformNetworkManagerSony::HandlePlayerLeaving(SQRNetworkPlayer *pSQRPlayer)
{ {
//__debugbreak();
app.DebugPrintf( "Player 0x%p leaving.\n", app.DebugPrintf( "Player 0x%p leaving.\n",
pSQRPlayer ); pSQRPlayer );

View file

@ -320,7 +320,7 @@ void UIScene::loadMovie()
{ {
app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str()); app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str());
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
app.FatalLoadError(); app.FatalLoadError();
} }
@ -335,7 +335,7 @@ void UIScene::loadMovie()
{ {
app.DebugPrintf("ERROR: Failed to load iggy scene!\n"); app.DebugPrintf("ERROR: Failed to load iggy scene!\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
app.FatalLoadError(); app.FatalLoadError();
} }
@ -941,9 +941,6 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
// if(m_parentLayer == nullptr) // if(m_parentLayer == nullptr)
// { // {
// app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is nullptr!\n"); // app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is nullptr!\n");
//#ifndef _CONTENT_PACKAGE
// __debugbreak();
//#endif
// } // }
// else // else
// { // {
@ -960,10 +957,6 @@ void UIScene::navigateBack()
if(m_parentLayer == nullptr) 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 else
{ {
@ -1194,7 +1187,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handlePress did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handlePress did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1202,7 +1195,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handlePress were not of the correct type\n"); app.DebugPrintf("Arguments for handlePress were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1214,7 +1207,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleFocusChange did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleFocusChange did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1222,7 +1215,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handleFocusChange were not of the correct type\n"); app.DebugPrintf("Arguments for handleFocusChange were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1234,7 +1227,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleInitFocus did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleInitFocus did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1242,7 +1235,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handleInitFocus were not of the correct type\n"); app.DebugPrintf("Arguments for handleInitFocus were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1254,7 +1247,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleCheckboxToggled did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleCheckboxToggled did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1262,7 +1255,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n"); app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1274,7 +1267,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleSliderMove did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleSliderMove did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1282,7 +1275,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n"); app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1294,7 +1287,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleAnimationEnd did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleAnimationEnd did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1306,7 +1299,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleSelectionChanged did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleSelectionChanged did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1314,7 +1307,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handleSelectionChanged were not of the correct type\n"); app.DebugPrintf("Arguments for handleSelectionChanged were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1332,7 +1325,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Callback for handleRequestMoreData did not have the correct number of arguments\n"); app.DebugPrintf("Callback for handleRequestMoreData did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }
@ -1340,7 +1333,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
{ {
app.DebugPrintf("Arguments for handleRequestMoreData were not of the correct type\n"); app.DebugPrintf("Arguments for handleRequestMoreData were not of the correct type\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }

View file

@ -390,7 +390,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
break; break;
#endif #endif
default: __debugbreak(); default: DEBUG_BREAK();
} }
bool confirmUser = false; bool confirmUser = false;

View file

@ -106,7 +106,7 @@ wstring DLCTexturePack::getResource(const wstring& name)
{ {
// 4J Stu - We should never call this function // 4J Stu - We should never call this function
#ifndef __CONTENT_PACKAGE #ifndef __CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return L""; return L"";
} }
@ -115,7 +115,7 @@ InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //th
{ {
// 4J Stu - We should never call this function // 4J Stu - We should never call this function
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
if(hasFile(name)) return nullptr; if(hasFile(name)) return nullptr;
#endif #endif
return nullptr; //resource; return nullptr; //resource;

View file

@ -641,7 +641,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i
{ {
DWORD error = GetLastError(); DWORD error = GetLastError();
app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error); app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error);
__debugbreak(); DEBUG_BREAK();
return 0; return 0;
} }

View file

@ -20,7 +20,7 @@ void ConsoleUIController::init(Microsoft::WRL::ComPtr<ID3D11Device> dev, Microso
{ {
app.DebugPrintf("Failed to initialise GDraw!\n"); app.DebugPrintf("Failed to initialise GDraw!\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
app.FatalLoadError(); app.FatalLoadError();
} }

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -187,8 +187,6 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl
void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRPlayer) void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRPlayer)
{ {
//__debugbreak();
app.DebugPrintf( "Player 0x%p leaving.\n", app.DebugPrintf( "Player 0x%p leaving.\n",
pDQRPlayer ); pDQRPlayer );

View file

@ -187,7 +187,7 @@ EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF e)
{ {
app.DebugPrintf("Couldn't find renderer for entity of type %d\n", e); app.DebugPrintf("Couldn't find renderer for entity of type %d\n", e);
// New renderer mapping required in above table // 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 /* 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) if (it == renderers.end() && e != Entity::_class)

View file

@ -83,7 +83,7 @@ void EntityTracker::addEntity(shared_ptr<Entity> e, int range, int updateInterva
} }
if( e->entityId >= 16384 ) if( e->entityId >= 16384 )
{ {
__debugbreak(); DEBUG_BREAK();
} }
shared_ptr<TrackedEntity> te = std::make_shared<TrackedEntity>(e, range, updateInterval, trackDeltas); shared_ptr<TrackedEntity> te = std::make_shared<TrackedEntity>(e, range, updateInterval, trackDeltas);
entities.insert(te); entities.insert(te);

View file

@ -2112,7 +2112,7 @@ void GameRenderer::setupFog(int i, float alpha)
if (i == 999) if (i == 999)
{ {
__debugbreak(); DEBUG_BREAK();
// 4J TODO // 4J TODO
/* /*
glFog(GL_FOG_COLOR, getBuffer(0, 0, 0, 1)); glFog(GL_FOG_COLOR, getBuffer(0, 0, 0, 1));

View file

@ -518,7 +518,7 @@ void LocalPlayer::changeDimension(int i)
//minecraft.setScreen(new WinScreen()); //minecraft.setScreen(new WinScreen());
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
app.DebugPrintf("LocalPlayer::changeDimension from 1 to 1 but WinScreen has not been implemented.\n"); app.DebugPrintf("LocalPlayer::changeDimension from 1 to 1 but WinScreen has not been implemented.\n");
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
else else

View file

@ -4817,7 +4817,7 @@ void Minecraft::main()
app.DebugPrintf("<xs:enumeration value=\"%d\"><xs:annotation><xs:documentation>%ls</xs:documentation></xs:annotation></xs:enumeration>\n", i, app.GetString( Tile::tiles[i]->getDescriptionId() )); app.DebugPrintf("<xs:enumeration value=\"%d\"><xs:annotation><xs:documentation>%ls</xs:documentation></xs:annotation></xs:enumeration>\n", i, app.GetString( Tile::tiles[i]->getDescriptionId() ));
} }
} }
__debugbreak(); DEBUG_BREAK();
#endif #endif
// 4J-PB - Can't call this for the first 5 seconds of a game - MS rule // 4J-PB - Can't call this for the first 5 seconds of a game - MS rule

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -245,7 +245,7 @@ bool OrbisLeaderboardManager::getScoreByIds()
{ {
// 4J-JEV: Something terrible must have happend, // 4J-JEV: Something terrible must have happend,
// 'getFriendslist' was supposed to be a synchronous operation. // 'getFriendslist' was supposed to be a synchronous operation.
__debugbreak(); DEBUG_BREAK();
// 4J-JEV: We can at least fall-back to just the players score. // 4J-JEV: We can at least fall-back to just the players score.
num = 1; num = 1;

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -218,7 +218,7 @@ void Particle::setTex(Textures *textures, Icon *icon)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Invalid call to Particle.setTex, use coordinate methods\n"); printf("Invalid call to Particle.setTex, use coordinate methods\n");
__debugbreak(); DEBUG_BREAK();
#endif #endif
//throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); //throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods");
} }
@ -230,7 +230,7 @@ void Particle::setMiscTex(int slotIndex)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Invalid call to Particle.setMixTex\n"); printf("Invalid call to Particle.setMixTex\n");
__debugbreak(); DEBUG_BREAK();
//throw new RuntimeException("Invalid call to Particle.setMiscTex"); //throw new RuntimeException("Invalid call to Particle.setMiscTex");
#endif #endif
} }

View file

@ -227,7 +227,6 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack *texturePack, Stitch
if(first->getWidth() != tex->getWidth() || first->getHeight() != tex->getHeight()) 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()); 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 #endif
@ -246,7 +245,7 @@ StitchedTexture *PreStitchedTextureMap::getTexture(const wstring &name)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
app.DebugPrintf("Not implemented!\n"); app.DebugPrintf("Not implemented!\n");
__debugbreak(); DEBUG_BREAK();
#endif #endif
return nullptr; return nullptr;
#if 0 #if 0
@ -277,7 +276,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name)
{ {
app.DebugPrintf("Don't register nullptr\n"); app.DebugPrintf("Don't register nullptr\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
result = missingPosition; result = missingPosition;
//new RuntimeException("Don't register null!").printStackTrace(); //new RuntimeException("Don't register null!").printStackTrace();
@ -290,7 +289,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
app.DebugPrintf("Could not find uv data for icon %ls\n", name.c_str() ); app.DebugPrintf("Could not find uv data for icon %ls\n", name.c_str() );
__debugbreak(); DEBUG_BREAK();
#endif #endif
result = missingPosition; result = missingPosition;
} }

View file

@ -87,7 +87,7 @@ void Stitcher::stitch()
{ {
app.DebugPrintf("Stitcher exception!\n"); app.DebugPrintf("Stitcher exception!\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
//throw new StitcherException(textureHolder); //throw new StitcherException(textureHolder);
} }

View file

@ -144,7 +144,7 @@ LPCWSTR StringTable::getString(const wstring &id)
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if (isStatic) if (isStatic)
{ {
__debugbreak(); DEBUG_BREAK();
return L""; return L"";
} }
#endif #endif
@ -166,7 +166,7 @@ LPCWSTR StringTable::getString(int id)
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if (!isStatic) if (!isStatic)
{ {
__debugbreak(); DEBUG_BREAK();
return L""; return L"";
} }
#endif #endif

View file

@ -214,7 +214,7 @@ Icon *TextureMap::registerIcon(const wstring &name)
{ {
app.DebugPrintf("Don't register nullptr\n"); app.DebugPrintf("Don't register nullptr\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
//new RuntimeException("Don't register null!").printStackTrace(); //new RuntimeException("Don't register null!").printStackTrace();
} }

View file

@ -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); app.DebugPrintf("Failed to select texture pack %d as it is not in the list\n", id);
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
// TODO - 4J Stu: We should report this to the player in some way // TODO - 4J Stu: We should report this to the player in some way
//__debugbreak();
#endif #endif
// Fail safely // Fail safely
if( selectSkin( DEFAULT_TEXTURE_PACK ) ) if( selectSkin( DEFAULT_TEXTURE_PACK ) )

@ -1 +1 @@
Subproject commit f567d33ccbddad1d8356e4d8344b22de80f23ab2 Subproject commit 8fb036f6d6ca5aa5aa2e20633638d6232a58d508

View file

@ -1619,7 +1619,7 @@ RADDEFSTART
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()
#define RR_CACHE_LINE_SIZE 32 #define RR_CACHE_LINE_SIZE 32
#elif defined(__RADXENON__) #elif defined(__RADXENON__)
#define RR_BREAK() __debugbreak() #define RR_BREAK() DEBUG_BREAK()
#define RR_CACHE_LINE_SIZE 128 #define RR_CACHE_LINE_SIZE 128
#elif defined(__RADANDROID__) #elif defined(__RADANDROID__)
#define RR_BREAK() __builtin_trap() #define RR_BREAK() __builtin_trap()

View file

@ -24,7 +24,7 @@ void ConsoleUIController::init(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D
{ {
app.DebugPrintf("Failed to initialise GDraw!\n"); app.DebugPrintf("Failed to initialise GDraw!\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
app.FatalLoadError(); app.FatalLoadError();
} }

View file

@ -487,7 +487,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
#ifdef _DEBUG #ifdef _DEBUG
__debugbreak(); DEBUG_BREAK();
#endif #endif
//wprintf(L"WARNING: Sound cue not found - %ls\n", name.c_str() ); //wprintf(L"WARNING: Sound cue not found - %ls\n", name.c_str() );
app.DebugPrintf("Not found: %s\n",xboxName); app.DebugPrintf("Not found: %s\n",xboxName);

View file

@ -183,7 +183,7 @@ bool XboxLeaderboardManager::WriteStats(unsigned int viewCount, ViewIn views)
// some debug code to catch the leaderboard write with 7 views // some debug code to catch the leaderboard write with 7 views
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if(viewCount>5) __debugbreak(); if(viewCount>5) DEBUG_BREAK();
#endif #endif
// 4J Stu - If we are online we already have a session, so use that // 4J Stu - If we are online we already have a session, so use that

View file

@ -211,8 +211,6 @@ VOID CPlatformNetworkManagerXbox::NotifyPlayerLeaving(
__in IQNetPlayer * pQNetPlayer __in IQNetPlayer * pQNetPlayer
) )
{ {
//__debugbreak();
app.DebugPrintf( "Player 0x%p \"%ls\" leaving.\n", app.DebugPrintf( "Player 0x%p \"%ls\" leaving.\n",
pQNetPlayer, pQNetPlayer,
pQNetPlayer->GetGamertag() ); pQNetPlayer->GetGamertag() );

View file

@ -315,8 +315,6 @@ int __cdecl main()
HRESULT hr; HRESULT hr;
static bool bTrialTimerDisplayed=true; static bool bTrialTimerDisplayed=true;
//__debugbreak();
#ifdef MEMORY_TRACKING #ifdef MEMORY_TRACKING
ResetMem(); ResetMem();
MEMORYSTATUS memStat; MEMORYSTATUS memStat;

View file

@ -147,6 +147,7 @@ typedef XUID GameSessionUID;
#endif #endif
#include "../Minecraft.World/Definitions.h" #include "../Minecraft.World/Definitions.h"
#include "../Minecraft.World/Debug.h"
#include "../Minecraft.World/Class.h" #include "../Minecraft.World/Class.h"
#include "../Minecraft.World/ArrayWithLength.h" #include "../Minecraft.World/ArrayWithLength.h"
#include "../Minecraft.World/SharedConstants.h" #include "../Minecraft.World/SharedConstants.h"

View file

@ -208,7 +208,7 @@ void ArmorItem::setColor(shared_ptr<ItemInstance> item, int color)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Can't dye non-leather!"); printf("Can't dye non-leather!");
__debugbreak(); DEBUG_BREAK();
#endif #endif
//throw new UnsupportedOperationException("Can't dye non-leather!"); //throw new UnsupportedOperationException("Can't dye non-leather!");
} }

View file

@ -23,7 +23,7 @@ void BiomeDecorator::decorate(Level *level, Random *random, int xo, int zo)
{ {
app.DebugPrintf("BiomeDecorator::decorate - Already decorating!!\n"); app.DebugPrintf("BiomeDecorator::decorate - Already decorating!!\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
//throw new RuntimeException("Already decorating!!"); //throw new RuntimeException("Already decorating!!");
#endif #endif
} }

View file

@ -32,7 +32,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup)
{ {
#ifdef _DURANGO #ifdef _DURANGO
__debugbreak(); // TODO DEBUG_BREAK(); // TODO
DWORD bytesRead,dwFileSize = 0; DWORD bytesRead,dwFileSize = 0;
#else #else
DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr); DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr);
@ -40,7 +40,7 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup)
if(dwFileSize > m_biomeOverride.length) if(dwFileSize > m_biomeOverride.length)
{ {
app.DebugPrintf("Biomemap binary is too large!!\n"); app.DebugPrintf("Biomemap binary is too large!!\n");
__debugbreak(); DEBUG_BREAK();
} }
BOOL bSuccess = ReadFile(file,m_biomeOverride.data,dwFileSize,&bytesRead,nullptr); BOOL bSuccess = ReadFile(file,m_biomeOverride.data,dwFileSize,&bytesRead,nullptr);

View file

@ -184,7 +184,7 @@ void BiomeSource::getRawBiomeBlock(BiomeArray &biomes, int x, int z, int w, int
if(biomes[i] == nullptr) if(biomes[i] == nullptr)
{ {
app.DebugPrintf("Tried to assign null biome %d\n", result[i]); app.DebugPrintf("Tried to assign null biome %d\n", result[i]);
__debugbreak(); DEBUG_BREAK();
} }
#endif #endif
} }

View file

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "Debug.h"
using namespace std; using namespace std;
class InputStream; class InputStream;
@ -598,7 +599,7 @@ public:
if ( (m_falsePositives.size() > 0) || (m_falseNegatives.size() > 0) ) if ( (m_falsePositives.size() > 0) || (m_falseNegatives.size() > 0) )
{ {
__debugbreak(); DEBUG_BREAK();
} }
} }
}; };

View file

@ -36,7 +36,7 @@ public:
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Tried to read NBT tag with too high complexity, depth > %d" , MAX_DEPTH); printf("Tried to read NBT tag with too high complexity, depth > %d" , MAX_DEPTH);
__debugbreak(); DEBUG_BREAK();
#endif #endif
return; return;
} }

View file

@ -1065,7 +1065,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/)
#ifndef _DURANGO #ifndef _DURANGO
MEMORYSTATUS memStatus; MEMORYSTATUS memStatus;
GlobalMemoryStatus(&memStatus); GlobalMemoryStatus(&memStatus);
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
unsigned char *pucData = newIndicesAndData + 1024; unsigned char *pucData = newIndicesAndData + 1024;

View file

@ -88,7 +88,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
if( pagesCommitted != 0 ) if( pagesCommitted != 0 )
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
@ -99,7 +99,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
// Out of physical memory // Out of physical memory
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
pagesCommitted = pagesRequired; pagesCommitted = pagesRequired;
@ -204,7 +204,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID
if( pvRet == nullptr ) if( pvRet == nullptr )
{ {
// Out of physical memory // Out of physical memory
__debugbreak(); DEBUG_BREAK();
} }
pagesCommitted = pagesRequired; pagesCommitted = pagesRequired;
} }
@ -495,7 +495,7 @@ void ConsoleSaveFileOriginal::finalizeWrite()
void *pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE, COMMIT_ALLOCATION, PAGE_READWRITE); void *pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE, COMMIT_ALLOCATION, PAGE_READWRITE);
if( pvRet == NULL ) if( pvRet == NULL )
{ {
__debugbreak(); DEBUG_BREAK();
} }
pagesCommitted = pagesRequired; pagesCommitted = pagesRequired;
} }
@ -529,7 +529,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt
if( pvRet == nullptr ) if( pvRet == nullptr )
{ {
// Out of physical memory // Out of physical memory
__debugbreak(); DEBUG_BREAK();
} }
pagesCommitted = pagesRequired; pagesCommitted = pagesRequired;
} }
@ -731,6 +731,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail )
s_bgSaveActive.store(true, std::memory_order_release); s_bgSaveActive.store(true, std::memory_order_release);
std::thread([snap, fileSize, thumb, thumbSz, meta, metaLen, this]() { std::thread([snap, fileSize, thumb, thumbSz, meta, metaLen, this]() {
Compression::UseDefaultThreadStorage();
unsigned int compLen = fileSize + 8; unsigned int compLen = fileSize + 8;
byte *buf = static_cast<byte *>(StorageManager.AllocateSaveData(compLen)); byte *buf = static_cast<byte *>(StorageManager.AllocateSaveData(compLen));
if (!buf) if (!buf)

View file

@ -41,7 +41,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
{ {
#ifdef _DURANGO #ifdef _DURANGO
__debugbreak(); // TODO DEBUG_BREAK(); // TODO
DWORD bytesRead,dwFileSize = 0; DWORD bytesRead,dwFileSize = 0;
#else #else
DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr); DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr);
@ -49,7 +49,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
if(dwFileSize > m_heightmapOverride.length) if(dwFileSize > m_heightmapOverride.length)
{ {
app.DebugPrintf("Heightmap binary is too large!!\n"); app.DebugPrintf("Heightmap binary is too large!!\n");
__debugbreak(); DEBUG_BREAK();
} }
BOOL bSuccess = ReadFile(file,m_heightmapOverride.data,dwFileSize,&bytesRead,nullptr); 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 #ifdef _DURANGO
__debugbreak(); // TODO DEBUG_BREAK(); // TODO
DWORD bytesRead,dwFileSize = 0; DWORD bytesRead,dwFileSize = 0;
#else #else
DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr); DWORD bytesRead,dwFileSize = GetFileSize(file,nullptr);
@ -91,7 +91,7 @@ CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateSt
if(dwFileSize > m_waterheightOverride.length) if(dwFileSize > m_waterheightOverride.length)
{ {
app.DebugPrintf("waterheight binary is too large!!\n"); app.DebugPrintf("waterheight binary is too large!!\n");
__debugbreak(); DEBUG_BREAK();
} }
BOOL bSuccess = ReadFile(file,m_waterheightOverride.data,dwFileSize,&bytesRead,nullptr); BOOL bSuccess = ReadFile(file,m_waterheightOverride.data,dwFileSize,&bytesRead,nullptr);

View file

@ -31,7 +31,7 @@ CustomPayloadPacket::CustomPayloadPacket(const wstring &identifier, byteArray da
{ {
app.DebugPrintf("Payload may not be larger than 32K\n"); app.DebugPrintf("Payload may not be larger than 32K\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
//throw new IllegalArgumentException("Payload may not be larger than 32k"); //throw new IllegalArgumentException("Payload may not be larger than 32k");
} }

12
Minecraft.World/Debug.h Normal file
View file

@ -0,0 +1,12 @@
#pragma once
#include <csignal>
#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

View file

@ -43,7 +43,7 @@ int _MapDataMappings::getDimension(int id)
default: default:
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Read invalid dimension from MapDataMapping\n"); printf("Read invalid dimension from MapDataMapping\n");
__debugbreak(); DEBUG_BREAK();
#endif #endif
break; break;
} }
@ -72,7 +72,7 @@ void _MapDataMappings::setMapping(int id, PlayerUID xuid, int dimension)
default: default:
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Trinyg to set a MapDataMapping for an invalid dimension.\n"); printf("Trinyg to set a MapDataMapping for an invalid dimension.\n");
__debugbreak(); DEBUG_BREAK();
#endif #endif
break; break;
} }

View file

@ -83,7 +83,7 @@ void Enchantment::_init(int id)
{ {
app.DebugPrintf("Duplicate enchantment id!"); app.DebugPrintf("Duplicate enchantment id!");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
//throw new IllegalArgumentException("Duplicate enchantment id!"); //throw new IllegalArgumentException("Duplicate enchantment id!");
} }

View file

@ -111,7 +111,7 @@ int Entity::getSmallId()
return fallbackId; return fallbackId;
#else #else
app.DebugPrintf("Out of small entity Ids... possible leak?\n"); app.DebugPrintf("Out of small entity Ids... possible leak?\n");
__debugbreak(); DEBUG_BREAK();
return -1; return -1;
#endif #endif
} }

View file

@ -239,7 +239,7 @@ bool File::renameTo(File dest)
std::string sourcePath = wstringtofilename(getPath()); std::string sourcePath = wstringtofilename(getPath());
const char *destPath = wstringtofilename(dest.getPath()); const char *destPath = wstringtofilename(dest.getPath());
#ifdef _DURANGO #ifdef _DURANGO
__debugbreak(); // TODO DEBUG_BREAK(); // TODO
BOOL result = false; BOOL result = false;
#else #else
BOOL result = MoveFile(sourcePath.c_str(), destPath); BOOL result = MoveFile(sourcePath.c_str(), destPath);

View file

@ -298,7 +298,7 @@ void FileHeader::ReadHeader( LPVOID saveMem, ESavePlatform plat /*= SAVE_FILE_PL
default: default:
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
app.DebugPrintf("********** Invalid save version %d\n",m_saveVersion); app.DebugPrintf("********** Invalid save version %d\n",m_saveVersion);
__debugbreak(); DEBUG_BREAK();
#endif #endif
break; break;
} }

View file

@ -44,7 +44,6 @@ FileInputStream::FileInputStream(const File &file)
if( m_fileHandle == INVALID_HANDLE_VALUE ) if( m_fileHandle == INVALID_HANDLE_VALUE )
{ {
// TODO 4J Stu - Any form of error/exception handling // TODO 4J Stu - Any form of error/exception handling
//__debugbreak();
app.FatalLoadError(); app.FatalLoadError();
} }
} }

View file

@ -23,7 +23,7 @@ GameCommandPacket::GameCommandPacket(EGameCommand command, byteArray data)
{ {
app.DebugPrintf("Payload may not be larger than 32K\n"); app.DebugPrintf("Payload may not be larger than 32K\n");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
//throw new IllegalArgumentException("Payload may not be larger than 32k"); //throw new IllegalArgumentException("Payload may not be larger than 32k");
} }

View file

@ -2411,7 +2411,7 @@ void Level::tickEntities()
{ {
if(isClientSide) if(isClientSide)
{ {
__debugbreak(); DEBUG_BREAK();
} }
it = tileEntityList.erase(it); it = tileEntityList.erase(it);
} }

View file

@ -38,7 +38,7 @@ void MoveEntityPacket::write(DataOutputStream *dos) //throws IOException
if( (id < 0 ) || (id >= 16384 ) ) if( (id < 0 ) || (id >= 16384 ) )
{ {
// We shouln't be tracking an entity that doesn't have a short type of id // We shouln't be tracking an entity that doesn't have a short type of id
__debugbreak(); DEBUG_BREAK();
} }
dos->writeShort(static_cast<short>(id)); dos->writeShort(static_cast<short>(id));
} }

View file

@ -22,7 +22,7 @@ MoveEntityPacketSmall::MoveEntityPacketSmall(int id)
if( (id < 0 ) || (id >= 16384 ) ) if( (id < 0 ) || (id >= 16384 ) )
{ {
// We shouln't be tracking an entity that doesn't have a short type of id // We shouln't be tracking an entity that doesn't have a short type of id
__debugbreak(); DEBUG_BREAK();
} }
this->id = id; this->id = id;
@ -45,7 +45,7 @@ void MoveEntityPacketSmall::write(DataOutputStream *dos) //throws IOException
if( (id < 0 ) || (id >= 16384 ) ) if( (id < 0 ) || (id >= 16384 ) )
{ {
// We shouln't be tracking an entity that doesn't have a short type of id // We shouln't be tracking an entity that doesn't have a short type of id
__debugbreak(); DEBUG_BREAK();
} }
dos->writeShort(static_cast<short>(id)); dos->writeShort(static_cast<short>(id));
} }
@ -102,7 +102,7 @@ void MoveEntityPacketSmall::PosRot::write(DataOutputStream *dos) //throws IOExce
if( (id < 0 ) || (id >= 16384 ) ) if( (id < 0 ) || (id >= 16384 ) )
{ {
// We shouln't be tracking an entity that doesn't have a short type of id // We shouln't be tracking an entity that doesn't have a short type of id
__debugbreak(); DEBUG_BREAK();
} }
short idAndRot = id | yRot << 11; short idAndRot = id | yRot << 11;
dos->writeShort(idAndRot); dos->writeShort(idAndRot);
@ -141,7 +141,7 @@ void MoveEntityPacketSmall::Pos::write(DataOutputStream *dos) //throws IOExcepti
if( (id < 0 ) || (id >= 16384 ) ) if( (id < 0 ) || (id >= 16384 ) )
{ {
// We shouln't be tracking an entity that doesn't have a short type of id // We shouln't be tracking an entity that doesn't have a short type of id
__debugbreak(); DEBUG_BREAK();
} }
short idAndY = id | ya << 11; short idAndY = id | ya << 11;
dos->writeShort(idAndY); dos->writeShort(idAndY);
@ -179,7 +179,7 @@ void MoveEntityPacketSmall::Rot::write(DataOutputStream *dos) //throws IOExcepti
if( (id < 0 ) || (id >= 16384 ) ) if( (id < 0 ) || (id >= 16384 ) )
{ {
// We shouln't be tracking an entity that doesn't have a short type of id // We shouln't be tracking an entity that doesn't have a short type of id
__debugbreak(); DEBUG_BREAK();
} }
short idAndRot = id | yRot << 11; short idAndRot = id | yRot << 11;
dos->writeShort(idAndRot); dos->writeShort(idAndRot);

View file

@ -288,7 +288,7 @@ byteArray Packet::readBytes(DataInputStream *datainputstream)
{ {
app.DebugPrintf("Key was smaller than nothing! Weird key!"); app.DebugPrintf("Key was smaller than nothing! Weird key!");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
return byteArray(); return byteArray();
//throw new IOException("Key was smaller than nothing! Weird key!"); //throw new IOException("Key was smaller than nothing! Weird key!");

View file

@ -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)); 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 == mobs) entities = level->getEntitiesOfClass(typeid(LivingEntity), getSensitiveAABB(x, y, z));
else if (sensitivity == players) entities = level->getEntitiesOfClass(typeid(Player), 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()) if (entities != nullptr && !entities->empty())
{ {

View file

@ -299,7 +299,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if(sectorNumber < 0) if(sectorNumber < 0)
{ {
__debugbreak(); DEBUG_BREAK();
} }
#endif #endif

View file

@ -50,7 +50,7 @@ shared_ptr<SavedData> SavedDataStorage::get(const type_info& clazz, const wstrin
else else
{ {
// Handling of new SavedData class required // Handling of new SavedData class required
__debugbreak(); DEBUG_BREAK();
} }
ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(levelStorage->getSaveFile(), file); ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(levelStorage->getSaveFile(), file);

View file

@ -14,9 +14,6 @@ Objective *Scoreboard::addObjective(const wstring &name, ObjectiveCriteria *crit
// Objective *objective = getObjective(name); // Objective *objective = getObjective(name);
// if (objective != nullptr) // if (objective != nullptr)
// { // {
//#indef _CONTENT_PACKAGE
// __debugbreak();
//#endif
// //throw new IllegalArgumentException("An objective with the name '" + name + "' already exists!"); // //throw new IllegalArgumentException("An objective with the name '" + name + "' already exists!");
// } // }
// //

View file

@ -39,14 +39,14 @@ SetPlayerTeamPacket::SetPlayerTeamPacket(PlayerTeam *team, vector<wstring> *play
{ {
app.DebugPrintf("Method must be join or leave for player constructor"); app.DebugPrintf("Method must be join or leave for player constructor");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }
if (playerNames == nullptr || playerNames->empty()) if (playerNames == nullptr || playerNames->empty())
{ {
app.DebugPrintf("Players cannot be null/empty"); app.DebugPrintf("Players cannot be null/empty");
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
__debugbreak(); DEBUG_BREAK();
#endif #endif
} }

View file

@ -148,7 +148,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if(position->x > 2560 || position->x < -2560 || position->z > 2560 || position->z < -2560) if(position->x > 2560 || position->x < -2560 || position->z > 2560 || position->z < -2560)
{ {
__debugbreak(); DEBUG_BREAK();
} }
#endif #endif

View file

@ -15,7 +15,7 @@ WeighedRandomItem *WeighedRandom::getRandomItem(Random *random, vector<WeighedRa
{ {
if (totalWeight <= 0) if (totalWeight <= 0)
{ {
__debugbreak(); DEBUG_BREAK();
} }
int selection = random->nextInt(totalWeight); int selection = random->nextInt(totalWeight);
@ -50,7 +50,7 @@ WeighedRandomItem *WeighedRandom::getRandomItem(Random *random, WeighedRandomIte
{ {
if (totalWeight <= 0) if (totalWeight <= 0)
{ {
__debugbreak(); DEBUG_BREAK();
} }
int selection = random->nextInt(totalWeight); int selection = random->nextInt(totalWeight);

View file

@ -104,6 +104,7 @@ set(_MINECRAFT_WORLD_COMMON_CONSOLEJAVALIBS_INPUTOUTPUTSTREAM
source_group("ConsoleJavaLibs/InputOutputStream" FILES ${_MINECRAFT_WORLD_COMMON_CONSOLEJAVALIBS_INPUTOUTPUTSTREAM}) source_group("ConsoleJavaLibs/InputOutputStream" FILES ${_MINECRAFT_WORLD_COMMON_CONSOLEJAVALIBS_INPUTOUTPUTSTREAM})
set(_MINECRAFT_WORLD_COMMON_HEADER_FILES set(_MINECRAFT_WORLD_COMMON_HEADER_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/Debug.h"
"${CMAKE_CURRENT_SOURCE_DIR}/LevelObjectInputStream.h" "${CMAKE_CURRENT_SOURCE_DIR}/LevelObjectInputStream.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World.h" "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ParticleTypes.h" "${CMAKE_CURRENT_SOURCE_DIR}/ParticleTypes.h"

View file

@ -126,6 +126,7 @@ typedef XUID GameSessionUID;
#include "TilePos.h" #include "TilePos.h"
#include "ChunkPos.h" #include "ChunkPos.h"
#include "compression.h" #include "compression.h"
#include "Debug.h"
#include "PerformanceTimer.h" #include "PerformanceTimer.h"

View file

@ -3,13 +3,6 @@
[![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?logo=discord&logoColor=white)](https://discord.gg/dH8AZWGcau) [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?logo=discord&logoColor=white)](https://discord.gg/dH8AZWGcau)
---
## IMPORTANT UPDATE
**This repo was moved to a new org!**
Please change all links and references from `smartcmd/MinecraftConsoles` to `MCLCE/MinecraftConsoles` instead.
---
This project is based on source code of Minecraft Legacy Console Edition v1.6.0560.0 (TU19) with some fixes and improvements applied. This project is based on source code of Minecraft Legacy Console Edition v1.6.0560.0 (TU19) with some fixes and improvements applied.
@ -213,7 +206,8 @@ Persistent files are bind-mounted to host:
## Build & Run ## Build & Run
1. Install [Visual Studio 2022](https://aka.ms/vs/17/release/vs_community.exe) or [newer](https://visualstudio.microsoft.com/downloads/). 1. Install [Visual Studio 2022](https://aka.ms/vs/17/release/vs_community.exe) or [newer](https://visualstudio.microsoft.com/downloads/).
2. Clone the repository. 2. Clone the repository with submodules. If you don't, you will get a build error!
- `git clone --recurse-submodules https://github.com/MCLCE/MinecraftConsoles.git`
3. Open the project folder from Visual Studio. 3. Open the project folder from Visual Studio.
4. Set the build configuration to **Windows64 - Debug** (Release is also ok but missing some debug features), then build and run. 4. Set the build configuration to **Windows64 - Debug** (Release is also ok but missing some debug features), then build and run.