diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 1c86fa5ef..778fb4885 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1845,6 +1845,8 @@ void Minecraft::run_middle() // capture the save thumbnail app.CaptureSaveThumbnail(); break; + default: + break; } } } @@ -4907,4 +4909,3 @@ int Minecraft::MustSignInReturnedPSN(void *pParam, int iPad, C4JStorage::EMessag return 0; } #endif - diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index a666de551..71910a18a 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -1202,6 +1202,8 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) switch(eAction) { + case eXuiServerAction_Idle: + break; case eXuiServerAction_AutoSaveGame: #if defined(_XBOX_ONE) || defined(__ORBIS__) { @@ -1380,6 +1382,8 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) } #endif break; + default: + break; } app.SetXuiServerAction(i,eXuiServerAction_Idle); diff --git a/Minecraft.Client/Network/ClientConnection.cpp b/Minecraft.Client/Network/ClientConnection.cpp index 6c5040452..d062fed55 100644 --- a/Minecraft.Client/Network/ClientConnection.cpp +++ b/Minecraft.Client/Network/ClientConnection.cpp @@ -3083,6 +3083,8 @@ void ClientConnection::displayPrivilegeChanges(std::shared_ptrgui->addMessage(message,userIndex); diff --git a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp index 730976f59..571b3a947 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp @@ -178,6 +178,8 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons m_parameters[type].push_back(value); //m_parameters[(int)type] = value; break; + default: + break; } } diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp index 55ddbbd44..ec3531c56 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp @@ -237,6 +237,8 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const std::wstring &path) case DLCManager::e_DLCType_GameRulesHeader: newFile = new DLCGameRulesHeader(path); break; + default: + break; }; if( newFile != NULL ) diff --git a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp index e15fd55a4..6d82d0d57 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp @@ -70,6 +70,8 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const std::ws case XC_LANGUAGE_KOREAN: maximumChars = 35; break; + default: + break; } std::wstring creditValue = value; while (creditValue.length() > maximumChars) @@ -155,10 +157,14 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const std::ws } break; case DLCManager::e_DLCParamType_Anim: - // 4J Stu - The Xbox version used swscanf_s which isn't available in GCC. - swscanf(value.c_str(), L"%X", &m_uiAnimOverrideBitmask); - std::uint32_t skinId = app.getSkinIdFromPath(m_path); - app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask); + { + // 4J Stu - The Xbox version used swscanf_s which isn't available in GCC. + swscanf(value.c_str(), L"%X", &m_uiAnimOverrideBitmask); + std::uint32_t skinId = app.getSkinIdFromPath(m_path); + app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask); + } + break; + default: break; } } diff --git a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp index b21443776..7f8a500fe 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp @@ -32,6 +32,8 @@ void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type, const std: m_animString = value; m_bIsAnim = true; + break; + default: break; } } diff --git a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp b/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp index ad9238a70..858d6cbce 100644 --- a/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp +++ b/Minecraft.Client/Platform/Common/GameRules/ConsoleGenerateStructure.cpp @@ -164,6 +164,8 @@ bool ConsoleGenerateStructure::postProcess(Level *level, Random *random, Boundin pPlaceSpawner->placeSpawnerInLevel(this,level,chunkBB); } break; + default: + break; }; } @@ -178,4 +180,4 @@ bool ConsoleGenerateStructure::checkIntersects(int x0, int y0, int z0, int x1, i int ConsoleGenerateStructure::getMinY() { return getBoundingBox()->y0; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp b/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp index 78a354316..c9aedfed8 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/ChoiceTask.cpp @@ -128,6 +128,8 @@ void ChoiceTask::sendTelemetry() firstPlay = !tutorial->getCompleted( eTutorial_Telemetry_Halfway ); tutorial->setCompleted( eTutorial_Telemetry_Halfway ); break; + default: + break; }; TelemetryManager->RecordEnemyKilledOrOvercome(pMinecraft->player->GetXboxPad(), 0, 0, 0, 0, 0, 0, m_eTelemetryEvent); diff --git a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp b/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp index d7379536d..cbeaab82c 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/InfoTask.cpp @@ -131,6 +131,8 @@ void InfoTask::sendTelemetry() firstPlay = !tutorial->getCompleted( eTutorial_Telemetry_Complete ); tutorial->setCompleted( eTutorial_Telemetry_Complete ); break; + default: + break; }; TelemetryManager->RecordEnemyKilledOrOvercome(pMinecraft->player->GetXboxPad(), 0, 0, 0, 0, 0, 0, m_eTelemetryEvent); } diff --git a/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp b/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp index 2391acfe0..18e5ffdbe 100644 --- a/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp +++ b/Minecraft.Client/Platform/Common/Tutorial/TutorialHint.cpp @@ -123,6 +123,8 @@ int TutorialHint::tick() case e_Hint_SwimUp: if( Minecraft::GetInstance()->localplayers[m_tutorial->getPad()]->isUnderLiquid(Material::water) ) returnVal = m_descriptionId; break; + default: + break; } return returnVal; } diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp index 9cecd88bc..90525f5d0 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -374,6 +374,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick() case eTapNone: /// Nothing to do, input is not a tap. break; + default: + break; } #endif // TAP_DETECTION @@ -632,6 +634,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick() iDesiredSlotX = m_iCurrSlotX; iDesiredSlotY = m_iCurrSlotY; break; + default: + break; } int iNumRows; diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp index 45a6aa072..05cfbb98f 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_AnvilMenu.cpp @@ -176,6 +176,8 @@ void IUIScene_AnvilMenu::handleOtherClicked(int iPad, ESceneSection eSection, in case eSectionAnvilName: handleEditNamePressed(); break; + default: + break; }; } @@ -188,7 +190,9 @@ bool IUIScene_AnvilMenu::IsSectionSlotList( ESceneSection eSection ) case eSectionAnvilItem1: case eSectionAnvilItem2: case eSectionAnvilResult: - return true; + return true; + default: + break; } return false; } diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp index 302f22720..a97d4d1b6 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp @@ -955,6 +955,8 @@ bool IUIScene_CreativeMenu::IsSectionSlotList( ESceneSection eSection ) case eSectionInventoryCreativeUsing: case eSectionInventoryCreativeSelector: return true; + default: + break; } return false; } @@ -966,6 +968,8 @@ bool IUIScene_CreativeMenu::CanHaveFocus( ESceneSection eSection ) case eSectionInventoryCreativeUsing: case eSectionInventoryCreativeSelector: return true; + default: + break; } return false; } diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp index 7ca6ee379..447eb9b87 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_EnchantingMenu.cpp @@ -138,6 +138,8 @@ void IUIScene_EnchantingMenu::handleOtherClicked(int iPad, ESceneSection eSectio case eSectionEnchantButton3: index = 2; break; + default: + break; }; Minecraft *pMinecraft = Minecraft::GetInstance(); if (index >= 0 && m_menu->clickMenuButton(std::dynamic_pointer_cast(pMinecraft->localplayers[iPad]), index)) @@ -175,6 +177,8 @@ bool IUIScene_EnchantingMenu::IsSectionSlotList( ESceneSection eSection ) case eSectionEnchantUsing: case eSectionEnchantSlot: return true; + default: + break; } return false; } diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp index e14ee6c98..faaf2130e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_Chat.cpp @@ -106,6 +106,8 @@ void UIComponent_Chat::render(S32 width, S32 height, C4JRender::eViewportType vi xPos = (S32)(ui.getScreenWidth() / 2); yPos = (S32)(ui.getScreenHeight() / 2); break; + default: + break; } ui.setupRenderPosition(xPos, yPos); @@ -134,6 +136,8 @@ void UIComponent_Chat::render(S32 width, S32 height, C4JRender::eViewportType vi case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT: tileYStart = (S32)(m_movieHeight / 2); break; + default: + break; } IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); @@ -154,4 +158,4 @@ void UIComponent_Chat::render(S32 width, S32 height, C4JRender::eViewportType vi { UIScene::render(width, height, viewport); } -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp index d5da90a1c..a09721f6e 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_MenuBackground.cpp @@ -52,6 +52,8 @@ void UIComponent_MenuBackground::render(S32 width, S32 height, C4JRender::eViewp xPos = (S32)(ui.getScreenWidth() / 2); yPos = (S32)(ui.getScreenHeight() / 2); break; + default: + break; } ui.setupRenderPosition(xPos, yPos); @@ -80,6 +82,8 @@ void UIComponent_MenuBackground::render(S32 width, S32 height, C4JRender::eViewp case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT: tileYStart = (S32)(m_movieHeight / 2); break; + default: + break; } IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); @@ -100,4 +104,4 @@ void UIComponent_MenuBackground::render(S32 width, S32 height, C4JRender::eViewp { UIScene::render(width, height, viewport); } -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp index f722cbfca..de96c257a 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp @@ -90,6 +90,8 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT: xPos = (S32)(ui.getScreenWidth() / 2); break; + default: + break; } ui.setupRenderPosition(xPos, yPos); diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp index a7ee45f31..d44a107b1 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_Tooltips.cpp @@ -204,6 +204,8 @@ void UIComponent_Tooltips::render(S32 width, S32 height, C4JRender::eViewportTyp xPos = (S32)(ui.getScreenWidth() / 2); yPos = (S32)(ui.getScreenHeight() / 2); break; + default: + break; } ui.setupRenderPosition(xPos, yPos); @@ -232,6 +234,8 @@ void UIComponent_Tooltips::render(S32 width, S32 height, C4JRender::eViewportTyp case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT: tileYStart = (S32)(m_movieHeight / 2); break; + default: + break; } IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); diff --git a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp b/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp index 3d0378346..e062b73df 100644 --- a/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIComponent_TutorialPopup.cpp @@ -496,6 +496,8 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo xPos = (S32)(ui.getScreenWidth() / 2); yPos = (S32)(ui.getScreenHeight() / 2); break; + default: + break; } //Adjust for safezone switch( viewport ) @@ -507,6 +509,8 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT: yPos += getSafeZoneHalfHeight(); break; + default: + break; } switch( viewport ) { @@ -517,6 +521,8 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT: xPos -= getSafeZoneHalfWidth(); break; + default: + break; } ui.setupRenderPosition(xPos, yPos); diff --git a/Minecraft.Client/Platform/Common/UI/UIController.cpp b/Minecraft.Client/Platform/Common/UI/UIController.cpp index e52429731..e9e906534 100644 --- a/Minecraft.Client/Platform/Common/UI/UIController.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIController.cpp @@ -523,12 +523,12 @@ IggyLibrary UIController::loadSkin(const std::wstring &skinPath, const std::wstr rrbool res; int iteration = 0; __int64 totalStatic = 0; - while(res = IggyDebugGetMemoryUseInfo ( NULL , + while((res = IggyDebugGetMemoryUseInfo ( NULL , lib , "" , 0 , iteration , - &memoryInfo )) + &memoryInfo ))) { totalStatic += memoryInfo.static_allocation_bytes; app.DebugPrintf(app.USER_SR, "%ls - %.*s, static: %dB, dynamic: %dB\n", skinPath.c_str(), memoryInfo.subcategory_stringlen, memoryInfo.subcategory, memoryInfo.static_allocation_bytes, memoryInfo.dynamic_allocation_bytes); diff --git a/Minecraft.Client/Platform/Common/UI/UILayer.cpp b/Minecraft.Client/Platform/Common/UI/UILayer.cpp index a6c236b6e..3fbefb8bb 100644 --- a/Minecraft.Client/Platform/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Platform/Common/UI/UILayer.cpp @@ -404,6 +404,8 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData) case eUIScene_Timer: newScene = new UIScene_Timer(iPad, initData, this); break; + default: + break; }; if(newScene == NULL) @@ -553,6 +555,8 @@ UIScene *UILayer::addComponent(int iPad, EUIScene scene, void *initData) newScene = new UIComponent_MenuBackground(iPad, initData, this); m_componentRefCount[scene] = std::pair(1,true); break; + default: + break; }; if(newScene == NULL) return NULL; @@ -728,6 +732,8 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) case eUIScene_EndPoem: m_bIgnoreAutosaveMenuDisplayed = true; break; + default: + break; } switch(sceneType) @@ -738,6 +744,8 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) case eUIScene_LeaderboardsMenu: m_bIgnorePlayerJoinMenuDisplayed = true; break; + default: + break; } } m_hasFocus = layerFocusSet; @@ -867,4 +875,4 @@ UIScene *UILayer::FindScene(EUIScene sceneType) } return NULL; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.cpp b/Minecraft.Client/Platform/Common/UI/UIScene.cpp index e7c35404e..38ffad1c9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene.cpp @@ -391,12 +391,12 @@ void UIScene::getDebugMemoryUseRecursive(const std::wstring &moviePath, IggyMemo rrbool res; IggyMemoryUseInfo internalMemoryInfo; int internalIteration = 0; - while(res = IggyDebugGetMemoryUseInfo ( swf , + while((res = IggyDebugGetMemoryUseInfo ( swf , 0 , memoryInfo.subcategory , memoryInfo.subcategory_stringlen , internalIteration , - &internalMemoryInfo )) + &internalMemoryInfo ))) { app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), internalMemoryInfo.subcategory_stringlen, internalMemoryInfo.subcategory, internalMemoryInfo.static_allocation_bytes, internalMemoryInfo.static_allocation_count, internalMemoryInfo.dynamic_allocation_bytes, internalMemoryInfo.dynamic_allocation_count); @@ -414,12 +414,12 @@ void UIScene::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) int iteration = 0; __int64 sceneStatic = 0; __int64 sceneDynamic = 0; - while(res = IggyDebugGetMemoryUseInfo ( swf , + while((res = IggyDebugGetMemoryUseInfo ( swf , 0 , "" , 0 , iteration , - &memoryInfo )) + &memoryInfo ))) { sceneStatic += memoryInfo.static_allocation_bytes; sceneDynamic += memoryInfo.dynamic_allocation_bytes; diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp index e8f065dfb..3a96d7aa9 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_DebugSetCamera.cpp @@ -150,6 +150,8 @@ int UIScene_DebugSetCamera::KeyboardCompleteCallback(void *lpParam,bool bRes) pClass->m_textInputElevation.setLabel(value); pClass->currentPosition->m_elev = val; break; + default: + break; } } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp index 3f4cc5d6e..33561b161 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_FullscreenProgress.cpp @@ -339,6 +339,8 @@ void UIScene_FullscreenProgress::handlePress(F64 controlId, F64 childId) ui.NavigateToHomeMenu(); ui.UpdatePlayerBasePositions(); break; + default: + break; } } } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp index e73b6bebd..903cb4f25 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_HUD.cpp @@ -598,6 +598,8 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor xPos = (S32)(ui.getScreenWidth() / 2); yPos = (S32)(ui.getScreenHeight() / 2); break; + default: + break; } ui.setupRenderPosition(xPos, yPos); @@ -626,6 +628,8 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT: tileYStart = (S32)(m_movieHeight / 2); break; + default: + break; } IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); @@ -711,6 +715,8 @@ void UIScene_HUD::repositionHud() case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM: width = (S32)(ui.getScreenWidth()); break; + default: + break; } app.DebugPrintf(app.USER_SR, "Reposition HUD with dims %d, %d\n", width, height ); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp index e400222eb..aae155bcc 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_InventoryMenu.cpp @@ -194,9 +194,14 @@ void UIScene_InventoryMenu::setSectionSelectedSlot(ESceneSection eSection, int x case eSectionInventoryUsing: slotList = &m_slotListHotbar; break; + default: + break; } - slotList->setHighlightSlot(index); + if (slotList != NULL) + { + slotList->setHighlightSlot(index); + } } UIControl *UIScene_InventoryMenu::getSection(ESceneSection eSection) @@ -213,6 +218,8 @@ UIControl *UIScene_InventoryMenu::getSection(ESceneSection eSection) case eSectionInventoryUsing: control = &m_slotListHotbar; break; + default: + break; } return control; } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp index 7b3d42c61..6050dbbea 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_JoinMenu.cpp @@ -522,6 +522,8 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) case CGameNetworkManager::JOINGAME_FAIL_SERVER_FULL: exitReasonStringId = IDS_DISCONNECTED_SERVER_FULL; break; + default: + break; } if( exitReasonStringId == -1 ) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp index 2961fccdd..b8c919c13 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp @@ -303,6 +303,8 @@ void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool se case eLaunchCheckbox_DisableSaving: m_params->bDisableSaving = selected; break; + default: + break; }; } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp index bcd7764fb..87b9fefac 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp @@ -419,6 +419,8 @@ void UIScene_MainMenu::RunAction(int iPad) Windows::Xbox::ApplicationModel::Help::Show(user); break; #endif + default: + break; } } @@ -500,6 +502,8 @@ int UIScene_MainMenu::MustSignInReturned(void *pParam, int iPad, C4JStorage::EMe #ifdef _DURANGO case eAction_RunXboxHelp: ProfileManager.RequestSignInUI(false, false, true, false, true, &UIScene_MainMenu::XboxHelp_SignInReturned, pClass, iPad ); break; #endif + default: + break; } } else diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp index f1a9f929c..8c5cb78d4 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_SkinSelectMenu.cpp @@ -411,6 +411,8 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr case eSkinNavigation_Skin: m_currentNavigation = eSkinNavigation_Pack; break; + default: + break; }; sendInputToMovie(key, repeat, pressed, released); } diff --git a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shared.inl b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shared.inl index 9916096ad..dc53e84db 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shared.inl +++ b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_gl_shared.inl @@ -1421,11 +1421,12 @@ static int set_render_state(GDrawRenderState *r, S32 vformat, const int **ovvars if (fvars[VAR_cmul] >= 0) glUniform4f(fvars[VAR_cmul], r->color[0], r->color[1], r->color[2], r->color[3]); - if (fvars[VAR_cadd] >= 0) + if (fvars[VAR_cadd] >= 0) { if (r->cxf_add) glUniform4f(fvars[VAR_cadd], r->cxf_add[0]/255.0f, r->cxf_add[1]/255.0f, r->cxf_add[2]/255.0f, r->cxf_add[3]/255.0f); else glUniform4f(fvars[VAR_cadd], 0,0,0,0); + } if (fvars[VAR_focal] >= 0) glUniform4fv(fvars[VAR_focal], 1, r->focal_point); @@ -2425,4 +2426,3 @@ void gdraw_GLx_(DestroyContext)(void) opengl_check(); free_gdraw(); } - diff --git a/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp index 47ae79e61..3b9a9e676 100644 --- a/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp +++ b/Minecraft.Client/Player/MultiPlayerLocalPlayer.cpp @@ -316,6 +316,8 @@ void MultiplayerLocalPlayer::ride(std::shared_ptr e) case eTYPE_PIG: eventType = eTelemetryInGame_Ride_Pig; break; + default: + break; }; } TelemetryManager->RecordEnemyKilledOrOvercome(GetXboxPad(), 0, y, 0, 0, 0, 0, eventType); diff --git a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp index c67224efd..bcf70eeb2 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp @@ -490,11 +490,11 @@ void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const s if((fScaleX!=1.0f) ||(fScaleY!=1.0f)) { // 4J Stu - Scales were multiples of 20, making 16 to not overlap in xui scenes - blitGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 16 * fScaleX, 16 * fScaleY); + blitGlint(x * 431278612.0f + y * 32178161.0f, x - 2, y - 2, 16 * fScaleX, 16 * fScaleY); } else { - blitGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); + blitGlint(x * 431278612.0f + y * 32178161.0f, x - 2, y - 2, 20, 20); } glColor4f(1.0f, 1.0f, 1.0f, 1); // 4J added if( !isConstantBlended ) glDisable(GL_BLEND); diff --git a/Minecraft.Client/Rendering/LevelRenderer.cpp b/Minecraft.Client/Rendering/LevelRenderer.cpp index 5ddc7b60a..1fb33a247 100644 --- a/Minecraft.Client/Rendering/LevelRenderer.cpp +++ b/Minecraft.Client/Rendering/LevelRenderer.cpp @@ -406,7 +406,7 @@ void LevelRenderer::allChanged(int playerIndex) // If this CS is entered before DisableUpdateThread is called then (on 360 at least) we can get a // deadlock when starting a game in splitscreen. //EnterCriticalSection(&m_csDirtyChunks); - if( level == NULL ) + if( level[playerIndex] == NULL ) { return; } @@ -473,7 +473,7 @@ void LevelRenderer::allChanged(int playerIndex) } nonStackDirtyChunksAdded(); - if (level != NULL) + if (level[playerIndex] != NULL) { std::shared_ptr player = mc->cameraTargetPlayer; if (player != NULL) diff --git a/Minecraft.Client/Rendering/Models/HumanoidModel.cpp b/Minecraft.Client/Rendering/Models/HumanoidModel.cpp index fe56ef1f3..a548edf8c 100644 --- a/Minecraft.Client/Rendering/Models/HumanoidModel.cpp +++ b/Minecraft.Client/Rendering/Models/HumanoidModel.cpp @@ -30,6 +30,9 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox) case eBodyPart_Leg1: pAttachTo=leg1; break; + case eBodyPart_Unknown: + default: + return NULL; } // first check this box doesn't already exist diff --git a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp index da897d6c2..006a73207 100644 --- a/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/MobSpawnerTileEntity.cpp @@ -92,7 +92,8 @@ void MobSpawnerTileEntity::tick() std::shared_ptr entity = std::dynamic_pointer_cast (EntityIO::newEntity(entityId, level)); if (entity == NULL) return; - std::vector > *vecNearby = level->getEntitiesOfClass(typeid(*entity), AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)->grow(8, 4, 8)); + Mob *entityPtr = entity.get(); + std::vector > *vecNearby = level->getEntitiesOfClass(typeid(*entityPtr), AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)->grow(8, 4, 8)); int nearBy = (int)vecNearby->size(); //4J - IB, TODO, Mob contains no getClass delete vecNearby; @@ -230,4 +231,4 @@ std::shared_ptr MobSpawnerTileEntity::clone() result->entityId = entityId; result->spawnDelay = spawnDelay; return result; -} \ No newline at end of file +} diff --git a/Minecraft.World/Entities/Mobs/Animal.cpp b/Minecraft.World/Entities/Mobs/Animal.cpp index d4b6a932a..1ad221c01 100644 --- a/Minecraft.World/Entities/Mobs/Animal.cpp +++ b/Minecraft.World/Entities/Mobs/Animal.cpp @@ -401,7 +401,8 @@ void Animal::resetLove() { bool Animal::canMate(std::shared_ptr partner) { if (partner == shared_from_this()) return false; - if (typeid(*partner) != typeid(*this)) return false; + Animal *partnerPtr = partner.get(); + if (partnerPtr == NULL || typeid(*partnerPtr) != typeid(*this)) return false; return isInLove() && partner->isInLove(); } diff --git a/Minecraft.World/Entities/Mobs/EnderDragon.cpp b/Minecraft.World/Entities/Mobs/EnderDragon.cpp index b5782740a..d739879bd 100644 --- a/Minecraft.World/Entities/Mobs/EnderDragon.cpp +++ b/Minecraft.World/Entities/Mobs/EnderDragon.cpp @@ -932,6 +932,8 @@ void EnderDragon::findNewTarget() #endif m_actionTicks = 0; break; + default: + break; }; newTarget = false; @@ -1347,6 +1349,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_LandingApproach: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_StrafePlayer: @@ -1356,6 +1360,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_LandingApproach: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_LandingApproach: @@ -1364,6 +1370,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_Landing: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_Landing: @@ -1373,6 +1381,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_Sitting_Scanning: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_Takeoff: @@ -1381,6 +1391,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_HoldingPattern: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_Sitting_Flaming: @@ -1391,6 +1403,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_Takeoff: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_Sitting_Scanning: @@ -1401,6 +1415,8 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_Takeoff: validTransition = true; break; + default: + break; }; break; case e_EnderdragonAction_Sitting_Attacking: @@ -1411,8 +1427,12 @@ bool EnderDragon::setSynchedAction(EEnderdragonAction action, bool force /*= fal case e_EnderdragonAction_Takeoff: validTransition = true; break; + default: + break; }; break; + default: + break; }; if( force || validTransition ) diff --git a/Minecraft.World/Level/CustomLevelSource.cpp b/Minecraft.World/Level/CustomLevelSource.cpp index a0d4fd057..e9e029ff7 100644 --- a/Minecraft.World/Level/CustomLevelSource.cpp +++ b/Minecraft.World/Level/CustomLevelSource.cpp @@ -86,8 +86,6 @@ CustomLevelSource::~CustomLevelSource() delete mineShaftFeature; delete canyonFeature; - this->level = level; - delete random; delete perlinNoise3; #endif diff --git a/Minecraft.World/Level/LevelChunk.cpp b/Minecraft.World/Level/LevelChunk.cpp index cc0aa626e..2c9bdeee3 100644 --- a/Minecraft.World/Level/LevelChunk.cpp +++ b/Minecraft.World/Level/LevelChunk.cpp @@ -1643,7 +1643,11 @@ void LevelChunk::getEntitiesOfClass(const std::type_info& ec, AABB *bb, std::vec else if ( ec == typeid(Mob) ) { if( std::dynamic_pointer_cast(e) != NULL ) isAssignableFrom = true; } else if ( ec == typeid(Monster) ) { if( std::dynamic_pointer_cast(e) != NULL ) isAssignableFrom = true; } else if ( ec == typeid(Zombie) ) { if( std::dynamic_pointer_cast(e) != NULL ) isAssignableFrom = true; } - else if(e != NULL && ec == typeid(*(e.get())) ) isAssignableFrom = true; + else + { + Entity *entityPtr = e.get(); + if(entityPtr != NULL && ec == typeid(*entityPtr)) isAssignableFrom = true; + } if (isAssignableFrom && e->bb->intersects(bb)) es.push_back(e); // 4J - note needs to be equivalent to baseClass.isAssignableFrom(e.getClass()) } diff --git a/Minecraft.World/Level/RandomLevelSource.cpp b/Minecraft.World/Level/RandomLevelSource.cpp index 0dad9dd00..df7070bc9 100644 --- a/Minecraft.World/Level/RandomLevelSource.cpp +++ b/Minecraft.World/Level/RandomLevelSource.cpp @@ -69,8 +69,6 @@ RandomLevelSource::~RandomLevelSource() delete scatteredFeature; delete canyonFeature; - this->level = level; - delete random;; delete lperlinNoise1; delete lperlinNoise2; diff --git a/Minecraft.World/Network/Connection.cpp b/Minecraft.World/Network/Connection.cpp index a67ee7623..fb4a4336b 100644 --- a/Minecraft.World/Network/Connection.cpp +++ b/Minecraft.World/Network/Connection.cpp @@ -334,34 +334,15 @@ close("disconnect.genericReason", "Internal exception: " + e.toString()); }*/ -void Connection::close(DisconnectPacket::eDisconnectReason reason, ...) +void Connection::close(DisconnectPacket::eDisconnectReason reason) { fprintf(stderr, "[CONN] close called with reason=%d on connection=%p\n", reason, (void*)this); if (!running) return; fprintf(stderr, "[CONN] close proceeding (was running) on connection=%p\n", (void*)this); disconnected = true; - va_list input; - va_start( input, reason ); - - disconnectReason = reason;//va_arg( input, const std::wstring ); - - std::vector objs = std::vector(); - void *i = NULL; - while (i != NULL) - { - i = va_arg( input, void* ); - objs.push_back(i); - } - - if( objs.size() ) - { - disconnectReasonObjects = &objs[0]; - } - else - { - disconnectReasonObjects = NULL; - } + disconnectReason = reason; + disconnectReasonObjects = NULL; // int count = 0, sum = 0, i = first; // va_list marker; diff --git a/Minecraft.World/Network/Connection.h b/Minecraft.World/Network/Connection.h index c29bf9e71..0d321b4ae 100644 --- a/Minecraft.World/Network/Connection.h +++ b/Minecraft.World/Network/Connection.h @@ -117,7 +117,7 @@ private: }*/ public: - void close(DisconnectPacket::eDisconnectReason reason, ...); + void close(DisconnectPacket::eDisconnectReason reason); void tick(); diff --git a/Minecraft.World/Player/Player.cpp b/Minecraft.World/Player/Player.cpp index 82f706430..3b0c53971 100644 --- a/Minecraft.World/Player/Player.cpp +++ b/Minecraft.World/Player/Player.cpp @@ -769,7 +769,7 @@ void Player::setCustomCape(std::uint32_t capeId) if(pMojangData) { // Cape - if(pMojangData->wchCape) + if(pMojangData->wchCape[0] != 0) { this->customTextureUrl2= pMojangData->wchCape; } @@ -884,7 +884,7 @@ void Player::prepareCustomTextures() if(pMojangData) { // Skin - if(pMojangData->wchSkin) + if(pMojangData->wchSkin[0] != 0) { this->customTextureUrl= pMojangData->wchSkin; } @@ -2275,6 +2275,8 @@ void Player::killed(std::shared_ptr mob) case eTYPE_ENDERDRAGON: awardStat(GenericStats::killsEnderdragon(), GenericStats::param_noArgs()); break; + default: + break; } } else if( mob->GetType() == eTYPE_COW ) @@ -2644,6 +2646,8 @@ void Player::setPlayerGamePrivilege(unsigned int &uiGamePrivileges, EPlayerGameP Player::setPlayerGamePrivilege(uiGamePrivileges,ePlayerGamePrivilege_CanToggleClassicHunger,0); Player::setPlayerGamePrivilege(uiGamePrivileges,ePlayerGamePrivilege_CanTeleport,0); break; + default: + break; } // off uiGamePrivileges&=~(1< item) case Item::sword_wood_Id: allowed = true; break; + default: + break; } } @@ -2850,6 +2860,8 @@ bool Player::isAllowedToHurtEntity(std::shared_ptr target) allowed = false; break; + default: + break; }; } return allowed; diff --git a/Minecraft.World/Stats/Achievements.cpp b/Minecraft.World/Stats/Achievements.cpp index fc50c5e7c..bc09a0d50 100644 --- a/Minecraft.World/Stats/Achievements.cpp +++ b/Minecraft.World/Stats/Achievements.cpp @@ -2,6 +2,7 @@ #include "../Headers/net.minecraft.stats.h" #include "../Headers/net.minecraft.world.item.h" #include "../Headers/net.minecraft.world.level.tile.h" +#include #include "Achievement.h" #include "Achievements.h" @@ -10,8 +11,8 @@ const int Achievements::ACHIEVEMENT_OFFSET = 0x500000; // maximum position of achievements (min and max) -int Achievements::xMin = 4294967295; // 4J Stu Was 4294967296 which is 1 larger than maxint. Hopefully no side effects -int Achievements::yMin = 4294967295; // 4J Stu Was 4294967296 which is 1 larger than maxint. Hopefully no side effects +int Achievements::xMin = std::numeric_limits::max(); +int Achievements::yMin = std::numeric_limits::max(); int Achievements::xMax = 0; int Achievements::yMax = 0; @@ -182,4 +183,3 @@ void Achievements::staticCtor() void Achievements::init() { } - diff --git a/Minecraft.World/Stats/Stat.cpp b/Minecraft.World/Stats/Stat.cpp index e17407d54..67c74c457 100644 --- a/Minecraft.World/Stats/Stat.cpp +++ b/Minecraft.World/Stats/Stat.cpp @@ -1,4 +1,5 @@ #include "../Platform/stdafx.h" +#include #include "../Util/NumberFormatters.h" #include "StatFormatter.h" #include "Stats.h" @@ -44,7 +45,7 @@ Stat *Stat::postConstruct() #ifdef __PS3__ Stats::statsById->emplace(id1 );// assert(0); // MGH - TODO - FIX - find out where this move function comes from #else - Stats::statsById->emplace( move(id1) ); + Stats::statsById->emplace(std::move(id1)); #endif // __PS3__ return this;